SubblySubbly
Log inGet started
  • Get started
  • Developer resources
Storefront API reference
Docs
Information
    Base URLAuthenticationPaginationErrors
Bootstrap
    Get shop info and settings
Product
    Get list of productsGet product by IDGet variant or pricing by IDGet plan by ID
Bundle
    Get list of bundlesGet bundle by IDQuote bundleGet list of bundle group itemsGet list of bundle itemsGet the list of bundle items associated with multiple bundles
Survey
    Get survey by ID
Cart
    Init cartGet cart by IDUpdate cart by IDGet cart gifting datesGet cart start datesGet shipping methodsGet local pickupsValidate the cartAttach the customer to the cart
Cart Item
    Add cart itemUpdate cart itemDelete cart item
Checkout
    Make purchase from the cart
Auth
    LoginOtp LoginOtp GenerateSocial LoginRegisteredRegister
Customer
    Get the current customerGet the current customer referral infoUpdate customer
Address
    Get list of addressStore addressUpdate addressDelete address
Pickup Info
    Get list of pickup infosStore pickup infoUpdate pickup infoDelete pickup info
Wallet
    Store payment methodGet list of payment methodsStore payment methodDelete payment methodSet default payment method
Subscription
    Get list of subscriptionsShow subscriptionUpdate subscriptionUpdate subscription survey preferences by Subscription IDUpdate subscription bundle data by Subscription IDCancel a subscriptionUndo cancellationUndo a scheduled cancellationRequest a cancellationWithdraw a cancellation requestSkip upcoming renewalsPause the subscriptionResume the subscriptionProlong an active skipReactivate the subscriptionUpdate shipping address and methodUpdate subscription payment methodGet shipping methodsGet local pickupsList upcoming billing datesList allowed skipping datesList allowed resume datesChange the plans of the subscription's itemsList the plans the subscription can move toCreate 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 item
Order
    Get list of ordersGet order by ID
Invoice
    Get list of invoicesGet invoice by ID
Payment Intent
    Confirm payment intentGet payment intent by ID
Funnels
    Get the current pre purchase funnel step by IDRefresh the funnel progressAccept the pre purchase funnel stepReject the pre purchase funnel stepGet the current mid purchase funnel step by IDRefresh the funnel progressAccept the mid purchase funnel stepReject the mid purchase funnel step
Countries
    Get list of countries
Out Of Stock
    Subscribe to the out of stock
Cancellation
    Get shop cancellation reasons
Metafield
    Get shop's metafields
Product Collection
    Get list of product collectionsGet product collection by IDGet list of collection groups with items
Lead
    Store the shop lead

Order

Storefront Order API endpoints

Endpoints
  • GET/orders
  • GET/orders/{order_id}

Get list of orders

GET /orders

An API endpoint to get list of orders for the authenticated customer.

Query parameters

pageoptionalinteger

Page

per_pageoptionalinteger

Entities per page

subscription_idoptionalinteger

Filter by subscription ID

product_idoptionalinteger

Filter by product ID

statusesoptionalstring[]

Filter by order status

fulfillment_statusesoptionalstring[]

Filter by fulfillment status

created_at[gte]optionalstring

Filter to include only orders with a creation date on or after the given date.

created_at[lte]optionalstring

Filter to include only orders with a creation date on or before the given date.

created_at_startoptionalstringDeprecated

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

created_at_endoptionalstringDeprecated

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

expandoptionalstring[]

Expandable relations

Returnsobject

Orders list response

Error responses

401object

Missing or invalid customer token.

422object

page is not a positive integer, per_page is outside 1-100, subscription_id is not a subscription of the customer, statuses or fulfillment_statuses hold an unknown or duplicate value, a date filter (created_at[gte], created_at[lte], created_at_start, created_at_end) does not match Y-m-d\TH:i:s, or expand is not an array.

