Skip to main content

Creating Orders

Once you have discovered the available gateways via Gateway Discovery, you can create an order to initiate a payment.

Request body

Nequi and Daviplata require the shopper. Their direct orders must include email, phone_number, country, id_number and id_type; omitting any of them returns a 422 validation error.

Breb orders without shopper

For Breb, the shopper object is optional: the QR code and transfer key are generated from the order, not from the buyer’s data. You can omit shopper entirely or send only the fields you have.
  • Fields you do send are still validated for format (an invalid email returns 422), but none of them is required.
  • Who actually paid is reported by the payer’s bank after the transfer is confirmed, and it is best-effort (see Payer data).
  • In webhooks and when reading the order, shopper fields you did not send arrive as null (the whole shopper object can be null). After confirmation, first_name and last_name may be filled with the payer’s name. Email and phone number are never guaranteed for Breb.
The API also accepts national_id_number and id_national_document_type as aliases for id_number and id_type respectively. Both formats are interchangeable.

Examples

The id_payment_gateway value in these examples is a placeholder. Always retrieve the correct ID for each gateway from the Gateway Discovery endpoint (GET /v1/orders/paymentGateways) — do not hardcode it.
Nequi uses the buyer’s phone_number to send a push notification. National ID fields are still required for compliance.
Response:

Document types

The POST /orders response includes an allowed_documents array with the valid document types for the store’s country. Use this field instead of calling GET /v1/national-document-types/{countryCode} separately.
The id_type field requires the integer ID (id_national_document_type) from this list. The legacy endpoint GET /v1/national-document-types/{countryCode} still works but is deprecated. For Colombia, the most common types are:
Daviplata only accepts CC, CE, and TI document types. Sending a different document type will result in a payment error.

What happens next

After creating the order, the payment flow depends on the selected gateway:

Nequi

Buyer receives a push notification and approves in the Nequi app.

Daviplata

Buyer receives an OTP via SMS and submits it to confirm.

Breb

Buyer completes a transfer using a QR code or transfer key.

Stripe

Buyer is redirected to complete the card payment.
To track the order result, see Order Status.

Resending an order_key

order_key identifies one order on your store. Use a unique order_key per order. Resending it is safe — it is how you retry after a timeout or a network error without creating a second order — and the response depends on the order that already exists for it. A resend is the same order only if it has the same amount and currency. The rest of the body may change between attempts: a different payment_gateway (the buyer switches from Nequi to Daviplata), corrected shopper data or a new description.
Already paid
Do not reuse an order_key for a different payment — for example, several payments against the same invoice. A resend with another amount answers 409, and one with the same amount resolves to the existing order. Use a distinct order_key per payment.

Partners

If you are a partner creating orders on behalf of a store, the request body is identical. The only difference is the authentication headers. See Partners — Creating Orders for details.