Use this file to discover all available pages before exploring further.
The checkout endpoint is the core of the purchase flow. It accepts the buyer details, recipient address, cart items, and payment method, then atomically creates an order, decrements product stock, records status history, and creates a pending payment — all within a single database transaction. Both guest shoppers (no session) and authenticated users are supported.
Prices and totals are always calculated server-side. Never send price data in the checkout request body. The server loads each product’s amountMinor from the database, resolves the correct price for the requested currency, and computes subtotalMinor, shippingMinor, and totalMinor itself. Any price fields sent by the client are silently ignored.
Guest checkout is fully supported. If no valid session cookie is present in the request, the resulting order is created with userId: null. Guests cannot later view their orders via the Orders API — for order lookup, the orderNumber returned at checkout is the only reference.
Creates a new order for the provided cart. The server validates stock levels, resolves the shipping rate for the destination province and currency, and then runs the full transaction. Up to 5 retries are attempted automatically if an orderNumber collision occurs.
curl -X POST https://api.avanzarintimeshop.com/api/v1/checkout \ -H "Content-Type: application/json" \ -d '{ "currency": "USD", "buyer": { "name": "Carlos Pérez", "email": "carlos@example.com", "phone": "+1-305-555-0100" }, "recipient": { "name": "María García", "phone": "+53-52345678", "province": "La Habana", "municipality": "Plaza de la Revolución", "addressLine": "Calle 23 #456 entre J e I, Vedado", "reference": "Edificio azul, apartamento 3B" }, "items": [ { "productId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "quantity": 1 } ], "payment": { "method": "zelle" } }'
ISO 4217 currency code, exactly 3 characters (e.g., "USD", "CUP"). All order amounts — subtotal, shipping, and total — will be calculated in this currency. A matching shipping rate for this currency and the recipient province must exist.
Delivery details for the person receiving the order in Cuba. Stored as an immutable snapshot — editing the address book later does not affect existing orders.
Cuban province for the delivery destination (e.g., "La Habana"). Must match a province with an active shipping rate for the chosen currency — otherwise the request fails with SHIPPING_NOT_SUPPORTED.
One of: "cod" (cash on delivery), "transfer_local" (local Cuban bank transfer), "zelle" (Zelle transfer from abroad). The payment record is created with status: "pending" and confirmed manually by an admin.