post
https://sandbox-api-gtw.softpoint.io/api//customers//payment-methods/card-session
This API is used to start saving a card: it returns what the SoftPoint iframe needs to tokenize the card in the browser.
Load the iframe with location_id and access_token in tokenize mode (process_type: tokenize, store-card: 1). The iframe returns a card token; send it to Save card.
Note: The location's card processor must be configured. The access_token is a short-lived gateway token: request a new session for each attempt.
URL
{{interface_url}}/{{version}}/customers/{{customer_id}}/payment-methods/card-session
Method
POST
Headers
Authorization: Bearer {access_token} (or Api-Key)
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| location_id | Integer | Conditional | Location to use. Required when the token covers more than one location (corporate / sub corporate); with a location token it is taken from the token. |
URL Parameters
| Parameter | Required/Optional | Type | Description |
|---|---|---|---|
| customer_id | Required | Integer | Our customer ID (id returned by Create customer). |
Example Request (cURL)
curl --location --request POST '{{interface_url}}/{{version}}/customers/{{customer_id}}/payment-methods/card-session' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--data '{
"location_id": 279685
}'
Example Response (JSON) — 200
{
"location_id": 279685,
"access_token": "eyJ0eXAiOiJKV1Qi...",
"environment": "sandbox",
"iframe": {
"process_type": "tokenize",
"store_card": 1
},
"customer_id": 48213
}
Error Responses
Format: { "error": { "code", "name", "message", "details" } }
| Status | Error | When |
|---|---|---|
| 404 | customer_not_found | The customer is not linked to that location. |
| 422 | processor_configuration_not_found | The location has no card processor. |
| 502 | gateway_unavailable | The gateway did not answer. Retry. |

