List orders

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

List a project's orders, newest first by default. The owning project is passed as the `projectId` query parameter. Requires an API key with `orders.read`.

Results are paginated with a cursor. Each page returns up to `limit` orders (25 by default, 100 at most). When `hasMore` is `true`, request the next page by sending the returned `nextCursor` as the `cursor` parameter, keeping every other parameter the same. The last page returns `hasMore: false` and `nextCursor: null`.

Filter by `status`, `paymentMethod`, `subscriptionId` and the order date range (`createdFrom`, `createdTo`). `status` and `paymentMethod` accept several values separated by commas.

`totalPrice` and each product `price` are returned in the smallest unit of the order currency (`1040` for $10.40). The `customer` object carries the name, email, phone, gender, date of birth and address of the customer record the order is attached to. Fields are null when unknown, and the shopper's IP and User-Agent are never returned.

Autenticación

Envía tu clave de API como bearer token en la cabecera Authorization.

Consulta Autenticación para saber cómo crear una clave de API y definir sus permisos.

Parámetros de consulta

projectIdstringobligatorio

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

limitintegeropcionalpredeterminado: 25

The number of orders to return, from 1 to 100. Defaults to 25.

cursorstringopcional

The `nextCursor` returned by the previous page. Omit it to fetch the first page.

statusstringopcional

Only return orders with one of these statuses, comma separated (e.g. `paid,refunded`). One of: paid, pending, rejected, refunded, canceled.

paymentMethodstringopcional

Only return orders paid with one of these payment methods, comma separated (e.g. `credit_card,pix`). One of: credit_card, debit_card, pix, boleto, paypal, apple_pay, google_pay, samsung_pay, stripe_link, other.

subscriptionIdstringopcional

Only return the charges of this subscription, the `subscription.id` sent when they were created.

createdFromdate-timeopcional

Only return orders placed at or after this date (ISO 8601).

createdTodate-timeopcional

Only return orders placed at or before this date (ISO 8601).

sortDirectionenum<string>opcionalpredeterminado: desc

Sort by order date, newest first (`desc`) or oldest first (`asc`). Keep it the same across the pages of one listing.

Valores admitidos:ascdesc

Respuesta

A page of orders

dataobject[]obligatorio

The orders on this page.

hasMorebooleanobligatorio

Whether more orders follow this page.

nextCursorstring | nullobligatorio

The cursor to send as `cursor` to fetch the next page, or null on the last page.