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.

Authentication

Send your API key as a bearer token in the Authorization header.

See Authentication for how to create and scope an API key.

Path parameters

orderIdstringrequired

The order ID in your own system.

Bodyapplication/json

projectIdstringrequired

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

statusenum<string>optional

The new order status (e.g. refunded)

Allowed values:paidpendingrejectedrefundedcanceled

paymentMethodenum<string>optional

The new payment method

Allowed values:credit_carddebit_cardpixboletopaypalapple_paygoogle_paysamsung_paystripe_linkother

platformstring | nulloptional

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

currencystringoptional

The new currency in ISO 4217 format (e.g. USD, 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

totalPricenumberoptional

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-timeoptional

The new order date

approvedDatedate-time | nulloptional

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 | nulloptional

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

Response

The updated order

messagestringrequired

A confirmation message.

dataobjectrequired