Saltar al contenido
Guías
Carritos y checkoutCarritos

Completar checkout del carrito

Crea el grupo de pedidos del carrito y devuelve sus IDs de pedido, el estado del pago y el carrito completado. Un carrito con varios vendedores puede generar varios pedidos.

POST/v1/carts/{cartToken}/checkout

Crea el grupo de pedidos del carrito y devuelve sus IDs de pedido, el estado del pago y el carrito completado. Un carrito con varios vendedores puede generar varios pedidos.

Parámetros de ruta

cartToken*string

Token opaco que identifica el carrito.

Parámetros de cabecera

x-Store-Domain*string

Slug o dominio configurado que selecciona el contexto de tienda en el gateway central de Storefront.

Longitud1 <= length <= 253

Cuerpo de la solicitud

application/json

Definiciones TypeScript

Usa esta definición en TypeScript.

Cuerpo de la respuesta

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/v1/carts/replace_with_the_issued_token/checkout" \  -H "x-Store-Domain: my-store" \  -H "Content-Type: application/json" \  -d '{    "paymentMethodCode": "example_code",    "externalRef": "example",    "receiptUrl": "https://example.com/resource",    "campaignId": "7204558912004325301"  }'
{  "orderId": "7204558912004325301",  "orderNumber": "ORD-2026-0001",  "orderGroup": "example",  "orderIds": [    "example"  ],  "payment": {    "transactionId": "7204558912004325301",    "paymentMethodCode": "example_code",    "providerId": "7204558912004325301",    "status": "pending",    "amount": 1,    "reference": "example",    "actionType": "example",    "receiptUrl": "https://example.com/resource",    "action": {      "publicConfiguration": {        "key": "example"      },      "url": "https://example.com/resource",      "html": "example",      "clientSecret": "replace_with_a_random_secret",      "qrCode": "example_code",      "expiresAt": "2026-08-01T15:30:00Z"    }  },  "cart": {    "id": "7204558912004325301",    "token": "replace_with_the_issued_token",    "cartNumber": "example",    "email": "andrea@example.com",    "phone": "+51987654321",    "firstName": "Andrea",    "lastName": "Ramos",    "currencyCode": "PEN",    "status": "inProgress",    "completedAt": "2026-08-01T15:30:00Z",    "shippingAddress": {      "name": "Example resource",      "address1": "example",      "city": "example",      "countryCode": "PE",      "company": "example",      "address2": "example",      "province": "example",      "postalCode": "example_code",      "district": "example",      "phone": "+51987654321",      "latitude": 1,      "longitude": 1    },    "billingAddress": {      "name": "Example resource",      "address1": "example",      "city": "example",      "countryCode": "PE",      "company": "example",      "address2": "example",      "province": "example",      "postalCode": "example_code",      "district": "example",      "phone": "+51987654321",      "latitude": 1,      "longitude": 1    },    "promotionCodes": [      "example"    ],    "items": [      {        "id": "7204558912004325301",        "productId": "7204558912004325301",        "title": "Example title",        "variantLabel": "example",        "productHandle": "example",        "thumbnail": "example",        "quantity": 1,        "variantId": "7204558912004325301",        "variantSku": "SKU-001",        "unitPrice": 1,        "compareAtUnitPrice": 1,        "bundleItems": [          {            "productId": "7204558912004325301",            "variantId": "7204558912004325301",            "productName": "Example resource",            "variantName": "Example resource",            "sku": "SKU-001",            "brand": "example",            "imageUrl": "https://example.com/resource",            "quantity": 1          }        ],        "requiresShipping": false,        "sellerId": "7204558912004325301",        "sellerName": "Example resource",        "orderBumpId": "7204558912004325301"      }    ],    "shippingMethods": [      {        "id": "7204558912004325301",        "shippingMethodId": "7204558912004325301",        "rateId": "7204558912004325301",        "name": "Example resource",        "description": "Example description.",        "total": 1,        "locationId": "7204558912004325301",        "estimatedDays": 1,        "pickupPointId": "7204558912004325301",        "scheduledDate": "2026-08-01",        "scheduledTime": "09:00:00Z",        "serviceCode": "example_code"      }    ],    "totals": {      "subtotal": 1,      "discountTotal": 1,      "shippingOriginalTotal": 1,      "shippingTotal": 1,      "taxTotal": 1,      "warrantyTotal": 1,      "total": 1    }  }}