Update an order

patch
https://api.clakta.com/v1/orders/{orderId}

Update an existing order. `orderId` is your own order ID (the value sent as `orderId` when the order was created) and the owning project is resolved from the `projectId` field in the request body.

Send only the fields you want to change: `status`, `paymentMethod`, `platform`, `currency`, `totalPrice`, `createdAt`, `approvedDate` and `refundedAt` are all optional, but at least one must be present. `approvedDate` and `refundedAt` are nullable. Send `null` to clear a date that was set before.

Marking an order as `paid` stamps its approved date, and marking it as `refunded` stamps its refund date, each the first time it happens, never overwriting a date that is already set. Sending `approvedDate` or `refundedAt` yourself always takes precedence over that.

`totalPrice` is a decimal in the order currency (`10.4` for $10.40) and is stored in that currency's smallest unit. Because decimal and zero-decimal currencies are stored at different scales, send `totalPrice` together with `currency` whenever you move an order between the two (e.g. USD to JPY).

The order's attribution (its `customer`, `products` and `tracking`) is resolved when the order is created and cannot be changed here.

Autenticação

Envie sua chave de API como bearer token no cabeçalho Authorization.

Veja Autenticação para saber como criar uma chave de API e definir seus escopos.

Parâmetros de rota

orderIdstringobrigatório

The order ID in your own system.

Corpoapplication/json

projectIdstringobrigatório

The project ID (e.g. proj_xxx) or slug that owns the order

statusenum<string>opcional

The new order status (e.g. refunded)

Valores aceitos:paidpendingrejectedrefundedcanceled

paymentMethodenum<string>opcional

The new payment method

Valores aceitos:credit_carddebit_cardpixboletopaypalapple_paygoogle_paysamsung_paystripe_linkother

platformstring | nullopcional

The new platform (e.g. shopify, woocommerce, etc.). Send `null` to clear it

currencystringopcional

The new currency in ISO 4217 format (e.g. USD, EUR, BRL, etc.). Send `totalPrice` alongside it when moving between a decimal and a zero-decimal currency (e.g. USD to JPY), since the two are stored at different scales

totalPricenumberopcional

The new total order price in floating point number (e.g. 10.4 for $10.40), quoted in the order currency after this update is applied

createdAtdate-timeopcional

The new order date

approvedDatedate-time | nullopcional

The new order approved date. Send `null` to clear it. When omitted, moving an order to `paid` stamps this automatically the first time it happens

refundedAtdate-time | nullopcional

The new order refunded at. Send `null` to clear it. When omitted, moving an order to `refunded` stamps this automatically the first time it happens

Resposta

The updated order

messagestringobrigatório

A confirmation message.

dataobjectobrigatório