Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.atriby.com/llms.txt

Use this file to discover all available pages before exploring further.

Use PATCH /api/v1/orders/{externalId} quando o status ou dados permitidos de um pedido mudarem.

Status aceitos

  • pending
  • paid
  • refused
  • refunded
  • chargedback
A API normaliza aliases comuns de gateways. Exemplos:
  • approved, completed, concluido, pago -> paid
  • waiting_payment, pendente -> pending
  • rejected, failed, cancelled, recusado -> refused
  • refund, reembolsado, estornado -> refunded
  • chargeback, charged_back, dispute -> chargedback

Transições válidas

DePara
pendingpending, paid, refused, refunded
paidpaid, refunded, chargedback
refundedrefunded, chargedback
refusedrefused
chargedbackchargedback
refused e chargedback são terminais.

Payload para marcar como pago

{
  "status": "paid",
  "paidAt": "2026-05-10T15:40:00Z"
}

Campos permitidos no PATCH

  • status
  • paidAt
  • refundedAt
  • chargedbackAt
  • isTest
  • amounts
  • customer
  • tracking
  • trackingExtras
  • metadata
Campos de criação como externalId, platform, paymentMethod, createdAt, products e fees não são atualizados por PATCH.

Exemplo curl

curl -X PATCH "https://app.atriby.com/api/v1/orders/order_001" \
  -H "Authorization: Bearer <TOKEN>" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order_001_paid" \
  -d '{
    "status": "paid",
    "paidAt": "2026-05-10T15:40:00Z"
  }'

Erros

  • ORDER_NOT_FOUND: pedido não existe no dashboard autenticado.
  • INVALID_STATUS_TRANSITION: transição de status inválida.
  • VALIDATION_FAILED: payload inválido.
  • UNAUTHORIZED ou TOKEN_REVOKED: problema no token.