Skip to main content
POST
/
v1
/
subscriptions
/
filter
Filter
curl --request POST \
  --url https://{defaultHost}/v1/subscriptions/filter \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "filter": {
    "type": "condition",
    "attribute_name": "status",
    "operator_label": "is",
    "comparison_value": "active"
  }
}
'
{
  "object": "list",
  "pagination": {
    "count": 1,
    "limit": 20,
    "page": 1,
    "url": "/v1/subscriptions/filter"
  },
  "data": [
    {
      "id": "64943a49-1334-4062-934f-5a1fb8267159",
      "object": "subscription",
      "ad_hoc_amount": null,
      "affiliation_expires_at": null,
      "cancel_at_period_end": false,
      "currency": "usd",
      "current_period_end_at": 1780689334,
      "current_period_start_at": 1778010934,
      "ended_at": null,
      "finite": false,
      "last_renewal_reminder_sent_at": null,
      "live_mode": true,
      "manual_payment": false,
      "metadata": {},
      "pending_update": {},
      "price_readonly": false,
      "portal_url": "http://app.example.com/portal_redirect/subscriptions/64943a49-1334-4062-934f-5a1fb8267159",
      "quantity": 1,
      "remaining_period_count": null,
      "restart_on_completed": false,
      "restore_at": null,
      "subtotal_amount": 2900,
      "status": "active",
      "tax_enabled": false,
      "trial_end_at": null,
      "trial_start_at": null,
      "variant_options": null,
      "affiliation": null,
      "current_cancellation_act": null,
      "current_period": "917459e0-0a2e-460b-9c73-a7f2efd568c9",
      "customer": "5f0441e8-f693-4593-ae39-3f35ebc0d8b9",
      "discount": null,
      "manual_payment_method": null,
      "payment_method": "5cfdb7ec-6d17-4d44-b5b4-52556f6e06d9",
      "price": "22149327-74a4-47ae-8978-5b724d6516cb",
      "purchase": "37342c63-6532-4b54-8431-c7d7820c68b9",
      "shipping_method": null,
      "variant": null,
      "created_at": 1778010934,
      "updated_at": 1778010934
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://developer.surecart.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
filter
object

A rule tree describing how to filter records. May be a single rule_condition or a rule_group combining multiple conditions and nested groups with and / or. The valid attribute_name and operator_label values for each resource come from the corresponding GET /v1/<resource>/filter_schema endpoint.

Example:
{
  "type": "group",
  "combinator": "and",
  "conditions": [
    {
      "type": "condition",
      "attribute_name": "order_type",
      "operator_label": "is",
      "comparison_value": "checkout"
    },
    {
      "type": "condition",
      "attribute_name": "products.name",
      "operator_label": "contains",
      "comparison_value": "shirt"
    }
  ]
}

Response

200 - application/json

Success

object
string

A string describing the object type returned.

pagination
object
data
array

An array of objects.