https://api.clakta.com/v1/ordersRecord 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` and `products`. Everything else, including `platform`, the whole `customer` object and the whole `tracking` object, is optional. Every field inside `customer` is optional too, so send what your storefront actually captured. Send `customer.id` or `customer.email` to attach the order to a known customer; otherwise it is attached to an anonymous visitor. 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`. They may send `ip` and `userAgent` to resolve the anonymous visitor from a server-computed daily session hash, or omit `customer` entirely to attribute the order from the browser's purchase event.
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.
For subscriptions, send every charge, the first purchase and each renewal, as its own order with its own `orderId` and the same `subscription.id`. Each charge counts towards the monthly order limit. A renewal sent without `tracking` inherits the attribution of the subscription's first charge, and ad revenue counts only that first charge unless the project is set to count renewals.
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.
projectIdThe project ID (e.g. proj_xxx) or slug that owns the order
orderIdThe order ID in your system
platformThe platform (e.g. shopify, woocommerce, etc.). Optional: an order sent without it is recorded with no platform
paymentMethodThe payment method
Valores aceitos:credit_carddebit_cardpixboletopaypalapple_paygoogle_paysamsung_paystripe_linkother
statusThe status
Valores aceitos:paidpendingrejectedrefundedcanceled
currencyThe currency in ISO 4217 format (e.g. USD, EUR, BRL, etc.) - defaults to the project currency if not provided
totalPriceThe 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)
productstrackingpadrão: {}The attribution parameters captured on your storefront. Every parameter is optional. An order sent without them is recorded as unattributed
subscriptionSend this when the order is a subscription charge. Send every charge (the first purchase and each renewal) as its own order with its own orderId. Renewals sent without tracking inherit the attribution of the subscription's first charge
createdAtThe order created at, defaults to the current date
approvedDateThe order approved date
refundedAtThe order refunded at
customerpadrão: {}The customer. The object and every field are optional: send `id` or `email` to attach the order to a known customer, or omit them to attach it to an anonymous visitor resolved from the browser session
The created order
messageA confirmation message.
data