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

Product

Private Product API endpoints

Endpoints
  • GET/products
  • GET/products/{product_id}
  • GET/variants/{variant_id}
  • PUT/variants/{variant_id}
  • GET/plans/{plan_id}
  • PUT/plans/{plan_id}
  • POST/products/subscription
  • PUT/products/subscription/{product_id}
  • POST/products/subscription/{product_id}/publish
  • POST/products/subscription/{product_id}/unpublish
  • POST/products/subscription/{product_id}/archive
  • POST/products/subscription/{product_id}/metadata
  • POST/products/one_time
  • PUT/products/one_time/{product_id}
  • POST/products/one_time/{product_id}/publish
  • POST/products/one_time/{product_id}/unpublish
  • POST/products/one_time/{product_id}/archive
  • POST/products/one_time/{product_id}/metadata
  • POST/variants
  • POST/variants/{variant_id}/archive
  • POST/variants/batch
  • POST/plans
  • POST/plans/{plan_id}/archive

Get list of products

GET /products

An API endpoint to get list of products. The private API can access both published and unpublished products. Archived products and products that belong to a bundle are never returned, so bundle_id and bundle are always null here. Child records (variants and plans) are excluded as well; fetch those with expand[]. Results are ordered by id descending unless sort is supplied. expand[]: Relations to expand. Accepted values: variants (one-time products), plans and pricings (subscription products), and bundle. Dot notation expands nested relations of those, for example variants.bundle_plan or plans.parent. images, tags, options and metadata are always included and need not be requested. Unknown values are ignored.

Query parameters

pageoptionalinteger

Page number for pagination

Defaults to 1.

per_pageoptionalinteger

Items per page

Defaults to 10.

typeoptionalstring

Filter by product type

Possible values: one_time, subscription.

ids[]optionalinteger[]

Filter by product IDs. Values must be unique.

tags[]optionalstring[]

Filter by tags. Values must be unique.

slugs[]optionalstring[]

Filter by product slugs. Values must be unique.

publishedoptionalboolean

Filter by published status

digitaloptionalboolean

Filter by digital products

gift_cardoptionalboolean

Filter by gift card products

expand[]optionalstring[]

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

sort[field]optionalstring

Field to sort by. Required whenever any sort[...] key is present, so sending sort[direction] on its own returns 422. Send sort as an object (sort[field]=name), never as a scalar. When sort is omitted the list is ordered by id descending.

Possible values: id, name.

sort[direction]optionalstring

Sort direction; defaults to asc.

Possible values: asc, desc.

Defaults to "asc".

Returnsobject

Products list response

Error responses

422object

A query parameter fails validation. type is not one_time or subscription; ids[], tags[] or slugs[] is not an array of unique values (ids[] integers, tags up to 255 characters, slugs up to 80); published, digital or gift_card is not a boolean; page is below 1; per_page is outside 1 to 100; sort is not an object, sort[field] is missing or not id or name, or sort[direction] is not asc or desc; or expand is not an array.

curl https://api.subbly.co/private/v1/products \ -H 'X-API-KEY: <api-key>'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "options": [ { "id": 1, "name": "Size", "values": [ "Medium" ] } ] } ] }

Get product by ID

GET /products/{product_id}

A detailed description of the product. The private API can access both published and unpublished products. expand[]: Relations to expand. Accepted values: variants (one-time products), plans and pricings (subscription products), and bundle. Dot notation expands nested relations of those, for example variants.bundle_plan or plans.parent. images, tags, options and metadata are always included and need not be requested. Unknown values are ignored.

Path parameters

product_idRequiredinteger

Product ID

Query parameters

expand[]optionalstring[]

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

ReturnsOneTimeProduct | SubscriptionProduct

Product object response

Error responses

400object

The product belongs to another shop, or is archived.

404object

No product exists with this ID, or the ID belongs to a variant or plan rather than a parent product.

curl https://api.subbly.co/private/v1/products/{product_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "options": [ { "id": 1, "name": "Size", "values": [ "Medium" ] } ] }

Get variant by ID

GET /variants/{variant_id}

Get a specific variant by ID. This endpoint is only for one-time product variants. Accepted expand values are parent, product and bundle_plan; without them those fields are null. options, attributes, metadata, stock_count and price_schema are always included and need no expand. Unrecognised expand values are ignored.

Path parameters

variant_idRequiredinteger

Variant ID

Query parameters

expand[]optionalstring[]

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

ReturnsVariant

Variant object response

Error responses

400object

The variant is archived (entity_archived).

404object

No product exists with this ID, the ID belongs to a parent product or a subscription plan rather than a one-time variant, or the variant belongs to another shop.

422object

expand is not an array.

curl https://api.subbly.co/private/v1/variants/{variant_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "bundle_plan_id": 1, "bundle_plan": { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "price_scheme": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "parent": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "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": [ {} ] } ], "attributes": [ { "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": [ {} ] } ], "options": [ { "id": 1, "name": "Size", "value": "Medium" } ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Update variant

PUT /variants/{variant_id}

Path parameters

variant_idRequiredinteger

Variant ID

Request body

nameoptionalstring | null

Required when the parent product is a gift card and the variant has no name yet.

priceoptionalinteger
descriptionoptionalstring | null
inventory_item_idoptionalinteger | null

Prohibited for gift card products.

optionsoptionalobject | null

Prohibited for gift card products. A product cannot have more than 3 distinct option types in total, counting option types already used by its variants.

ReturnsVariant

Variant object response

Error responses

400object

The variant or its parent product is archived (entity_archived).

404object

No product exists with this ID, the ID belongs to a parent product or a subscription plan rather than a one-time variant, or the variant belongs to another shop.

422object

A body field fails validation. name is over 255 characters, or is sent empty for a gift card variant that has no name yet; price is not a non-negative integer; inventory_item_id is not a non-archived inventory item of the shop; options.create has more than 3 entries or an entry without name or value; an options.update entry has no id or value. On gift card products inventory_item_id and options are prohibited ('Inventory item is not available for gift card products.', 'Options are not available for gift card products.'). Other messages: 'A product cannot have more than 3 option types.', "Option type '' does not exist on this product." and 'This option does not belong to this variant.'

