Pular para o conteúdo

POST /v1/orders

POST
/v1/orders
curl --request POST \
--url https://seu-endereco-da-api/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "idempotencyKey": "example", "customerName": "example", "customerPhone": "example", "fulfillment": "delivery", "zoneId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "address": { "street": "example", "number": "example", "complement": "example", "reference": "example" }, "items": [ { "productId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "variantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "quantity": 1, "note": "example" } ], "paymentMethod": "pix", "changeForCents": 1, "document": "example", "notes": "example" }'

Permissão que a Chave de acesso precisa: Criar e atualizar pedidos (orders:manage).

Media typeapplication/json
object
idempotencyKey
required
string
>= 16 characters <= 64 characters
customerName
required
string
<= 80 characters /\S/
customerPhone
required
string
<= 32 characters
fulfillment
required
string
Allowed values: delivery pickup
zoneId
string format: uuid
address
object
street
required
string
<= 120 characters /\S/
number
required
string
<= 20 characters /\S/
complement
string
<= 80 characters
reference
string
<= 120 characters
items
required
Array<object>
>= 1 items
object
productId
required
string format: uuid
variantId
string format: uuid
quantity
required
number
>= 1 <= 99
note
string
<= 200 characters
paymentMethod
required
string
Allowed values: pix cash_on_delivery card_on_delivery
changeForCents
number
>= 1 <= 100000000
document
string
<= 32 characters
notes
string
<= 300 characters
Media typeapplication/json
object
id
required
string
number
required
number
status
required
string
totalCents
required

Total in centavos

number
paymentMethod
required
string
source
required
string
Allowed values: operator agent
token
required

Opaque token of the public tracking page

string
trackingUrl
required

Link the customer opens to follow the order and pay

string
nullable
pix
required

Pix code, present when the order is paid with Pix

object
state
required
string
Allowed values: ready unavailable
code

Copy-and-paste Pix code, present when ready

string
invoiceUrl
string
nullable
expiresAt
string
nullable
reason

Why the code could not be generated, present when unavailable

string

Example

{
"source": "operator",
"pix": {
"state": "ready"
}
}

The store is not activated or the idempotency key already belongs to another order