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

Coupon

Private Coupon API endpoints

Endpoints
  • GET/coupons
  • POST/coupons
  • GET/coupons/{coupon_id}
  • PATCH/coupons/{coupon_id}
  • POST/coupons/{coupon_id}/archive

Get list of coupons

GET /coupons

An API endpoint to get a paginated list of coupons.

Query parameters

idsoptionalinteger[]

Filter by coupon IDs

queryoptionalstring

Search by coupon code or name

activeoptionalinteger

Filter by active status (0 or 1)

Possible values: 0, 1.

trashedoptionalinteger

Include soft-deleted coupons (0 or 1)

Possible values: 0, 1.

sort[field]optionalstring

Sort field

Possible values: id, name.

sort[direction]optionalstring

Sort direction; defaults to asc.

Possible values: asc, desc.

Defaults to "asc".

pageoptionalinteger

Page number

per_pageoptionalinteger

Items per page

expand[]optionalstring[]

List of relations to expand in the response.

Returnsobject

Coupons list response

curl https://api.subbly.co/private/v1/coupons \ -H 'X-API-KEY: <api-key>'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 1234, "coupon_id": "SAVE20", "name": "20% off", "duration": "once", "duration_in_months": 3, "remove_gifts_after_end_of_duration": false, "max_redemptions": 100, "times_redeemed": 5, "active": true, "limit_one_per_customer": false, "redeem_by": "2026-12-31 23:59:59", "valid": true, "condition": { "id": 10, "type": "product", "operator": "only", "products": [ {} ], "collections": [ {} ], "cart_value": { "min": 1, "max": 1 }, "cart_quantity": { "min": 1, "max": 1 } }, "discount": { "id": 20, "amount_off": 500, "percent_off": 20, "skip_payment_method": false, "first_shipment_only": false, "products": [ "389855", "389856" ], "products_operator": "only", "item_types": [ "subscription", "setup_fee" ] }, "gift": { "id": 30, "amount_off": 1, "percent_off": 100, "addon_duration": "once", "remove_products_after_coupon_detached": false, "products": [ {} ] }, "rules": { "emails": {}, "customers": {}, "subscriptions": {} }, "created_at": "2026-01-15T10:30:00Z", "updated_at": "2026-01-15T10:30:00Z", "deleted_at": "2026-01-15T10:30:00Z" } ] }

Create a coupon

POST /coupons

Create a new coupon. Must include either a discount or a gift (or both).

Query parameters

expand[]optionalstring[]

List of relations to expand in the response.

Request body

nameRequiredstring
coupon_codeRequiredstring

Unique coupon code within the shop

durationRequiredstring

Possible values: once, forever, multiple.

duration_in_monthsoptionalinteger

Required when duration is "multiple". Prohibited when duration is "once" or "forever".

remove_gifts_after_end_of_durationoptionalinteger

Possible values: 0, 1.

max_redemptionsoptionalinteger | null
limit_one_per_customeroptionalinteger

Possible values: 0, 1.

redeem_byoptionalstring | null

Expiry date in Y-m-dTH:i:s format, interpreted as UTC. Must be after tomorrow.

Format: date-time.

conditionoptionalobject | null

Coupon condition. Set to null for no condition.

discountoptionalobject | null

Discount action. Required if gift is not provided.

giftoptionalobject | null

Gift action. Required if discount is not provided.

rulesoptionalobject | null

Coupon restriction rules

ReturnsCoupon

Coupon created

