SubblySubbly
Log inGet started
  • Get started
  • Developer resources
Private API reference
Docs
Information
    Base URLAuthenticationPaginationErrors
Customer
    Get list of customersCreate a customerGet customer by IDUpdate a customerDelete a customerChange a customer's store credit balanceCreate a customer noteUpdate a customer noteDelete a customer note
Address
    Create an addressUpdate an addressDelete an address
Pickup Info
    Get list of pickup infoCreate pickup infoUpdate pickup infoDelete pickup info
Subscription
    Get list of subscriptionsCreate a subscriptionGet subscription by IDUpdate a subscriptionCancel a subscriptionUndo cancellationPause a subscriptionResume a subscriptionSkip renewals until a dateReactivate a cancelled or expired subscriptionSwitch the subscription to another plan by starting overChange the plans of the subscription's itemsUpdate a subscription's shipping address and methodUpdate a subscription's payment methodUpdate a subscription's survey preferencesCreate a subscription itemShow a subscription itemUpdate a subscription itemRemove a subscription itemUpdate a subscription item's preferencesUpdate a subscription item's bundleChange the plan of a subscription itemChange the variant of a one-time itemApply a discount to a subscription itemRemove a subscription item discountApply a discount to a subscriptionRemove a subscription discount
Invoice
    Get list of invoicesGet invoice by IDSchedule the next payment for invoiceVoid an invoiceForgive an invoiceMark an invoice as paid
Order
    Get list of ordersGet order by IDUpdate an orderShip an orderCancel an orderMark an order as pendingArchive an orderMark an order as a future shipmentSync order shipping items
Payment Method
    Create a payment methodGet payment method by IDDelete a payment method
Transaction
    Get list of transactionsGet transaction by ID
Cancellation
    Get shop cancellation reasons
Product
    Get list of productsGet product by IDGet variant by IDUpdate variantGet plan by IDUpdate planCreate subscription productUpdate subscription productPublish subscription productUnpublish subscription productArchive subscription productSync subscription product metadataCreate one-time productUpdate one-time productPublish one-time productUnpublish one-time productArchive one-time productSync one-time product metadataCreate variantArchive variantBatch create/update/archive variantsCreate planArchive plan
Survey
    Get survey by IDGet list of surveys
Bundle
    Get list of bundlesCreate a new bundleGet bundle by IDUpdate a bundleGet list of bundle itemsCreate a bundle itemBatch create bundle itemsGet bundle item by IDUpdate a bundle itemDelete a bundle itemGet list of bundle groupsPublish a bundleUnpublish a bundleArchive a bundleSync bundle metadataCreate a bundle planGet bundle plan by IDUpdate a bundle planArchive a bundle plan
Tag
    Get list of tags
Metafield
    Get shop's metafieldsCreate a new metadataUpdate the metadata
Funnel
    Get list of funnelsGet funnel by ID
Option
    Get list of options
Country
    Get list of countries
Inventory
    Get list of inventory itemsCreate a new inventory itemGet inventory item by IDUpdate an inventory itemArchive an inventory itemGet list of inventory groupsCreate a new inventory groupGet inventory group by IDUpdate an inventory group
Coupon
    Get list of couponsCreate a couponGet coupon by IDUpdate a couponArchive a coupon
Product Collection
    Get list of product collectionsCreate a product collectionGet product collection by IDUpdate a product collectionPublish a product collectionUnpublish a product collectionArchive a product collectionGet list of collection groups with itemsSync collection items

Subscription

Private Subscription API endpoints

Endpoints
  • GET/subscriptions
  • POST/subscriptions
  • GET/subscriptions/{subscription_id}
  • PATCH/subscriptions/{subscription_id}
  • POST/subscriptions/{subscription_id}/cancel
  • DELETE/subscriptions/{subscription_id}/undo_cancellation
  • POST/subscriptions/{subscription_id}/pause
  • POST/subscriptions/{subscription_id}/resume
  • POST/subscriptions/{subscription_id}/skip
  • POST/subscriptions/{subscription_id}/reactivate
  • POST/subscriptions/{subscription_id}/switch_plan
  • POST/subscriptions/{subscription_id}/change_plans
  • PATCH/subscriptions/{subscription_id}/address
  • PATCH/subscriptions/{subscription_id}/payment_method
  • PATCH/subscriptions/{subscription_id}/preferences
  • POST/subscriptions/{subscription_id}/items
  • GET/subscriptions/{subscription_id}/items/{item_id}
  • PATCH/subscriptions/{subscription_id}/items/{item_id}
  • DELETE/subscriptions/{subscription_id}/items/{item_id}
  • PATCH/subscriptions/{subscription_id}/items/{item_id}/preferences
  • PATCH/subscriptions/{subscription_id}/items/{item_id}/bundle
  • POST/subscriptions/{subscription_id}/items/{item_id}/change_plan
  • POST/subscriptions/{subscription_id}/items/{item_id}/change_variant
  • POST/subscriptions/{subscription_id}/items/{item_id}/discounts
  • DELETE/subscriptions/{subscription_id}/items/{item_id}/discounts/{discount_id}
  • POST/subscriptions/{subscription_id}/discounts
  • DELETE/subscriptions/{subscription_id}/discounts/{discount_id}

Get list of subscriptions

GET /subscriptions

An API endpoint to get list of subscriptions

Query parameters

pageoptionalinteger

Page number

per_pageoptionalinteger

Items per page

statusesoptionalstring[]

Filter by subscription statuses

created_at[gte]optionalstring

Filter to include only records with a created_at on or after the given date.

created_at[lte]optionalstring

Filter to include only records with a created_at on or before the given date.

start_created_atoptionalstringDeprecated

Deprecated alias of created_at[gte]. When both arrive, created_at[gte] wins.

end_created_atoptionalstringDeprecated

Deprecated alias of created_at[lte]. When both arrive, created_at[lte] wins.

customer_idoptionalinteger

Filter by customer ID

product_idoptionalintegerDeprecated

Deprecated, use plan_ids or bundle_ids instead. Filter by product ID. Accepts a parent product ID or a plan (child product) ID; a parent is expanded to itself plus all of its plans. Matches subscriptions whose primary product or any line item is in the resulting set.

plan_idsoptionalinteger[]

Filter by exact plan IDs. Matches subscriptions whose primary product or any line item is one of the given plans. Cannot be combined with bundle_ids.

bundle_idsoptionalinteger[]

Filter by bundle IDs. Matches subscriptions whose primary product or any line item belongs to one of the bundles' products. Cannot be combined with plan_ids.

activeoptionalinteger

Filter by the subscription active flag (0 or 1).

Possible values: 0, 1.

pausedoptionalinteger

Filter by the subscription paused flag (0 or 1). Skipping until a date (skipping_until) does not set this flag.

Possible values: 0, 1.

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

Returnsobject

Subscriptions list response

Error responses

422object

A query parameter failed validation: page below 1, per_page outside 1 to 100, a customer_id, product_id, plan_ids[] or bundle_ids[] value that does not belong to the shop, plan_ids sent together with bundle_ids, an unknown statuses[] value, a non-boolean active or paused, a date not in 2022-02-24T04:00:00 format, or a non-array expand[].

curl https://api.subbly.co/private/v1/subscriptions \ -H 'X-API-KEY: <api-key>'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Create a subscription

POST /subscriptions

Create a subscription directly, without a checkout. No invoice is issued at creation: an auto-collecting subscription is billed by the renewals engine once starts_at is due, while one with auto_collecting: false waits for manually issued invoices.

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

Request body

Create a subscription

auto_collectingoptionalboolean

Whether renewals are collected automatically. When true the subscription is charged by the renewals engine when the next payment date is due; when false it is never charged automatically and waits for manually issued invoices. The renewals engine skips non-auto-collecting subscriptions entirely, so starts_at is recorded but nothing is billed on that date. It takes effect only once auto_collecting is switched back to true.

Defaults to true.

customer_idRequiredinteger

The customer the subscription belongs to.

currency_codeRequiredstring

Subscription currency. Must be enabled for the shop and, when a payment method is given, one of that payment method's currencies โ€” the shop currencies attached to its gateway.

payment_method_idRequiredinteger

The customer's payment method, charged on every renewal. Must belong to the customer and support currency_code (see the payment method's currencies); an expired card is rejected. The subscription's test mode is derived from the payment method's gateway: a payment method on a test gateway creates a test subscription.

shipping_address_idoptionalinteger | null

The customer's shipping address id. Required when any product on the subscription is physical; prohibited when every product is digital and none of them collects a shipping address. The products counted are those in items[] plus the gift products of the coupon in discounts, if any. A pickup point id is accepted instead of a street address only when a physical product is present, and then shipping_method_id must be a local pickup method.

