Paycose Docs
Payment Intent
POST/payment_intents

Create 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

NameValue
X-Session-Token{{session_token}}
X-Country{{country}}

Body

NameTypeValue
amountnumber10000
currencystringthb
customer_idstring{{customer_id}}
invoice_idstring<string>
payment_methodobject{…}
capture_methodstringautomatic
confirmation_methodstringautomatic
confirmbooleanfalse
metadataobject{…}
transfer_dataobject{…}
application_fee_amountnumber0
application_feenumber0
on_behalf_ofstring<string>
transfer_groupstring<string>
off_sessionbooleanfalse
return_urlstring<string>
payment_method_typesarray[1]
payment_method_providersarray[1]
labelsarray[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

NameValue
Content-Typeapplication/json

Body

{
  "object": "error",
  "code": "<string>",
  "key": "<string>",
  "i18n_key": "<string>",
  "message": "<string>",
  "request_id": "<string>"
}
500500 Internal Server Error

Headers

NameValue
Content-Typeapplication/json

Body

{
  "object": "error",
  "code": "<string>",
  "key": "<string>",
  "i18n_key": "<string>",
  "message": "<string>",
  "request_id": "<string>"
}

On this page