You are viewing an old version of the API
Batch retrieve orders

Retrieves a set of Orders by their IDs

If a given Order ID does not exist, the ID is ignored instead of generating an error.

Required permissions ORDERS_READ

Path Parameters

Name Description
location_id
string

Required

The ID of the orders' associated location.

Request Body

Name Description
order_ids
string [ ]

Required

The IDs of the orders to retrieve. A maximum of 100 orders can be retrieved per request.

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

orders
Order [ ]

The requested orders. This will omit any requested orders that do not exist.

Examples

You are viewing an old version of the API
POST /v2/locations/{location_id}/orders/batch-retrieve
cURL
  • cURL
  • Ruby
  • Python
curl https://connect.squareup.com/v2/locations/{location_id}/orders/batch-retrieve \
  -X POST \
  -H 'Square-Version: 2019-11-20' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -d '{
    "order_ids": [
      "CAISEM82RcpmcFBM0TfOyiHV3es",
      "CAISENgvlJ6jLWAzERDzjyHVybY"
    ]
  }'
Response JSON
{
  "orders": [
    {
      "id": "CAISEM82RcpmcFBM0TfOyiHV3es",
      "location_id": "057P5VYJ4A5X1",
      "reference_id": "my-order-001",
      "line_items": [
        {
          "uid": "945986d1-9586-11e6-ad5a-28cfe92138cf",
          "name": "Awesome product",
          "quantity": "1",
          "base_price_money": {
            "amount": 1599,
            "currency": "USD"
          },
          "total_money": {
            "amount": 1599,
            "currency": "USD"
          }
        },
        {
          "uid": "a8f4168c-9586-11e6-bdf0-28cfe92138cf",
          "name": "Another awesome product",
          "quantity": "3",
          "base_price_money": {
            "amount": 2000,
            "currency": "USD"
          },
          "total_money": {
            "amount": 6000,
            "currency": "USD"
          }
        }
      ],
      "total_money": {
        "amount": 7599,
        "currency": "USD"
      }
    }
  ]
}

Share Feedback

Thanks for visiting the Square API documentation. What's on your mind?