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 customerCredit a customer's store credit balanceCreate a customer noteUpdate a customer noteDelete a customer noteCreate a customer addressUpdate a customer addressDelete a customer addressGet list of customer pickup infoCreate customer pickup infoUpdate customer pickup infoDelete customer pickup infoCreate a customer payment methodDelete a customer payment method
Subscription
    Get list of subscriptionsCreate a subscriptionGet subscription by IDCancel a subscriptionUndo cancellationCreate a subscription itemShow a subscription itemUpdate a subscription itemRemove a subscription itemUpdate a subscription item's preferencesUpdate a subscription item's bundleApply 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
    Get payment method by ID
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}
  • POST/subscriptions/{subscription_id}/cancel
  • DELETE/subscriptions/{subscription_id}/undo_cancellation
  • 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}/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.

Format: date-time.

created_at[lte]optionalstring

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

Format: date-time.

start_created_atoptionalstringDeprecated

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

Format: date-time.

end_created_atoptionalstringDeprecated

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

Format: date-time.

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.

expand[]optionalstring[]

List of relations to expand in the response.

Returnsobject

Subscriptions list response

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-01 00:00:00", "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-01 00:00:00" }, "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": [ { "id": 1, "value": "new" }, { "id": 2, "value": "featured" } ], "published": true, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00", "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, "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", "last_four": "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-01 00:00:00" }, "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-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "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-23 00:45:00", "end": "2023-04-23 00:45:00", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addons": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "items": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ] }

Create a subscription

POST /subscriptions

Create a subscription directly, without a checkout. No invoice is issued at creation time: an auto-collecting subscription is billed by the renewals engine once its starts_at date is due, while one with auto_collecting: false waits for manually issued invoices. A subscription created with a future starts_at is returned with status: active and a future next_payment_date โ€” there is no distinct "scheduled" status. Only gifts are distinguished, as gift_waiting_to_start. To tell whether a subscription has started yet, compare starts_at to the current time rather than reading status.

Query parameters

expand[]optionalstring[]

List of relations to expand in the response.

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). 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.

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.

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; see the endpoint description.

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. Item types are derived from the products: subscription products create subscription items (all of them must share one billing plan), one-time products create one_time add-on items. At least one subscription product is required.

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. Nothing is created.

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": "recipient_email" }, "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": [ { "product_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-01 00:00:00", "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-01 00:00:00" }, "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": [ { "id": 1, "value": "new" }, { "id": 2, "value": "featured" } ], "published": true, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00", "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, "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", "last_four": "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-01 00:00:00" }, "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-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "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-23 00:45:00", "end": "2023-04-23 00:45:00", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addons": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "items": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Get subscription by ID

GET /subscriptions/{subscription_id}

A detailed description of the subscription.

Path parameters

subscription_idRequiredinteger

Subscription ID

Format: integer.

ReturnsSubscription

Subscription object response

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-01 00:00:00", "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-01 00:00:00" }, "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": [ { "id": 1, "value": "new" }, { "id": 2, "value": "featured" } ], "published": true, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00", "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, "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", "last_four": "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-01 00:00:00" }, "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-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "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-23 00:45:00", "end": "2023-04-23 00:45:00", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addons": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "items": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

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

curl -X POST https://api.subbly.co/private/v1/subscriptions/{subscription_id}/cancel \ -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-01 00:00:00", "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-01 00:00:00" }, "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": [ { "id": 1, "value": "new" }, { "id": 2, "value": "featured" } ], "published": true, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00", "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, "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", "last_four": "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-01 00:00:00" }, "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-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "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-23 00:45:00", "end": "2023-04-23 00:45:00", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addons": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "items": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

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

curl -X DELETE https://api.subbly.co/private/v1/subscriptions/{subscription_id}/undo_cancellation
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-01 00:00:00", "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-01 00:00:00" }, "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": [ { "id": 1, "value": "new" }, { "id": 2, "value": "featured" } ], "published": true, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00", "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, "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", "last_four": "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-01 00:00:00" }, "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-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "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-23 00:45:00", "end": "2023-04-23 00:45:00", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addons": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "items": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Create a subscription item

