Payment Intent
POST
/payment_intentsCreate Payment Intent
Create a PaymentIntent. capture_method: automatic|manual. confirmation_method: automatic|manual. Set confirm=true to create + confirm in one call (requires payment_method.type). Status flows: requires_payment_method -> requires_confirmation -> requires_action|processing -> requires_capture -> succeeded, or canceled.
Request
Example
curl -X POST 'https://api.paycose.com/api/v1/app1/platform/wallet/payment_intents/' \
-H 'X-Session-Token: {{session_token}}' \
-H 'X-Country: {{country}}' \
-d '{
"amount": 10000,
"currency": "thb",
"customer_id": "{{customer_id}}",
"invoice_id": "<string>",
"payment_method": {
"type": "card"
},
"capture_method": "automatic",
"confirmation_method": "automatic",
"confirm": false,
"metadata": {
"order_id": "ord_123"
},
"transfer_data": {
"destination": "<string>",
"amount": 0,
"balance_id": "<string>"
},
"application_fee_amount": 0,
"application_fee": 0,
"on_behalf_of": "<string>",
"transfer_group": "<string>",
"off_session": false,
"return_url": "<string>",
"payment_method_types": [
"<string>"
],
"payment_method_providers": [
"<string>"
],
"labels": [
"<string>"
]
}'Headers
| Name | Value |
|---|---|
| X-Session-Token | {{session_token}} |
| X-Country | {{country}} |
Body
| Name | Type | Value |
|---|---|---|
| amount | number | 10000 |
| currency | string | thb |
| customer_id | string | {{customer_id}} |
| invoice_id | string | <string> |
| payment_method | object | {…} |
| capture_method | string | automatic |
| confirmation_method | string | automatic |
| confirm | boolean | false |
| metadata | object | {…} |
| transfer_data | object | {…} |
| application_fee_amount | number | 0 |
| application_fee | number | 0 |
| on_behalf_of | string | <string> |
| transfer_group | string | <string> |
| off_session | boolean | false |
| return_url | string | <string> |
| payment_method_types | array | [1] |
| payment_method_providers | array | [1] |
| labels | array | [1] |
{
"amount": 10000,
"currency": "thb",
"customer_id": "{{customer_id}}",
"invoice_id": "<string>",
"payment_method": {
"type": "card"
},
"capture_method": "automatic",
"confirmation_method": "automatic",
"confirm": false,
"metadata": {
"order_id": "ord_123"
},
"transfer_data": {
"destination": "<string>",
"amount": 0,
"balance_id": "<string>"
},
"application_fee_amount": 0,
"application_fee": 0,
"on_behalf_of": "<string>",
"transfer_group": "<string>",
"off_session": false,
"return_url": "<string>",
"payment_method_types": [
"<string>"
],
"payment_method_providers": [
"<string>"
],
"labels": [
"<string>"
]
}Responses
400400 Bad Request
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
Body
{
"object": "error",
"code": "<string>",
"key": "<string>",
"i18n_key": "<string>",
"message": "<string>",
"request_id": "<string>"
}500500 Internal Server Error
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
Body
{
"object": "error",
"code": "<string>",
"key": "<string>",
"i18n_key": "<string>",
"message": "<string>",
"request_id": "<string>"
}