billing_address_idoptionalinteger | null

The customer's billing address id. Defaults to shipping_address_id when omitted.

shipping_method_idoptionalinteger | null

Shipping method id. Must be published in the shop and available for shipping_address_id and the subscription's products: a shipping option or local delivery method serving the address's country, region and zip, or a local pickup method serving the pickup point. A FlavorCloud method is accepted only for an address outside the shop's country. Rejected when sent without shipping_address_id. Required when any product on the subscription is physical; prohibited when every product is digital, even one that collects a shipping address. The gift products of the coupon in discounts count like items[] products.

shipping_carrier_idoptionalinteger | null

Shipping carrier id. Required for (and only allowed with) dynamic shipping methods.

shipping_carrier_serviceoptionalstring | null

Shipping carrier service code. Required for (and only allowed with) dynamic shipping methods.

giftoptionalobject | null

Marks the subscription as a gift. With a future starts_at the subscription is created in the gift_waiting_to_start status and activates on that date.

starts_atoptionalstring | null

The day the first charge should land, as a Y-m-d date in the shop's timezone. It is stored at the shop's renewal time, exactly like next_payment_date on the update endpoint, and doubles as the gift start date. Must be today or later, where "today" is evaluated against the server's UTC clock โ€” not the shop's timezone. Omit the field (or send null) to bill the subscription as soon as the renewals engine next runs. That is not the same as passing today's date: today resolves to today at the shop's renewal time, which may still be hours away. Only meaningful for auto-collecting subscriptions โ€” see auto_collecting. A future date does not put the subscription in a distinct status.

Format: date.

charges_limitoptionalinteger | null

Number of successful charges after which the subscription expires. Defaults to the subscription product's setting when omitted; pass null for unlimited.

discountsoptionalobject[]

Subscription-level discounts. At most one entry per type is allowed: a coupon, a gift_card and a custom discount may be combined. The coupon becomes the subscription discount (and its gift products, if any, are added as coupon items); the gift card is redeemed to the customer and its balance is consumed by upcoming invoices; a discount becomes a single subscription-scoped discount, visible via expand=discounts, applied once per invoice across all items โ€” including items added after creation. Items may still carry their own per-item discounts via items[].discounts. At billing time discounts stack in a fixed order โ€” per-item discounts first, then the subscription discount, then the coupon (each computed on the already-discounted total), then the gift card against the remainder โ€” and can never exceed the invoice total.

metadataoptionalobject[] | null

List of metadata and their values

itemsRequiredobject[]

Subscription items. The item type follows the key that names its product: plan_id items are subscription lines (all of them must share one billing cycle), variant_id items are one_time add-ons. At least one plan_id item is required. More than one plan_id item needs the multiple subscription products feature of the shop's plan, and a membership plan (a digital plan) takes no variant_id items.

ReturnsSubscription

Subscription object response

Error responses

400object

The coupon in discounts was redeemable when the request was validated but reached its redemption limit, expired or was deactivated before the subscription was written (coupon_not_redeemable) - typically because a concurrent request took the last redemption. Redemptions are serialised per coupon, so exactly one of the competing requests succeeds. The same holds for the gift card in discounts when a concurrent request redeemed it first (gift_card_already_redeemed, "The gift voucher was already redeemed."). Nothing is created.

422object

Validation failed. customer_id is not a customer of the shop; currency_code is not a currency the shop sells in; payment_method_id does not belong to the customer ("The selected payment method does not belong to the customer."), is an expired card ("The selected payment method card has expired.") or cannot be charged in currency_code ("The payment method id field cannot be charged in EUR; it can be charged in USD."). items names no plan ("The items must contain at least one subscription plan."), plans on different billing cycles ("All subscription plans must share the same billing cycle."), a one-time item on a membership plan ("One-time items are not allowed on membership subscriptions.") or more than one plan while the shop's plan lacks the multiple subscription products feature ("Multiple subscription products are not available on your current plan."); an item sends neither or both of plan_id and variant_id, a product that is not available, a duration on a plan, a bundle that is missing for a configurable bundle, sent for another product or does not fit it, or preferences that do not answer the plan's survey. A shipping address or method is missing while a product is physical ("The shipping method id is required when the subscription contains a physical product.") or sent while no product needs it ("The shipping address id is prohibited for digital products."), the address is not the customer's, a pickup point comes without a local pickup method, the method does not serve the address, or the carrier fields are missing for a dynamic-rate method or sent for another one. gift is sent without recipient_email; starts_at is before today. discounts repeats a type ("Only one coupon discount is allowed per subscription."), names a coupon that is not redeemable or a gift card that is not valid ("The gift card is not valid.") or has expired ("The gift card has already expired."), or holds a discount entry without duration or without exactly one of percent_off and amount_off; items[].discounts holds more than one entry or a type other than discount.

429object

Another rate-limited request from the same IP address is still running. The endpoint handles one such request at a time.

curl -X POST https://api.subbly.co/private/v1/subscriptions \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "auto_collecting": true, "customer_id": 1, "currency_code": "USD", "payment_method_id": 1, "shipping_address_id": 1, "billing_address_id": 1, "shipping_method_id": 1, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "gift": { "message": "message", "orders_limit": 1, "recipient_email": "customer@example.com" }, "starts_at": "2026-08-01", "charges_limit": 1, "discounts": [ { "type": "discount", "percent_off": 15, "duration": "forever" } ], "metadata": [ { "id": 1, "values": [ { "id": 10, "value": "Blue" } ] } ], "items": [ { "plan_id": 1, "variant_id": 1, "duration": 1, "quantity": 1, "bundle": { "preferences": [ { "metafield_id": 1, "values": [ null ] } ], "items": [ { "product_id": 1, "quantity": 1 } ] }, "preferences": [ { "question_id": 1, "answers": [ { "id": 1, "content": "content", "quantity": 1 } ] } ], "metadata": [ { "id": 1, "values": [ { "id": 10, "value": "Blue" } ] } ], "discounts": [ { "type": "discount", "amount_off": 150, "duration": "once" } ] } ] }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Get subscription by ID

GET /subscriptions/{subscription_id}

A detailed description of the subscription.

Path parameters

subscription_idRequiredinteger

Subscription ID

Format: integer.

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription exists but belongs to another shop.

404object

No subscription exists with this ID.

422object

The expand[] parameter is not an array.

curl https://api.subbly.co/private/v1/subscriptions/{subscription_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Update a subscription

PATCH /subscriptions/{subscription_id}

Partially update an active subscription. Only the keys present in the body are applied, every other field is left untouched. metadata replaces all subscription-level metadata; item metadata is updated through PATCH /subscriptions/{subscription_id}/items/{item_id}. product_id is deprecated: change plans with POST /subscriptions/{subscription_id}/change_plans.

Path parameters

subscription_idRequiredinteger

Subscription ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

Request body

Update a subscription

product_idoptionalintegerDeprecated

Deprecated: use POST /subscriptions/{subscription_id}/change_plans with one pick for the subscription's only subscription item. Moves that item to the given subscription plan of this shop in the same transaction as the other keys. Rejected with 422 for subscriptions with multiple subscription items, for a plan on the other membership kind and for a configurable bundle other than the current one, whose contents must be picked through POST /subscriptions/{subscription_id}/items/{item_id}/change_plan.

quantityoptionalinteger

Subscription-level quantity. Rejected for subscriptions with multiple subscription items; update the quantity per item via PATCH /subscriptions/{subscription_id}/items/{item_id}.

next_payment_dateoptionalstring

Next payment date in Y-m-d format. Must be after yesterday.

Format: date.

gift_recipient_emailoptionalstring | null

Email of the gift recipient. Send null to clear it.

Format: email.

gift_messageoptionalstring | null

Gift message. Send null to clear it.

auto_collectingoptionalboolean

Whether payments are collected automatically.

successful_shipment_numberoptionalinteger

Number of successful shipments.

tagsoptionalobject

Tag changes to apply to the subscription.

metadataoptionalMetadataUpdate

Subscription-level metadata only. Item metadata is not affected.

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription is not active (bad_request). The write re-checks the product_id pick under the lock and refuses it when a subscription item added by a concurrent write since validation would stay on another billing cycle (plan_change_items_left_behind, Item 2 must also be moved to a plan with the same billing cycle.).

404object

No subscription with this ID exists in the shop.

422object

Validation failed, for example product_id is not a subscription plan of this shop on the subscription's membership kind (The selected plan is not available for this item.) or is a configurable bundle other than the current one (The selected plan needs new bundle contents. Pick it with its contents using POST subscriptions/{subscription}/items/{item}/change_plan.), product_id or quantity is sent for a subscription with multiple subscription items (This subscription has multiple subscription items. Change the plans per item using POST subscriptions/{subscription}/change_plans.), next_payment_date is not a Y-m-d date after yesterday, a tags.delete ID is not a tag of this shop, or a metadata entry is invalid.