curl -X PUT https://api.subbly.co/private/v1/variants/{variant_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "price": 0, "description": "description", "inventory_item_id": 1, "options": { "create": [ { "name": "name", "value": "value" } ], "update": [ { "id": 1, "value": "value" } ] } }'
Response
{ "id": 1, "bundle_plan_id": 1, "bundle_plan": { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "price_scheme": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "parent": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "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": [ {} ] } ], "attributes": [ { "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": [ {} ] } ], "options": [ { "id": 1, "name": "Size", "value": "Medium" } ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Get plan by ID

GET /plans/{plan_id}

Get a specific plan by ID. This endpoint is only for subscription product plans that are not part of a bundle; use GET /bundles/{bundle_id}/plans/{plan_id} for those. Archived plans are not returned. Expandable relations: parent, product and bundle_plan. Shippings, survey, stock_count, metadata and price_schema are always included.

Path parameters

plan_idRequiredinteger

Plan ID

Query parameters

expand[]optionalstring[]

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

ReturnsPlan

Plan object response

Error responses

400object

The plan is archived (entity_archived), or its product belongs to a bundle (product_in_bundle).

404object

No product exists with this ID, the ID belongs to a parent product or a one-time variant rather than a subscription plan, or the plan belongs to another shop.

422object

expand is not an array, or one of its values is not a string.

curl https://api.subbly.co/private/v1/plans/{plan_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "bundle_plan_id": 1, "bundle_plan": { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "price_scheme": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "parent": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ { "id": 1, "shipping_at": "2022-04-01T00:00:00.000000Z", "add_count": 1, "add_unit": "month", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "survey": { "id": 1, "title": "What is your favorite color?", "questions": [ {} ], "single_step": true, "multiply_price_by_shipment_number": true, "appearance_type": "before_cart", "customizations": {}, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Update plan

PUT /plans/{plan_id}

Path parameters

plan_idRequiredinteger

Plan ID

Request body

nameoptionalstring | null
priceoptionalinteger

Price in cents. Cannot be changed if the plan has active subscriptions.

cut_off_daysoptionalinteger | null

Required when the plan's shipment schedule is anchored (entries with unit_day), and prohibited when it is not. If shipment_schedule is sent in the same request, that value decides; otherwise the stored schedule does.

cut_off_timeoptionalstring | null

Format HH:mm. Defaults to "23:59" when cut_off_days is sent without it. Rejected for digital products, for non-anchored shipment schedules, and when the shop's subscription plan does not include the cut-off-time feature.

charge_immediatelyoptionalinteger

Prohibited for digital products. Must be 1 when the plan is ad-hoc (no rebilling_day, rebilling_day_of_month or rebilling_day_of_week stored). Required whenever ship_immediately is sent.

Possible values: 0, 1.

ship_immediatelyoptionalinteger

Required whenever charge_immediately is sent. Cannot be 1 while charge_immediately is 0, and cannot be set to 0 while the plan has buffer_days; send buffer_days as null in the same request to clear it.

Possible values: 0, 1.

buffer_daysoptionalinteger | null

Only settable when the plan has exactly one shipment schedule entry, counted from shipment_schedule if sent in the same request, otherwise from the plan's stored schedule.

trial_priceoptionalinteger | null

Prohibited when the parent product has a pre-order end date, and prohibited for anchored plans (plans with a stored rebilling_day* value).

trial_length_daysoptionalinteger | null

Prohibited when the parent product has a pre-order end date, and prohibited for anchored plans (plans with a stored rebilling_day* value).

trial_single_orderoptionalinteger

Prohibited for digital products. Setting it to 1 also requires an ad-hoc plan with a trial length (sent or already stored) and no pre-order end date.

Possible values: 0, 1.

commitment_billing_countoptionalinteger | null

Only available when the shop's subscription plan includes commitment billing.

charges_limitoptionalinteger | null
shipment_scheduleoptionalobject[]

Prohibited for digital products. All entries must use the same format, and each entry must supply exactly one of the two pairs: buffered (add_unit + add_count) or anchored (unit_day + unit_offset). The buffered pair is prohibited while the plan's schedule is anchored.

survey_idoptionalinteger | null

ID of a survey belonging to the authenticated shop.

ReturnsPlan

Plan object response

Error responses

400object

The plan or its product is archived (entity_archived), or the product belongs to a bundle (product_in_bundle).

404object

No product exists with this ID, the ID belongs to a parent product or a one-time variant rather than a subscription plan, or the plan belongs to another shop.

422object

A body field fails validation. Common cases: price changes while the plan has active subscriptions ('The price field cannot be changed while there are active subscriptions.'); cut_off_days is sent for a non-anchored shipment schedule, is empty for an anchored one, or is out of range; cut_off_time is not HH:mm, or is sent for a digital product, a non-anchored schedule, or a shop whose plan lacks the cut-off-time feature; charge_immediately is not 1 on an ad-hoc plan or is sent for a digital product; ship_immediately is 1 while charge_immediately is 0, or is 0 while buffer days are set; buffer_days is out of range, is set while ship immediately is off, or is set with more than one shipment entry; trial fields are sent on an anchored plan or a pre-order product; commitment_billing_count is sent without the plan feature; shipment_schedule is sent for a digital product, mixes anchored and buffered entries, or has values out of range; survey_id is not a survey of the shop.

curl -X PUT https://api.subbly.co/private/v1/plans/{plan_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "price": 0, "cut_off_days": 0, "cut_off_time": "23:59", "charge_immediately": 0, "ship_immediately": 0, "buffer_days": 0, "trial_price": 0, "trial_length_days": 0, "trial_single_order": 0, "commitment_billing_count": 1, "charges_limit": 1, "shipment_schedule": [ { "add_unit": "day", "add_count": 1, "unit_day": 1, "unit_offset": 1 } ], "survey_id": 1 }'
Response
{ "id": 1, "bundle_plan_id": 1, "bundle_plan": { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "price_scheme": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "parent": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ { "id": 1, "shipping_at": "2022-04-01T00:00:00.000000Z", "add_count": 1, "add_unit": "month", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "survey": { "id": 1, "title": "What is your favorite color?", "questions": [ {} ], "single_step": true, "multiply_price_by_shipment_number": true, "appearance_type": "before_cart", "customizations": {}, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Create subscription product

POST /products/subscription

Request body

nameRequiredstring
slugRequiredstring

Letters, digits, dashes and underscores only. Must be unique among the shop's products; a duplicate slug is rejected with 422.

digitaloptionalinteger

Possible values: 0, 1.

descriptionoptionalstring | null
delivery_infooptionalstring | null
gifting_enabledoptionalinteger | null

Not available for digital products: when digital is 1 the only accepted value is 0. Defaults to 0 when omitted.

Possible values: 0, 1.

pre_order_end_atoptionalstring | null

Date in Y-m-d form; must be today or later. Must be omitted when digital is 1; pre-order is not available for digital products.

Format: date.

setup_feeoptionalinteger | null
pause_enabledoptionalinteger

Disabling pause (0) requires the optional-pause feature on the shop's plan. Shops without it may only send 1. Defaults to 1 when omitted.

Possible values: 0, 1.

collect_shipping_addressoptionalinteger | null

Only digital products (digital: 1) may send 0. For physical products the only accepted value is 1. Defaults to 1 for physical products and 0 for digital ones when omitted.

Possible values: 0, 1.

tax_product_codeoptionalstring | null

US-based shops only. Sending a non-empty value from a shop in any other country is rejected with 422.

inventory_item_idoptionalinteger | null

Must reference a non-archived inventory item belonging to the shop.

funnel_idoptionalinteger | null

Must reference a non-deleted funnel belonging to the shop.

tagsoptionalobject
imagesoptionalobject | null

ReturnsSubscriptionProduct

Subscription product created

Error responses

422object

A body field fails validation. name or slug is missing; slug has characters other than letters, digits, dashes and underscores, is over 80 characters, or is already used by a product of the shop; gifting_enabled is 1 on a digital product ('Gifting is not available for digital products.'); pre_order_end_at is not Y-m-d, is before today, or is sent for a digital product; pause_enabled is 0 and the shop plan lacks optional pause; collect_shipping_address is 0 on a physical product ('Collect shipping address is only available for digital products.'); tax_product_code is sent by a shop outside the US ('Tax product code is only available for US-based shops.'); inventory_item_id or funnel_id does not belong to the shop; tags.create values repeat or are over 255 characters; or images.create has more than 5 entries or an entry without a valid url.

curl -X POST https://api.subbly.co/private/v1/products/subscription \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "slug": "slug", "digital": 0, "description": "description", "delivery_info": "delivery_info", "gifting_enabled": 0, "pre_order_end_at": "2026-06-01", "setup_fee": 0, "pause_enabled": 0, "collect_shipping_address": 0, "tax_product_code": "tax_product_code", "inventory_item_id": 1, "funnel_id": 1, "tags": { "create": [ { "value": "value" } ] }, "images": { "create": [ { "url": "url", "order": 0 } ] } }'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "plans": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Update subscription product

PUT /products/subscription/{product_id}

Path parameters

product_idRequiredinteger

Product ID

Request body

nameoptionalstring
slugoptionalstring

Letters, digits, dashes and underscores only. Must be unique among the shop's other products; a duplicate slug is rejected with 422.

descriptionoptionalstring | null
delivery_infooptionalstring | null
gifting_enabledoptionalinteger

Must be omitted for digital products; sending any value, including 0, on a digital product is rejected with 422.

Possible values: 0, 1.

pre_order_end_atoptionalstring | null

Date in Y-m-d form; must be today or later. Must be omitted for digital products. Rejected with 422 when any active plan of this product has a trial; remove the trial first, or send null to clear the pre-order date.

Format: date.

setup_feeoptionalinteger | null
pause_enabledoptionalinteger

Disabling pause (0) requires the optional-pause feature on the shop's plan. Shops without it may only send 1.

Possible values: 0, 1.

collect_shipping_addressoptionalinteger

Only accepted as 0 when the product is digital. For a physical product the only accepted value is 1.

Possible values: 0, 1.

tax_product_codeoptionalstring | null

US-based shops only. Sending a non-empty value from a shop in any other country is rejected with 422.

inventory_item_idoptionalinteger | null

Must reference a non-archived inventory item belonging to the shop.

funnel_idoptionalinteger | null

Must reference a non-deleted funnel belonging to the shop.

change_product_collection_idoptionalinteger | null

ID of the product collection used for cross-product plan switching. Must be a non-archived collection of the shop whose type is 'subscription' or unset.

tagsoptionalobject
imagesoptionalobject

ReturnsSubscriptionProduct

Subscription product updated

Error responses

400object

The product is archived (entity_archived) or belongs to a bundle (product_in_bundle).

404object

No product exists with this ID, the ID is not a subscription product (for example a one-time product, a variant or a plan), or the product belongs to another shop.

422object

A body field fails validation. slug has characters other than letters, digits, dashes and underscores, is over 80 characters, or is used by another product of the shop; gifting_enabled or pre_order_end_at is sent for a digital product; pre_order_end_at is not Y-m-d, is before today, or is set while an active plan has a trial ('One of your plans has a trial enabled. Remove the trial from your plan or pre-order end date first.'); pause_enabled is not 1 and the shop plan lacks optional pause ('Pause is not available on your current plan.'); collect_shipping_address is not 1 on a physical product; tax_product_code is sent by a shop outside the US; inventory_item_id, funnel_id, change_product_collection_id, tags.delete[].id, images.update[].id or images.delete[].id does not belong to the shop or product; tags.create values repeat or are over 255 characters; or images.create has more than 5 entries or an entry without a valid url.

curl -X PUT https://api.subbly.co/private/v1/products/subscription/{product_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "slug": "slug", "description": "description", "delivery_info": "delivery_info", "gifting_enabled": 0, "pre_order_end_at": "2026-06-01", "setup_fee": 0, "pause_enabled": 0, "collect_shipping_address": 0, "tax_product_code": "tax_product_code", "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tags": { "create": [ { "value": "value" } ], "delete": [ { "id": 1 } ] }, "images": { "create": [ { "url": "url", "order": 0 } ], "update": [ { "id": 1, "order": 0 } ], "delete": [ { "id": 1 } ] } }'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "plans": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Publish subscription product

POST /products/subscription/{product_id}/publish

Fails with 400 when the product is archived or part of a bundle, when name or slug is missing, when it has no active plans, or when a physical product has a plan without shipping options.

Path parameters

product_idRequiredinteger

Product ID

ReturnsSubscriptionProduct

Subscription product published

Error responses

400object

The product is archived (entity_archived), belongs to a bundle (product_in_bundle), has no name or slug (missing_required_fields), has no active plans (no_active_children), or is a physical product with an active plan that has no shipment schedule (missing_shippings).

404object

No product exists with this ID, the ID is not a subscription product (for example a one-time product, a variant or a plan), or the product belongs to another shop.

curl -X POST https://api.subbly.co/private/v1/products/subscription/{product_id}/publish \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "plans": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Unpublish subscription product

POST /products/subscription/{product_id}/unpublish

Fails with 400 when the product is archived or part of a bundle.

Path parameters

product_idRequiredinteger

Product ID

ReturnsSubscriptionProduct

Subscription product unpublished

Error responses

400object

The product is archived (entity_archived) or belongs to a bundle (product_in_bundle).

404object

No product exists with this ID, the ID is not a subscription product (for example a one-time product, a variant or a plan), or the product belongs to another shop.

curl -X POST https://api.subbly.co/private/v1/products/subscription/{product_id}/unpublish \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "plans": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Archive subscription product

POST /products/subscription/{product_id}/archive

Fails with 400 when the product is already archived, is part of a bundle, or still has active subscriptions.

Path parameters

product_idRequiredinteger

Product ID

ReturnsSubscriptionProduct

Subscription product archived

Error responses

400object

The product is already archived (entity_archived), belongs to a bundle (product_in_bundle), or still has active subscriptions on its plans (product_has_active_subscriptions).

404object

No product exists with this ID, the ID is not a subscription product (for example a one-time product, a variant or a plan), or the product belongs to another shop.

curl -X POST https://api.subbly.co/private/v1/products/subscription/{product_id}/archive \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "plans": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Sync subscription product metadata

POST /products/subscription/{product_id}/metadata

Attaches and detaches metadata on the product. The product must not be archived and must not belong to a bundle; either case returns 400 (entity_archived, product_in_bundle). Values attached to or detached from a parent product are also applied to all of its active variants.

Path parameters

product_idRequiredinteger

Product ID

Request body

Metadata sync request body

metadataRequiredobject

ReturnsSubscriptionProduct

Subscription product metadata synced

Error responses

400object

The product is archived (entity_archived) or belongs to a bundle (product_in_bundle).

404object

No product exists with this ID, the ID is not a subscription product (for example a one-time product, a variant or a plan), or the product belongs to another shop.

422object

The body fails validation. metadata is missing or not an object; a metadata.create entry has no name or values, a name over 255 characters, a description over 500 characters, or values that do not match the data type of the shop's existing attribute with that name; a metadata.delete entry has no attribute_id, names an attribute that is not in the shop ('The attribute does not exist.'), or lists value IDs that repeat ('The value IDs must be unique.') or are not attached to the product ('delete.values.: This value is not attached to the entity.').

curl -X POST https://api.subbly.co/private/v1/products/subscription/{product_id}/metadata \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "metadata": { "create": [ { "name": "name", "description": "description", "values": [ "values" ] } ], "delete": [ { "attribute_id": 1, "values": [ 1 ] } ] } }'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "plans": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "metadata": [ {} ], "survey": {}, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Create one-time product

POST /products/one_time

Request body

nameRequiredstring
slugRequiredstring

Letters, digits, dashes and underscores only. Must be unique among the shop's products.

gift_cardoptionalinteger

Possible values: 0, 1.

digitaloptionalinteger

Must be omitted when gift_card is 1; gift cards are always digital. Sending both fields returns a validation error.

Possible values: 0, 1.

descriptionoptionalstring | null
delivery_infooptionalstring | null

Must be omitted when digital or gift_card is 1; delivery info is not available for digital products.

gift_card_expirationoptionalinteger | null

Gift card expiration in months. Only allowed when gift_card is 1; sending it for a non-gift-card product returns a validation error.

gifting_enabledoptionalinteger

Must be omitted when digital or gift_card is 1; gifting is not available for digital products. Null is not accepted. Defaults to 0.

Possible values: 0, 1.

collect_shipping_addressoptionalinteger | null

Only digital products (digital or gift_card = 1) may send 0. For physical products the only accepted value is 1. Defaults to 1 for physical products and 0 for digital ones.

Possible values: 0, 1.

funnel_idoptionalinteger | null
tax_product_codeoptionalstring | null

Only available for US-based shops. Shops in any other country must omit this field entirely.

tagsoptionalobject
imagesoptionalobject | null

ReturnsOneTimeProduct

One-time product created

Error responses

400object

gift_card is 1 and the shop plan does not include gift cards (feature_not_available).

422object

A body field fails validation. name or slug is missing; slug has characters other than letters, digits, dashes and underscores, is over 80 characters, or is already used by a product of the shop; digital is sent with gift_card ('Digital flag cannot be set for gift card products.'); gift_card_expiration is sent for a product that is not a gift card ('Gift card expiration is only available for gift card products.') or is outside 1 to 36; delivery_info or gifting_enabled is sent for a digital or gift card product; collect_shipping_address is 0 on a physical product ('Collect shipping address is only available for digital products.'); tax_product_code is sent by a shop outside the US ('Tax product code is only available for US-based shops.'); funnel_id is not a funnel of the shop; tags.create values repeat or are over 255 characters; or images.create has more than 5 entries or an entry without a valid url.

curl -X POST https://api.subbly.co/private/v1/products/one_time \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "slug": "slug", "gift_card": 0, "digital": 0, "description": "description", "delivery_info": "delivery_info", "gift_card_expiration": 1, "gifting_enabled": 0, "collect_shipping_address": 0, "funnel_id": 1, "tax_product_code": "tax_product_code", "tags": { "create": [ { "value": "value" } ] }, "images": { "create": [ { "url": "url", "order": 0 } ] } }'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "options": [ { "id": 1, "name": "Size", "values": [ "Medium" ] } ] }

Update one-time product

PUT /products/one_time/{product_id}

Returns 400 when the product is already archived (entity_archived) or belongs to a bundle (product_in_bundle). The id must refer to a one-time product owned by the authenticated shop.

Path parameters

product_idRequiredinteger

Product ID

Request body

nameoptionalstring
slugoptionalstring

Letters, digits, dashes and underscores only. Must be unique among the shop's products (this product excluded).

descriptionoptionalstring | null
delivery_infooptionalstring | null

Must be omitted when the stored product is digital (digital = true in the response).

gift_card_expirationoptionalinteger | null

Gift card expiration in months. Only allowed when the stored product is a gift card (gift_card = true in the response).

gifting_enabledoptionalinteger

Must be omitted when the stored product is digital (digital = true in the response).

Possible values: 0, 1.

collect_shipping_addressoptionalinteger

0 is accepted only when the stored product is digital (digital = true in the response). For physical products the only accepted value is 1.

Possible values: 0, 1.

positionoptionalinteger
funnel_idoptionalinteger | null
tax_product_codeoptionalstring | null

Only available for US-based shops. Shops in any other country must omit this field entirely.

tagsoptionalobject
imagesoptionalobject

ReturnsOneTimeProduct

One-time product updated

Error responses

400object

The product is archived (entity_archived) or belongs to a bundle (product_in_bundle).

404object

No product exists with this ID, the ID is not a one-time product (for example a subscription product, a variant or a plan), or the product belongs to another shop.

422object

A body field fails validation. slug has characters other than letters, digits, dashes and underscores, is over 80 characters, or is used by another product of the shop; delivery_info or gifting_enabled is sent for a digital product ('Delivery info is not available for digital products.', 'Gifting is not available for digital products.'); gift_card_expiration is sent for a product that is not a gift card or is outside 1 to 36; position is below 1; collect_shipping_address is not 1 on a physical product; tax_product_code is sent by a shop outside the US; funnel_id, tags.delete[].id, images.update[].id or images.delete[].id does not belong to the shop or product; tags.create values repeat or are over 255 characters; or images.create has more than 5 entries or an entry without a valid url.

curl -X PUT https://api.subbly.co/private/v1/products/one_time/{product_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "slug": "slug", "description": "description", "delivery_info": "delivery_info", "gift_card_expiration": 1, "gifting_enabled": 0, "collect_shipping_address": 0, "position": 1, "funnel_id": 1, "tax_product_code": "tax_product_code", "tags": { "create": [ { "value": "value" } ], "delete": [ { "id": 1 } ] }, "images": { "create": [ { "url": "url", "order": 0 } ], "update": [ { "id": 1, "order": 0 } ], "delete": [ { "id": 1 } ] } }'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "options": [ { "id": 1, "name": "Size", "values": [ "Medium" ] } ] }

Publish one-time product

POST /products/one_time/{product_id}/publish

Preconditions, each returning 400: the product must have a name and a slug (missing_required_fields), it must have at least one non-archived variant (no_active_children), it must not be archived (entity_archived) and it must not belong to a bundle (product_in_bundle). Gift card products also require the gift_cards feature on the shop.

Path parameters

product_idRequiredinteger

Product ID

ReturnsOneTimeProduct

One-time product published

Error responses

400object

The product is archived (entity_archived), belongs to a bundle (product_in_bundle), has no name or slug (missing_required_fields), has no active variants (no_active_children), or is a gift card and the shop plan does not include gift cards (feature_not_available).

404object

No product exists with this ID, the ID is not a one-time product (for example a subscription product, a variant or a plan), or the product belongs to another shop.

curl -X POST https://api.subbly.co/private/v1/products/one_time/{product_id}/publish \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "options": [ { "id": 1, "name": "Size", "values": [ "Medium" ] } ] }

Unpublish one-time product

POST /products/one_time/{product_id}/unpublish

Returns 400 when the product is already archived (entity_archived) or belongs to a bundle (product_in_bundle). The id must refer to a one-time product owned by the authenticated shop.

Path parameters

product_idRequiredinteger

Product ID

ReturnsOneTimeProduct

One-time product unpublished

Error responses

400object

The product is archived (entity_archived) or belongs to a bundle (product_in_bundle).

404object

No product exists with this ID, the ID is not a one-time product (for example a subscription product, a variant or a plan), or the product belongs to another shop.

curl -X POST https://api.subbly.co/private/v1/products/one_time/{product_id}/unpublish \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "options": [ { "id": 1, "name": "Size", "values": [ "Medium" ] } ] }

Archive one-time product

POST /products/one_time/{product_id}/archive

Returns 400 when the product is already archived (entity_archived, so archive is not idempotent) or belongs to a bundle (product_in_bundle). The id must refer to a one-time product owned by the authenticated shop.

Path parameters

product_idRequiredinteger

Product ID

ReturnsOneTimeProduct

One-time product archived

Error responses

400object

The product is already archived (entity_archived) or belongs to a bundle (product_in_bundle).

404object

No product exists with this ID, the ID is not a one-time product (for example a subscription product, a variant or a plan), or the product belongs to another shop.

curl -X POST https://api.subbly.co/private/v1/products/one_time/{product_id}/archive \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "options": [ { "id": 1, "name": "Size", "values": [ "Medium" ] } ] }

Sync one-time product metadata

POST /products/one_time/{product_id}/metadata

Attaches and detaches metadata on the product. The product must not be archived and must not belong to a bundle; either case returns 400 (entity_archived, product_in_bundle). Values attached to or detached from a parent product are also applied to all of its active variants.

Path parameters

product_idRequiredinteger

Product ID

Request body

Metadata sync request body

metadataRequiredobject

ReturnsOneTimeProduct

One-time product metadata synced

Error responses

400object

The product is archived (entity_archived) or belongs to a bundle (product_in_bundle).

404object

No product exists with this ID, the ID is not a one-time product (for example a subscription product, a variant or a plan), or the product belongs to another shop.

422object

The body fails validation. metadata is missing or not an object; a metadata.create entry has no name or values, a name over 255 characters, a description over 500 characters, or values that do not match the data type of the shop's existing attribute with that name; a metadata.delete entry has no attribute_id, names an attribute that is not in the shop ('The attribute does not exist.'), or lists value IDs that repeat ('The value IDs must be unique.') or are not attached to the product ('delete.values.: This value is not attached to the entity.').

curl -X POST https://api.subbly.co/private/v1/products/one_time/{product_id}/metadata \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "metadata": { "create": [ { "name": "name", "description": "description", "values": [ "values" ] } ], "delete": [ { "attribute_id": 1, "values": [ 1 ] } ] } }'
Response
{ "id": 1, "bundle_id": 1, "bundle": { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "configurable": true, "images": [ {} ], "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ {} ], "plans": [ {} ], "preferences": [ {} ], "filters": [ {} ], "discounts": [ {} ], "prices": [ {} ], "tags": [ "new", "bundle" ], "tags_meta": [], "setup_fee": 500, "gifting_enabled": false, "pause_enabled": false, "pre_order_end_at": "2024-12-31", "funnel_id": 1, "change_product_collection_id": 1, "collect_shipping_address": true, "published": true, "items_count": 5, "plans_count": 2, "rulesets_count": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "bundle_ruleset_id": 1, "bundle_ruleset": { "id": 1, "name": "Ruleset Name", "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "products": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "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": [ { "id": 1, "url": "https://cdn.filestackcontent.com/security=p:<policy>,s:<signature>/resize=w:1000,h:1000,fit:max/output=format:png/quality=v:70/AaBbCcDdEeFf", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "published": true, "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "price_scheme": {}, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "options": [ { "id": 1, "name": "Size", "values": [ "Medium" ] } ] }

Create variant

POST /variants

Creates a variant on a one-time product. The parent product must not be archived. A product is limited to 125 variants. Only one variant without options is allowed per product, so once a product has any variant, further variants must supply options.create (gift card products are exempt).

Request body

product_idRequiredinteger

Parent one-time product ID

nameoptionalstring | null

Required when product is a gift card or when no options are provided.

priceRequiredinteger

Price in cents

descriptionoptionalstring | null
inventory_item_idoptionalinteger | null

Prohibited for gift card products.

optionsoptionalobject | null

Prohibited for gift card products. A product cannot have more than 3 distinct option types in total, counting option types already used by its variants.

ReturnsVariant

Variant object response

Error responses

400object

The product is archived (entity_archived), already has 125 variants counting archived ones (max_children_exceeded), or already has a variant and this request sends no options.create (single_variant_without_options; gift cards are exempt).

404object

product_id is missing, no product exists with it, it is not a one-time parent product, or it belongs to another shop.

422object

A body field fails validation. name is missing when the product is a gift card or no options.create is sent, or is over 255 characters; price is missing or not a non-negative integer; inventory_item_id is not a non-archived inventory item of the shop; options.create has more than 3 entries or an entry without name or value; the option names differ from those the product's variants already use ('Variant options must match the product's existing options: .'); the product would pass 3 option types ('A product cannot have more than 3 option types.'). On gift card products inventory_item_id and options are prohibited.

curl -X POST https://api.subbly.co/private/v1/variants \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "product_id": 1, "name": "name", "price": 0, "description": "description", "inventory_item_id": 1, "options": { "create": [ { "name": "name", "value": "value" } ] } }'
Response
{ "id": 1, "bundle_plan_id": 1, "bundle_plan": { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "price_scheme": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "parent": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "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": [ {} ] } ], "attributes": [ { "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": [ {} ] } ], "options": [ { "id": 1, "name": "Size", "value": "Medium" } ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Archive variant

POST /variants/{variant_id}/archive

Archives a one-time product variant. Fails if the variant is already archived, or if it is the parent product's last non-archived variant, because a product must keep at least one active variant.

Path parameters

variant_idRequiredinteger

Variant ID

ReturnsVariant

Variant object response

Error responses

400object

The variant is already archived (entity_archived), or it is the product's last active variant (last_active_child).

404object

No product exists with this ID, the ID belongs to a parent product or a subscription plan rather than a one-time variant, or the variant belongs to another shop.

curl -X POST https://api.subbly.co/private/v1/variants/{variant_id}/archive \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "bundle_plan_id": 1, "bundle_plan": { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "price_scheme": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "parent": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "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": [ {} ] } ], "attributes": [ { "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": [ {} ] } ], "options": [ { "id": 1, "name": "Size", "value": "Medium" } ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Batch create/update/archive variants

POST /variants/batch

Creates, updates and archives variants of a one-time product in one call. Not available for gift card products, and the product must not be archived. The maxItems: 100 cap applies per list; in addition, the product's variant count after the batch (existing + created - archived) must not exceed 125.

Request body

product_idRequiredinteger
generate_inventoryoptionalboolean

Defaults to false.

inventory_group_idoptionalinteger | null

Must be a non-deleted inventory item group belonging to your shop.

inventory_stock_countoptionalinteger

Defaults to 0.

createoptionalobject[]

Every entry must use the same set of option names, and that set must match the option names already used by the product's existing variants (case-insensitive). A product cannot have more than 3 distinct option types in total. An entry with no options.create must supply name.

updateoptionalobject[]

Within each entry, options.create[].name must already be an option type on the product, since new option types cannot be introduced here, and options.update[].id must be an option that belongs to the product.

archiveoptionalobject[]

Returnsobject

Batch operation result

Error responses

400object

The product is a gift card (operation_not_allowed_for_gift_cards), is archived (entity_archived), or would have more than 125 variants after the batch, counting archived ones (max_children_exceeded).

404object

product_id is missing, no product exists with it, it is not a one-time parent product, or it belongs to another shop.

422object

A body field fails validation. create, update or archive has more than 100 entries; inventory_group_id is not an inventory group of the shop; inventory_stock_count is negative; a create entry has no price or no non-empty options.create, or more than 3 options; an update or archive entry's id is not a variant of this product; an inventory_item_id is not a non-archived inventory item of the shop; option names do not match the product's option set, or the product would pass 3 option types ('A product cannot have more than 3 option types.'). Messages from these batch rules start with the entry path, for example 'update.0.options.update.0.id: This option does not belong to this product.'

curl -X POST https://api.subbly.co/private/v1/variants/batch \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "product_id": 1, "generate_inventory": false, "inventory_group_id": 1, "inventory_stock_count": 0, "create": [ { "name": "name", "description": "description", "price": 0, "inventory_item_id": 1, "options": { "create": [ { "name": "name", "value": "value" } ] } } ], "update": [ { "id": 1, "name": "name", "description": "description", "price": 0, "inventory_item_id": 1, "options": { "create": [ { "name": "name", "value": "value" } ], "update": [ { "id": 1, "value": "value" } ] } } ], "archive": [ { "id": 1 } ] }'
Response
{ "create": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "price_scheme": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "parent": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "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": [ {} ] } ], "attributes": [ { "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": [ {} ] } ], "options": [ { "id": 1, "name": "Size", "value": "Medium" } ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "update": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "price_scheme": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "parent": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "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": [ {} ] } ], "attributes": [ { "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": [ {} ] } ], "options": [ { "id": 1, "name": "Size", "value": "Medium" } ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "delete": [ { "id": 1, "bundle_plan_id": 1, "bundle_plan": { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "price_scheme": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "parent": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "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": [ {} ] } ], "attributes": [ { "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": [ {} ] } ], "options": [ { "id": 1, "name": "Size", "value": "Medium" } ], "stock_count": 100, "published": true, "inventory_item_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Create plan

POST /plans

Request body

product_idRequiredinteger

Parent subscription product ID

frequency_unitRequiredstring

Possible values: day, week, month.

frequency_countRequiredinteger

Minimum 1, but minimum 2 when rebilling_day is set together with frequency_unit=day.

nameoptionalstring | null
priceoptionalinteger

Price in cents

anchor_dateoptionalstring | null

Accepts a date (Y-m-d) or the string "today", which resolves to the current date. Only allowed for non-digital products whose shipment_schedule uses the anchored format (entries with unit_day). Required when a rebilling_day* field is set and frequency_unit=day.

Format: date.

rebilling_dayoptionalinteger

Only the value 1 is accepted. Allowed for non-digital products with frequency_unit=day only. Mutually exclusive with rebilling_day_of_week and rebilling_day_of_month. Do not send null; omit the field instead.

Possible values: 1.

rebilling_day_of_monthoptionalinteger

Mutually exclusive with the other two rebilling_day* fields. Requires a non-digital product and frequency_unit=month, and must agree with anchor_date when one is supplied. Do not send null; omit the field instead.

rebilling_day_of_weekoptionalinteger

Mutually exclusive with the other two rebilling_day* fields. Requires a non-digital product and frequency_unit=week, and must agree with anchor_date when one is supplied. Do not send null; omit the field instead.

cut_off_daysoptionalinteger | null

Only allowed when shipment_schedule uses the anchored format (entries with unit_day). Required when a rebilling_day* field is set.

cut_off_timeoptionalstring | null

Format HH:mm. Defaults to "23:59" when cut_off_days is sent without it. Rejected for digital products, for non-anchored shipment schedules, and when the shop's subscription plan does not include the cut-off-time feature.

charge_immediatelyoptionalinteger

Prohibited for digital products. Must be 1 for ad-hoc plans (plans with no rebilling_day, rebilling_day_of_month or rebilling_day_of_week). Required whenever ship_immediately is sent. Defaults to 1 when omitted.

Possible values: 0, 1.

ship_immediatelyoptionalinteger

Required whenever charge_immediately is sent, and cannot be 1 while charge_immediately is 0. Defaults to 0 when omitted.

Possible values: 0, 1.

buffer_daysoptionalinteger | null
trial_priceoptionalinteger | null

Prohibited when the parent product has a pre-order end date, and prohibited for anchored plans (plans that set any rebilling_day* field).

trial_length_daysoptionalinteger | null

Prohibited when the parent product has a pre-order end date, and prohibited for anchored plans (plans that set any rebilling_day* field).

trial_single_orderoptionalinteger

Prohibited for digital products. Setting it to 1 also requires an ad-hoc plan with trial_length_days set and no pre-order end date on the parent product.

Possible values: 0, 1.

commitment_billing_countoptionalinteger | null

Only available when the shop's subscription plan includes commitment billing; otherwise the request is rejected.

charges_limitoptionalinteger | null
shipment_scheduleoptionalobject[]

Required when the parent product is not digital, and prohibited when it is digital. All entries must use the same format: either every entry is buffered (add_unit + add_count) or every entry is anchored (unit_day + unit_offset). Mixing formats is rejected.

survey_idoptionalinteger | null

ID of a survey belonging to the authenticated shop.

ReturnsPlan

Plan object response

Error responses

400object

The product belongs to a bundle (product_in_bundle) or is archived (entity_archived).

404object

product_id is missing, no product exists with it, it is not a subscription parent product, or it belongs to another shop.

422object

A body field fails validation. Common cases: frequency_unit or frequency_count is missing or out of range (day is not allowed for anchored plans without anchor_date); anchor_date is sent without an anchored shipment schedule or for a digital product, is missing for a daily anchored plan, or is outside its allowed window; more than one rebilling_day* field is sent ('Only one rebilling day type can be set at a time.'), or one does not fit the frequency or the anchor date; cut_off_days is missing for an anchored billing plan, is sent without an anchored schedule, or is out of range; cut_off_time is not HH:mm, or is not allowed for the product, schedule or shop plan; charge_immediately is not 1 on an ad-hoc plan ('Charge immediately must be enabled for ad-hoc billing plans.') or is sent for a digital product; ship_immediately is 1 while charge_immediately is 0; buffer_days is out of range or set while ship immediately is off; trial fields are sent on an anchored plan or a pre-order product; commitment_billing_count is sent without the plan feature; shipment_schedule is missing for a physical product, sent for a digital one, mixes anchored and buffered entries, or has values out of range; survey_id is not a survey of the shop.

curl -X POST https://api.subbly.co/private/v1/plans \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "product_id": 1, "frequency_unit": "day", "frequency_count": 1, "name": "name", "price": 0, "anchor_date": "2026-01-15", "rebilling_day": 1, "rebilling_day_of_month": 1, "rebilling_day_of_week": 1, "cut_off_days": 0, "cut_off_time": "23:59", "charge_immediately": 0, "ship_immediately": 0, "buffer_days": 0, "trial_price": 0, "trial_length_days": 0, "trial_single_order": 0, "commitment_billing_count": 1, "charges_limit": 1, "shipment_schedule": [ { "add_unit": "day", "add_count": 1, "unit_day": 1, "unit_offset": 1 } ], "survey_id": 1 }'
Response
{ "id": 1, "bundle_plan_id": 1, "bundle_plan": { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "price_scheme": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "parent": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ { "id": 1, "shipping_at": "2022-04-01T00:00:00.000000Z", "add_count": 1, "add_unit": "month", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "survey": { "id": 1, "title": "What is your favorite color?", "questions": [ {} ], "single_step": true, "multiply_price_by_shipment_number": true, "appearance_type": "before_cart", "customizations": {}, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Archive plan

POST /plans/{plan_id}/archive

Archive a subscription product plan. The plan must belong to a subscription product that is not part of a bundle (use POST /bundles/{bundle_id}/plans/{plan_id}/archive for those), must not already be archived, must not be the parent product's last active plan, and must have no active subscriptions attached.

Path parameters

plan_idRequiredinteger

Plan ID

ReturnsPlan

Plan object response

Error responses

400object

The plan is already archived (entity_archived), its product belongs to a bundle (product_in_bundle), it is the product's last active plan (last_active_child), or it has active subscriptions (plan_has_active_subscriptions).

404object

No product exists with this ID, the ID belongs to a parent product or a one-time variant rather than a subscription plan, or the plan belongs to another shop.

curl -X POST https://api.subbly.co/private/v1/plans/{plan_id}/archive \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "bundle_plan_id": 1, "bundle_plan": { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "price_scheme": { "id": 1, "type": "flat_price", "amount": 799, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "parent": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [], "published": true, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "setup_fee": 1, "pre_order_end_at": "2024-06-01", "pause_enabled": true, "inventory_item_id": 1, "funnel_id": 1, "change_product_collection_id": 1, "tax_product_code": "tax_product_code", "plans_count": 3, "pricings": [ {} ], "plans": [ {} ] }, "frequency_unit": "month", "frequency_count": 1, "anchored": true, "anchor_date": "2022-04-01", "rebilling_day": 1, "rebilling_day_of_week": 1, "rebilling_day_of_month": 1, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "23:59", "cut_off_days": 0, "buffer_days": 0, "stock_count": 100, "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ { "id": 1, "shipping_at": "2022-04-01T00:00:00.000000Z", "add_count": 1, "add_unit": "month", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "metadata": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "variant": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "survey": { "id": 1, "title": "What is your favorite color?", "questions": [ {} ], "single_step": true, "multiply_price_by_shipment_number": true, "appearance_type": "before_cart", "customizations": {}, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "commitment_billing_count": 0, "charges_limit": 0, "plan_hash": "a1b2c3d4", "published": true, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }
paginationobject
data(OneTimeProduct | SubscriptionProduct)[]
idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

gift_cardboolean
gift_card_expirationinteger | null
funnel_idinteger | null
tax_product_codestring | null
variants_countinteger
variantsVariant[] | null

Expandable list of variants representing unique variations of the product. Each variant is a combination of one or more options. For example, Size and Color.

optionsProductOptionGroup[] | null

List of all available options for this product.

idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

setup_feeinteger | null
pre_order_end_atstring | null

Format: date.

pause_enabledboolean
inventory_item_idinteger | null
funnel_idinteger | null
change_product_collection_idinteger | null

ID of the product collection used for cross-product plan switching.

tax_product_codestring | null
plans_countinteger
pricingsPlan[] | nullDeprecated

Expandable list of pricings representing unique subscription plans. Deprecated - use 'plans' instead.

plansPlan[] | null

Expandable list of plans representing unique subscription plans.

idinteger
bundle_plan_idinteger | null
bundle_planBundlePlan
namestring
descriptionstring | null
priceinteger
price_schemaPriceSchema
price_schemePriceSchemaDeprecated

Deprecated. Use price_schema instead.

parentOneTimeProduct | null

Expandable link to the parent product.

productOneTimeProduct | null

Expandable link to the parent product (alias for parent).

metadataEntityMetadata[] | null
attributesEntityMetadata[]Deprecated
optionsProductOption[]
stock_countinteger | null
publishedboolean
inventory_item_idinteger | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

createoptionalobject[]

Each name must already be an option type on the parent product; new option types cannot be introduced here.

updateoptionalobject[]

Each id must be an option that already belongs to this variant.

idinteger
bundle_plan_idinteger | null
bundle_planBundlePlan
namestring
descriptionstring | null
priceinteger
price_schemaPriceSchema
price_schemePriceSchemaDeprecated

Deprecated. Use price_schema instead.

parentOneTimeProduct | null

Expandable link to the parent product.

productOneTimeProduct | null

Expandable link to the parent product (alias for parent).

metadataEntityMetadata[] | null
attributesEntityMetadata[]Deprecated
optionsProductOption[]
stock_countinteger | null
publishedboolean
inventory_item_idinteger | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
bundle_plan_idinteger | null
bundle_planBundlePlan
namestring
pricing_namestring
descriptionstring | null
priceinteger
price_schemaPriceSchema
price_schemePriceSchemaDeprecated

Deprecated. Use price_schema instead.

parentSubscriptionProduct | null

Expandable link to the parent product.

productSubscriptionProduct | null

Expandable link to the parent product (alias for parent).

frequency_unitstring

Possible values: day, week, month.

frequency_countinteger
anchoredboolean
anchor_datestring | null

Format: date.

rebilling_dayinteger | null
rebilling_day_of_weekinteger | null
rebilling_day_of_monthinteger | null
trial_priceinteger | null
trial_lengthinteger | null
trial_single_orderboolean
charge_immediatelyboolean
ship_immediatelyboolean
rebilling_start_atstring | null

Format: date.

cut_off_atstring | null

Format: date.

cut_off_timestring | null

Time in HH:mm format

cut_off_daysinteger | null
buffer_daysinteger | null
stock_countinteger | null
setup_feeinteger | null
pre_order_end_atstring | null

Format: date.

shippingsProductShipping[]
metadataEntityMetadata[] | null
surveySurvey | null
commitment_billing_countinteger | null
charges_limitinteger | null
plan_hashstring | null

Hash identifying the plan's billing and shipping configuration.

publishedboolean
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

add_unitoptionalstring | null

Possible values: day, week, month.

add_countoptionalinteger | null
unit_dayoptionalinteger | null
unit_offsetoptionalinteger | null
idinteger
bundle_plan_idinteger | null
bundle_planBundlePlan
namestring
pricing_namestring
descriptionstring | null
priceinteger
price_schemaPriceSchema
price_schemePriceSchemaDeprecated

Deprecated. Use price_schema instead.

parentSubscriptionProduct | null

Expandable link to the parent product.

productSubscriptionProduct | null

Expandable link to the parent product (alias for parent).

frequency_unitstring

Possible values: day, week, month.

frequency_countinteger
anchoredboolean
anchor_datestring | null

Format: date.

rebilling_dayinteger | null
rebilling_day_of_weekinteger | null
rebilling_day_of_monthinteger | null
trial_priceinteger | null
trial_lengthinteger | null
trial_single_orderboolean
charge_immediatelyboolean
ship_immediatelyboolean
rebilling_start_atstring | null

Format: date.

cut_off_atstring | null

Format: date.

cut_off_timestring | null

Time in HH:mm format

cut_off_daysinteger | null
buffer_daysinteger | null
stock_countinteger | null
setup_feeinteger | null
pre_order_end_atstring | null

Format: date.

shippingsProductShipping[]
metadataEntityMetadata[] | null
surveySurvey | null
commitment_billing_countinteger | null
charges_limitinteger | null
plan_hashstring | null

Hash identifying the plan's billing and shipping configuration.

publishedboolean
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

createoptionalobject[]
createoptionalobject[]
idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

setup_feeinteger | null
pre_order_end_atstring | null

Format: date.

pause_enabledboolean
inventory_item_idinteger | null
funnel_idinteger | null
change_product_collection_idinteger | null

ID of the product collection used for cross-product plan switching.

tax_product_codestring | null
plans_countinteger
pricingsPlan[] | nullDeprecated

Expandable list of pricings representing unique subscription plans. Deprecated - use 'plans' instead.

plansPlan[] | null

Expandable list of plans representing unique subscription plans.

createoptionalobject[]
deleteoptionalobject[]
createoptionalobject[]
updateoptionalobject[]
deleteoptionalobject[]
idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

setup_feeinteger | null
pre_order_end_atstring | null

Format: date.

pause_enabledboolean
inventory_item_idinteger | null
funnel_idinteger | null
change_product_collection_idinteger | null

ID of the product collection used for cross-product plan switching.

tax_product_codestring | null
plans_countinteger
pricingsPlan[] | nullDeprecated

Expandable list of pricings representing unique subscription plans. Deprecated - use 'plans' instead.

plansPlan[] | null

Expandable list of plans representing unique subscription plans.

idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

setup_feeinteger | null
pre_order_end_atstring | null

Format: date.

pause_enabledboolean
inventory_item_idinteger | null
funnel_idinteger | null
change_product_collection_idinteger | null

ID of the product collection used for cross-product plan switching.

tax_product_codestring | null
plans_countinteger
pricingsPlan[] | nullDeprecated

Expandable list of pricings representing unique subscription plans. Deprecated - use 'plans' instead.

plansPlan[] | null

Expandable list of plans representing unique subscription plans.

idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

setup_feeinteger | null
pre_order_end_atstring | null

Format: date.

pause_enabledboolean
inventory_item_idinteger | null
funnel_idinteger | null
change_product_collection_idinteger | null

ID of the product collection used for cross-product plan switching.

tax_product_codestring | null
plans_countinteger
pricingsPlan[] | nullDeprecated

Expandable list of pricings representing unique subscription plans. Deprecated - use 'plans' instead.

plansPlan[] | null

Expandable list of plans representing unique subscription plans.

idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

setup_feeinteger | null
pre_order_end_atstring | null

Format: date.

pause_enabledboolean
inventory_item_idinteger | null
funnel_idinteger | null
change_product_collection_idinteger | null

ID of the product collection used for cross-product plan switching.

tax_product_codestring | null
plans_countinteger
pricingsPlan[] | nullDeprecated

Expandable list of pricings representing unique subscription plans. Deprecated - use 'plans' instead.

plansPlan[] | null

Expandable list of plans representing unique subscription plans.

createoptionalobject[] | null
deleteoptionalobject[] | null
idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

setup_feeinteger | null
pre_order_end_atstring | null

Format: date.

pause_enabledboolean
inventory_item_idinteger | null
funnel_idinteger | null
change_product_collection_idinteger | null

ID of the product collection used for cross-product plan switching.

tax_product_codestring | null
plans_countinteger
pricingsPlan[] | nullDeprecated

Expandable list of pricings representing unique subscription plans. Deprecated - use 'plans' instead.

plansPlan[] | null

Expandable list of plans representing unique subscription plans.

createoptionalobject[]
createoptionalobject[]
idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

gift_cardboolean
gift_card_expirationinteger | null
funnel_idinteger | null
tax_product_codestring | null
variants_countinteger
variantsVariant[] | null

Expandable list of variants representing unique variations of the product. Each variant is a combination of one or more options. For example, Size and Color.

optionsProductOptionGroup[] | null

List of all available options for this product.

createoptionalobject[]
deleteoptionalobject[]
createoptionalobject[]
updateoptionalobject[]
deleteoptionalobject[]
idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

gift_cardboolean
gift_card_expirationinteger | null
funnel_idinteger | null
tax_product_codestring | null
variants_countinteger
variantsVariant[] | null

Expandable list of variants representing unique variations of the product. Each variant is a combination of one or more options. For example, Size and Color.

optionsProductOptionGroup[] | null

List of all available options for this product.

idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

gift_cardboolean
gift_card_expirationinteger | null
funnel_idinteger | null
tax_product_codestring | null
variants_countinteger
variantsVariant[] | null

Expandable list of variants representing unique variations of the product. Each variant is a combination of one or more options. For example, Size and Color.

optionsProductOptionGroup[] | null

List of all available options for this product.

idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

gift_cardboolean
gift_card_expirationinteger | null
funnel_idinteger | null
tax_product_codestring | null
variants_countinteger
variantsVariant[] | null

Expandable list of variants representing unique variations of the product. Each variant is a combination of one or more options. For example, Size and Color.

optionsProductOptionGroup[] | null

List of all available options for this product.

idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

gift_cardboolean
gift_card_expirationinteger | null
funnel_idinteger | null
tax_product_codestring | null
variants_countinteger
variantsVariant[] | null

Expandable list of variants representing unique variations of the product. Each variant is a combination of one or more options. For example, Size and Color.

optionsProductOptionGroup[] | null

List of all available options for this product.

createoptionalobject[] | null
deleteoptionalobject[] | null
idinteger
bundle_idinteger | null
bundleBundle | null

Expandable link to the bundle.

bundle_ruleset_idinteger | null
bundle_rulesetBundleRuleset | null

Expandable link to the bundle ruleset.

slugstring
typestring

Possible values: one_time, subscription.

namestring
descriptionstring | null
delivery_infostring | null
collect_shipping_addressboolean
gifting_enabledboolean
digitalboolean
imagesProductImage[]
tagsstring[]
tags_metaTags

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

publishedboolean
metadataEntityMetadata[] | null

Expandable list of metadata for the product.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

gift_cardboolean
gift_card_expirationinteger | null
funnel_idinteger | null
tax_product_codestring | null
variants_countinteger
variantsVariant[] | null

Expandable list of variants representing unique variations of the product. Each variant is a combination of one or more options. For example, Size and Color.

optionsProductOptionGroup[] | null

List of all available options for this product.

createoptionalobject[]

If the product already has variants, the set of option names here must exactly match the option names those variants use (case-insensitive), with no extra and no missing option types.

idinteger
bundle_plan_idinteger | null
bundle_planBundlePlan
namestring
descriptionstring | null
priceinteger
price_schemaPriceSchema
price_schemePriceSchemaDeprecated

Deprecated. Use price_schema instead.

parentOneTimeProduct | null

Expandable link to the parent product.

productOneTimeProduct | null

Expandable link to the parent product (alias for parent).

metadataEntityMetadata[] | null
attributesEntityMetadata[]Deprecated
optionsProductOption[]
stock_countinteger | null
publishedboolean
inventory_item_idinteger | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
bundle_plan_idinteger | null
bundle_planBundlePlan
namestring
descriptionstring | null
priceinteger
price_schemaPriceSchema
price_schemePriceSchemaDeprecated

Deprecated. Use price_schema instead.

parentOneTimeProduct | null

Expandable link to the parent product.

productOneTimeProduct | null

Expandable link to the parent product (alias for parent).

metadataEntityMetadata[] | null
attributesEntityMetadata[]Deprecated
optionsProductOption[]
stock_countinteger | null
publishedboolean
inventory_item_idinteger | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

nameoptionalstring | null
descriptionoptionalstring | null
priceRequiredinteger
inventory_item_idoptionalinteger | null

Must be a non-archived inventory item belonging to your shop.

optionsRequiredobject
idRequiredinteger

Must be a variant of the product given in product_id.

nameoptionalstring | null
descriptionoptionalstring | null
priceoptionalinteger | null
inventory_item_idoptionalinteger | null

Must be a non-archived inventory item belonging to your shop.

optionsoptionalobject | null
idRequiredinteger

Must be a variant of the product given in product_id.

createVariant[]
updateVariant[]
deleteVariant[]
add_unitoptionalstring

Possible values: day, week, month.

add_countoptionalinteger
unit_dayoptionalinteger
unit_offsetoptionalinteger
idinteger
bundle_plan_idinteger | null
bundle_planBundlePlan
namestring
pricing_namestring
descriptionstring | null
priceinteger
price_schemaPriceSchema
price_schemePriceSchemaDeprecated

Deprecated. Use price_schema instead.

parentSubscriptionProduct | null

Expandable link to the parent product.

productSubscriptionProduct | null

Expandable link to the parent product (alias for parent).

frequency_unitstring

Possible values: day, week, month.

frequency_countinteger
anchoredboolean
anchor_datestring | null

Format: date.

rebilling_dayinteger | null
rebilling_day_of_weekinteger | null
rebilling_day_of_monthinteger | null
trial_priceinteger | null
trial_lengthinteger | null
trial_single_orderboolean
charge_immediatelyboolean
ship_immediatelyboolean
rebilling_start_atstring | null

Format: date.

cut_off_atstring | null

Format: date.

cut_off_timestring | null

Time in HH:mm format

cut_off_daysinteger | null
buffer_daysinteger | null
stock_countinteger | null
setup_feeinteger | null
pre_order_end_atstring | null

Format: date.

shippingsProductShipping[]
metadataEntityMetadata[] | null
surveySurvey | null
commitment_billing_countinteger | null
charges_limitinteger | null
plan_hashstring | null

Hash identifying the plan's billing and shipping configuration.

publishedboolean
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
bundle_plan_idinteger | null
bundle_planBundlePlan
namestring
pricing_namestring
descriptionstring | null
priceinteger
price_schemaPriceSchema
price_schemePriceSchemaDeprecated

Deprecated. Use price_schema instead.

parentSubscriptionProduct | null

Expandable link to the parent product.

productSubscriptionProduct | null

Expandable link to the parent product (alias for parent).

frequency_unitstring

Possible values: day, week, month.

frequency_countinteger
anchoredboolean
anchor_datestring | null

Format: date.

rebilling_dayinteger | null
rebilling_day_of_weekinteger | null
rebilling_day_of_monthinteger | null
trial_priceinteger | null
trial_lengthinteger | null
trial_single_orderboolean
charge_immediatelyboolean
ship_immediatelyboolean
rebilling_start_atstring | null

Format: date.

cut_off_atstring | null

Format: date.

cut_off_timestring | null

Time in HH:mm format

cut_off_daysinteger | null
buffer_daysinteger | null
stock_countinteger | null
setup_feeinteger | null
pre_order_end_atstring | null

Format: date.

shippingsProductShipping[]
metadataEntityMetadata[] | null
surveySurvey | null
commitment_billing_countinteger | null
charges_limitinteger | null
plan_hashstring | null

Hash identifying the plan's billing and shipping configuration.

publishedboolean
created_atstring

Format: date-time.

updated_atstring

Format: date-time.