curl -X POST https://api.subbly.co/private/v1/coupons \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "coupon_code": "coupon_code", "duration": "once", "duration_in_months": 1, "remove_gifts_after_end_of_duration": 0, "max_redemptions": 1, "limit_one_per_customer": 0, "redeem_by": "2026-12-31T23:59:59", "condition": { "type": "product", "operator": "any", "products": { "create": [ { "product_id": 1 } ] }, "collections": { "create": [ { "collection_id": 1 } ] }, "cart_value": { "min": 1, "max": 1 }, "cart_quantity": { "min": 1, "max": 1 } }, "discount": { "amount_off": 1, "percent_off": 1.5, "item_types": [ "subscription" ], "products": [ 1 ], "products_operator": "only", "skip_payment_method": 0, "first_shipment_only": 0 }, "gift": { "amount_off": 1, "percent_off": 1.5, "addon_duration": "once", "remove_products_after_coupon_detached": 0, "products": { "create": [ { "product_id": 1 } ] } }, "rules": { "emails": { "create": [ "customer@example.com" ] }, "customers": { "create": [ 1 ] }, "subscriptions": { "create": [ 1 ] } } }'
Response
{ "id": 1234, "coupon_id": "SAVE20", "name": "20% off", "duration": "once", "duration_in_months": 3, "remove_gifts_after_end_of_duration": false, "max_redemptions": 100, "times_redeemed": 5, "active": true, "limit_one_per_customer": false, "redeem_by": "2026-12-31 23:59:59", "valid": true, "condition": { "id": 10, "type": "product", "operator": "only", "products": [ {} ], "collections": [ {} ], "cart_value": { "min": 1, "max": 1 }, "cart_quantity": { "min": 1, "max": 1 } }, "discount": { "id": 20, "amount_off": 500, "percent_off": 20, "skip_payment_method": false, "first_shipment_only": false, "products": [ "389855", "389856" ], "products_operator": "only", "item_types": [ "subscription", "setup_fee" ] }, "gift": { "id": 30, "amount_off": 1, "percent_off": 100, "addon_duration": "once", "remove_products_after_coupon_detached": false, "products": [ {} ] }, "rules": { "emails": {}, "customers": {}, "subscriptions": {} }, "created_at": "2026-01-15T10:30:00Z", "updated_at": "2026-01-15T10:30:00Z", "deleted_at": "2026-01-15T10:30:00Z" }

Get coupon by ID

GET /coupons/{coupon_id}

Get a single coupon by its ID.

Path parameters

coupon_idRequiredinteger

Coupon ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response.

ReturnsCoupon

Coupon object response

curl https://api.subbly.co/private/v1/coupons/{coupon_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1234, "coupon_id": "SAVE20", "name": "20% off", "duration": "once", "duration_in_months": 3, "remove_gifts_after_end_of_duration": false, "max_redemptions": 100, "times_redeemed": 5, "active": true, "limit_one_per_customer": false, "redeem_by": "2026-12-31 23:59:59", "valid": true, "condition": { "id": 10, "type": "product", "operator": "only", "products": [ {} ], "collections": [ {} ], "cart_value": { "min": 1, "max": 1 }, "cart_quantity": { "min": 1, "max": 1 } }, "discount": { "id": 20, "amount_off": 500, "percent_off": 20, "skip_payment_method": false, "first_shipment_only": false, "products": [ "389855", "389856" ], "products_operator": "only", "item_types": [ "subscription", "setup_fee" ] }, "gift": { "id": 30, "amount_off": 1, "percent_off": 100, "addon_duration": "once", "remove_products_after_coupon_detached": false, "products": [ {} ] }, "rules": { "emails": {}, "customers": {}, "subscriptions": {} }, "created_at": "2026-01-15T10:30:00Z", "updated_at": "2026-01-15T10:30:00Z", "deleted_at": "2026-01-15T10:30:00Z" }

Update a coupon

PATCH /coupons/{coupon_id}

Partially update a coupon. All fields are optional.

Path parameters

coupon_idRequiredinteger

Coupon ID

Query parameters

expand[]optionalstring[]

List of relations to expand in the response.

Request body

nameoptionalstring
durationoptionalstring

Possible values: once, forever, multiple.

duration_in_monthsoptionalinteger

Required when duration is "multiple". Prohibited when duration is "once" or "forever".

remove_gifts_after_end_of_durationoptionalinteger

Possible values: 0, 1.

max_redemptionsoptionalinteger | null
limit_one_per_customeroptionalinteger

Possible values: 0, 1.

redeem_byoptionalstring | null

Expiry date in Y-m-dTH:i:s format, interpreted as UTC. Must be after tomorrow.

Format: date-time.

conditionoptionalobject | null

Set to null to remove the condition.

discountoptionalobject | null

Update discount settings.

giftoptionalobject | null

Update gift settings.

rulesoptionalobject | null

Update restriction rules. Omit a type to leave it unchanged.

ReturnsCoupon

Coupon updated

