Saltar al contenido
Guías
Carritos y checkoutCarritos

Agregar código promocional al carrito

POST/v1/carts/{cartToken}/promotion-codes

Agregar código promocional al carrito. Una solicitud exitosa devuelve HTTP 200 con el cuerpo de respuesta documentado.

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/promotion-codes" \  -H "x-Store-Domain: my-store" \  -H "Content-Type: application/json" \  -d '{    "code": "example_code"  }'
{  "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  }}