POST /subscriptions/{subscription_id}/items

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

Path parameters

subscription_idRequiredinteger

Subscription ID

Query parameters

expand[]optionalstring[]

List of relations to expand (e.g. product, bundle, discounts, metadata)

Request body

Create a subscription item

ReturnsSubscriptionItem

Subscription item object response

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, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }, "duration": 1, "quantity": 1, "addon": true, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

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 (e.g. product, bundle, discounts, metadata)

ReturnsSubscriptionItem

Subscription item object response

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, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }, "duration": 1, "quantity": 1, "addon": true, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Update a subscription item

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

Update a subscription item's quantity, duration and/or product. duration is only valid for one-time items. plan_id switches the item's product (product_id is the deprecated name of the same field): for one_time items any one-time product is accepted; for subscription items the product must share the subscription's billing plan and must not be a configurable bundle (use the item bundle endpoint for configurable bundles). Quantity cannot be changed on a coupon-issued item.

Path parameters

subscription_idRequiredinteger

Subscription ID

item_idRequiredinteger

Subscription item ID

Query parameters

expand[]optionalstring[]

List of relations to expand (e.g. product, bundle, discounts, metadata)

Request body

Update a subscription item

quantityoptionalinteger

Item quantity. Cannot be changed on a coupon-issued item.

durationoptionalinteger | null

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

Possible values: 1.

plan_idoptionalinteger

Switch the item's product, and the current name of this field. For one_time items any valid one-time product is accepted. For subscription items the product must share the subscription's billing plan and must not be a configurable bundle. Send at most one of plan_id or the deprecated product_id; a payload carrying both is rejected.

product_idoptionalintegerDeprecated

Deprecated alias of plan_id, still accepted. Send plan_id instead.

ReturnsSubscriptionItem

Subscription item object response

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, "plan_id": 1, "product_id": 1 }'
Response
{ "id": 1, "subscription_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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }, "duration": 1, "quantity": 1, "addon": true, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

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.

This endpoint is concurrency limited to a single in-flight request per API key. Overlapping requests respond 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 (e.g. product, discounts, metadata)

ReturnsSubscription

Subscription object response

Error responses

400object

The last remaining subscription item cannot be removed. Cancel the subscription instead.

429object

Too many concurrent requests. Only one removal may be in flight per API key at a time; retry once the previous request has completed.

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-01 00:00:00", "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-01 00:00:00" }, "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": [ { "id": 1, "value": "new" }, { "id": 2, "value": "featured" } ], "published": true, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00", "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, "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", "last_four": "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-01 00:00:00" }, "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-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "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-23 00:45:00", "end": "2023-04-23 00:45:00", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addons": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "items": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

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 (e.g. product, bundle, discounts, metadata)

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

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, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }, "duration": 1, "quantity": 1, "addon": true, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Update a subscription item's bundle

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

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.

Path parameters

subscription_idRequiredinteger

Subscription ID

item_idRequiredinteger

Subscription item ID

Query parameters

expand[]optionalstring[]

List of relations to expand (e.g. product, bundle, discounts, metadata)

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. Cannot be changed on a coupon-issued item.

product_idoptionalinteger

Optional target product for this item. Must share the subscription's billing plan and be a configurable bundle. When omitted the item keeps its current product.

ReturnsSubscriptionItem

