Get all orders via API

You can easily retrieve all orders using the TWICE Admin API

Written by
Karri Hiekkanen
Published on
Dec 20, 2024
Updated on
Dec 20, 2024

You can easily retrieve all orders using GET on TWICE Admin API's /orders/ endpoint.

Query parameters

You can control your query with multiple parameters:

  • createdAt, which filters by order creation date in ISO 8601 format. Example: ?createdAt[lt]=2025-01-01T20:00:00.000Z.
  • limit, which allows you to limit the number of orders retrieved. The default value is 10 and you can control it between 1 and 100.
  • pageToken, which can be used to retrieve the next page of results. This is returned in the paged response (see example below).
  • storeId, which allows you to filter the results based on the stores. You can include multiple stores by using comma-separation. Example: storeId=123,321.

Example response

If you have authenticated and have access to the API, you will receive similar 200 response.

{
  "data": [
    {
      "id": "12ckKcHWl70HEF3uadzd",
      "createdAt": "2024-12-12T15:12:45.711Z",
      "startDate": "2024-12-13T15:00:00.000Z",
      "initialStartDate": "2024-12-13T15:00:00.000Z",
      "endDate": "2024-12-14T15:00:00.000Z",
      "payment": {
        "paid": 10000,
        "refunded": 0,
        "authorised": 10000,
        "cancelled": 0,
        "captured": 10000
      },
      "deposit": {
        "paid": 10000,
        "refunded": 0,
        "authorised": 10000,
        "cancelled": 0,
        "captured": 10000
      },
      "cancellationPolicy": [
        {
          "hoursBefore": 24,
          "refundPercentage": 50,
          "displayAs": "days"
        }
      ],
      "channel": "admin",
      "state": "booked",
      "store": {
        "name": "ACME Store",
        "storeId": "Ll7mWWQmhmAnbgSUZdLn",
        "address": {
          "address": "123 Main St",
          "zipCode": "12345",
          "city": "New York",
          "country": "United States",
          "state": "New York"
        }
      },
      "customerDetails": {
        "firstName": "John",
        "lastName": "Doe",
        "phone": "+1555555555",
        "email": "john@doe.com",
        "marketingConsent": true,
        "language": "en",
        "address": {
          "address": "123 Main St",
          "zipCode": "12345",
          "city": "New York",
          "country": "United States",
          "state": "New York"
        },
        "customerId": "xiCwjojw2iLzjKIjh4lc"
      },
      "terms": {
        "accepted": true,
        "timestamp": "2024-12-12T15:12:45.711Z"
      },
      "staffComment": "Customer will arrive 30 minutes late.",
      "orderNumber": 1507,
      "prepared": false,
      "pricing": {
        "total": 10000,
        "currency": "USD",
        "subtotal": 10000,
        "totalTaxes": 2400,
        "totalDiscounts": 0,
        "taxExcluded": false,
        "taxLines": [
          {
            "price": 2400,
            "rate": 0.24
          }
        ],
        "deposit": {
          "value": 0,
          "type": "payment"
        }
      },
      "items": [
        {
          "id": "1Lml7QAhnlCP2KFwilfa",
          "productId": "miR5bIalgvWHABPCutO4",
          "name": {
            "def": "E-bike package"
          },
          "itemCodes": [
            "E-1"
          ],
          "variantId": "XCNX4I3UCJ100VA7Ebqr",
          "variantValues": [
            {
              "def": "Small"
            }
          ],
          "startDate": "2024-12-13T15:00:00.000Z",
          "endDate": "2024-12-14T15:00:00.000Z",
          "cancelled": false,
          "payment": {
            "paid": 10000,
            "refunded": 0,
            "authorised": 10000,
            "cancelled": 0,
            "captured": 10000
          },
          "deposit": {
            "paid": 10000,
            "refunded": 0,
            "authorised": 10000,
            "cancelled": 0,
            "captured": 10000
          },
          "pricing": {
            "total": 10000,
            "currency": "USD",
            "subtotal": 10000,
            "totalTaxes": 2400,
            "totalDiscounts": 0,
            "taxExcluded": false,
            "taxLines": [
              {
                "price": 2400,
                "rate": 24
              }
            ],
            "manualDiscount": 0,
            "deposit": 0,
            "listPrice": 10000,
            "originalListPrice": 10000
          },
          "purchaseType": "rental",
          "itemSkus": [
            {
              "units": 1,
              "skuId": "qvfNAMW7aYvDLJYPtBPf",
              "type": "single",
              "itemCodes": [
                "E-1"
              ]
            }
          ],
          "packageItems": [
            {
              "id": "1Lml7QAhnlCP2KFwilfa",
              "productId": "miR5bIalgvWHABPCutO4",
              "name": {
                "def": "Bicycle helmet"
              },
              "itemCodes": [
                "E-1"
              ],
              "variantId": "XCNX4I3UCJ100VA7Ebqr",
              "variantValues": [
                {
                  "def": "Small"
                }
              ],
              "startDate": "2024-12-13T15:00:00.000Z",
              "endDate": "2024-12-14T15:00:00.000Z",
              "cancelled": false,
              "payment": {
                "paid": 10000,
                "refunded": 0,
                "authorised": 10000,
                "cancelled": 0,
                "captured": 10000
              },
              "deposit": {
                "paid": 10000,
                "refunded": 0,
                "authorised": 10000,
                "cancelled": 0,
                "captured": 10000
              },
              "pricing": {
                "total": 10000,
                "currency": "USD",
                "subtotal": 10000,
                "totalTaxes": 2400,
                "totalDiscounts": 0,
                "taxExcluded": false,
                "taxLines": [
                  {
                    "price": 2400,
                    "rate": 24
                  }
                ],
                "manualDiscount": 0,
                "deposit": 0,
                "listPrice": 10000,
                "originalListPrice": 10000
              },
              "purchaseType": "rental",
              "itemSkus": [
                {
                  "units": 1,
                  "skuId": "qvfNAMW7aYvDLJYPtBPf",
                  "type": "single",
                  "itemCodes": [
                    "E-1"
                  ]
                }
              ],
              "removedFromPackage": false
            }
          ]
        }
      ],
      "persons": [
        {
          "firstName": "John",
          "lastName": "Doe",
          "phone": "+1555555555",
          "email": "john@doe.com",
          "marketingConsent": true,
          "language": "en",
          "address": {
            "address": "123 Main St",
            "zipCode": "12345",
            "city": "New York",
            "country": "United States",
            "state": "New York"
          },
          "customerId": "xiCwjojw2iLzjKIjh4lc",
          "id": "kCrBAzNy5Xoty6q1EfOl",
          "createdAt": "2024-12-12T15:12:45.713Z",
          "isLiableCustomer": true,
          "additionalDetails": [],
          "staffComment": "This customer will arrive 15min late",
          "itemIds": [
            "1Lml7QAhnlCP2KFwilfa"
          ]
        }
      ],
      "delivery": {
        "name": {
          "def": "Express delivery"
        },
        "pricing": {
          "total": 10000,
          "currency": "USD",
          "subtotal": 10000,
          "totalTaxes": 2400,
          "totalDiscounts": 0,
          "taxExcluded": false,
          "taxLines": [
            {
              "price": 2400,
              "rate": 24
            }
          ],
          "manualDiscount": 0,
          "deposit": 0,
          "listPrice": 10000,
          "originalListPrice": 10000
        },
        "payment": {
          "paid": 10000,
          "refunded": 0,
          "authorised": 10000,
          "cancelled": 0,
          "captured": 10000
        },
        "deliveryOptionId": "T6aqb6c2yBxbSnRL43d7",
        "to": {
          "timeslot": {
            "startDate": "2024-12-12T15:12:00.000Z",
            "endDate": "2024-12-12T18:12:00.000Z"
          },
          "pricing": {
            "total": 10000,
            "currency": "USD",
            "subtotal": 10000,
            "totalTaxes": 2400,
            "totalDiscounts": 0,
            "taxExcluded": false,
            "taxLines": [
              {
                "price": 2400,
                "rate": 24
              }
            ],
            "manualDiscount": 0,
            "deposit": 0,
            "listPrice": 10000,
            "originalListPrice": 10000
          },
          "handlingTimeMinutes": 120,
          "location": {
            "address": {
              "address": "123 Main St",
              "zipCode": "12345",
              "city": "New York",
              "country": "United States",
              "state": "New York"
            }
          },
          "carrierId": "zjGNRwidgsygaFGsZFBU",
          "carrierName": {
            "def": "Van F255"
          },
          "trackingId": "NyaAuun1Yg4S9U8F2HwK"
        },
        "from": {
          "timeslot": {
            "startDate": "2024-12-12T15:12:00.000Z",
            "endDate": "2024-12-12T18:12:00.000Z"
          },
          "pricing": {
            "total": 10000,
            "currency": "USD",
            "subtotal": 10000,
            "totalTaxes": 2400,
            "totalDiscounts": 0,
            "taxExcluded": false,
            "taxLines": [
              {
                "price": 2400,
                "rate": 24
              }
            ],
            "manualDiscount": 0,
            "deposit": 0,
            "listPrice": 10000,
            "originalListPrice": 10000
          },
          "handlingTimeMinutes": 120,
          "location": {
            "address": {
              "address": "123 Main St",
              "zipCode": "12345",
              "city": "New York",
              "country": "United States",
              "state": "New York"
            }
          },
          "carrierId": "zjGNRwidgsygaFGsZFBU",
          "carrierName": {
            "def": "Van F255"
          },
          "trackingId": "NyaAuun1Yg4S9U8F2HwK"
        }
      },
      "customCheckoutFields": [
        {
          "label": {
            "def": "I have ridden an electric bike before"
          },
          "value": true
        }
      ]
    }
  ],
  "count": 0,
  "total": 0,
  "nextPageToken": "string"
}

Check out our full API documentation for retrieving all orders.

On this page

Start your circular business  with TWICE