curl -X PATCH https://api.subbly.co/private/v1/subscriptions/{subscription_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "product_id": 1, "quantity": 1, "next_payment_date": "2026-11-01", "gift_recipient_email": "customer@example.com", "gift_message": "gift_message", "auto_collecting": true, "successful_shipment_number": 0, "tags": { "create": [ { "value": "VIP" } ], "delete": [ { "id": 1 } ] }, "metadata": [ { "id": 1, "values": [ { "id": 10 } ] }, { "id": 2, "values": [ { "value": "Leave at the door" } ] } ] }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Cancel a subscription

POST /subscriptions/{subscription_id}/cancel

Cancels a subscription for a given reason.

Path parameters

subscription_idRequiredinteger

The ID of the subscription to cancel

Request body

Cancellation Reasons Body

reason_idoptionalinteger | null

The ID of the cancellation reason (available if cancellation reasons are enabled)

extra_feedbackoptionalstring | null

Additional feedback from the customer

involuntary_churnoptionalboolean | null

Involuntary churn occurs when a subscription ends due to issues like payment failures. Pass false to clear the past due status and prevent involuntary churn event. Pass true to keep the subscription in its current past due state, which may lead to involuntary churn.

typeoptionalstring | null

Cancellation type. Defaults to 'immediate'. For committed subscriptions 'end_of_commitment' sets cancellation after commitment fulfillment. 'end_of_period' schedules cancellation at the end of the current billing period.

Possible values: immediate, end_of_period, end_of_commitment.

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription is not active, for example because it is already cancelled.

404object

No subscription with this ID exists in the shop.

422object

type is not immediate, end_of_period or end_of_commitment; the subscription is already set to cancel at the end of the period (The subscription is already set to cancel at end of period.) or at the end of its commitment (The subscription is already set to cancel at the end of commitment.); type is end_of_commitment but the subscription has no commitment term; reason_id does not belong to the shop, or the shop has cancellation reasons turned off (A cancellation reason cannot be submitted because cancellation reasons are disabled for this shop.); extra_feedback is longer than 255 characters; or involuntary_churn is not a boolean.

429object

Another rate-limited request from the same IP address is still running. The endpoint handles one such request at a time.

curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/cancel \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "reason_id": 1, "extra_feedback": "extra_feedback", "involuntary_churn": true, "type": "immediate" }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Undo cancellation

DELETE /subscriptions/{subscription_id}/undo_cancellation

Undo the cancellation of a subscription.

Path parameters

subscription_idRequiredinteger

The ID of the subscription

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription belongs to another shop, is not active, or is not set to cancel at the end of the period or at the end of its commitment.

404object

No subscription exists with this ID.

curl -X DELETE https://api.subbly.co/private/v1/subscriptions/{subscription_id}/undo_cancellation \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Pause a subscription

POST /subscriptions/{subscription_id}/pause

Pauses an active subscription until it is resumed with POST /subscriptions/{subscription_id}/resume. The shop's and the product's pause settings do not apply here.

Path parameters

subscription_idRequiredinteger

Subscription ID

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription is not active, is already paused, is past due, is set to cancel at the end of the period, or is skipping renewals.

404object

No subscription with this ID exists in the shop.

429object

Another rate-limited request from the same IP address is still running. The endpoint handles one such request at a time.

curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/pause \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Resume a subscription

POST /subscriptions/{subscription_id}/resume

Resumes a paused or skipping subscription: the pause and the skip are cleared and next_payment_date becomes the next payment date, stored at the shop's renewal time.

Path parameters

subscription_idRequiredinteger

Subscription ID

Request body

next_payment_dateRequiredstring

The next payment date, as a Y-m-d date of today or later.

Format: date.

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription is not active, or it is neither paused nor skipping renewals.

404object

No subscription with this ID exists in the shop.

422object

next_payment_date is missing, not a Y-m-d date, or before today.

429object

Another rate-limited request from the same IP address is still running. The endpoint handles one such request at a time.

curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/resume \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "next_payment_date": "2026-11-01" }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Skip renewals until a date

POST /subscriptions/{subscription_id}/skip

Skips renewals until skip_until, which becomes the next payment date, stored at the shop's renewal time. Any date after today is accepted; the shop's skipping settings do not apply here. End a skip early with POST /subscriptions/{subscription_id}/resume.

Path parameters

subscription_idRequiredinteger

Subscription ID

Request body

skip_untilRequiredstring

The date renewals are skipped until, as a Y-m-d date after today.

Format: date.

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription is not active, is paused, is past due, or is already skipping renewals.

404object

No subscription with this ID exists in the shop.

422object

skip_until is missing, not a Y-m-d date, or not after today.

429object

Another rate-limited request from the same IP address is still running. The endpoint handles one such request at a time.

curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/skip \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "skip_until": "2026-11-01" }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Reactivate a cancelled or expired subscription

POST /subscriptions/{subscription_id}/reactivate

Makes a cancelled or expired subscription active again with renewal_date as its next payment date, stored at the shop's renewal time. The cancellation, pause and skip are cleared and charges_limit resets to unlimited. The shop's reactivation settings do not apply here.

Path parameters

subscription_idRequiredinteger

Subscription ID

Request body

renewal_dateRequiredstring

The next payment date, as a Y-m-d date of today or later.

Format: date.

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription is neither cancelled nor expired.

404object

No subscription with this ID exists in the shop.

422object

renewal_date is missing, not a Y-m-d date, or before today.

429object

Another rate-limited request from the same IP address is still running. The endpoint handles one such request at a time.

curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/reactivate \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "renewal_date": "2026-11-01" }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Switch the subscription to another plan by starting over

POST /subscriptions/{subscription_id}/switch_plan

Closes the subscription and opens a new one, keeping the customer, addresses, payment method, dates, discounts and tags. The new subscription starts on plan_id, or on the subscription's current plan when no plan is named. It holds exactly one subscription item on that plan, seeded from the subscription's representative item (the lowest-id subscription item): its quantity and item discounts carry over, its bundle contents only when the new plan has the same bundle and its survey answers only when it has the same survey; every other subscription item is not copied, one-time items are copied as they are. The old subscription is marked switched. To change plans in place, with every item and the billing cycle kept together, use POST subscriptions/{subscription_id}/change_plans.

Path parameters

subscription_idRequiredinteger

The ID of the subscription to switch

Request body (optional)

plan_idoptionalinteger

The plan the new subscription starts on; any subscription plan of the shop. Defaults to the subscription's current plan.

ReturnsSubscription

The new subscription

Error responses

400object

The subscription is not active.

404object

No subscription with this ID exists in the shop.

422object

plan_id is not an integer or not a subscription plan of the shop.

429object

Another rate-limited request from the same IP address is still running. The endpoint handles one such request at a time.

curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/switch_plan \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "plan_id": 48 }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Change the plans of the subscription's items

POST /subscriptions/{subscription_id}/change_plans

Moves the named subscription items to other plans in one write: a plan change, a product change or a billing cycle change. The picks are laid over the current items and every subscription item must end on one billing cycle (plan hash); an item that is not named is never written, so a cycle change names every subscription item. A pick may be any subscription plan of the shop, unpublished or archived included, on the subscription's membership kind; one-time items are never picks. A pick's bundle is accepted only when the target plan is a configurable bundle, required when that bundle is not the item's current bundle, and replaces the contents when sent; on the same bundle the contents are kept without it, while any other bundle, or none, drops them. A pick equal to the current plan is a no-op without bundle and a contents change with it. Survey answers reset unless the target plan's active survey is the one they answer, and the subscription's product_id follows its lowest-id subscription item. Nothing else is written: the renewal date, the commitment, discounts and upcoming orders stay as they are and the change takes effect at the next renewal. One subscription item moves on its own with POST subscriptions/{subscription_id}/items/{item_id}/change_plan.

Path parameters

subscription_idRequiredinteger

Subscription ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

Request body

itemsRequiredobject[]

The picks, one per subscription item to move.

ReturnsSubscription

The subscription with its items on their new plans

Error responses

400object

The subscription is not active (subscription_not_active). The write re-checks the picks under the lock and refuses one that another write made invalid while the change waited for the subscription: a named item was removed (plan_change_item_not_found, "Item 2 is not a subscription item of this subscription."), or an unnamed item is on another billing cycle (plan_change_items_left_behind, "Item 2 must also be moved to a plan with the same billing cycle.").

404object

No subscription with this ID exists in the shop.

422object