Subscription item object response

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, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }, "duration": 1, "quantity": 1, "addon": true, "preferences": { "version": 2, "survey_id": 1, "data": [ {} ] }, "bundle": { "preferences": [ {} ], "items": [ {} ] }, "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

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), or 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.

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; a coupon that does not belong to the shop, or is no longer redeemable, fails with The selected coupon does not exist. or The selected coupon is not valid., and an unsupported type with The selected type is invalid.

  • 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-01 00:00:00", "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-01 00:00:00" }, "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": [ { "id": 1, "value": "new" }, { "id": 2, "value": "featured" } ], "published": true, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00", "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, "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", "last_four": "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-01 00:00:00" }, "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-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "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-23 00:45:00", "end": "2023-04-23 00:45:00", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addons": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "items": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

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

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-01 00:00:00", "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-01 00:00:00" }, "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": [ { "id": 1, "value": "new" }, { "id": 2, "value": "featured" } ], "published": true, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00", "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, "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", "last_four": "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-01 00:00:00" }, "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-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "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-23 00:45:00", "end": "2023-04-23 00:45:00", "extra_feedback": "extra_feedback", "reason_submitted_on": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "discounts": [ { "id": 1, "customer_id": 1, "amount_off": 1, "percent_off": 1, "coupon_id": 1, "coupon": {}, "start": "2023-04-23 00:45:00", "end": "2023-04-23 00:45:00", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addons": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "items": [ { "id": 1, "subscription_id": 1, "product_id": 1, "product": {}, "duration": 1, "quantity": 1, "addon": true, "preferences": {}, "bundle": {}, "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "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-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }
paginationobject
dataSubscription[]
messageoptionalstring | null

Gift message.

orders_limitoptionalinteger | null

Number of orders after which the gift ends.

recipient_emailoptionalstring | null

Gift recipient email. Required when the shop collects gift recipient emails.

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

product_idRequiredinteger

The item's product id.

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. Takes precedence over a subscription-level discount for this item. 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
productSubscriptionProduct | null

Expandable link to the product

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

shipping_method_idinteger
billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method

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.

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

Format: date-time.

unpaidboolean
cancellation_requestedboolean
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
productSubscriptionProduct | null

Expandable link to the product

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

shipping_method_idinteger
billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method

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.

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

Format: date-time.

unpaidboolean
cancellation_requestedboolean
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
productSubscriptionProduct | null

Expandable link to the product

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

shipping_method_idinteger
billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method

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.

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

Format: date-time.

unpaidboolean
cancellation_requestedboolean
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
productSubscriptionProduct | null

Expandable link to the product

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

shipping_method_idinteger
billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method

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.

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

Format: date-time.

unpaidboolean
cancellation_requestedboolean
metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
subscription_idinteger
product_idinteger
productVariant | null

Expandable link to the variant.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

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

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

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

discountsDiscount[]
metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
subscription_idinteger
product_idinteger
productVariant | null

Expandable link to the variant.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

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

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

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

discountsDiscount[]
metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
subscription_idinteger
product_idinteger
productVariant | null

Expandable link to the variant.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

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

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

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

discountsDiscount[]
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
productSubscriptionProduct | null

Expandable link to the product

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

shipping_method_idinteger
billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method

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.

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

Format: date-time.

unpaidboolean
cancellation_requestedboolean
metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

question_idRequiredinteger
answersRequiredobject[]
idinteger
subscription_idinteger
product_idinteger
productVariant | null

Expandable link to the variant.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

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

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

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

discountsDiscount[]
metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

preferencesRequiredBundlePreferenceBody[] | null
itemsRequiredBundleItemBody[]
idinteger
subscription_idinteger
product_idinteger
productVariant | null

Expandable link to the variant.

durationinteger | null

Possible values: 1.

quantityinteger
addonboolean

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

preferencesSubscriptionItemPreferences

Survey preferences snapshot for a single subscription item.

bundleSubscriptionBundle | null

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

discountsDiscount[]
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
productSubscriptionProduct | null

Expandable link to the product

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

shipping_method_idinteger
billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method

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.

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

Format: date-time.

unpaidboolean
cancellation_requestedboolean
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
productSubscriptionProduct | null

Expandable link to the product

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

shipping_method_idinteger
billing_address_idinteger
billing_addressAddress | null

Expandable link to the subscription's billing address

payment_method_idinteger
payment_methodPaymentMethod | null

Expandable link to the subscription's default payment method

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.

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

Format: date-time.

unpaidboolean
cancellation_requestedboolean
metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.