Paycose Docs
Setup Intent
POST/setup_intents

Create

Create a setup intent for adding a payment method.

Returns a card form link where the customer can enter their card details. The link should be opened in a browser.

After the customer submits the form, a payment method is automatically created via Stripe webhook.

Required: customer_id, return_url, refresh_url. Requires: Bearer token, X-Country header.

Request

Example

curl -X POST 'https://api.paycose.com/api/v1/app1/platform/wallet/setup_intents/' \
  -H 'X-Session-Token: {{session_token}}' \
  -H 'X-Country: {{country}}' \
  -H 'X-Test-Mode: {{x_test_mode}}' \
  -d '{
  "customer_id": "{{customer_id}}",
  "refresh_url": "http://127.0.0.1:3001/refresh",
  "return_url": "http://127.0.0.1:3001/success",
  "metadata": {},
  "payment_method_type": "<string>",
  "fields": {}
}'

Headers

NameValueDescription
X-Session-Token{{session_token}}
X-Country{{country}}
X-Test-Mode{{x_test_mode}}true=wallet_test, false=wallet_live (default). Toggle the x_test_mode collection variable to flip every applicable request.

Body

NameTypeValue
customer_idstring{{customer_id}}
refresh_urlstringhttp://127.0.0.1:3001/refresh
return_urlstringhttp://127.0.0.1:3001/success
metadataobject{…}
payment_method_typestring<string>
fieldsobject{…}
{
  "customer_id": "{{customer_id}}",
  "refresh_url": "http://127.0.0.1:3001/refresh",
  "return_url": "http://127.0.0.1:3001/success",
  "metadata": {},
  "payment_method_type": "<string>",
  "fields": {}
}

Responses

200200 OK

Headers

NameValue
Content-Typeapplication/json

Body

{
  "setup_intent": null,
  "session": null,
  "link": "<string>"
}
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