items is missing, empty or not a list; an id is not an item of this subscription ("The item does not belong to this subscription."), is a one-time item ("The item is not a subscription item.") or is named twice ("The item is picked more than once."); a plan_id is not a subscription plan of the shop on the subscription's membership kind ("The selected plan is not available for this item."); the picks name plans on different cycles ("All picked plans must share one billing cycle." on items.N.plan_id) or leave an unnamed item on another cycle ("Item 2 must also be moved to a plan with the same billing cycle." on items); bundle is sent for a plan that is not a configurable bundle ("The bundle field is not accepted for this plan."), missing while the target's bundle is not the item's current bundle ("The bundle field is required for this plan."), or its items or preferences do not fit the target's bundle; or expand is not an array.

429object

Another rate-limited request from the same IP address is still running. The endpoint handles one such request at a time.

curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/change_plans \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "items": [ { "id": 1, "plan_id": 47, "bundle": { "preferences": [ { "metafield_id": 1, "values": [ null ] } ], "items": [ { "product_id": 1, "quantity": 1 } ] } } ] }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Update a subscription's shipping address and method

PATCH /subscriptions/{subscription_id}/address

Changes the shipping address, the shipping method and, for a dynamic-rate method, the carrier and service of an active subscription. Only the keys sent are written; null clears one. Which keys are required or accepted follows the subscription's plan (product_id).

Path parameters

subscription_idRequiredinteger

Subscription ID

Request body

shipping_address_idoptionalinteger | null

One of the customer's addresses or pickup points. Required when shipping_method_id is sent and the plan collects a shipping address; rejected when it does not. A pickup point needs a physical plan and a local pickup shipping_method_id in the same request.

shipping_method_idoptionalinteger | null

A published shipping method of the shop that serves shipping_address_id, which must be sent with it. Required when shipping_address_id is sent and the plan is physical and not a gift card; rejected for a digital or gift-card plan.

shipping_carrier_idoptionalinteger | null

A carrier of the dynamic-rate shipping_method_id sent. Required with a dynamic-rate method and rejected otherwise.

shipping_carrier_serviceoptionalstring | null

A service code offered by shipping_carrier_id. Required with a dynamic-rate method and rejected otherwise.

update_orders_addressoptionalinteger

1 also copies the subscription's shipping address, method, carrier and service to its future_shipment and awaiting_delivery orders. Rejected with a dynamic-rate shipping_method_id.

Possible values: 0, 1.

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription is not active.

404object

No subscription with this ID exists in the shop.

422object

A key has the wrong type; shipping_address_id is missing while a shipping_method_id is sent for a plan that collects a shipping address ("A shipping address is required when a shipping method is set on a product that collects shipping addresses."), sent for a plan that does not ("A shipping address cannot be set because the subscription's product does not collect shipping addresses."), not the customer's, or a pickup point without a local pickup method or on a digital plan; shipping_method_id is missing while a shipping_address_id is sent for a physical plan ("A shipping method is required when a shipping address is set on a product that requires shipping."), sent for a digital or gift-card plan ("A shipping method cannot be set because the subscription's product does not require shipping."), not a published method of the shop, or sent without a shipping_address_id it serves ("Incorrect value for shipping method id"); the carrier fields are missing for a dynamic-rate method, sent without one, or not offered by it; or update_orders_address is not 0 or 1, or is 1 with a dynamic-rate method ("Updating order address is not supported for dynamic shipping methods.").

curl -X PATCH https://api.subbly.co/private/v1/subscriptions/{subscription_id}/address \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "shipping_address_id": 123, "shipping_method_id": 45, "shipping_carrier_id": 7, "shipping_carrier_service": "ground", "update_orders_address": 1 }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Update a subscription's payment method

PATCH /subscriptions/{subscription_id}/payment_method

Sets the payment method renewals are charged to, together with the subscription's currency and, optionally, its billing address. Only active subscriptions can be updated.

Path parameters

subscription_idRequiredinteger

Subscription ID

Request body

payment_method_idRequiredinteger

One of the customer's payment methods, on a gateway in the subscription's mode (a test gateway for a test subscription, a live one otherwise). An expired card is rejected.

currency_codeRequiredstring

The subscription's currency from now on; must be a known currency code.

billing_address_idoptionalinteger

One of the customer's addresses. Left unchanged when omitted.

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription is not active.

404object

No subscription with this ID exists in the shop.

422object

payment_method_id is missing, not an integer, not one of the customer's payment methods on a gateway in the subscription's mode ("The selected payment method id is invalid."), or a card that has expired ("The selected payment method card has expired."); currency_code is missing or not a known currency; or billing_address_id is not one of the customer's addresses.

curl -X PATCH https://api.subbly.co/private/v1/subscriptions/{subscription_id}/payment_method \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "payment_method_id": 567, "currency_code": "USD", "billing_address_id": 123 }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Update a subscription's survey preferences

PATCH /subscriptions/{subscription_id}/preferences

Replaces the survey answers of an active subscription with a single subscription item; null or an empty list clears them where the survey accepts no answers. For a subscription with several subscription items use PATCH /subscriptions/{subscription_id}/items/{item_id}/preferences.

Path parameters

subscription_idRequiredinteger

Subscription ID

Request body

preferencesRequiredobject[] | null

Answers to the active survey of the subscription's plan.

update_ordersoptionalinteger

1 also writes the answers to the subscription's future_shipment and awaiting_delivery orders. Accepted only when the survey is shown after checkout and the subscription's shipping method is not dynamic-rate.

Possible values: 0, 1.

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription is not active (bad_request), has more than one subscription item (subscription_preferences_not_editable), or a chosen answer is out of stock (out_of_stock).

404object

No subscription with this ID exists in the shop.

422object

preferences is missing or the answers do not match the plan's active survey ("The preferences are invalid"); a preference has no question_id or answers; or update_orders is not 0 or 1, or is 1 while the subscription uses dynamic shipping ("The update orders is not allowed when the subscription uses dynamic shipping.") or the survey is not shown after checkout ("The update orders is prohibited when the survey appearance type is not after checkout.").

curl -X PATCH https://api.subbly.co/private/v1/subscriptions/{subscription_id}/preferences \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "preferences": [ { "question_id": 1, "answers": [ { "id": 1, "content": "content", "quantity": 1 } ] } ], "update_orders": 0 }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Create a subscription item

POST /subscriptions/{subscription_id}/items