curl https://api.subbly.co/storefront/v1/orders \ -H 'X-API-KEY: <api-key>' \ -H 'Authorization: Bearer <access-token>'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 1, "subscription_id": 1, "invoice_id": 1, "invoice": { "id": 1, "subscription_id": 1, "customer_id": 1, "customer": {}, "payment_method": {}, "billing_address_id": 1, "billing_address": {}, "shipping_address_id": 1, "shipping_address": {}, "shipping_method_id": 1, "shipping_method": {}, "shipping_details": {}, "currency_code": "USD", "total": 1, "sub_total": 1, "adjustment": 1, "discounts_amount": 1, "tax_amount": 1, "description": "description", "first_shipment_at": "2022-04-01T00:00:00.000000Z", "period_start": "2022-04-01T00:00:00.000000Z", "period_end": "2022-04-01T00:00:00.000000Z", "paid_at": "2022-04-01T00:00:00.000000Z", "status": "paid", "items": [ {} ], "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "customer_id": 1, "customer": { "id": 8435732, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "active_subscriptions_count": 0, "external_id": "external_id", "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last_four": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "shipping_method_id": 1, "shipping_method": { "id": 1, "type": "shipping_option", "method": {} }, "due_date": "2022-04-01T00:00:00.000000Z", "currency_code": "USD", "status": "Awaiting Delivery", "gift": { "message": "message", "recipient_email": "recipient_email" }, "total": 1, "sub_total": 1, "tax_amount": 1, "adjustment": 1, "items": [ { "id": 1, "product_id": 1, "product": {}, "subscription_id": "subscription_id", "description": "description", "type": "setup", "subscription_item_id": 1, "amount": 1, "quantity": 1, "survey": { "survey_id": 1, "version": 2, "data": [ {} ] }, "bundle": {}, "discount_amount": 1, "tax_amount": 1, "tax_rate": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "shipping_items": [ { "id": 1, "order_id": 1, "quantity": 1, "note": "note", "inventory_id": 1, "inventory": {}, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "product_id": 1, "subscription_id": 1, "subscription_item_id": 1, "description": "description", "type": "balance", "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, "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Get order by ID

GET /orders/{order_id}

An API endpoint to get order by ID for the authenticated customer.

Path parameters

order_idRequiredinteger

Order ID

Format: integer.

Query parameters

expandoptionalstring[]

Expandable relations

ReturnsOrder

Order object response

Error responses

400object

The order belongs to another customer.

401object

Missing or invalid customer token.

404object

No order with this ID exists.

422object

expand is not an array.