curl -X PATCH https://api.subbly.co/private/v1/coupons/{coupon_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "duration": "once", "duration_in_months": 1, "remove_gifts_after_end_of_duration": 0, "max_redemptions": 1, "limit_one_per_customer": 0, "redeem_by": "2026-12-31T23:59:59", "condition": { "type": "product", "operator": "any", "products": { "create": [ { "product_id": 1 } ], "delete": [ { "id": 1 } ] }, "collections": { "create": [ { "collection_id": 1 } ], "delete": [ { "id": 1 } ] }, "cart_value": { "min": 1, "max": 1 }, "cart_quantity": { "min": 1, "max": 1 } }, "discount": { "amount_off": 1, "percent_off": 1.5, "item_types": [ "subscription" ], "products": [ 1 ], "products_operator": "only", "skip_payment_method": 0, "first_shipment_only": 0 }, "gift": { "amount_off": 1, "percent_off": 1.5, "addon_duration": "once", "remove_products_after_coupon_detached": 0, "products": { "create": [ { "product_id": 1 } ], "delete": [ { "id": 1 } ] } }, "rules": { "emails": { "create": [ "customer@example.com" ], "delete": [ "customer@example.com" ] }, "customers": { "create": [ 1 ], "delete": [ 1 ] }, "subscriptions": { "create": [ 1 ], "delete": [ 1 ] } } }'
Response
{ "id": 1234, "coupon_id": "SAVE20", "name": "20% off", "duration": "once", "duration_in_months": 3, "remove_gifts_after_end_of_duration": false, "max_redemptions": 100, "times_redeemed": 5, "active": true, "limit_one_per_customer": false, "redeem_by": "2026-12-31 23:59:59", "valid": true, "condition": { "id": 10, "type": "product", "operator": "only", "products": [ {} ], "collections": [ {} ], "cart_value": { "min": 1, "max": 1 }, "cart_quantity": { "min": 1, "max": 1 } }, "discount": { "id": 20, "amount_off": 500, "percent_off": 20, "skip_payment_method": false, "first_shipment_only": false, "products": [ "389855", "389856" ], "products_operator": "only", "item_types": [ "subscription", "setup_fee" ] }, "gift": { "id": 30, "amount_off": 1, "percent_off": 100, "addon_duration": "once", "remove_products_after_coupon_detached": false, "products": [ {} ] }, "rules": { "emails": {}, "customers": {}, "subscriptions": {} }, "created_at": "2026-01-15T10:30:00Z", "updated_at": "2026-01-15T10:30:00Z", "deleted_at": "2026-01-15T10:30:00Z" }

Archive a coupon

POST /coupons/{coupon_id}/archive

Archive (deactivate) a coupon.

Path parameters

coupon_idRequiredinteger

Coupon ID

ReturnsCoupon

Coupon archived

curl -X POST https://api.subbly.co/private/v1/coupons/{coupon_id}/archive \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1234, "coupon_id": "SAVE20", "name": "20% off", "duration": "once", "duration_in_months": 3, "remove_gifts_after_end_of_duration": false, "max_redemptions": 100, "times_redeemed": 5, "active": true, "limit_one_per_customer": false, "redeem_by": "2026-12-31 23:59:59", "valid": true, "condition": { "id": 10, "type": "product", "operator": "only", "products": [ {} ], "collections": [ {} ], "cart_value": { "min": 1, "max": 1 }, "cart_quantity": { "min": 1, "max": 1 } }, "discount": { "id": 20, "amount_off": 500, "percent_off": 20, "skip_payment_method": false, "first_shipment_only": false, "products": [ "389855", "389856" ], "products_operator": "only", "item_types": [ "subscription", "setup_fee" ] }, "gift": { "id": 30, "amount_off": 1, "percent_off": 100, "addon_duration": "once", "remove_products_after_coupon_detached": false, "products": [ {} ] }, "rules": { "emails": {}, "customers": {}, "subscriptions": {} }, "created_at": "2026-01-15T10:30:00Z", "updated_at": "2026-01-15T10:30:00Z", "deleted_at": "2026-01-15T10:30:00Z" }
paginationobject
dataCoupon[]
typeRequiredstring

Possible values: product, cart_quantity, cart_value, collection.

operatorRequiredstring

Valid operators depend on type: product supports any/only/except; cart_quantity and cart_value support only 'any'.

Possible values: any, only, except.

productsoptionalobject | null

Required when operator is "only" or "except" and type is not "collection". Prohibited when operator is "any" or type is "collection".

collectionsoptionalobject | null

Required when type is "collection". Prohibited otherwise.

cart_valueoptionalobject | null

Prohibited when type is "product" or "cart_quantity".

cart_quantityoptionalobject | null

Prohibited when type is "product" or "cart_value".

amount_offoptionalinteger | null

Amount off in cents. Mutually exclusive with percent_off.

percent_offoptionalnumber | null

Percentage off (0-100). Mutually exclusive with amount_off.

item_typesoptionalstring[] | null
productsoptionalinteger[] | null

Product IDs to apply discount to

products_operatoroptionalstring | null

Required when products is provided

Possible values: only, except.

skip_payment_methodoptionalinteger

Possible values: 0, 1.

first_shipment_onlyoptionalinteger

