Setup Intent
POST
/setup_intentsCreate
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
| Name | Value | Description |
|---|---|---|
| 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
| Name | Type | Value |
|---|---|---|
| customer_id | string | {{customer_id}} |
| refresh_url | string | http://127.0.0.1:3001/refresh |
| return_url | string | http://127.0.0.1:3001/success |
| metadata | object | {…} |
| payment_method_type | string | <string> |
| fields | object | {…} |
{
"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
| Name | Value |
|---|---|
| Content-Type | application/json |
Body
{
"setup_intent": null,
"session": null,
"link": "<string>"
}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>"
}