curl https://api.subbly.co/storefront/v1/orders/{order_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Authorization: Bearer <access-token>'
Response
{ "id": 1, "subscription_id": 1, "invoice_id": 1, "invoice": { "id": 1, "subscription_id": 1, "customer_id": 1, "customer": {}, "payment_method": {}, "billing_address_id": 1, "billing_address": {}, "shipping_address_id": 1, "shipping_address": {}, "shipping_method_id": 1, "shipping_method": {}, "shipping_details": {}, "currency_code": "USD", "total": 1, "sub_total": 1, "adjustment": 1, "discounts_amount": 1, "tax_amount": 1, "description": "description", "first_shipment_at": "2022-04-01T00:00:00.000000Z", "period_start": "2022-04-01T00:00:00.000000Z", "period_end": "2022-04-01T00:00:00.000000Z", "paid_at": "2022-04-01T00:00:00.000000Z", "status": "paid", "items": [ {} ], "discounts": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "customer_id": 1, "customer": { "id": 8435732, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01T00:00:00.000000Z", "active_subscriptions_count": 0, "external_id": "external_id", "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z" }, "shipping_address_id": 1, "shipping_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "billing_address": { "id": 3486, "first_name": "John", "last_name": "Smith", "country_id": 230, "region_id": 1231, "country": "United States", "region": "California", "phone": "+13232380656", "company_name": null, "address_one": "7609 Mckinley Ave", "address_two": null, "city": "Los Angeles", "zip": "90044" }, "payment_method": { "id": 567, "type": "card", "identifier": "4242", "card": { "last_four": "4242", "expiry_month": "2", "expiry_year": "2099", "type": "credit", "brand": "visa" }, "ideal": { "bank": "ING", "bic": "INGBNL2A", "email": "test@subbly.co", "name": "John Doe" }, "bancontact": { "email": "test@subbly.co", "name": "John Doe" }, "acss_debit": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "Royal Bank of Canada", "transit_number": "12345", "institution_number": "123", "last_four": "6789" }, "us_bank_account": { "email": "test@subbly.co", "name": "John Doe", "bank_name": "US Bank", "last_four": "6789", "routing_number": "123456789", "account_type": "checking", "account_holder_type": "individual" }, "sepa_debit": { "email": "test@subbly.co", "name": "John Doe", "iban_last4": "6789", "bank_code": "123456", "country": "DE", "branch_code": "12345" }, "sofort": { "email": "test@subbly.co", "name": "John Doe", "country": "DE" }, "link": { "email": "test@subbly.co", "name": "John Doe" }, "cashapp": { "email": "test@subbly.co", "name": "John Doe", "buyer_id": "cashapp:123456789", "cash_tag": "$subbly" }, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "shipping_method_id": 1, "shipping_method": { "id": 1, "type": "shipping_option", "method": {} }, "due_date": "2022-04-01T00:00:00.000000Z", "currency_code": "USD", "status": "Awaiting Delivery", "gift": { "message": "message", "recipient_email": "recipient_email" }, "total": 1, "sub_total": 1, "tax_amount": 1, "adjustment": 1, "items": [ { "id": 1, "product_id": 1, "product": {}, "subscription_id": "subscription_id", "description": "description", "type": "setup", "subscription_item_id": 1, "amount": 1, "quantity": 1, "survey": { "survey_id": 1, "version": 2, "data": [ {} ] }, "bundle": {}, "discount_amount": 1, "tax_amount": 1, "tax_rate": 1, "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "shipping_items": [ { "id": 1, "order_id": 1, "quantity": 1, "note": "note", "inventory_id": 1, "inventory": {}, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "product_id": 1, "subscription_id": 1, "subscription_item_id": 1, "description": "description", "type": "balance", "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, "save_behavior": "customer", "editable": true, "values": [ {} ] } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }
paginationobject
dataOrder[]
idinteger
subscription_idinteger | null
invoice_idinteger | null
invoiceInvoice | null

Expandable link to the invoice. null unless expand[]=invoice.

customer_idinteger
customerCustomer | null

Expandable link to the customer. null unless expand[]=customer.

shipping_address_idinteger
shipping_addressAddress | PickupInfo | null

Expandable link to the shipping address or pickup point object. null unless expand[]=shipping_address. Deleted addresses are still returned.

billing_addressAddress | null

Expandable link to the billing address of the order's invoice. null unless expand[]=billing_address. Deleted addresses are still returned.

payment_methodPaymentMethod | null

Expandable link to the payment method. null unless expand[]=payment_method. Uses the payment method of the order's invoice, else the one on the order's transaction. Deleted payment methods are still returned.

shipping_method_idinteger
shipping_methodShippingMethod | null

Expandable link to the shipping method. null unless expand[]=shipping_method.

due_datestring

Format: date-time.

currency_codestring
statusstring

Possible values: Awaiting Delivery, Shipped, Returned, Dispute, Future Shipment, Cancelled, Payment Failed.

giftobject | null
totalinteger
sub_totalinteger
tax_amountinteger
adjustmentinteger
itemsOrderItem[]
shipping_itemsShippingItem[]
discountsOrderDiscount[]
metadataEntityMetadata[] | null
created_atstring

Format: date-time.

updated_atstring

Format: date-time.