Prohibited when amount_off is used

Possible values: 0, 1.

amount_offoptionalinteger | null

Amount off in cents. Mutually exclusive with percent_off.

percent_offoptionalnumber | null

Percentage off (0-100). Mutually exclusive with amount_off.

addon_durationRequiredstring

Possible values: once, forever.

remove_products_after_coupon_detachedRequiredinteger

Possible values: 0, 1.

productsRequiredobject
emailsoptionalobject
customersoptionalobject
subscriptionsoptionalobject
idinteger
coupon_idstring

Unique coupon code

namestring | null
durationstring

Possible values: once, forever, multiple.

duration_in_monthsinteger | null

Present when duration is "multiple"

remove_gifts_after_end_of_durationboolean
max_redemptionsinteger | null
times_redeemedinteger
activeboolean
limit_one_per_customerboolean
redeem_bystring | null

Format: date-time.

validboolean

Whether the coupon is currently valid for redemption

conditionCouponCondition | null
discountCouponDiscount | null
giftCouponGift | null
rulesCouponRules | null
created_atstring | null

Format: date-time.

updated_atstring | null

Format: date-time.

deleted_atstring | null

Format: date-time.

idinteger
coupon_idstring

Unique coupon code

namestring | null
durationstring

Possible values: once, forever, multiple.

duration_in_monthsinteger | null

Present when duration is "multiple"

remove_gifts_after_end_of_durationboolean
max_redemptionsinteger | null
times_redeemedinteger
activeboolean
limit_one_per_customerboolean
redeem_bystring | null

Format: date-time.

validboolean

Whether the coupon is currently valid for redemption

conditionCouponCondition | null
discountCouponDiscount | null
giftCouponGift | null
rulesCouponRules | null
created_atstring | null

Format: date-time.

updated_atstring | null

Format: date-time.

deleted_atstring | null

Format: date-time.

typeRequiredstring

Possible values: product, cart_quantity, cart_value, collection.

operatorRequiredstring

Possible values: any, only, except.

productsoptionalobject | null

Required when operator is "only" or "except" and type is not "collection". Prohibited when operator is "any" or type is "collection".

collectionsoptionalobject | null

Required when type is "collection". Prohibited otherwise.

cart_valueoptionalobject | null
cart_quantityoptionalobject | null
amount_offoptionalinteger | null

Prohibited if discount already exists. Can only be set on initial creation.

percent_offoptionalnumber | null

Prohibited if discount already exists. Can only be set on initial creation.

item_typesoptionalstring[] | null
productsoptionalinteger[] | null
products_operatoroptionalstring | null

Required when products is provided

Possible values: only, except.

skip_payment_methodoptionalinteger

Possible values: 0, 1.

first_shipment_onlyoptionalinteger

Possible values: 0, 1.

amount_offoptionalinteger | null

Prohibited if gift already exists. Can only be set on initial creation.

percent_offoptionalnumber | null

Prohibited if gift already exists. Can only be set on initial creation.

addon_durationoptionalstring

Possible values: once, forever.

remove_products_after_coupon_detachedoptionalinteger

Possible values: 0, 1.

productsoptionalobject | null
emailsoptionalobject
customersoptionalobject
subscriptionsoptionalobject
idinteger
coupon_idstring

Unique coupon code

namestring | null
durationstring

Possible values: once, forever, multiple.

duration_in_monthsinteger | null

Present when duration is "multiple"

remove_gifts_after_end_of_durationboolean
max_redemptionsinteger | null
times_redeemedinteger
activeboolean
limit_one_per_customerboolean
redeem_bystring | null

Format: date-time.

validboolean

Whether the coupon is currently valid for redemption

conditionCouponCondition | null
discountCouponDiscount | null
giftCouponGift | null
rulesCouponRules | null
created_atstring | null

Format: date-time.

updated_atstring | null

Format: date-time.

deleted_atstring | null

Format: date-time.

idinteger
coupon_idstring

Unique coupon code

namestring | null
durationstring

Possible values: once, forever, multiple.

duration_in_monthsinteger | null

Present when duration is "multiple"

remove_gifts_after_end_of_durationboolean
max_redemptionsinteger | null
times_redeemedinteger
activeboolean
limit_one_per_customerboolean
redeem_bystring | null

Format: date-time.

validboolean

Whether the coupon is currently valid for redemption

conditionCouponCondition | null
discountCouponDiscount | null
giftCouponGift | null
rulesCouponRules | null
created_atstring | null

Format: date-time.

updated_atstring | null

Format: date-time.

deleted_atstring | null

Format: date-time.