Skip to content

Orders API

Mehrdad Pajuhaan edited this page Oct 23, 2026 · 1 revision

Orders API

Use this endpoint to import orders from a Selldone shop into your ERP. This page covers the request, query parameters, order types, sorting, pagination and incremental synchronization.

Endpoint

GET https://api.selldone.com/shops/{shop-id-here}/process-center/baskets-PHYSICAL

Replace {shop-id-here} with the actual shop ID and send:

Authorization: Bearer <token>
Accept: application/json

Example:

https://api.selldone.com/shops/{shop-id-here}/process-center/baskets-PHYSICAL?offset=0&limit=10&sortDesc=true&statuses[]=Payed&with[]=items&with[]=buyer&with[]=products

This endpoint returns a list of PHYSICAL orders with full details. The maximum limit is 250.

Order types

For ERP systems, you typically need to work with physical (goods) orders. Selldone supports various order types, including:

Type Notes
PHYSICAL ERPs work only with this type.
FILE
SERVICE
VIRTUAL
SUBSCRIPTION

Query parameters

Parameter Type Description
offset integer, min 0 The starting point of records.
limit integer, min 1, max 250 The number of records to return.
sortBy string, optional The field to sort by (e.g., reserved_at).
sortDesc boolean, optional Whether to sort in descending order.
statuses[] array of strings, optional The order statuses to filter by. Valid values are Open, Reserved, Payed, Canceled, COD. If not provided, Payed and COD are considered by default.
product_id integer, optional Filter orders containing a specific product.
affiliate_id integer, optional Filter orders associated with a specific affiliate.
customer_id integer, optional Filter orders placed by a specific customer.
with[] array of strings, optional Include related data. Valid values are items, buyer, connect_orders, products, payment.
updated_at integer timestamp, optional Return only orders updated after this date (see Synchronizing orders).

Response

The response contains two main fields:

  • orders: An array of orders.
  • total: The total number of orders.
{
  "orders": [
    {
      "id": 9019,
      "type": "PHYSICAL",
      "status": "Payed",
      "delivery_state": "ToCustomer",
      "price": 599.95,
      "currency": "USD",
      "reserved_at": "2024-08-17T16:29:26.000000Z",
      "items": [ ... ],
      "buyer": { ... },
      ...
    }
  ],
  "total": 1
}

All fields are described in Response Structure.

Sorting

By default, the endpoint returns the most recent orders first. To get the oldest first, add sortBy=reserved_at and sortDesc=false to the query string.

Pagination

Request pages with offset and limit until you have read total orders:

async function fetchAllOrders(shopId, token) {
  const limit = 250;
  let offset = 0;
  let all = [];
  let total = Infinity;

  while (offset < total) {
    const url =
      `https://api.selldone.com/shops/${shopId}/process-center/baskets-PHYSICAL` +
      `?offset=${offset}&limit=${limit}&statuses[]=Payed&with[]=items&with[]=buyer&with[]=products`;
    const res = await fetch(url, {
      headers: { Authorization: `Bearer ${token}`, Accept: "application/json" },
    });
    const data = await res.json();
    all = all.concat(data.orders);
    total = data.total;
    offset += limit;
    if (data.orders.length === 0) break;
  }
  return all;
}

Synchronizing orders

To synchronize orders without fetching all orders every time, use the updated_at query parameter. Send the last sync date as a timestamp (integer), and the endpoint will return orders updated after this date.

Suggested approach:

  1. Before each sync, record the current time.
  2. Request orders with updated_at=<previous sync timestamp>.
  3. Upsert the returned orders in your ERP by id.
  4. Save the time you recorded in step 1 as the new sync timestamp.

Important order fields for ERPs

Parameter Description
Order ID (id) Unique identifier for the order, used for tracking and managing orders.
Customer ID (customer_id) Unique identifier for the customer placing the order.
Order Type (type) Type of order (e.g., PHYSICAL, SERVICE), determining the fulfillment process.
Order Status (status) Current status of the order. Possible values: Open, Reserved, Payed, Canceled, COD. Since we are fetching Payed orders, this value will be Payed.
Order Price (price) Total price of the order.
Currency (currency) Currency used in the order.
Delivery Price (delivery_price) Cost of delivering the order to the customer.
Delivery State (delivery_state) Current state of the delivery process. Possible values: CheckQueue, OrderConfirm, PreparingOrder, SentOrder, ToCustomer.
Receiver Information (receiver_info) Information about the recipient for fulfilling the delivery: name, phone, address, city, state and country, postal (postal/ZIP code) and location (GPS coordinates).
Items (items) List of items within the order: id (item ID in the order), product_id, variant_id (if applicable), count (quantity), price (price of each item) and currency.
Product Information (product) sku and mpn. If the product has multiple variants, refer to variant.sku and variant.mpn.
Variant Information (variant) Variant-specific sku and mpn, if applicable.
Buyer Information (buyer) name, email and phone of the buyer. Can be null for a guest checkout.
Checkout Date (reserved_at) Timestamp of when the order was checked out.

Try it

Fetch Orders Demo: enter the shop ID and token, then click Fetch Orders. The page shows each order with its delivery progress and links to update the state or set tracking.

Next steps

Clone this wiki locally