v1

latestOpenAPI 3.0.0Apache 2.02026-07-142008071.1 MB
Subscriptions

SearchSubscriptions

Searches for subscriptions. Results are ordered chronologically by subscription creation date. If the request specifies more than one location ID, the endpoint orders the result by location ID, and then by creation date within each location. If no locations are given in the query, all locations are searched.

You can also optionally specify customer_ids to search by customer. If left unset, all customers associated with the specified locations are returned. If the request specifies customer IDs, the endpoint orders results first by location, within location by customer ID, and within customer by subscription creation date.

For more information, see Retrieve subscriptions.

post/v2/subscriptions/search

Request body

cursorstring

A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query.

For more information, see Pagination.

limitinteger

The upper limit on the number of subscriptions to return in the response.

Default: 200

Example request

{
  "request_body": {
    "query": {
      "filter": {
        "customer_ids": [
          "CHFGVKYY8RSV93M5KCYTG4PN0G"
        ],
        "location_ids": [
          "S8GWD5R9QB376"
        ]
      }
    }
  }
}

Response

Success

cursorstring

When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch the next set of subscriptions. If empty, this is the final response.

For more information, see Pagination.

Example response

{
  "subscriptions": [
    {
      "canceled_date": "2020-04-14",
      "card_id": "ccof:mueUsvgajChmjEbp4GB",
      "charged_through_date": "2020-05-14",
      "created_at": "2020-08-03T21:53:10Z",
      "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G",
      "id": "de86fc96-8664-474b-af1a-abbe59cacf0e",
      "location_id": "S8GWD5R9QB376",
      "paid_until_date": "2020-05-14",
      "plan_id": "L3TJVDHVBEQEGQDEZL2JJM7R",
      "start_date": "2020-04-14",
      "status": "CANCELED",
      "timezone": "UTC"
    },
    {
      "created_at": "2020-08-03T21:53:10Z",
      "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G",
      "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f",
      "location_id": "S8GWD5R9QB376",
      "plan_id": "6JHXF3B2CW3YKHDV4XEM674H",
      "price_override_money": {
        "amount": 100,
        "currency": "USD"
      },
      "start_date": "2020-08-01",
      "status": "PENDING",
      "tax_percentage": "5",
      "timezone": "America/Los_Angeles",
      "version": 1594155459464
    },
    {
      "charged_through_date": "2020-06-11",
      "created_at": "2020-08-03T21:53:10Z",
      "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G",
      "id": "8151fc89-da15-4eb9-a685-1a70883cebfc",
      "invoice_ids": [
        "grebK0Q_l8H4fqoMMVvt-Q",
        "rcX_i3sNmHTGKhI4W2mceA"
      ],
      "location_id": "S8GWD5R9QB376",
      "paid_until_date": "2020-06-11",
      "plan_id": "6JHXF3B2CW3YKHDV4XEM674H",
      "price_override_money": {
        "amount": 1000,
        "currency": "USD"
      },
      "start_date": "2020-05-11",
      "status": "ACTIVE",
      "timezone": "America/Los_Angeles"
    }
  ]
}