v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.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.

post/v2/subscriptions/search

Request body

cursorstring

When the total number of resulting subscriptions exceeds the limit of a paged response, specify the cursor returned from a preceding response here to fetch the next set of results. If the cursor is unset, the response contains the last page of the results.

For more information, see Pagination.

limitinteger

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

includestring[]

An option to include related information in the response.

The supported values are:

  • actions: to include scheduled actions on the targeted subscriptions.

Example request

{
  "query": {
    "filter": {
      "customer_ids": [
        "CHFGVKYY8RSV93M5KCYTG4PN0G"
      ],
      "location_ids": [
        "S8GWD5R9QB376"
      ],
      "source_names": [
        "My App"
      ]
    }
  }
}

Response

Success

cursorstring

When the total number of resulting subscription exceeds the limit of a paged response, the response includes a cursor for you to use in a subsequent request to fetch the next set of results. If the cursor is unset, the response contains the last page of the results.

For more information, see Pagination.

Example response

{
  "subscriptions": [
    {
      "canceled_date": "2021-10-30",
      "card_id": "ccof:mueUsvgajChmjEbp4GB",
      "charged_through_date": "2021-11-20",
      "created_at": "2021-10-20T21:53:10Z",
      "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G",
      "id": "de86fc96-8664-474b-af1a-abbe59cacf0e",
      "location_id": "S8GWD5R9QB376",
      "paid_until_date": "2021-11-20",
      "plan_variation_id": "L3TJVDHVBEQEGQDEZL2JJM7R",
      "source": {
        "name": "My Application"
      },
      "start_date": "2021-10-20",
      "status": "CANCELED",
      "timezone": "UTC"
    },
    {
      "charged_through_date": "2022-08-19",
      "created_at": "2022-01-19T21:53:10Z",
      "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G",
      "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f",
      "invoice_ids": [
        "grebK0Q_l8H4fqoMMVvt-Q",
        "rcX_i3sNmHTGKhI4W2mceA"
      ],
      "location_id": "S8GWD5R9QB376",
      "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H",
      "price_override_money": {
        "amount": 1000,
        "currency": "USD"
      },
      "source": {
        "name": "My Application"
      },
      "start_date": "2022-01-19",
      "status": "PAUSED",
      "tax_percentage": "5",
      "timezone": "America/Los_Angeles",
      "version": 2
    },
    {
      "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB",
      "created_at": "2023-06-20T21:53:10Z",
      "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G",
      "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f",
      "location_id": "S8GWD5R9QB376",
      "phases": [
        {
          "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY",
          "ordinal": 0,
          "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP",
          "uid": "873451e0-745b-4e87-ab0b-c574933fe616"
        }
      ],
      "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H",
      "source": {
        "name": "My Application"
      },
      "start_date": "2023-06-20",
      "status": "ACTIVE",
      "timezone": "America/Los_Angeles",
      "version": 1
    }
  ]
}