Add an item to a subscription. A subscription item adds another concurrent subscription line, named by its plan_id (the plan must share the subscription's billing cycle); a one_time item adds a one-time add-on product, named by its variant_id. The item is billed on the next renewal, not immediately.

Path parameters

subscription_idRequiredinteger

Subscription ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

Request body

Create a subscription item

ReturnsSubscriptionItem

Subscription item object response

Error responses

400object

The subscription is not active, or type is one_time and the subscription is a membership (its product is digital) (bad_request); or type is subscription and the shop's plan lacks the multiple subscription products feature (feature_not_available, The multiple subscription products feature is not available on your current plan.).

404object

No subscription with this ID exists in the shop.

422object

type is missing or not one_time or subscription; the key matching the type is missing (The plan_id field is required for subscription items., The variant_id field is required for one_time items.) or the other kind's key is sent (The plan_id field is only allowed for subscription items; a one_time item takes variant_id., The variant_id field is only allowed for one_time items; a subscription item takes plan_id.); plan_id is not a published, unarchived subscription plan of the shop or does not share the subscription's billing cycle (The selected product must share this subscription's billing cycle.); variant_id is not a published, unarchived, non-gift-card one-time product of the shop without variants and not a configurable bundle (The selected product is not a valid one-time product for this shop.); duration is not 1 or is sent for a subscription item (The duration field is not allowed for subscription items.); quantity is missing or below 1; bundle is missing while the plan is a configurable bundle, sent while it is not, or its preferences or items do not fit the bundle; or metadata holds an unknown metafield or an invalid value.

curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/items \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d 'null'
Response
{ "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Show a subscription item

GET /subscriptions/{subscription_id}/items/{item_id}

Show a single subscription item.

Path parameters

subscription_idRequiredinteger

Subscription ID

item_idRequiredinteger

Subscription item ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

ReturnsSubscriptionItem

Subscription item object response

Error responses

400object

The subscription item does not belong to this subscription.

404object

No subscription with this ID exists in the shop, or no subscription item exists with this ID.

422object

The expand[] parameter is not an array.

curl https://api.subbly.co/private/v1/subscriptions/{subscription_id}/items/{item_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Update a subscription item

PATCH /subscriptions/{subscription_id}/items/{item_id}

Update a subscription item's quantity, duration and/or metadata. duration is only valid for one-time items. The product is not changed here: move a subscription item to another plan with POST /subscriptions/{subscription_id}/items/{item_id}/change_plan (or several at once with POST /subscriptions/{subscription_id}/change_plans) and a one_time item to another variant with POST /subscriptions/{subscription_id}/items/{item_id}/change_variant. metadata replaces all metadata of the item.

Path parameters

subscription_idRequiredinteger

Subscription ID

item_idRequiredinteger

Subscription item ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

Request body

Update a subscription item

quantityoptionalinteger

Item quantity.

durationoptionalinteger | null

Add-on duration. Only valid for one-time items; prohibited for subscription items.

Possible values: 1.

metadataoptionalMetadataUpdate

Metadata of this item only.

ReturnsSubscriptionItem

Subscription item object response

Error responses

400object

The subscription is not active, or the subscription item does not belong to this subscription.

404object

No subscription with this ID exists in the shop, or no subscription item exists with this ID.

422object

quantity is not an integer of at least 1; duration is not 1, or is sent for a subscription item (The duration field is not allowed for subscription items.); a metadata entry is invalid (unknown metadata ID, missing values, or a value that does not fit the field); or expand[] is not an array.

curl -X PATCH https://api.subbly.co/private/v1/subscriptions/{subscription_id}/items/{item_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "quantity": 1, "duration": 1, "metadata": [ { "id": 1, "values": [ { "id": 10 } ] }, { "id": 2, "values": [ { "value": "Leave at the door" } ] } ] }'
Response
{ "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Remove a subscription item

DELETE /subscriptions/{subscription_id}/items/{item_id}

Remove a subscription item. The last remaining subscription item cannot be removed. The request responds with 400 (error code last_subscription_item); cancel the subscription instead. The subscription's product_id is re-synced to the plan of its lowest-id remaining subscription item.

Only one rate-limited request per IP address runs at a time; an overlapping request responds with 429 (error code too_many_requests) instead of queueing.

Path parameters

subscription_idRequiredinteger

Subscription ID

item_idRequiredinteger

Subscription item ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

ReturnsSubscription

Subscription object response

Error responses

400object

The subscription is not active or the subscription item does not belong to this subscription (bad_request), or the item is the last remaining subscription item (last_subscription_item, Cannot remove the last subscription item. Please cancel the subscription instead.).

404object

No subscription with this ID exists in the shop, or no subscription item exists with this ID.

422object

expand is not an array.

429object

Another rate-limited request from the same IP address is still running. The endpoint handles one such request at a time.

curl -X DELETE https://api.subbly.co/private/v1/subscriptions/{subscription_id}/items/{item_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Update a subscription item's preferences

PATCH /subscriptions/{subscription_id}/items/{item_id}/preferences

Update the survey preferences (answers) for a single subscription item.

Path parameters

subscription_idRequiredinteger

Subscription ID

item_idRequiredinteger

Subscription item ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

Request body

Update a subscription item's survey preferences

preferencesRequiredobject[] | null
update_ordersoptionalboolean

Update order preferences in the awaiting_delivery and future_shipment status. Allowed when the survey appearance type is after checkout.

ReturnsSubscriptionItem

Subscription item object response

Error responses

400object

The subscription is not active or the item is a one-time item (bad_request), or the chosen answers are out of stock (out_of_stock).

404object

No subscription with this ID exists in the shop, no subscription item exists with this ID, or the item does not belong to this subscription.

422object

preferences is missing, or the answers do not match the product's active survey (The preferences are invalid); a preference has no question_id or answers; or update_orders is true while the subscription uses dynamic shipping (The update orders is not allowed when the subscription uses dynamic shipping.) or while the survey is not shown after checkout and the shop does not sync order preferences (The update orders is prohibited when the survey appearance type is not after checkout.).

curl -X PATCH https://api.subbly.co/private/v1/subscriptions/{subscription_id}/items/{item_id}/preferences \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "preferences": [ { "question_id": 1, "answers": [ { "id": 1, "content": "content", "quantity": 1 } ] } ], "update_orders": true }'
Response
{ "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Update a subscription item's bundle

PATCH /subscriptions/{subscription_id}/items/{item_id}/bundle

Deprecated. Do not use it in new integrations.

Deprecated: use POST /subscriptions/{subscription_id}/items/{item_id}/change_plan with plan_id (the target plan, or the current one to change only the contents) and bundle, and PATCH /subscriptions/{subscription_id}/items/{item_id} for the quantity. Update the configurable-bundle configuration (preferences, items, quantity and optionally the product) of a single subscription item. The item's product must be a configurable bundle. Works for subscriptions with any number of subscription items. The request runs as that pick plus the quantity change in one transaction.

Path parameters

subscription_idRequiredinteger

Subscription ID

item_idRequiredinteger

Subscription item ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

Request body

Update a single subscription item's configurable bundle. The item's product must be a configurable bundle.

bundleRequiredSubscriptionBundleBody

Bundle payload (preferences + items) for this subscription item.

quantityoptionalinteger

Item quantity. When omitted the current quantity is kept.

product_idoptionalinteger

Optional target plan for this item: a published configurable bundle of the shop, on the subscription's billing cycle unless the item is its only subscription item. When omitted the item keeps its current product.

ReturnsSubscriptionItem

Subscription item object response

Error responses

400object

The subscription is not active, or the item is a one-time item (bad_request).

404object

No subscription with this ID exists in the shop, no subscription item exists with this ID, or the item does not belong to this subscription.

422object

bundle is missing or lacks the preferences and items keys; the target product is not a configurable bundle (The selected product must have a configurable bundle.); bundle.preferences do not match the bundle (The bundle.preferences is invalid.); bundle.items hold a product the bundle does not allow (The bundle.items contains the invalid product.); product_id is not a subscription plan of the shop (The selected plan is not available for this item.), is on another billing cycle while the subscription has other subscription items (The selected plan is on another billing cycle. Move every subscription item at once with POST subscriptions/{subscription}/change_plans.), or is not published and unarchived, the scope this deprecated route keeps; or quantity is below 1.

curl -X PATCH https://api.subbly.co/private/v1/subscriptions/{subscription_id}/items/{item_id}/bundle \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "bundle": { "preferences": [ { "metafield_id": 1, "values": [ null ] } ], "items": [ { "product_id": 1, "quantity": 1 } ] }, "quantity": 1, "product_id": 1 }'
Response
{ "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Change the plan of a subscription item

POST /subscriptions/{subscription_id}/items/{item_id}/change_plan

Moves one subscription item to another plan: a pick of POST subscriptions/{subscription_id}/change_plans on its own route, with that route's targets (any subscription plan of the shop on the subscription's membership kind, the item's current plan included), bundle rules and effects. The plan must share the subscription's billing cycle unless the item is its only subscription item, which may change the cycle alone (one-time items do not count); with other subscription items, move them all at once with change_plans. One-time items change their variant with change_variant.

Path parameters

subscription_idRequiredinteger

Subscription ID

item_idRequiredinteger

Subscription item ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

Request body

plan_idRequiredinteger

The plan the item moves to.

bundleoptionalSubscriptionBundleBody | null

The contents for a configurable bundle plan: items (product_id, quantity) and preferences (metafield_id, values). null is the same as leaving bundle out.

ReturnsSubscriptionItem

The subscription item on its new plan

Error responses

400object

The subscription is not active (subscription_not_active), or the item is a one-time item (item_not_subscription). The write re-checks the pick under the lock and refuses one that another write made invalid while the change waited for the subscription: the item was removed (plan_change_item_not_found), or another subscription item is on another billing cycle (plan_change_items_left_behind).

404object

No subscription with this ID exists in the shop, or no subscription item with this ID belongs to the subscription.

422object

plan_id is missing, not an integer, or not a subscription plan of the shop the item may move to ("The selected plan is not available for this item."), or is on another billing cycle while the subscription has other subscription items ("The selected plan is on another billing cycle. Move every subscription item at once with POST subscriptions/{subscription}/change_plans."); bundle is sent for a plan without a configurable bundle ("The bundle field is not accepted for this plan."), missing while the plan's bundle is not the item's current bundle ("The bundle field is required for this plan."), lacks preferences or items, or holds preferences or items the bundle does not allow; or expand is not an array.

429object

Another rate-limited request from the same IP address is still running. The endpoint handles one such request at a time.

curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/items/{item_id}/change_plan \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "plan_id": 47, "bundle": { "preferences": [ { "metafield_id": 1, "values": [ null ] } ], "items": [ { "product_id": 1, "quantity": 1 } ] } }'
Response
{ "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Change the variant of a one-time item

POST /subscriptions/{subscription_id}/items/{item_id}/change_variant

Moves a one-time item of the subscription to another one-time variant of the shop. The change takes effect at the next renewal; quantity and duration stay as they are (change them with PATCH subscriptions/{subscription_id}/items/{item_id}). Sending the item's current variant is a no-op. Subscription items change their plan with POST subscriptions/{subscription_id}/items/{item_id}/change_plan or POST subscriptions/{subscription_id}/change_plans.

Path parameters

subscription_idRequiredinteger

Subscription ID

item_idRequiredinteger

Subscription item ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response. Each expandable field on the response schema names its key, e.g. expand[]=customer. Nested keys use dot notation, e.g. items.product or subscriptions.items. Fields marked as always present are returned without being requested. An expanded list is null, not [], when there are no records. Unknown keys are ignored unless the endpoint says otherwise.

Request body

variant_idRequiredinteger

The one-time variant the item moves to.

ReturnsSubscriptionItem

Subscription item object response

Error responses

400object

The subscription is not active (subscription_not_active), or the item is a subscription item (item_not_one_time).

404object

No subscription with this ID exists in the shop, or no subscription item with this ID belongs to the subscription.

422object

variant_id is missing, not an integer, or not a one-time variant of the shop that is published, not archived, not a gift card, a leaf and not a configurable bundle; or expand is not an array.

429object

Another rate-limited request from the same IP address is still running. The endpoint handles one such request at a time.

curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/items/{item_id}/change_variant \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "variant_id": 89 }'
Response
{ "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Apply a discount to a subscription item

POST /subscriptions/{subscription_id}/items/{item_id}/discounts

Applies a custom discount to one item of an active subscription. An item carries one at a time: remove it first to change it. An item gifted by a coupon keeps the coupon's discount next to the custom one, and both apply at renewal.

Path parameters

subscription_idRequiredinteger

Subscription ID

item_idRequiredinteger

Subscription item ID

Request body

The custom discount to apply to the subscription item

typeRequiredstring

The kind of discount. Only discount, a custom discount, is accepted on an item.

Possible values: discount.

percent_offoptionalnumber

Percentage taken off the item. Exactly one of percent_off or amount_off must be provided.

amount_offoptionalinteger

Fixed amount taken off the item, in the minor units of the shop's base currency, converted to the subscription's currency at billing time. An amount above the item's price makes it free, never negative. Exactly one of percent_off or amount_off must be provided.

durationRequiredstring

once applies the discount to the next renewal that bills the item and then discards it; forever re-applies it on every renewal.

Possible values: once, forever.

ReturnsSubscriptionItem

Subscription item object response, with its discounts

Error responses

400object

The item belongs to another subscription (bad_request), the subscription is not active (subscription_not_active), or the item already carries a custom discount (discount_already_applied).

404object

No subscription with this ID exists in the shop, or no subscription item with this ID exists.

422object

The payload is not a valid custom discount, for example:

  • The type field must be "discount", coupon and gift card discounts can only be applied to the subscription.
  • The duration field is required for discounts of type "discount".
  • The percent off field is required for discounts of type "discount" when amount_off is not provided.
  • The percent off field cannot be combined with amount_off, a discount of type "discount" takes either an amount off or a percent off.
curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/items/{item_id}/discounts \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "type": "discount", "percent_off": 10, "duration": "forever" }'
Response
{ "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Remove a subscription item discount

DELETE /subscriptions/{subscription_id}/items/{item_id}/discounts/{discount_id}

Removes a discount of a subscription item: its custom one, or the discount a coupon put on the item it gifted. Without its coupon's discount a gift is billed at full price and is no longer removed when the coupon ends, so remove the item instead to drop the gift. The coupon is not credited back. Invoices that were already discounted are left untouched.

Path parameters

subscription_idRequiredinteger

Subscription ID

item_idRequiredinteger

Subscription item ID

discount_idRequiredinteger

ID of the discount to remove, as listed in the item's discounts

ReturnsSubscriptionItem

Subscription item object response, with its discounts

Error responses

400object

The item belongs to another subscription, or the discount does not belong to the item.

404object

No subscription, subscription item or discount with this ID exists.

curl -X DELETE https://api.subbly.co/private/v1/subscriptions/{subscription_id}/items/{item_id}/discounts/{discount_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Apply a discount to a subscription

POST /subscriptions/{subscription_id}/discounts

Applies a subscription-level discount to an active subscription. Two kinds are supported and one of each may be applied at the same time: a coupon discount, which redeems a coupon and takes its duration from the coupon itself, and a custom discount, whose amount and duration you set directly. Applying a second discount of the same kind is rejected โ€” remove the existing one first. The discount is applied to upcoming invoices, not to invoices that already exist.

Path parameters

subscription_idRequiredinteger

Subscription ID

Request body

The discount to apply to the subscription

typeoptionalstring

The kind of discount to apply. Defaults to coupon when omitted, so a body carrying only coupon_id keeps working.

Possible values: coupon, discount.

Defaults to "coupon".

coupon_idoptionalinteger

ID of the coupon to redeem. Required for the coupon type and prohibited for discount. The coupon must belong to the shop and still be redeemable; how long the discount lasts is taken from the coupon's own duration.

percent_offoptionalnumber

Percentage taken off the invoice total. Only valid for the discount type; exactly one of percent_off or amount_off must be provided.

amount_offoptionalinteger

Fixed amount taken off the invoice total, in the minor units of the shop's base currency โ€” the same convention coupons use. It is converted to the subscription's currency at billing time, so a subscription billed in another currency is discounted by the converted equivalent. Only valid for the discount type; exactly one of percent_off or amount_off must be provided.

durationoptionalstring

How long the custom discount lasts. once applies it to the next invoice only and is then discarded; forever re-applies it on every renewal. Required for the discount type and prohibited for coupon.

Possible values: once, forever.

ReturnsSubscription

Subscription object response, with discounts expanded

Error responses

400object

The subscription is not active (subscription_not_active), it already carries a discount of the requested type (discount_already_applied) โ€” remove the existing one first, the message names the type that is already applied โ€” or the coupon's last redemption was taken by a request that committed while this one was being validated (coupon_not_redeemable).

404object

No subscription with this ID exists in the shop.

422object

The payload does not match the requested discount type. Every message names both the offending field and the type in play, so the response alone is enough to correct the request. amount_off is validated the same way as percent_off, with the counterpart field named in its place, and it is capped at 99999999. A coupon that does not belong to the shop fails with The selected coupon id is invalid., one that can no longer be redeemed with The selected coupon can no longer be redeemed., and an unsupported type with The selected type is invalid. โ€” whatever discounts the subscription already carries, a payload that does not validate is answered here, not with a 400.

  • The coupon_id field is required for discounts of type "coupon".
  • The coupon_id field is only allowed for discounts of type "coupon", the requested discount type is "discount".
  • The duration field is required for discounts of type "discount".
  • The duration field is only allowed for discounts of type "discount", the requested discount type is "coupon".
  • The percent_off field is required for discounts of type "discount" when amount_off is not provided.
  • The percent_off field cannot be combined with amount_off, a discount of type "discount" takes either an amount off or a percent off.
  • The code field is not accepted here. Apply a coupon by its coupon_id.
curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/discounts \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "type": "discount", "percent_off": 15, "duration": "forever" }'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Remove a subscription discount

DELETE /subscriptions/{subscription_id}/discounts/{discount_id}

Removes a subscription-level discount โ€” either the coupon-backed one or the custom one. A coupon that was redeemed to create the discount is not credited back. Invoices that were already discounted are left untouched; upcoming invoices are billed without the discount.

Path parameters

subscription_idRequiredinteger

Subscription ID

discount_idRequiredinteger

ID of the discount to remove, as returned by expand[]=discounts

ReturnsSubscription

Subscription object response, with discounts expanded

Error responses

400object

The discount does not belong to this subscription.

404object

No subscription with this ID exists in the shop, or no discount with this ID exists.

curl -X DELETE https://api.subbly.co/private/v1/subscriptions/{subscription_id}/discounts/{discount_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "customer_id": 1, "customer": { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": {}, "payment_methods": [ {} ], "subscriptions": [ {} ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [], "notes": [ {} ], "addresses": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "referred_by": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "quantity": 1, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "shipping_method_id": 1, "shipping_method": {}, "shipping_carrier_id": 1, "shipping_carrier_service": "shipping_carrier_service", "billing_address_id": 1, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method_id": 1, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last4": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z" }, "currency_code": "USD", "survey": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ], "items_count": 1, "items": [ { "id": 1, "product_id": 1, "survey_id": 1, "data": [ {} ] } ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "gift": { "message": "message", "starts_at": "2022-02-24T04:00:00.000000Z", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23T00:45:00.000000Z", "starts_at": "2023-04-23T00:45:00.000000Z", "active": true, "paused": false, "paused_at": null, "skipping_until": null, "waiting_until": null, "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ { "id": 1, "subscription_id": 1, "reason": "reason", "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1.5, "coupon_id": 1, "coupon": {}, "start": "2023-04-23T00:45:00.000000Z", "end": "2023-04-23T00:45:00.000000Z", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "addons": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "items": [ { "id": 1, "subscription_id": 1, "plan_id": 1, "variant_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "origin": "coupon", "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "last_payment_at": "2023-04-23T00:45:00.000000Z", "unpaid": false, "cancellation_requested": false, "cancelled_at": null, "reactivated_at": null, "switched_at": null, "previous_subscription_id": null, "auto_collecting": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "tags": [ "tags" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }
paginationobject
dataSubscription[]
messageoptionalstring | null

Gift message.

orders_limitoptionalinteger | null

Number of orders after which the gift ends.

recipient_emailRequiredstring

Gift recipient email. Required whenever gift is sent ("The gift.recipient email field is required when the subscription is created as a gift.").

Format: email.

typeRequiredstring

Possible values: coupon, gift_card, discount.

codeoptionalstring

The coupon or gift card code. Required for coupon and gift_card types; prohibited for discount.

percent_offoptionalnumber

Percentage taken off every item's total. Only valid for the discount type; exactly one of percent_off or amount_off must be provided.

amount_offoptionalinteger

Fixed amount taken off every item's total, in the minor units of the shop's base currency โ€” the same convention coupons use. It is converted to the subscription's currency at billing time. Only valid for the discount type; exactly one of percent_off or amount_off must be provided.

durationoptionalstring

How long the custom discount lasts. once applies it to the next invoice only and is then discarded; forever re-applies it on every renewal. Required for the discount type; prohibited for coupon and gift_card (a coupon carries its own duration).

Possible values: once, forever.

idRequiredinteger

Metadata ID

valuesRequiredobject[]

Array of metadata values

plan_idoptionalinteger

The plan (a subscription product's child) this line subscribes to; it must be a published, non-archived plan of your shop. Send exactly one of plan_id or variant_id per item; product_id is not accepted.

variant_idoptionalinteger

The one-time product this add-on sells: a variant, or the product itself when it has no variants. Send exactly one of plan_id or variant_id per item; product_id is not accepted.

durationoptionalinteger | null

Optional add-on duration. Only valid for one-time products; prohibited for subscription products.

Possible values: 1.

quantityRequiredinteger

Item quantity.

bundleoptionalSubscriptionBundleBody

Bundle configuration. Required when the item's product is a configurable bundle; only valid for subscription products.

preferencesoptionalobject[] | null

Survey answers for the item's product. Only valid for subscription products.

metadataoptionalobject[] | null

List of metadata and their values

discountsoptionalobject[]

Custom discount applied to this item alone. Only one per item; exactly one of percent_off or amount_off must be provided. It stacks with a subscription-level discount rather than replacing it: the item discount is applied first, then the subscription discount on the already discounted item total (see discounts). Only discount entries are accepted here โ€” coupons and gift cards (and their code field) can only be applied at the subscription level.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

createoptionalobject[]

Tag names to attach. A tag of this shop with that name is reused, otherwise a new one is created. Values must be distinct within the request.

deleteoptionalobject[]

Tags to detach. Each ID must be a tag of this shop.

idRequiredinteger

Metadata ID. Must be a metadata field of this shop.

valuesRequiredobject[]

Values of the field. Replaces all current values of the field. Only one value is allowed unless the field accepts multiple values.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idRequiredinteger

A subscription item of this subscription (not a one-time item), named at most once.

plan_idRequiredinteger

The plan the item moves to.

bundleoptionalSubscriptionBundleBody | null

The contents for a configurable bundle plan: items (product_id, quantity) and preferences (metafield_id, values). null is the same as leaving bundle out.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

question_idRequiredinteger
answersRequiredobject[]
idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
subscription_idinteger
plan_idinteger | null

The item's plan on a subscription item; null on a one_time item.

variant_idinteger | null

The item's one-time product on a one_time item; null on a subscription item.

product_idintegerDeprecated

Deprecated alias of whichever of plan_id or variant_id is set.

productVariant | null

Expandable link to the variant. Archived products are still returned.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

Whether this item is a one-time add-on (true) rather than a recurring subscription item (false).

originstring | null

What put the item on the subscription: coupon for an item gifted by a coupon; pre_purchase, mid_purchase or post_purchase for an item accepted from a funnel offer at that checkout step; null for an item added directly.

Possible values: coupon, pre_purchase, mid_purchase, post_purchase.

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

Bundle configuration for this item. null for one-time add-on items.

discountsDiscount[]

Every discount on the item: the custom one, whose coupon_id is null, and on an item gifted by a coupon the coupon's discount. Apply and remove them with POST and DELETE /subscriptions/{subscription_id}/items/{item_id}/discounts.

metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
subscription_idinteger
plan_idinteger | null

The item's plan on a subscription item; null on a one_time item.

variant_idinteger | null

The item's one-time product on a one_time item; null on a subscription item.

product_idintegerDeprecated

Deprecated alias of whichever of plan_id or variant_id is set.

productVariant | null

Expandable link to the variant. Archived products are still returned.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

Whether this item is a one-time add-on (true) rather than a recurring subscription item (false).

originstring | null

What put the item on the subscription: coupon for an item gifted by a coupon; pre_purchase, mid_purchase or post_purchase for an item accepted from a funnel offer at that checkout step; null for an item added directly.

Possible values: coupon, pre_purchase, mid_purchase, post_purchase.

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

Bundle configuration for this item. null for one-time add-on items.

discountsDiscount[]

Every discount on the item: the custom one, whose coupon_id is null, and on an item gifted by a coupon the coupon's discount. Apply and remove them with POST and DELETE /subscriptions/{subscription_id}/items/{item_id}/discounts.

metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idRequiredinteger

Metadata ID. Must be a metadata field of this shop.

valuesRequiredobject[]

Values of the field. Replaces all current values of the field. Only one value is allowed unless the field accepts multiple values.

idinteger
subscription_idinteger
plan_idinteger | null

The item's plan on a subscription item; null on a one_time item.

variant_idinteger | null

The item's one-time product on a one_time item; null on a subscription item.

product_idintegerDeprecated

Deprecated alias of whichever of plan_id or variant_id is set.

productVariant | null

Expandable link to the variant. Archived products are still returned.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

Whether this item is a one-time add-on (true) rather than a recurring subscription item (false).

originstring | null

What put the item on the subscription: coupon for an item gifted by a coupon; pre_purchase, mid_purchase or post_purchase for an item accepted from a funnel offer at that checkout step; null for an item added directly.

Possible values: coupon, pre_purchase, mid_purchase, post_purchase.

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

Bundle configuration for this item. null for one-time add-on items.

discountsDiscount[]

Every discount on the item: the custom one, whose coupon_id is null, and on an item gifted by a coupon the coupon's discount. Apply and remove them with POST and DELETE /subscriptions/{subscription_id}/items/{item_id}/discounts.

metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

question_idRequiredinteger
answersRequiredobject[]
idinteger
subscription_idinteger
plan_idinteger | null

The item's plan on a subscription item; null on a one_time item.

variant_idinteger | null

The item's one-time product on a one_time item; null on a subscription item.

product_idintegerDeprecated

Deprecated alias of whichever of plan_id or variant_id is set.

productVariant | null

Expandable link to the variant. Archived products are still returned.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

Whether this item is a one-time add-on (true) rather than a recurring subscription item (false).

originstring | null

What put the item on the subscription: coupon for an item gifted by a coupon; pre_purchase, mid_purchase or post_purchase for an item accepted from a funnel offer at that checkout step; null for an item added directly.

Possible values: coupon, pre_purchase, mid_purchase, post_purchase.

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

Bundle configuration for this item. null for one-time add-on items.

discountsDiscount[]

Every discount on the item: the custom one, whose coupon_id is null, and on an item gifted by a coupon the coupon's discount. Apply and remove them with POST and DELETE /subscriptions/{subscription_id}/items/{item_id}/discounts.

metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

preferencesRequiredBundlePreferenceBody[] | null
itemsRequiredBundleItemBody[]
idinteger
subscription_idinteger
plan_idinteger | null

The item's plan on a subscription item; null on a one_time item.

variant_idinteger | null

The item's one-time product on a one_time item; null on a subscription item.

product_idintegerDeprecated

Deprecated alias of whichever of plan_id or variant_id is set.

productVariant | null

Expandable link to the variant. Archived products are still returned.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

Whether this item is a one-time add-on (true) rather than a recurring subscription item (false).

originstring | null

What put the item on the subscription: coupon for an item gifted by a coupon; pre_purchase, mid_purchase or post_purchase for an item accepted from a funnel offer at that checkout step; null for an item added directly.

Possible values: coupon, pre_purchase, mid_purchase, post_purchase.

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

Bundle configuration for this item. null for one-time add-on items.

discountsDiscount[]

Every discount on the item: the custom one, whose coupon_id is null, and on an item gifted by a coupon the coupon's discount. Apply and remove them with POST and DELETE /subscriptions/{subscription_id}/items/{item_id}/discounts.

metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

preferencesRequiredBundlePreferenceBody[] | null
itemsRequiredBundleItemBody[]
idinteger
subscription_idinteger
plan_idinteger | null

The item's plan on a subscription item; null on a one_time item.

variant_idinteger | null

The item's one-time product on a one_time item; null on a subscription item.

product_idintegerDeprecated

Deprecated alias of whichever of plan_id or variant_id is set.

productVariant | null

Expandable link to the variant. Archived products are still returned.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

Whether this item is a one-time add-on (true) rather than a recurring subscription item (false).

originstring | null

What put the item on the subscription: coupon for an item gifted by a coupon; pre_purchase, mid_purchase or post_purchase for an item accepted from a funnel offer at that checkout step; null for an item added directly.

Possible values: coupon, pre_purchase, mid_purchase, post_purchase.

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

Bundle configuration for this item. null for one-time add-on items.

discountsDiscount[]

Every discount on the item: the custom one, whose coupon_id is null, and on an item gifted by a coupon the coupon's discount. Apply and remove them with POST and DELETE /subscriptions/{subscription_id}/items/{item_id}/discounts.

metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
subscription_idinteger
plan_idinteger | null

The item's plan on a subscription item; null on a one_time item.

variant_idinteger | null

The item's one-time product on a one_time item; null on a subscription item.

product_idintegerDeprecated

Deprecated alias of whichever of plan_id or variant_id is set.

productVariant | null

Expandable link to the variant. Archived products are still returned.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

Whether this item is a one-time add-on (true) rather than a recurring subscription item (false).

originstring | null

What put the item on the subscription: coupon for an item gifted by a coupon; pre_purchase, mid_purchase or post_purchase for an item accepted from a funnel offer at that checkout step; null for an item added directly.

Possible values: coupon, pre_purchase, mid_purchase, post_purchase.

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

Bundle configuration for this item. null for one-time add-on items.

discountsDiscount[]

Every discount on the item: the custom one, whose coupon_id is null, and on an item gifted by a coupon the coupon's discount. Apply and remove them with POST and DELETE /subscriptions/{subscription_id}/items/{item_id}/discounts.

metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
subscription_idinteger
plan_idinteger | null

The item's plan on a subscription item; null on a one_time item.

variant_idinteger | null

The item's one-time product on a one_time item; null on a subscription item.

product_idintegerDeprecated

Deprecated alias of whichever of plan_id or variant_id is set.

productVariant | null

Expandable link to the variant. Archived products are still returned.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

Whether this item is a one-time add-on (true) rather than a recurring subscription item (false).

originstring | null

What put the item on the subscription: coupon for an item gifted by a coupon; pre_purchase, mid_purchase or post_purchase for an item accepted from a funnel offer at that checkout step; null for an item added directly.

Possible values: coupon, pre_purchase, mid_purchase, post_purchase.

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

Bundle configuration for this item. null for one-time add-on items.

discountsDiscount[]

Every discount on the item: the custom one, whose coupon_id is null, and on an item gifted by a coupon the coupon's discount. Apply and remove them with POST and DELETE /subscriptions/{subscription_id}/items/{item_id}/discounts.

metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
subscription_idinteger
plan_idinteger | null

The item's plan on a subscription item; null on a one_time item.

variant_idinteger | null

The item's one-time product on a one_time item; null on a subscription item.

product_idintegerDeprecated

Deprecated alias of whichever of plan_id or variant_id is set.

productVariant | null

Expandable link to the variant. Archived products are still returned.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

Whether this item is a one-time add-on (true) rather than a recurring subscription item (false).

originstring | null

What put the item on the subscription: coupon for an item gifted by a coupon; pre_purchase, mid_purchase or post_purchase for an item accepted from a funnel offer at that checkout step; null for an item added directly.

Possible values: coupon, pre_purchase, mid_purchase, post_purchase.

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

Bundle configuration for this item. null for one-time add-on items.

discountsDiscount[]

Every discount on the item: the custom one, whose coupon_id is null, and on an item gifted by a coupon the coupon's discount. Apply and remove them with POST and DELETE /subscriptions/{subscription_id}/items/{item_id}/discounts.

metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
customer_idinteger
customerCustomer | null

Expandable link to the customer

referred_byinteger | null
product_idinteger

The subscription's plan: the plan of its lowest-id subscription item. Re-synced when a subscription item is removed and when plans change through change_plans, items/{item_id}/change_plan or the deprecated product_id of PATCH /subscriptions/{subscription_id}.

productSubscriptionProduct | null

Expandable link to the product. Archived products are still returned.

quantityinteger | nullDeprecated

Deprecated. null for subscriptions with multiple subscription items. Use the per-item quantity on items[].

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the subscription's shipping address or pickup point object. Deleted addresses are still returned.

shipping_method_idinteger
shipping_methodobject | null

Shipping method payload with id, type (shipping_option, local_delivery or local_pickup) and a type-specific method object. Only returned when requested through expand[]=shipping_method; null otherwise.

shipping_carrier_idinteger | null

The carrier of a dynamic-rate shipping method; null for other methods.

shipping_carrier_servicestring | null

The carrier service code of a dynamic-rate shipping method; null for other methods.

billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address. Deleted addresses are still returned.

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method. Deleted payment methods are still returned.

currency_codestring
surveySubscriptionPreferencesDeprecated

Deprecated. Alias of preferences.

preferencesSubscriptionPreferences

Subscription survey preferences envelope. For subscriptions with multiple subscription items, items holds the per-item preferences and is authoritative; the top-level survey_id and data reflect the primary (first) subscription item only.

bundleSubscriptionBundleDeprecated

Deprecated. Empty for subscriptions with multiple subscription items. Use the per-item bundle on items[].

giftobject | null
commitment_term_total_paymentsinteger | null
cancel_at_end_of_commitmentboolean
next_payment_datestring

Format: date-time.

starts_atstring | null

Subscription start date, set when the customer chose a future start.

Format: date-time.

activeboolean

Whether the subscription is live. false once it has been cancelled, has expired or was switched to another subscription.

pausedboolean

Whether the subscription is paused.

paused_atstring | null

When the subscription was paused. null when it is not paused.

Format: date-time.

skipping_untilstring | null

Renewals are skipped until this date. A future value means a skip is running.

Format: date-time.

waiting_untilstring | null

The subscription waits to start until this date. A future value means it has not started yet.

Format: date-time.

past_dueboolean
successful_charges_countinteger

Number of successful charges.

charges_limitinteger | null
statusstring

The current status of the subscription. Possible values:

  • active: The subscription is currently active, and the user is being billed as per the plan's terms
  • trial: The subscription is in a trial period, and will automatically switch to an active status with billing at the start of the next renewal cycle
  • pre_order: The subscription has been created but will only be charged once the pre-order end date is reached
  • gift_waiting_to_start: A subscription that was gifted and is set to begin at a future date
  • cancelled: The subscription has been canceled and will not renew at the end of the current billing period
  • switched: The subscription has been switched to a different plan with purpose to reset subscription's order count
  • expired: The subscription has ended due to reaching its auto expire cycles

Possible values: active, trial, pre_order, gift_waiting_to_start, cancelled, switched, expired.

cancel_at_period_endboolean

Whether the subscription is set to cancel at the end of the current billing period.

cancellationsCancellation[]
discountsDiscount[]
addonsSubscriptionItem[]Deprecated

Deprecated. Contains only the one-time items (legacy add-ons). Use items for the full list.

itemsSubscriptionItem[]

The subscription's items: recurring subscription items and any one-time add-on items.

last_payment_atstring | null

Format: date-time.

unpaidboolean
cancellation_requestedboolean
cancelled_atstring | null

When the subscription was cancelled.

Format: date-time.

reactivated_atstring | null

When the subscription was last reactivated.

Format: date-time.

switched_atstring | null

When the subscription was switched to another subscription.

Format: date-time.

previous_subscription_idinteger | null

The subscription this one replaced through switch_plan.

auto_collectingboolean

Whether renewals are charged automatically. false waits for manually issued invoices.

metadataEntityMetadata[] | null
tagsstring[]

Names of the tags attached to the subscription. Always present; does not need to be requested via expand.

tags_metaTags

Tags with their IDs. Always present; does not need to be requested via expand.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.