Pedidos
Endereço base: https://api.denaryx.com/admin/2026-10. Exemplos e regras no guia Pedidos. Os erros seguem o formato comum. A especificação inteira: baixar o OpenAPI.
GET /orders
Os pedidos da loja
Escopo read_orders
Na ordem da última mudança, da mais antiga à mais nova, com o id para desempatar: para sincronizar, guarde o updated_at do último que leu e peça updated_at_min na próxima vez. Toda mudança do pedido conta: a situação, o pagamento confirmado, o rastreio, a nota fiscal e a anonimização. Cada pedido traz os dados de quem comprou.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
limit | consulta | integer | Quantos itens por página, de 1 a 100 (50 sem ele). |
cursor | consulta | string | O next_cursor da página anterior, como veio. Os filtros continuam os mesmos. |
ids | consulta | string | Só estes ids, separados por vírgula (até 100). |
status | consulta | string | Só os pedidos nesta situação.Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
updated_at_min | consulta | string (data e hora) | Só o que mudou a partir desta data (ISO 8601): a sincronização incremental. |
created_at_min | consulta | string (data e hora) | Só o criado a partir desta data (ISO 8601). |
created_at_max | consulta | string (data e hora) | Só o criado até esta data (ISO 8601). |
Resposta
200 Sucesso. (OrderList)
Os campos da resposta (118)
| Campo | Tipo | Descrição |
|---|---|---|
data | lista de Order | |
data[].id | string (uuid) | |
data[].number | integer | |
data[].status | string | Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
data[].customer | objeto | |
data[].customer.id | string (uuid) ou null | |
data[].customer.name | string | |
data[].customer.email | string | |
data[].customer.phone | string | |
data[].customer.cpf | string | |
data[].shipping_address | objeto | |
data[].shipping_address.zip | string | |
data[].shipping_address.street | string | |
data[].shipping_address.number | string | |
data[].shipping_address.complement | string | |
data[].shipping_address.neighborhood | string | |
data[].shipping_address.city | string | |
data[].shipping_address.state | string | |
data[].line_items | lista de objeto | |
data[].line_items[].id | string (uuid) | |
data[].line_items[].key | string ou null | |
data[].line_items[].parent_line_id | string (uuid) ou null | |
data[].line_items[].group | objeto ou null | |
data[].line_items[].group.code | string | |
data[].line_items[].group.name | string | |
data[].line_items[].properties | objeto | |
data[].line_items[].inventory_tracked | boolean | |
data[].line_items[].eyes | objeto ou null | |
data[].line_items[].eyes.right | integer | |
data[].line_items[].eyes.left | integer | |
data[].line_items[].variant_id | string (uuid) | |
data[].line_items[].title | string | |
data[].line_items[].options | lista de string | |
data[].line_items[].sku | string ou null | |
data[].line_items[].price | integer | |
data[].line_items[].quantity | integer | |
data[].line_items[].line_price | integer | |
data[].line_items[].promotion | string ou null | |
data[].line_items[].files | lista de objeto | |
data[].line_items[].files[].id | string (uuid) | |
data[].line_items[].files[].name | string | |
data[].line_items[].files[].content_type | string | |
data[].line_items[].files[].size | integer | |
data[].line_items[].files[].purpose | string | Um de: general, prescription. |
data[].line_items[].files[].url | string (URL) | |
data[].line_items[].files[].url_expires_at | string (data e hora) | |
data[].line_items[].prescription | objeto ou null | |
data[].line_items[].prescription.type | string ou null | Um de: single_vision, progressive, bifocal, reading, plano, contact_lens. |
data[].line_items[].prescription.right | objeto ou null | |
data[].line_items[].prescription.right.sphere | number | |
data[].line_items[].prescription.right.cylinder | number | |
data[].line_items[].prescription.right.axis | integer ou null | |
data[].line_items[].prescription.right.add | number ou null | |
data[].line_items[].prescription.right.base_curve | number ou null | |
data[].line_items[].prescription.right.diameter | number ou null | |
data[].line_items[].prescription.left | objeto ou null | |
data[].line_items[].prescription.left.sphere | number | |
data[].line_items[].prescription.left.cylinder | number | |
data[].line_items[].prescription.left.axis | integer ou null | |
data[].line_items[].prescription.left.add | number ou null | |
data[].line_items[].prescription.left.base_curve | number ou null | |
data[].line_items[].prescription.left.diameter | number ou null | |
data[].line_items[].prescription.pd | objeto ou null | |
data[].line_items[].prescription.segment_height | objeto ou null | |
data[].line_items[].prescription.segment_height.right | number | |
data[].line_items[].prescription.segment_height.left | number | |
data[].line_items[].prescription.prism | objeto ou null | |
data[].line_items[].prescription.prism.right | objeto ou null | |
data[].line_items[].prescription.prism.right.value | number | |
data[].line_items[].prescription.prism.right.base | string | Um de: in, out, up, down. |
data[].line_items[].prescription.prism.left | objeto ou null | |
data[].line_items[].prescription.prism.left.value | number | |
data[].line_items[].prescription.prism.left.base | string | Um de: in, out, up, down. |
data[].line_items[].prescription.issued_at | string ou null | |
data[].line_items[].prescription.doctor | objeto ou null | |
data[].line_items[].prescription.doctor.name | string | |
data[].line_items[].prescription.doctor.license | string ou null | |
data[].line_items[].prescription.note | string ou null | |
data[].line_items[].prescription.lens_brand | string ou null | |
data[].line_items[].prescription.status | string | Um de: pending, declared, provided, checked. |
data[].line_items[].prescription.provided_at | string (data e hora) ou null | |
data[].line_items[].prescription.checked_at | string (data e hora) ou null | |
data[].line_items[].prescription.declared_at | string (data e hora) ou null | |
data[].line_items[].prescription.declaration | string ou null | |
data[].line_items[].prescription.store_note | string ou null | |
data[].subtotal_price | integer | |
data[].shipping_price | integer | |
data[].total_discounts | integer | |
data[].coupon_code | string ou null | |
data[].pix_discount | integer | |
data[].total_price | integer | |
data[].shipping_line | objeto ou null | |
data[].shipping_line.title | string | |
data[].shipping_line.carrier | string | |
data[].shipping_line.delivery_days | integer | |
data[].shipping_line.pickup | objeto ou null | |
data[].shipping_line.pickup.address | string | |
data[].shipping_line.pickup.instructions | string | |
data[].tracking_code | string ou null | |
data[].payment | objeto ou null | |
data[].payment.method | string | Um de: pix, credit_card, debit_card, boleto. |
data[].payment.status | string | Um de: pending, approved, expired, cancelled, declined, refunded, authorized. |
data[].payment.amount | integer | |
data[].payment.installments | integer ou null | |
data[].payment.refunded_at | string (data e hora) ou null | |
data[].payment.created_at | string (data e hora) | |
data[].invoice | objeto ou null | |
data[].invoice.key | string | |
data[].invoice.number | string | |
data[].invoice.series | string | |
data[].invoice.url | string ou null | |
data[].invoice.informed_at | string (data e hora) | |
data[].paid_at | string (data e hora) ou null | |
data[].test | boolean | |
data[].anonymized_at | string (data e hora) ou null | |
data[].created_at | string (data e hora) | |
data[].updated_at | string (data e hora) | |
next_cursor | string ou null |
Erros
400A chamada veio com campos inválidos; os campos recusados vão em fields (invalid_request).401O token falta, não existe, foi revogado ou venceu (authentication_error).403O token não tem o escopo da rota, ou, com write_content, mandou campos que pedem write_products, listados em fields (permission_error).429Chamadas demais: espere o Retry-After (rate_limited).500Erro do nosso lado (api_error).503A API está ocupada com outras chamadas: espere o Retry-After (api_error).
GET /orders/count
Quantos pedidos casam com os filtros
Escopo read_orders
Os mesmos filtros da lista.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
ids | consulta | string | Só estes ids, separados por vírgula (até 100). |
status | consulta | string | Só os pedidos nesta situação.Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
updated_at_min | consulta | string (data e hora) | Só o que mudou a partir desta data (ISO 8601): a sincronização incremental. |
created_at_min | consulta | string (data e hora) | Só o criado a partir desta data (ISO 8601). |
created_at_max | consulta | string (data e hora) | Só o criado até esta data (ISO 8601). |
Resposta
200 Sucesso. (Count)
Os campos da resposta (1)
| Campo | Tipo | Descrição |
|---|---|---|
count | integer |
Erros
400A chamada veio com campos inválidos; os campos recusados vão em fields (invalid_request).401O token falta, não existe, foi revogado ou venceu (authentication_error).403O token não tem o escopo da rota, ou, com write_content, mandou campos que pedem write_products, listados em fields (permission_error).429Chamadas demais: espere o Retry-After (rate_limited).500Erro do nosso lado (api_error).503A API está ocupada com outras chamadas: espere o Retry-After (api_error).
GET /orders/{id}
Um pedido
Escopo read_orders
O pedido, com os itens, os valores, o frete, a última cobrança, a nota fiscal e os dados de quem comprou.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
idobrigatório | caminho | string (uuid) | O id do pedido. |
Resposta
200 Sucesso. (Order)
Os campos da resposta (116)
| Campo | Tipo | Descrição |
|---|---|---|
id | string (uuid) | |
number | integer | |
status | string | Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
customer | objeto | |
customer.id | string (uuid) ou null | |
customer.name | string | |
customer.email | string | |
customer.phone | string | |
customer.cpf | string | |
shipping_address | objeto | |
shipping_address.zip | string | |
shipping_address.street | string | |
shipping_address.number | string | |
shipping_address.complement | string | |
shipping_address.neighborhood | string | |
shipping_address.city | string | |
shipping_address.state | string | |
line_items | lista de objeto | |
line_items[].id | string (uuid) | |
line_items[].key | string ou null | |
line_items[].parent_line_id | string (uuid) ou null | |
line_items[].group | objeto ou null | |
line_items[].group.code | string | |
line_items[].group.name | string | |
line_items[].properties | objeto | |
line_items[].inventory_tracked | boolean | |
line_items[].eyes | objeto ou null | |
line_items[].eyes.right | integer | |
line_items[].eyes.left | integer | |
line_items[].variant_id | string (uuid) | |
line_items[].title | string | |
line_items[].options | lista de string | |
line_items[].sku | string ou null | |
line_items[].price | integer | |
line_items[].quantity | integer | |
line_items[].line_price | integer | |
line_items[].promotion | string ou null | |
line_items[].files | lista de objeto | |
line_items[].files[].id | string (uuid) | |
line_items[].files[].name | string | |
line_items[].files[].content_type | string | |
line_items[].files[].size | integer | |
line_items[].files[].purpose | string | Um de: general, prescription. |
line_items[].files[].url | string (URL) | |
line_items[].files[].url_expires_at | string (data e hora) | |
line_items[].prescription | objeto ou null | |
line_items[].prescription.type | string ou null | Um de: single_vision, progressive, bifocal, reading, plano, contact_lens. |
line_items[].prescription.right | objeto ou null | |
line_items[].prescription.right.sphere | number | |
line_items[].prescription.right.cylinder | number | |
line_items[].prescription.right.axis | integer ou null | |
line_items[].prescription.right.add | number ou null | |
line_items[].prescription.right.base_curve | number ou null | |
line_items[].prescription.right.diameter | number ou null | |
line_items[].prescription.left | objeto ou null | |
line_items[].prescription.left.sphere | number | |
line_items[].prescription.left.cylinder | number | |
line_items[].prescription.left.axis | integer ou null | |
line_items[].prescription.left.add | number ou null | |
line_items[].prescription.left.base_curve | number ou null | |
line_items[].prescription.left.diameter | number ou null | |
line_items[].prescription.pd | objeto ou null | |
line_items[].prescription.segment_height | objeto ou null | |
line_items[].prescription.segment_height.right | number | |
line_items[].prescription.segment_height.left | number | |
line_items[].prescription.prism | objeto ou null | |
line_items[].prescription.prism.right | objeto ou null | |
line_items[].prescription.prism.right.value | number | |
line_items[].prescription.prism.right.base | string | Um de: in, out, up, down. |
line_items[].prescription.prism.left | objeto ou null | |
line_items[].prescription.prism.left.value | number | |
line_items[].prescription.prism.left.base | string | Um de: in, out, up, down. |
line_items[].prescription.issued_at | string ou null | |
line_items[].prescription.doctor | objeto ou null | |
line_items[].prescription.doctor.name | string | |
line_items[].prescription.doctor.license | string ou null | |
line_items[].prescription.note | string ou null | |
line_items[].prescription.lens_brand | string ou null | |
line_items[].prescription.status | string | Um de: pending, declared, provided, checked. |
line_items[].prescription.provided_at | string (data e hora) ou null | |
line_items[].prescription.checked_at | string (data e hora) ou null | |
line_items[].prescription.declared_at | string (data e hora) ou null | |
line_items[].prescription.declaration | string ou null | |
line_items[].prescription.store_note | string ou null | |
subtotal_price | integer | |
shipping_price | integer | |
total_discounts | integer | |
coupon_code | string ou null | |
pix_discount | integer | |
total_price | integer | |
shipping_line | objeto ou null | |
shipping_line.title | string | |
shipping_line.carrier | string | |
shipping_line.delivery_days | integer | |
shipping_line.pickup | objeto ou null | |
shipping_line.pickup.address | string | |
shipping_line.pickup.instructions | string | |
tracking_code | string ou null | |
payment | objeto ou null | |
payment.method | string | Um de: pix, credit_card, debit_card, boleto. |
payment.status | string | Um de: pending, approved, expired, cancelled, declined, refunded, authorized. |
payment.amount | integer | |
payment.installments | integer ou null | |
payment.refunded_at | string (data e hora) ou null | |
payment.created_at | string (data e hora) | |
invoice | objeto ou null | |
invoice.key | string | |
invoice.number | string | |
invoice.series | string | |
invoice.url | string ou null | |
invoice.informed_at | string (data e hora) | |
paid_at | string (data e hora) ou null | |
test | boolean | |
anonymized_at | string (data e hora) ou null | |
created_at | string (data e hora) | |
updated_at | string (data e hora) |
Erros
401O token falta, não existe, foi revogado ou venceu (authentication_error).403O token não tem o escopo da rota, ou, com write_content, mandou campos que pedem write_products, listados em fields (permission_error).404O recurso não existe nesta loja (not_found).429Chamadas demais: espere o Retry-After (rate_limited).500Erro do nosso lado (api_error).503A API está ocupada com outras chamadas: espere o Retry-After (api_error).
POST /orders/{id}/mark_paid
Marca o pedido como pago
Escopo write_orders
Para o pagamento recebido fora da plataforma (depósito, dinheiro na retirada). Só o pedido que aguarda pagamento; quem comprou recebe o e-mail de pagamento confirmado. O pagamento feito pelo checkout já chega pago, pelo gateway.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
idobrigatório | caminho | string (uuid) | O id do pedido. |
Idempotency-Key | cabeçalho | string | Até 255 caracteres. A mesma escrita mandada de novo com a mesma chave, em até 24 horas, devolve a resposta guardada (com Idempotent-Replayed: true) em vez de acontecer duas vezes. |
Resposta
200 Sucesso. (Order)
Os campos da resposta (116)
| Campo | Tipo | Descrição |
|---|---|---|
id | string (uuid) | |
number | integer | |
status | string | Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
customer | objeto | |
customer.id | string (uuid) ou null | |
customer.name | string | |
customer.email | string | |
customer.phone | string | |
customer.cpf | string | |
shipping_address | objeto | |
shipping_address.zip | string | |
shipping_address.street | string | |
shipping_address.number | string | |
shipping_address.complement | string | |
shipping_address.neighborhood | string | |
shipping_address.city | string | |
shipping_address.state | string | |
line_items | lista de objeto | |
line_items[].id | string (uuid) | |
line_items[].key | string ou null | |
line_items[].parent_line_id | string (uuid) ou null | |
line_items[].group | objeto ou null | |
line_items[].group.code | string | |
line_items[].group.name | string | |
line_items[].properties | objeto | |
line_items[].inventory_tracked | boolean | |
line_items[].eyes | objeto ou null | |
line_items[].eyes.right | integer | |
line_items[].eyes.left | integer | |
line_items[].variant_id | string (uuid) | |
line_items[].title | string | |
line_items[].options | lista de string | |
line_items[].sku | string ou null | |
line_items[].price | integer | |
line_items[].quantity | integer | |
line_items[].line_price | integer | |
line_items[].promotion | string ou null | |
line_items[].files | lista de objeto | |
line_items[].files[].id | string (uuid) | |
line_items[].files[].name | string | |
line_items[].files[].content_type | string | |
line_items[].files[].size | integer | |
line_items[].files[].purpose | string | Um de: general, prescription. |
line_items[].files[].url | string (URL) | |
line_items[].files[].url_expires_at | string (data e hora) | |
line_items[].prescription | objeto ou null | |
line_items[].prescription.type | string ou null | Um de: single_vision, progressive, bifocal, reading, plano, contact_lens. |
line_items[].prescription.right | objeto ou null | |
line_items[].prescription.right.sphere | number | |
line_items[].prescription.right.cylinder | number | |
line_items[].prescription.right.axis | integer ou null | |
line_items[].prescription.right.add | number ou null | |
line_items[].prescription.right.base_curve | number ou null | |
line_items[].prescription.right.diameter | number ou null | |
line_items[].prescription.left | objeto ou null | |
line_items[].prescription.left.sphere | number | |
line_items[].prescription.left.cylinder | number | |
line_items[].prescription.left.axis | integer ou null | |
line_items[].prescription.left.add | number ou null | |
line_items[].prescription.left.base_curve | number ou null | |
line_items[].prescription.left.diameter | number ou null | |
line_items[].prescription.pd | objeto ou null | |
line_items[].prescription.segment_height | objeto ou null | |
line_items[].prescription.segment_height.right | number | |
line_items[].prescription.segment_height.left | number | |
line_items[].prescription.prism | objeto ou null | |
line_items[].prescription.prism.right | objeto ou null | |
line_items[].prescription.prism.right.value | number | |
line_items[].prescription.prism.right.base | string | Um de: in, out, up, down. |
line_items[].prescription.prism.left | objeto ou null | |
line_items[].prescription.prism.left.value | number | |
line_items[].prescription.prism.left.base | string | Um de: in, out, up, down. |
line_items[].prescription.issued_at | string ou null | |
line_items[].prescription.doctor | objeto ou null | |
line_items[].prescription.doctor.name | string | |
line_items[].prescription.doctor.license | string ou null | |
line_items[].prescription.note | string ou null | |
line_items[].prescription.lens_brand | string ou null | |
line_items[].prescription.status | string | Um de: pending, declared, provided, checked. |
line_items[].prescription.provided_at | string (data e hora) ou null | |
line_items[].prescription.checked_at | string (data e hora) ou null | |
line_items[].prescription.declared_at | string (data e hora) ou null | |
line_items[].prescription.declaration | string ou null | |
line_items[].prescription.store_note | string ou null | |
subtotal_price | integer | |
shipping_price | integer | |
total_discounts | integer | |
coupon_code | string ou null | |
pix_discount | integer | |
total_price | integer | |
shipping_line | objeto ou null | |
shipping_line.title | string | |
shipping_line.carrier | string | |
shipping_line.delivery_days | integer | |
shipping_line.pickup | objeto ou null | |
shipping_line.pickup.address | string | |
shipping_line.pickup.instructions | string | |
tracking_code | string ou null | |
payment | objeto ou null | |
payment.method | string | Um de: pix, credit_card, debit_card, boleto. |
payment.status | string | Um de: pending, approved, expired, cancelled, declined, refunded, authorized. |
payment.amount | integer | |
payment.installments | integer ou null | |
payment.refunded_at | string (data e hora) ou null | |
payment.created_at | string (data e hora) | |
invoice | objeto ou null | |
invoice.key | string | |
invoice.number | string | |
invoice.series | string | |
invoice.url | string ou null | |
invoice.informed_at | string (data e hora) | |
paid_at | string (data e hora) ou null | |
test | boolean | |
anonymized_at | string (data e hora) ou null | |
created_at | string (data e hora) | |
updated_at | string (data e hora) |
Erros
401O token falta, não existe, foi revogado ou venceu (authentication_error).403O token não tem o escopo da rota, ou, com write_content, mandou campos que pedem write_products, listados em fields (permission_error).404O recurso não existe nesta loja (not_found).409O estado do recurso não permite a mudança, ou ele mudou desde a leitura (conflict).429Chamadas demais: espere o Retry-After (rate_limited).500Erro do nosso lado (api_error).503A API está ocupada com outras chamadas: espere o Retry-After (api_error).
POST /orders/{id}/prepare
Começa a separar o pedido
Escopo write_orders
Só o pedido pago.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
idobrigatório | caminho | string (uuid) | O id do pedido. |
Idempotency-Key | cabeçalho | string | Até 255 caracteres. A mesma escrita mandada de novo com a mesma chave, em até 24 horas, devolve a resposta guardada (com Idempotent-Replayed: true) em vez de acontecer duas vezes. |
Resposta
200 Sucesso. (Order)
Os campos da resposta (116)
| Campo | Tipo | Descrição |
|---|---|---|
id | string (uuid) | |
number | integer | |
status | string | Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
customer | objeto | |
customer.id | string (uuid) ou null | |
customer.name | string | |
customer.email | string | |
customer.phone | string | |
customer.cpf | string | |
shipping_address | objeto | |
shipping_address.zip | string | |
shipping_address.street | string | |
shipping_address.number | string | |
shipping_address.complement | string | |
shipping_address.neighborhood | string | |
shipping_address.city | string | |
shipping_address.state | string | |
line_items | lista de objeto | |
line_items[].id | string (uuid) | |
line_items[].key | string ou null | |
line_items[].parent_line_id | string (uuid) ou null | |
line_items[].group | objeto ou null | |
line_items[].group.code | string | |
line_items[].group.name | string | |
line_items[].properties | objeto | |
line_items[].inventory_tracked | boolean | |
line_items[].eyes | objeto ou null | |
line_items[].eyes.right | integer | |
line_items[].eyes.left | integer | |
line_items[].variant_id | string (uuid) | |
line_items[].title | string | |
line_items[].options | lista de string | |
line_items[].sku | string ou null | |
line_items[].price | integer | |
line_items[].quantity | integer | |
line_items[].line_price | integer | |
line_items[].promotion | string ou null | |
line_items[].files | lista de objeto | |
line_items[].files[].id | string (uuid) | |
line_items[].files[].name | string | |
line_items[].files[].content_type | string | |
line_items[].files[].size | integer | |
line_items[].files[].purpose | string | Um de: general, prescription. |
line_items[].files[].url | string (URL) | |
line_items[].files[].url_expires_at | string (data e hora) | |
line_items[].prescription | objeto ou null | |
line_items[].prescription.type | string ou null | Um de: single_vision, progressive, bifocal, reading, plano, contact_lens. |
line_items[].prescription.right | objeto ou null | |
line_items[].prescription.right.sphere | number | |
line_items[].prescription.right.cylinder | number | |
line_items[].prescription.right.axis | integer ou null | |
line_items[].prescription.right.add | number ou null | |
line_items[].prescription.right.base_curve | number ou null | |
line_items[].prescription.right.diameter | number ou null | |
line_items[].prescription.left | objeto ou null | |
line_items[].prescription.left.sphere | number | |
line_items[].prescription.left.cylinder | number | |
line_items[].prescription.left.axis | integer ou null | |
line_items[].prescription.left.add | number ou null | |
line_items[].prescription.left.base_curve | number ou null | |
line_items[].prescription.left.diameter | number ou null | |
line_items[].prescription.pd | objeto ou null | |
line_items[].prescription.segment_height | objeto ou null | |
line_items[].prescription.segment_height.right | number | |
line_items[].prescription.segment_height.left | number | |
line_items[].prescription.prism | objeto ou null | |
line_items[].prescription.prism.right | objeto ou null | |
line_items[].prescription.prism.right.value | number | |
line_items[].prescription.prism.right.base | string | Um de: in, out, up, down. |
line_items[].prescription.prism.left | objeto ou null | |
line_items[].prescription.prism.left.value | number | |
line_items[].prescription.prism.left.base | string | Um de: in, out, up, down. |
line_items[].prescription.issued_at | string ou null | |
line_items[].prescription.doctor | objeto ou null | |
line_items[].prescription.doctor.name | string | |
line_items[].prescription.doctor.license | string ou null | |
line_items[].prescription.note | string ou null | |
line_items[].prescription.lens_brand | string ou null | |
line_items[].prescription.status | string | Um de: pending, declared, provided, checked. |
line_items[].prescription.provided_at | string (data e hora) ou null | |
line_items[].prescription.checked_at | string (data e hora) ou null | |
line_items[].prescription.declared_at | string (data e hora) ou null | |
line_items[].prescription.declaration | string ou null | |
line_items[].prescription.store_note | string ou null | |
subtotal_price | integer | |
shipping_price | integer | |
total_discounts | integer | |
coupon_code | string ou null | |
pix_discount | integer | |
total_price | integer | |
shipping_line | objeto ou null | |
shipping_line.title | string | |
shipping_line.carrier | string | |
shipping_line.delivery_days | integer | |
shipping_line.pickup | objeto ou null | |
shipping_line.pickup.address | string | |
shipping_line.pickup.instructions | string | |
tracking_code | string ou null | |
payment | objeto ou null | |
payment.method | string | Um de: pix, credit_card, debit_card, boleto. |
payment.status | string | Um de: pending, approved, expired, cancelled, declined, refunded, authorized. |
payment.amount | integer | |
payment.installments | integer ou null | |
payment.refunded_at | string (data e hora) ou null | |
payment.created_at | string (data e hora) | |
invoice | objeto ou null | |
invoice.key | string | |
invoice.number | string | |
invoice.series | string | |
invoice.url | string ou null | |
invoice.informed_at | string (data e hora) | |
paid_at | string (data e hora) ou null | |
test | boolean | |
anonymized_at | string (data e hora) ou null | |
created_at | string (data e hora) | |
updated_at | string (data e hora) |
Erros
401O token falta, não existe, foi revogado ou venceu (authentication_error).403O token não tem o escopo da rota, ou, com write_content, mandou campos que pedem write_products, listados em fields (permission_error).404O recurso não existe nesta loja (not_found).409O estado do recurso não permite a mudança, ou ele mudou desde a leitura (conflict).429Chamadas demais: espere o Retry-After (rate_limited).500Erro do nosso lado (api_error).503A API está ocupada com outras chamadas: espere o Retry-After (api_error).
POST /orders/{id}/ship
Marca o pedido como enviado
Escopo write_orders
Só o pedido em separação, com o código de rastreio opcional. Quem comprou recebe o e-mail de pedido enviado, com o rastreio. Na retirada na loja, enviado é o pedido pronto para retirar.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
idobrigatório | caminho | string (uuid) | O id do pedido. |
Idempotency-Key | cabeçalho | string | Até 255 caracteres. A mesma escrita mandada de novo com a mesma chave, em até 24 horas, devolve a resposta guardada (com Idempotent-Replayed: true) em vez de acontecer duas vezes. |
Corpo application/json: OrderShip, opcional
| Campo | Tipo | Descrição |
|---|---|---|
tracking_code | string |
Resposta
200 Sucesso. (Order)
Os campos da resposta (116)
| Campo | Tipo | Descrição |
|---|---|---|
id | string (uuid) | |
number | integer | |
status | string | Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
customer | objeto | |
customer.id | string (uuid) ou null | |
customer.name | string | |
customer.email | string | |
customer.phone | string | |
customer.cpf | string | |
shipping_address | objeto | |
shipping_address.zip | string | |
shipping_address.street | string | |
shipping_address.number | string | |
shipping_address.complement | string | |
shipping_address.neighborhood | string | |
shipping_address.city | string | |
shipping_address.state | string | |
line_items | lista de objeto | |
line_items[].id | string (uuid) | |
line_items[].key | string ou null | |
line_items[].parent_line_id | string (uuid) ou null | |
line_items[].group | objeto ou null | |
line_items[].group.code | string | |
line_items[].group.name | string | |
line_items[].properties | objeto | |
line_items[].inventory_tracked | boolean | |
line_items[].eyes | objeto ou null | |
line_items[].eyes.right | integer | |
line_items[].eyes.left | integer | |
line_items[].variant_id | string (uuid) | |
line_items[].title | string | |
line_items[].options | lista de string | |
line_items[].sku | string ou null | |
line_items[].price | integer | |
line_items[].quantity | integer | |
line_items[].line_price | integer | |
line_items[].promotion | string ou null | |
line_items[].files | lista de objeto | |
line_items[].files[].id | string (uuid) | |
line_items[].files[].name | string | |
line_items[].files[].content_type | string | |
line_items[].files[].size | integer | |
line_items[].files[].purpose | string | Um de: general, prescription. |
line_items[].files[].url | string (URL) | |
line_items[].files[].url_expires_at | string (data e hora) | |
line_items[].prescription | objeto ou null | |
line_items[].prescription.type | string ou null | Um de: single_vision, progressive, bifocal, reading, plano, contact_lens. |
line_items[].prescription.right | objeto ou null | |
line_items[].prescription.right.sphere | number | |
line_items[].prescription.right.cylinder | number | |
line_items[].prescription.right.axis | integer ou null | |
line_items[].prescription.right.add | number ou null | |
line_items[].prescription.right.base_curve | number ou null | |
line_items[].prescription.right.diameter | number ou null | |
line_items[].prescription.left | objeto ou null | |
line_items[].prescription.left.sphere | number | |
line_items[].prescription.left.cylinder | number | |
line_items[].prescription.left.axis | integer ou null | |
line_items[].prescription.left.add | number ou null | |
line_items[].prescription.left.base_curve | number ou null | |
line_items[].prescription.left.diameter | number ou null | |
line_items[].prescription.pd | objeto ou null | |
line_items[].prescription.segment_height | objeto ou null | |
line_items[].prescription.segment_height.right | number | |
line_items[].prescription.segment_height.left | number | |
line_items[].prescription.prism | objeto ou null | |
line_items[].prescription.prism.right | objeto ou null | |
line_items[].prescription.prism.right.value | number | |
line_items[].prescription.prism.right.base | string | Um de: in, out, up, down. |
line_items[].prescription.prism.left | objeto ou null | |
line_items[].prescription.prism.left.value | number | |
line_items[].prescription.prism.left.base | string | Um de: in, out, up, down. |
line_items[].prescription.issued_at | string ou null | |
line_items[].prescription.doctor | objeto ou null | |
line_items[].prescription.doctor.name | string | |
line_items[].prescription.doctor.license | string ou null | |
line_items[].prescription.note | string ou null | |
line_items[].prescription.lens_brand | string ou null | |
line_items[].prescription.status | string | Um de: pending, declared, provided, checked. |
line_items[].prescription.provided_at | string (data e hora) ou null | |
line_items[].prescription.checked_at | string (data e hora) ou null | |
line_items[].prescription.declared_at | string (data e hora) ou null | |
line_items[].prescription.declaration | string ou null | |
line_items[].prescription.store_note | string ou null | |
subtotal_price | integer | |
shipping_price | integer | |
total_discounts | integer | |
coupon_code | string ou null | |
pix_discount | integer | |
total_price | integer | |
shipping_line | objeto ou null | |
shipping_line.title | string | |
shipping_line.carrier | string | |
shipping_line.delivery_days | integer | |
shipping_line.pickup | objeto ou null | |
shipping_line.pickup.address | string | |
shipping_line.pickup.instructions | string | |
tracking_code | string ou null | |
payment | objeto ou null | |
payment.method | string | Um de: pix, credit_card, debit_card, boleto. |
payment.status | string | Um de: pending, approved, expired, cancelled, declined, refunded, authorized. |
payment.amount | integer | |
payment.installments | integer ou null | |
payment.refunded_at | string (data e hora) ou null | |
payment.created_at | string (data e hora) | |
invoice | objeto ou null | |
invoice.key | string | |
invoice.number | string | |
invoice.series | string | |
invoice.url | string ou null | |
invoice.informed_at | string (data e hora) | |
paid_at | string (data e hora) ou null | |
test | boolean | |
anonymized_at | string (data e hora) ou null | |
created_at | string (data e hora) | |
updated_at | string (data e hora) |
Erros
400A chamada veio com campos inválidos; os campos recusados vão em fields (invalid_request).401O token falta, não existe, foi revogado ou venceu (authentication_error).403O token não tem o escopo da rota, ou, com write_content, mandou campos que pedem write_products, listados em fields (permission_error).404O recurso não existe nesta loja (not_found).409O estado do recurso não permite a mudança, ou ele mudou desde a leitura (conflict).429Chamadas demais: espere o Retry-After (rate_limited).500Erro do nosso lado (api_error).503A API está ocupada com outras chamadas: espere o Retry-After (api_error).
POST /orders/{id}/deliver
Marca o pedido como entregue
Escopo write_orders
Só o pedido enviado. Na retirada na loja, entregue é o pedido retirado.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
idobrigatório | caminho | string (uuid) | O id do pedido. |
Idempotency-Key | cabeçalho | string | Até 255 caracteres. A mesma escrita mandada de novo com a mesma chave, em até 24 horas, devolve a resposta guardada (com Idempotent-Replayed: true) em vez de acontecer duas vezes. |
Resposta
200 Sucesso. (Order)
Os campos da resposta (116)
| Campo | Tipo | Descrição |
|---|---|---|
id | string (uuid) | |
number | integer | |
status | string | Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
customer | objeto | |
customer.id | string (uuid) ou null | |
customer.name | string | |
customer.email | string | |
customer.phone | string | |
customer.cpf | string | |
shipping_address | objeto | |
shipping_address.zip | string | |
shipping_address.street | string | |
shipping_address.number | string | |
shipping_address.complement | string | |
shipping_address.neighborhood | string | |
shipping_address.city | string | |
shipping_address.state | string | |
line_items | lista de objeto | |
line_items[].id | string (uuid) | |
line_items[].key | string ou null | |
line_items[].parent_line_id | string (uuid) ou null | |
line_items[].group | objeto ou null | |
line_items[].group.code | string | |
line_items[].group.name | string | |
line_items[].properties | objeto | |
line_items[].inventory_tracked | boolean | |
line_items[].eyes | objeto ou null | |
line_items[].eyes.right | integer | |
line_items[].eyes.left | integer | |
line_items[].variant_id | string (uuid) | |
line_items[].title | string | |
line_items[].options | lista de string | |
line_items[].sku | string ou null | |
line_items[].price | integer | |
line_items[].quantity | integer | |
line_items[].line_price | integer | |
line_items[].promotion | string ou null | |
line_items[].files | lista de objeto | |
line_items[].files[].id | string (uuid) | |
line_items[].files[].name | string | |
line_items[].files[].content_type | string | |
line_items[].files[].size | integer | |
line_items[].files[].purpose | string | Um de: general, prescription. |
line_items[].files[].url | string (URL) | |
line_items[].files[].url_expires_at | string (data e hora) | |
line_items[].prescription | objeto ou null | |
line_items[].prescription.type | string ou null | Um de: single_vision, progressive, bifocal, reading, plano, contact_lens. |
line_items[].prescription.right | objeto ou null | |
line_items[].prescription.right.sphere | number | |
line_items[].prescription.right.cylinder | number | |
line_items[].prescription.right.axis | integer ou null | |
line_items[].prescription.right.add | number ou null | |
line_items[].prescription.right.base_curve | number ou null | |
line_items[].prescription.right.diameter | number ou null | |
line_items[].prescription.left | objeto ou null | |
line_items[].prescription.left.sphere | number | |
line_items[].prescription.left.cylinder | number | |
line_items[].prescription.left.axis | integer ou null | |
line_items[].prescription.left.add | number ou null | |
line_items[].prescription.left.base_curve | number ou null | |
line_items[].prescription.left.diameter | number ou null | |
line_items[].prescription.pd | objeto ou null | |
line_items[].prescription.segment_height | objeto ou null | |
line_items[].prescription.segment_height.right | number | |
line_items[].prescription.segment_height.left | number | |
line_items[].prescription.prism | objeto ou null | |
line_items[].prescription.prism.right | objeto ou null | |
line_items[].prescription.prism.right.value | number | |
line_items[].prescription.prism.right.base | string | Um de: in, out, up, down. |
line_items[].prescription.prism.left | objeto ou null | |
line_items[].prescription.prism.left.value | number | |
line_items[].prescription.prism.left.base | string | Um de: in, out, up, down. |
line_items[].prescription.issued_at | string ou null | |
line_items[].prescription.doctor | objeto ou null | |
line_items[].prescription.doctor.name | string | |
line_items[].prescription.doctor.license | string ou null | |
line_items[].prescription.note | string ou null | |
line_items[].prescription.lens_brand | string ou null | |
line_items[].prescription.status | string | Um de: pending, declared, provided, checked. |
line_items[].prescription.provided_at | string (data e hora) ou null | |
line_items[].prescription.checked_at | string (data e hora) ou null | |
line_items[].prescription.declared_at | string (data e hora) ou null | |
line_items[].prescription.declaration | string ou null | |
line_items[].prescription.store_note | string ou null | |
subtotal_price | integer | |
shipping_price | integer | |
total_discounts | integer | |
coupon_code | string ou null | |
pix_discount | integer | |
total_price | integer | |
shipping_line | objeto ou null | |
shipping_line.title | string | |
shipping_line.carrier | string | |
shipping_line.delivery_days | integer | |
shipping_line.pickup | objeto ou null | |
shipping_line.pickup.address | string | |
shipping_line.pickup.instructions | string | |
tracking_code | string ou null | |
payment | objeto ou null | |
payment.method | string | Um de: pix, credit_card, debit_card, boleto. |
payment.status | string | Um de: pending, approved, expired, cancelled, declined, refunded, authorized. |
payment.amount | integer | |
payment.installments | integer ou null | |
payment.refunded_at | string (data e hora) ou null | |
payment.created_at | string (data e hora) | |
invoice | objeto ou null | |
invoice.key | string | |
invoice.number | string | |
invoice.series | string | |
invoice.url | string ou null | |
invoice.informed_at | string (data e hora) | |
paid_at | string (data e hora) ou null | |
test | boolean | |
anonymized_at | string (data e hora) ou null | |
created_at | string (data e hora) | |
updated_at | string (data e hora) |
Erros
401O token falta, não existe, foi revogado ou venceu (authentication_error).403O token não tem o escopo da rota, ou, com write_content, mandou campos que pedem write_products, listados em fields (permission_error).404O recurso não existe nesta loja (not_found).409O estado do recurso não permite a mudança, ou ele mudou desde a leitura (conflict).429Chamadas demais: espere o Retry-After (rate_limited).500Erro do nosso lado (api_error).503A API está ocupada com outras chamadas: espere o Retry-After (api_error).
POST /orders/{id}/cancel
Cancela o pedido
Escopo write_orders
Os itens voltam ao estoque, e a cobrança em aberto deixa de valer. O pedido já pago tem o dinheiro devolvido a quem comprou, pelo gateway que cobrou: cancelá-lo pede também o escopo refund_orders (sem ele, 403). Se o gateway recusar o estorno, nada muda. O pedido enviado ou entregue não se cancela (409).
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
idobrigatório | caminho | string (uuid) | O id do pedido. |
Idempotency-Key | cabeçalho | string | Até 255 caracteres. A mesma escrita mandada de novo com a mesma chave, em até 24 horas, devolve a resposta guardada (com Idempotent-Replayed: true) em vez de acontecer duas vezes. |
Resposta
200 Sucesso. (Order)
Os campos da resposta (116)
| Campo | Tipo | Descrição |
|---|---|---|
id | string (uuid) | |
number | integer | |
status | string | Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
customer | objeto | |
customer.id | string (uuid) ou null | |
customer.name | string | |
customer.email | string | |
customer.phone | string | |
customer.cpf | string | |
shipping_address | objeto | |
shipping_address.zip | string | |
shipping_address.street | string | |
shipping_address.number | string | |
shipping_address.complement | string | |
shipping_address.neighborhood | string | |
shipping_address.city | string | |
shipping_address.state | string | |
line_items | lista de objeto | |
line_items[].id | string (uuid) | |
line_items[].key | string ou null | |
line_items[].parent_line_id | string (uuid) ou null | |
line_items[].group | objeto ou null | |
line_items[].group.code | string | |
line_items[].group.name | string | |
line_items[].properties | objeto | |
line_items[].inventory_tracked | boolean | |
line_items[].eyes | objeto ou null | |
line_items[].eyes.right | integer | |
line_items[].eyes.left | integer | |
line_items[].variant_id | string (uuid) | |
line_items[].title | string | |
line_items[].options | lista de string | |
line_items[].sku | string ou null | |
line_items[].price | integer | |
line_items[].quantity | integer | |
line_items[].line_price | integer | |
line_items[].promotion | string ou null | |
line_items[].files | lista de objeto | |
line_items[].files[].id | string (uuid) | |
line_items[].files[].name | string | |
line_items[].files[].content_type | string | |
line_items[].files[].size | integer | |
line_items[].files[].purpose | string | Um de: general, prescription. |
line_items[].files[].url | string (URL) | |
line_items[].files[].url_expires_at | string (data e hora) | |
line_items[].prescription | objeto ou null | |
line_items[].prescription.type | string ou null | Um de: single_vision, progressive, bifocal, reading, plano, contact_lens. |
line_items[].prescription.right | objeto ou null | |
line_items[].prescription.right.sphere | number | |
line_items[].prescription.right.cylinder | number | |
line_items[].prescription.right.axis | integer ou null | |
line_items[].prescription.right.add | number ou null | |
line_items[].prescription.right.base_curve | number ou null | |
line_items[].prescription.right.diameter | number ou null | |
line_items[].prescription.left | objeto ou null | |
line_items[].prescription.left.sphere | number | |
line_items[].prescription.left.cylinder | number | |
line_items[].prescription.left.axis | integer ou null | |
line_items[].prescription.left.add | number ou null | |
line_items[].prescription.left.base_curve | number ou null | |
line_items[].prescription.left.diameter | number ou null | |
line_items[].prescription.pd | objeto ou null | |
line_items[].prescription.segment_height | objeto ou null | |
line_items[].prescription.segment_height.right | number | |
line_items[].prescription.segment_height.left | number | |
line_items[].prescription.prism | objeto ou null | |
line_items[].prescription.prism.right | objeto ou null | |
line_items[].prescription.prism.right.value | number | |
line_items[].prescription.prism.right.base | string | Um de: in, out, up, down. |
line_items[].prescription.prism.left | objeto ou null | |
line_items[].prescription.prism.left.value | number | |
line_items[].prescription.prism.left.base | string | Um de: in, out, up, down. |
line_items[].prescription.issued_at | string ou null | |
line_items[].prescription.doctor | objeto ou null | |
line_items[].prescription.doctor.name | string | |
line_items[].prescription.doctor.license | string ou null | |
line_items[].prescription.note | string ou null | |
line_items[].prescription.lens_brand | string ou null | |
line_items[].prescription.status | string | Um de: pending, declared, provided, checked. |
line_items[].prescription.provided_at | string (data e hora) ou null | |
line_items[].prescription.checked_at | string (data e hora) ou null | |
line_items[].prescription.declared_at | string (data e hora) ou null | |
line_items[].prescription.declaration | string ou null | |
line_items[].prescription.store_note | string ou null | |
subtotal_price | integer | |
shipping_price | integer | |
total_discounts | integer | |
coupon_code | string ou null | |
pix_discount | integer | |
total_price | integer | |
shipping_line | objeto ou null | |
shipping_line.title | string | |
shipping_line.carrier | string | |
shipping_line.delivery_days | integer | |
shipping_line.pickup | objeto ou null | |
shipping_line.pickup.address | string | |
shipping_line.pickup.instructions | string | |
tracking_code | string ou null | |
payment | objeto ou null | |
payment.method | string | Um de: pix, credit_card, debit_card, boleto. |
payment.status | string | Um de: pending, approved, expired, cancelled, declined, refunded, authorized. |
payment.amount | integer | |
payment.installments | integer ou null | |
payment.refunded_at | string (data e hora) ou null | |
payment.created_at | string (data e hora) | |
invoice | objeto ou null | |
invoice.key | string | |
invoice.number | string | |
invoice.series | string | |
invoice.url | string ou null | |
invoice.informed_at | string (data e hora) | |
paid_at | string (data e hora) ou null | |
test | boolean | |
anonymized_at | string (data e hora) ou null | |
created_at | string (data e hora) | |
updated_at | string (data e hora) |
Erros
401O token falta, não existe, foi revogado ou venceu (authentication_error).403O token não tem o escopo da rota, ou, com write_content, mandou campos que pedem write_products, listados em fields (permission_error).404O recurso não existe nesta loja (not_found).409O estado do recurso não permite a mudança, ou ele mudou desde a leitura (conflict).429Chamadas demais: espere o Retry-After (rate_limited).500Erro do nosso lado (api_error).503A API está ocupada com outras chamadas: espere o Retry-After (api_error).
PUT /orders/{id}/invoice
Informa a nota fiscal do pedido
Escopo write_orders
A nota emitida pelo ERP (a plataforma não emite nota): a chave de acesso, e o número, a série e o link, opcionais. O número e a série estão dentro da chave; sem eles, saem dela. Informar de novo troca a nota anterior. A nota aparece no pedido no painel, e a compra da etiqueta do Melhor Envio usa a chave.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
idobrigatório | caminho | string (uuid) | O id do pedido. |
Idempotency-Key | cabeçalho | string | Até 255 caracteres. A mesma escrita mandada de novo com a mesma chave, em até 24 horas, devolve a resposta guardada (com Idempotent-Replayed: true) em vez de acontecer duas vezes. |
Corpo application/json: OrderInvoice
| Campo | Tipo | Descrição |
|---|---|---|
keyobrigatório | string | |
number | string | |
series | string | |
url | string (URL) | Até 500 caracteres. |
Resposta
200 Sucesso. (Order)
Os campos da resposta (116)
| Campo | Tipo | Descrição |
|---|---|---|
id | string (uuid) | |
number | integer | |
status | string | Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
customer | objeto | |
customer.id | string (uuid) ou null | |
customer.name | string | |
customer.email | string | |
customer.phone | string | |
customer.cpf | string | |
shipping_address | objeto | |
shipping_address.zip | string | |
shipping_address.street | string | |
shipping_address.number | string | |
shipping_address.complement | string | |
shipping_address.neighborhood | string | |
shipping_address.city | string | |
shipping_address.state | string | |
line_items | lista de objeto | |
line_items[].id | string (uuid) | |
line_items[].key | string ou null | |
line_items[].parent_line_id | string (uuid) ou null | |
line_items[].group | objeto ou null | |
line_items[].group.code | string | |
line_items[].group.name | string | |
line_items[].properties | objeto | |
line_items[].inventory_tracked | boolean | |
line_items[].eyes | objeto ou null | |
line_items[].eyes.right | integer | |
line_items[].eyes.left | integer | |
line_items[].variant_id | string (uuid) | |
line_items[].title | string | |
line_items[].options | lista de string | |
line_items[].sku | string ou null | |
line_items[].price | integer | |
line_items[].quantity | integer | |
line_items[].line_price | integer | |
line_items[].promotion | string ou null | |
line_items[].files | lista de objeto | |
line_items[].files[].id | string (uuid) | |
line_items[].files[].name | string | |
line_items[].files[].content_type | string | |
line_items[].files[].size | integer | |
line_items[].files[].purpose | string | Um de: general, prescription. |
line_items[].files[].url | string (URL) | |
line_items[].files[].url_expires_at | string (data e hora) | |
line_items[].prescription | objeto ou null | |
line_items[].prescription.type | string ou null | Um de: single_vision, progressive, bifocal, reading, plano, contact_lens. |
line_items[].prescription.right | objeto ou null | |
line_items[].prescription.right.sphere | number | |
line_items[].prescription.right.cylinder | number | |
line_items[].prescription.right.axis | integer ou null | |
line_items[].prescription.right.add | number ou null | |
line_items[].prescription.right.base_curve | number ou null | |
line_items[].prescription.right.diameter | number ou null | |
line_items[].prescription.left | objeto ou null | |
line_items[].prescription.left.sphere | number | |
line_items[].prescription.left.cylinder | number | |
line_items[].prescription.left.axis | integer ou null | |
line_items[].prescription.left.add | number ou null | |
line_items[].prescription.left.base_curve | number ou null | |
line_items[].prescription.left.diameter | number ou null | |
line_items[].prescription.pd | objeto ou null | |
line_items[].prescription.segment_height | objeto ou null | |
line_items[].prescription.segment_height.right | number | |
line_items[].prescription.segment_height.left | number | |
line_items[].prescription.prism | objeto ou null | |
line_items[].prescription.prism.right | objeto ou null | |
line_items[].prescription.prism.right.value | number | |
line_items[].prescription.prism.right.base | string | Um de: in, out, up, down. |
line_items[].prescription.prism.left | objeto ou null | |
line_items[].prescription.prism.left.value | number | |
line_items[].prescription.prism.left.base | string | Um de: in, out, up, down. |
line_items[].prescription.issued_at | string ou null | |
line_items[].prescription.doctor | objeto ou null | |
line_items[].prescription.doctor.name | string | |
line_items[].prescription.doctor.license | string ou null | |
line_items[].prescription.note | string ou null | |
line_items[].prescription.lens_brand | string ou null | |
line_items[].prescription.status | string | Um de: pending, declared, provided, checked. |
line_items[].prescription.provided_at | string (data e hora) ou null | |
line_items[].prescription.checked_at | string (data e hora) ou null | |
line_items[].prescription.declared_at | string (data e hora) ou null | |
line_items[].prescription.declaration | string ou null | |
line_items[].prescription.store_note | string ou null | |
subtotal_price | integer | |
shipping_price | integer | |
total_discounts | integer | |
coupon_code | string ou null | |
pix_discount | integer | |
total_price | integer | |
shipping_line | objeto ou null | |
shipping_line.title | string | |
shipping_line.carrier | string | |
shipping_line.delivery_days | integer | |
shipping_line.pickup | objeto ou null | |
shipping_line.pickup.address | string | |
shipping_line.pickup.instructions | string | |
tracking_code | string ou null | |
payment | objeto ou null | |
payment.method | string | Um de: pix, credit_card, debit_card, boleto. |
payment.status | string | Um de: pending, approved, expired, cancelled, declined, refunded, authorized. |
payment.amount | integer | |
payment.installments | integer ou null | |
payment.refunded_at | string (data e hora) ou null | |
payment.created_at | string (data e hora) | |
invoice | objeto ou null | |
invoice.key | string | |
invoice.number | string | |
invoice.series | string | |
invoice.url | string ou null | |
invoice.informed_at | string (data e hora) | |
paid_at | string (data e hora) ou null | |
test | boolean | |
anonymized_at | string (data e hora) ou null | |
created_at | string (data e hora) | |
updated_at | string (data e hora) |
Erros
400A chamada veio com campos inválidos; os campos recusados vão em fields (invalid_request).401O token falta, não existe, foi revogado ou venceu (authentication_error).403O token não tem o escopo da rota, ou, com write_content, mandou campos que pedem write_products, listados em fields (permission_error).404O recurso não existe nesta loja (not_found).429Chamadas demais: espere o Retry-After (rate_limited).500Erro do nosso lado (api_error).503A API está ocupada com outras chamadas: espere o Retry-After (api_error).
PUT /orders/{id}/line_items/{line_id}/prescription
Informa a receita de um item
Escopo write_orders
A receita oftalmológica recebida por outro canal (o balcão, o ERP da ótica, o telefone), com os nomes em inglês e os rótulos do padrão dos laboratórios (DCS) nas descrições. Conferida pelas mesmas regras do checkout (faixas, passos de 0.25, eixo com o cilíndrico, adição na progressive e na bifocal): o erro diz o campo. Troca a receita que havia; a conferida volta a provided. Só o item que pede receita (prescription não é null); sem isso, 409. A receita que estava pendente gera o evento order.prescription_received. A resposta é o pedido com os valores da receita, como no GET.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
idobrigatório | caminho | string (uuid) | O id do pedido. |
line_idobrigatório | caminho | string (uuid) | O id do item do pedido (line_items[].id) que pede a receita. |
Idempotency-Key | cabeçalho | string | Até 255 caracteres. A mesma escrita mandada de novo com a mesma chave, em até 24 horas, devolve a resposta guardada (com Idempotent-Replayed: true) em vez de acontecer duas vezes. |
Corpo application/json: Prescription
| Campo | Tipo | Descrição |
|---|---|---|
typeobrigatório | string | single_vision (visão simples), progressive (multifocal), bifocal, reading (leitura), plano (sem grau) ou contact_lens (lente de contato).Um de: single_vision, progressive, bifocal, reading, plano, contact_lens. |
right | objeto | O olho direito (OD). Obrigatório, menos no plano; na contact_lens, basta um dos olhos. |
right.sphereobrigatório | number ou string | Esférico (SPH), de -20.00 a +20.00, de 0.25 em 0.25. |
right.cylinder | number ou string ou null | Cilíndrico (CYL), de -8.00 a +8.00, de 0.25 em 0.25, como o médico escreveu. Ausente vale 0. |
right.axis | number ou string ou null | Eixo (AX), de 0 a 180, inteiro: obrigatório com cilíndrico, ignorado sem ele. |
right.add | number ou string ou null | Adição (ADD), de 0.75 a 4.00: obrigatória na progressive e na bifocal, opcional na contact_lens, recusada nas outras. |
right.base_curve | number ou string ou null | Curva base (BC) em mm, de 7.0 a 10.0, com uma casa decimal: só na contact_lens. |
right.diameter | number ou string ou null | Diâmetro (DIA) em mm, de 8.0 a 16.0, com uma casa decimal: só na contact_lens. |
left | objeto | O olho esquerdo (OE). Obrigatório, menos no plano; na contact_lens, basta um dos olhos. |
left.sphereobrigatório | number ou string | Esférico (SPH), de -20.00 a +20.00, de 0.25 em 0.25. |
left.cylinder | number ou string ou null | Cilíndrico (CYL), de -8.00 a +8.00, de 0.25 em 0.25, como o médico escreveu. Ausente vale 0. |
left.axis | number ou string ou null | Eixo (AX), de 0 a 180, inteiro: obrigatório com cilíndrico, ignorado sem ele. |
left.add | number ou string ou null | Adição (ADD), de 0.75 a 4.00: obrigatória na progressive e na bifocal, opcional na contact_lens, recusada nas outras. |
left.base_curve | number ou string ou null | Curva base (BC) em mm, de 7.0 a 10.0, com uma casa decimal: só na contact_lens. |
left.diameter | number ou string ou null | Diâmetro (DIA) em mm, de 8.0 a 16.0, com uma casa decimal: só na contact_lens. |
pd | number ou string ou objeto ou null | Distância pupilar em mm (IPD), de 0.5 em 0.5: um número ou { binocular } (de 40 a 80), ou { right, left } (NPD, de 20 a 40 cada). |
segment_height | objeto ou null | Altura de montagem em mm (SEGHT), de 10 a 40, de 0.5 em 0.5: só na progressive e na bifocal. |
segment_height.rightobrigatório | number ou string | |
segment_height.leftobrigatório | number ou string | |
prism | objeto ou null | |
prism.right | objeto ou null | |
prism.right.valueobrigatório | number ou string | Prisma (PRVM), de 0.25 a 10.00, de 0.25 em 0.25. |
prism.right.baseobrigatório | string | A base do prisma (PRVA): in (nasal), out (temporal), up ou down.Um de: in, out, up, down. |
prism.left | objeto ou null | |
prism.left.valueobrigatório | number ou string | Prisma (PRVM), de 0.25 a 10.00, de 0.25 em 0.25. |
prism.left.baseobrigatório | string | A base do prisma (PRVA): in (nasal), out (temporal), up ou down.Um de: in, out, up, down. |
issued_at | string ou null | A data da receita, AAAA-MM-DD. Não pode ser depois de hoje. |
doctor | objeto ou null | |
doctor.nameobrigatório | string | |
doctor.license | string ou null | O CRM. |
note | string ou null | A observação da receita, até 300 caracteres. |
lens_brand | string ou null | A lente receitada (marca e modelo), até 80 caracteres: só na contact_lens. |
Resposta
200 Sucesso. (Order)
Os campos da resposta (116)
| Campo | Tipo | Descrição |
|---|---|---|
id | string (uuid) | |
number | integer | |
status | string | Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
customer | objeto | |
customer.id | string (uuid) ou null | |
customer.name | string | |
customer.email | string | |
customer.phone | string | |
customer.cpf | string | |
shipping_address | objeto | |
shipping_address.zip | string | |
shipping_address.street | string | |
shipping_address.number | string | |
shipping_address.complement | string | |
shipping_address.neighborhood | string | |
shipping_address.city | string | |
shipping_address.state | string | |
line_items | lista de objeto | |
line_items[].id | string (uuid) | |
line_items[].key | string ou null | |
line_items[].parent_line_id | string (uuid) ou null | |
line_items[].group | objeto ou null | |
line_items[].group.code | string | |
line_items[].group.name | string | |
line_items[].properties | objeto | |
line_items[].inventory_tracked | boolean | |
line_items[].eyes | objeto ou null | |
line_items[].eyes.right | integer | |
line_items[].eyes.left | integer | |
line_items[].variant_id | string (uuid) | |
line_items[].title | string | |
line_items[].options | lista de string | |
line_items[].sku | string ou null | |
line_items[].price | integer | |
line_items[].quantity | integer | |
line_items[].line_price | integer | |
line_items[].promotion | string ou null | |
line_items[].files | lista de objeto | |
line_items[].files[].id | string (uuid) | |
line_items[].files[].name | string | |
line_items[].files[].content_type | string | |
line_items[].files[].size | integer | |
line_items[].files[].purpose | string | Um de: general, prescription. |
line_items[].files[].url | string (URL) | |
line_items[].files[].url_expires_at | string (data e hora) | |
line_items[].prescription | objeto ou null | |
line_items[].prescription.type | string ou null | Um de: single_vision, progressive, bifocal, reading, plano, contact_lens. |
line_items[].prescription.right | objeto ou null | |
line_items[].prescription.right.sphere | number | |
line_items[].prescription.right.cylinder | number | |
line_items[].prescription.right.axis | integer ou null | |
line_items[].prescription.right.add | number ou null | |
line_items[].prescription.right.base_curve | number ou null | |
line_items[].prescription.right.diameter | number ou null | |
line_items[].prescription.left | objeto ou null | |
line_items[].prescription.left.sphere | number | |
line_items[].prescription.left.cylinder | number | |
line_items[].prescription.left.axis | integer ou null | |
line_items[].prescription.left.add | number ou null | |
line_items[].prescription.left.base_curve | number ou null | |
line_items[].prescription.left.diameter | number ou null | |
line_items[].prescription.pd | objeto ou null | |
line_items[].prescription.segment_height | objeto ou null | |
line_items[].prescription.segment_height.right | number | |
line_items[].prescription.segment_height.left | number | |
line_items[].prescription.prism | objeto ou null | |
line_items[].prescription.prism.right | objeto ou null | |
line_items[].prescription.prism.right.value | number | |
line_items[].prescription.prism.right.base | string | Um de: in, out, up, down. |
line_items[].prescription.prism.left | objeto ou null | |
line_items[].prescription.prism.left.value | number | |
line_items[].prescription.prism.left.base | string | Um de: in, out, up, down. |
line_items[].prescription.issued_at | string ou null | |
line_items[].prescription.doctor | objeto ou null | |
line_items[].prescription.doctor.name | string | |
line_items[].prescription.doctor.license | string ou null | |
line_items[].prescription.note | string ou null | |
line_items[].prescription.lens_brand | string ou null | |
line_items[].prescription.status | string | Um de: pending, declared, provided, checked. |
line_items[].prescription.provided_at | string (data e hora) ou null | |
line_items[].prescription.checked_at | string (data e hora) ou null | |
line_items[].prescription.declared_at | string (data e hora) ou null | |
line_items[].prescription.declaration | string ou null | |
line_items[].prescription.store_note | string ou null | |
subtotal_price | integer | |
shipping_price | integer | |
total_discounts | integer | |
coupon_code | string ou null | |
pix_discount | integer | |
total_price | integer | |
shipping_line | objeto ou null | |
shipping_line.title | string | |
shipping_line.carrier | string | |
shipping_line.delivery_days | integer | |
shipping_line.pickup | objeto ou null | |
shipping_line.pickup.address | string | |
shipping_line.pickup.instructions | string | |
tracking_code | string ou null | |
payment | objeto ou null | |
payment.method | string | Um de: pix, credit_card, debit_card, boleto. |
payment.status | string | Um de: pending, approved, expired, cancelled, declined, refunded, authorized. |
payment.amount | integer | |
payment.installments | integer ou null | |
payment.refunded_at | string (data e hora) ou null | |
payment.created_at | string (data e hora) | |
invoice | objeto ou null | |
invoice.key | string | |
invoice.number | string | |
invoice.series | string | |
invoice.url | string ou null | |
invoice.informed_at | string (data e hora) | |
paid_at | string (data e hora) ou null | |
test | boolean | |
anonymized_at | string (data e hora) ou null | |
created_at | string (data e hora) | |
updated_at | string (data e hora) |
Erros
400A chamada veio com campos inválidos; os campos recusados vão em fields (invalid_request).401O token falta, não existe, foi revogado ou venceu (authentication_error).403O token não tem o escopo da rota, ou, com write_content, mandou campos que pedem write_products, listados em fields (permission_error).404O recurso não existe nesta loja (not_found).409O estado do recurso não permite a mudança, ou ele mudou desde a leitura (conflict).429Chamadas demais: espere o Retry-After (rate_limited).500Erro do nosso lado (api_error).503A API está ocupada com outras chamadas: espere o Retry-After (api_error).
POST /orders/{id}/line_items/{line_id}/prescription/check
Marca a receita de um item como conferida
Escopo write_orders
A ótica conferiu a receita (a foto contra os valores, a validade, o médico). Só a receita informada (status provided); a pendente dá 409. Gera order.updated. A resposta é o pedido com os valores da receita, como no GET.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
idobrigatório | caminho | string (uuid) | O id do pedido. |
line_idobrigatório | caminho | string (uuid) | O id do item do pedido (line_items[].id) que pede a receita. |
Idempotency-Key | cabeçalho | string | Até 255 caracteres. A mesma escrita mandada de novo com a mesma chave, em até 24 horas, devolve a resposta guardada (com Idempotent-Replayed: true) em vez de acontecer duas vezes. |
Resposta
200 Sucesso. (Order)
Os campos da resposta (116)
| Campo | Tipo | Descrição |
|---|---|---|
id | string (uuid) | |
number | integer | |
status | string | Um de: pending_payment, paid, preparing, shipped, delivered, cancelled. |
customer | objeto | |
customer.id | string (uuid) ou null | |
customer.name | string | |
customer.email | string | |
customer.phone | string | |
customer.cpf | string | |
shipping_address | objeto | |
shipping_address.zip | string | |
shipping_address.street | string | |
shipping_address.number | string | |
shipping_address.complement | string | |
shipping_address.neighborhood | string | |
shipping_address.city | string | |
shipping_address.state | string | |
line_items | lista de objeto | |
line_items[].id | string (uuid) | |
line_items[].key | string ou null | |
line_items[].parent_line_id | string (uuid) ou null | |
line_items[].group | objeto ou null | |
line_items[].group.code | string | |
line_items[].group.name | string | |
line_items[].properties | objeto | |
line_items[].inventory_tracked | boolean | |
line_items[].eyes | objeto ou null | |
line_items[].eyes.right | integer | |
line_items[].eyes.left | integer | |
line_items[].variant_id | string (uuid) | |
line_items[].title | string | |
line_items[].options | lista de string | |
line_items[].sku | string ou null | |
line_items[].price | integer | |
line_items[].quantity | integer | |
line_items[].line_price | integer | |
line_items[].promotion | string ou null | |
line_items[].files | lista de objeto | |
line_items[].files[].id | string (uuid) | |
line_items[].files[].name | string | |
line_items[].files[].content_type | string | |
line_items[].files[].size | integer | |
line_items[].files[].purpose | string | Um de: general, prescription. |
line_items[].files[].url | string (URL) | |
line_items[].files[].url_expires_at | string (data e hora) | |
line_items[].prescription | objeto ou null | |
line_items[].prescription.type | string ou null | Um de: single_vision, progressive, bifocal, reading, plano, contact_lens. |
line_items[].prescription.right | objeto ou null | |
line_items[].prescription.right.sphere | number | |
line_items[].prescription.right.cylinder | number | |
line_items[].prescription.right.axis | integer ou null | |
line_items[].prescription.right.add | number ou null | |
line_items[].prescription.right.base_curve | number ou null | |
line_items[].prescription.right.diameter | number ou null | |
line_items[].prescription.left | objeto ou null | |
line_items[].prescription.left.sphere | number | |
line_items[].prescription.left.cylinder | number | |
line_items[].prescription.left.axis | integer ou null | |
line_items[].prescription.left.add | number ou null | |
line_items[].prescription.left.base_curve | number ou null | |
line_items[].prescription.left.diameter | number ou null | |
line_items[].prescription.pd | objeto ou null | |
line_items[].prescription.segment_height | objeto ou null | |
line_items[].prescription.segment_height.right | number | |
line_items[].prescription.segment_height.left | number | |
line_items[].prescription.prism | objeto ou null | |
line_items[].prescription.prism.right | objeto ou null | |
line_items[].prescription.prism.right.value | number | |
line_items[].prescription.prism.right.base | string | Um de: in, out, up, down. |
line_items[].prescription.prism.left | objeto ou null | |
line_items[].prescription.prism.left.value | number | |
line_items[].prescription.prism.left.base | string | Um de: in, out, up, down. |
line_items[].prescription.issued_at | string ou null | |
line_items[].prescription.doctor | objeto ou null | |
line_items[].prescription.doctor.name | string | |
line_items[].prescription.doctor.license | string ou null | |
line_items[].prescription.note | string ou null | |
line_items[].prescription.lens_brand | string ou null | |
line_items[].prescription.status | string | Um de: pending, declared, provided, checked. |
line_items[].prescription.provided_at | string (data e hora) ou null | |
line_items[].prescription.checked_at | string (data e hora) ou null | |
line_items[].prescription.declared_at | string (data e hora) ou null | |
line_items[].prescription.declaration | string ou null | |
line_items[].prescription.store_note | string ou null | |
subtotal_price | integer | |
shipping_price | integer | |
total_discounts | integer | |
coupon_code | string ou null | |
pix_discount | integer | |
total_price | integer | |
shipping_line | objeto ou null | |
shipping_line.title | string | |
shipping_line.carrier | string | |
shipping_line.delivery_days | integer | |
shipping_line.pickup | objeto ou null | |
shipping_line.pickup.address | string | |
shipping_line.pickup.instructions | string | |
tracking_code | string ou null | |
payment | objeto ou null | |
payment.method | string | Um de: pix, credit_card, debit_card, boleto. |
payment.status | string | Um de: pending, approved, expired, cancelled, declined, refunded, authorized. |
payment.amount | integer | |
payment.installments | integer ou null | |
payment.refunded_at | string (data e hora) ou null | |
payment.created_at | string (data e hora) | |
invoice | objeto ou null | |
invoice.key | string | |
invoice.number | string | |
invoice.series | string | |
invoice.url | string ou null | |
invoice.informed_at | string (data e hora) | |
paid_at | string (data e hora) ou null | |
test | boolean | |
anonymized_at | string (data e hora) ou null | |
created_at | string (data e hora) | |
updated_at | string (data e hora) |
Erros
401O token falta, não existe, foi revogado ou venceu (authentication_error).403O token não tem o escopo da rota, ou, com write_content, mandou campos que pedem write_products, listados em fields (permission_error).404O recurso não existe nesta loja (not_found).409O estado do recurso não permite a mudança, ou ele mudou desde a leitura (conflict).429Chamadas demais: espere o Retry-After (rate_limited).500Erro do nosso lado (api_error).503A API está ocupada com outras chamadas: espere o Retry-After (api_error).