Order
Storefront Order API endpoints
An API endpoint to get list of orders for the authenticated customer.
Query parameters
pageoptionalintegerPage
per_pageoptionalintegerEntities per page
subscription_idoptionalintegerFilter by subscription ID
product_idoptionalintegerFilter by product ID
statusesoptionalstring[]Filter by order status
fulfillment_statusesoptionalstring[]Filter by fulfillment status
created_at[gte]optionalstringFilter to include only orders with a creation date on or after the given date.
created_at[lte]optionalstringFilter to include only orders with a creation date on or before the given date.
created_at_startoptionalstringDeprecatedDeprecated alias of created_at[gte]. When both arrive, created_at[gte] wins.
created_at_endoptionalstringDeprecatedDeprecated alias of created_at[lte]. When both arrive, created_at[lte] wins.
expandoptionalstring[]Expandable relations
Returnsobject
Orders list response
Error responses
401objectMissing or invalid customer token.
422objectpage 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>'{
"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"
}
]
}An API endpoint to get order by ID for the authenticated customer.
Path parameters
order_idRequiredintegerOrder ID
Format: integer.
Query parameters
expandoptionalstring[]Expandable relations
ReturnsOrder
Order object response
Error responses
400objectThe order belongs to another customer.
401objectMissing or invalid customer token.
404objectNo order with this ID exists.
422objectexpand 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>'{
"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"
}