Skip to content
Carts & CheckoutCarts

Start a payment session

Starts a payment session for the cart total with the chosen method. Providers that take the card in the page through a session, like Niubiz, need it before showing their fields. Send its id as paymentSessionId when checking out; a new attempt needs a new session.

POST/v1/carts/{cartToken}/payment-session
No token

Path Parameters

cartToken*string

Token that identifies the cart.

Header Parameters

x-Store-Domain*string

Slug of the store or one of its configured domains, such as my-store.

Length1 <= length <= 253
X-Customer-Session?string

Customer session from POST /v1/customer/sessions. Links the cart to the customer, with their prices and assigned codes.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://storefront.ecomiq.pe/v1/carts/replace_with_the_issued_token/payment-session" \  -H "x-Store-Domain: my-store" \  -H "X-Customer-Session: <session-id>" \  -H "Content-Type: application/json" \  -d '{    "paymentMethodCode": "POL-001"  }'
{  "id": "7204558912004324239",  "key": "color",  "amount": 178,  "currency": "PEN",  "expiresAt": "2026-09-28T15:30:00Z"}