Create an order

post
https://api.clakta.com/v1/orders

Record a new order for a project. The owning project is resolved from the `projectId` field in the request body. Orders count towards your team's monthly order limit.

The required fields are `projectId`, `orderId`, `paymentMethod`, `status`, `totalPrice`, `products`, and `name`, `email` and `ip` on `customer`. Everything else — `platform`, the remaining personal fields and the whole `tracking` object — is optional, so send what your storefront actually captured. An order with no `tracking` is recorded as unattributed, and one with no `platform` is stored and returned with `platform: null`.

Projects using the `privacy_friendly` tracking mode must omit every personal field from `customer` and send only `ip` and `userAgent` — the order is then attached to an anonymous visitor derived from a server-computed daily session hash.

Send `totalPrice` and each product `price` as a decimal in the order currency (`10.4` for $10.40). Clakta stores and returns them in the smallest unit of that currency, so `10.4` USD comes back as `1040`, while a zero-decimal currency such as JPY is kept whole — `1040` in, `1040` out.

Authentication

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

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

Bodyapplication/json

projectIdstringrequired

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

orderIdstringrequired

The order ID in your system

platformstring | nulloptional

The platform (e.g. shopify, woocommerce, etc.). Optional — an order sent without it is recorded with no platform

paymentMethodenum<string>required

The payment method

Allowed values:credit_carddebit_cardpixboletopaypalapple_paygoogle_paysamsung_paystripe_linkother

statusenum<string>required

The status

Allowed values:paidpendingrejectedrefundedcanceled

currencystring | nulloptional

The currency in ISO 4217 format (e.g. USD, BRL, etc.) - defaults to the project currency if not provided

totalPricenumberrequired

The total order price in floating point number (e.g. 10.4 for $10.40). Send the amount as a person would read it — Clakta stores it in the smallest unit of the order currency, so zero-decimal currencies such as JPY are kept whole (1040 stays 1040, not 104000)

productsobject[]required
trackingobjectoptionaldefault: {}

The attribution parameters captured on your storefront. Every parameter is optional — an order sent without them is recorded as unattributed

createdAtdate-time | nulloptional

The order created at, defaults to the current date

approvedDatedate-time | nulloptional

The order approved date

refundedAtdate-time | nulloptional

The order refunded at

customerobjectrequired

The customer. Every field is optional: send `id` or `email` to attach the order to a known customer, or omit both and it is attached to an anonymous visitor resolved from the browser session

Response

The created order

messagestringrequired

A confirmation message.

dataobjectrequired