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

Address

Private Address API endpoints

Endpoints
  • POST/addresses
  • PATCH/addresses/{address_id}
  • DELETE/addresses/{address_id}

Create an address

POST /addresses

Add a delivery address to a customer of your shop. Whether region or region_id is required depends on the country: countries that have regions require region_id and reject region, countries without regions require region and reject region_id. When neither is sent, the API tries to derive the region from the country and zip before validating.

Request body

first_nameRequiredstring
last_nameRequiredstring
phoneoptionalstring | null

Required unless the shop has optional phone numbers enabled. Must be a valid international phone number.

company_nameoptionalstring | null
address_oneRequiredstring
address_twooptionalstring | null
cityRequiredstring
zipRequiredstring
country_idRequiredinteger

ID of a known shipping country.

region_idoptionalinteger

Required when the country has regions, and prohibited when it has none. Must be a region of country_id. When neither region_id nor region is sent, the API first tries to derive the region from the country code and zip.

regionoptionalstring

Free-text region, required when the country has no regions and prohibited when it has them. When neither region nor region_id is sent, the API first tries to derive the region from the country code and zip.

customer_idRequiredinteger

ID of the customer the address belongs to.

ReturnsAddress

Address object response

Error responses

422object

Validation failed, for example a customer_id that is not a customer of your shop, an unknown country_id, a region_id that does not belong to that country, a region/region_id combination that does not match the country, an invalid phone number, or a zip outside 3-16 characters.

curl -X POST https://api.subbly.co/private/v1/addresses \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "first_name": "John", "last_name": "Smith", "phone": "+13232380656", "company_name": "company_name", "address_one": "7609 Mckinley Ave", "address_two": "address_two", "city": "Los Angeles", "zip": "90044", "country_id": 230, "region_id": 1, "region": "region", "customer_id": 1 }'
Response
{ "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" }

Update an address

PATCH /addresses/{address_id}

Update an address. All required fields must be sent again, but optional fields (company_name, address_two, and phone when the shop makes it optional) are merged: leaving one out keeps its current value, and sending it as an explicit null clears it. The address must belong to a customer of your shop.

Path parameters

address_idRequiredinteger

Address ID

Format: integer.

Request body

first_nameRequiredstring
last_nameRequiredstring
phoneoptionalstring | null

Required unless the shop has optional phone numbers enabled. Must be a valid international phone number.

company_nameoptionalstring | null
address_oneRequiredstring
address_twooptionalstring | null
cityRequiredstring
zipRequiredstring
country_idRequiredinteger

ID of a known shipping country.

region_idoptionalinteger

Required when the country has regions, and prohibited when it has none. Must be a region of country_id. When neither region_id nor region is sent, the API first tries to derive the region from the country code and zip.

regionoptionalstring

Free-text region, required when the country has no regions and prohibited when it has them. When neither region nor region_id is sent, the API first tries to derive the region from the country code and zip.

ReturnsAddress

Address object response

Error responses

404object

The address does not exist or does not belong to a customer of your shop.

422object

Validation failed, for example an unknown country_id, a region_id that does not belong to that country, a region/region_id combination that does not match the country, an invalid phone number, or a zip outside 3-16 characters.

curl -X PATCH https://api.subbly.co/private/v1/addresses/{address_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "first_name": "John", "last_name": "Smith", "phone": "+13232380656", "company_name": "company_name", "address_one": "7609 Mckinley Ave", "address_two": "address_two", "city": "Los Angeles", "zip": "90044", "country_id": 230, "region_id": 1, "region": "region" }'
Response
{ "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" }

Delete an address

DELETE /addresses/{address_id}

Delete an address. An address that is still linked to a subscription, or to an order awaiting delivery or a future shipment, cannot be deleted.

Path parameters

address_idRequiredinteger

Address ID

Format: integer.

ReturnsAddress

The deleted address

Error responses

404object

The address does not exist or does not belong to a customer of your shop.

422object

The address is in use: it is the shipping or billing address of a subscription, or the shipping address of an order awaiting delivery or a future shipment.

curl -X DELETE https://api.subbly.co/private/v1/addresses/{address_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "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" }
idinteger
first_namestring
last_namestring
country_idinteger | null
region_idinteger | null
countrystring | null
regionstring | null
phonestring | null
company_namestring | null
address_onestring | null
address_twostring | null
citystring | null
zipstring
idinteger
first_namestring
last_namestring
country_idinteger | null
region_idinteger | null
countrystring | null
regionstring | null
phonestring | null
company_namestring | null
address_onestring | null
address_twostring | null
citystring | null
zipstring
idinteger
first_namestring
last_namestring
country_idinteger | null
region_idinteger | null
countrystring | null
regionstring | null
phonestring | null
company_namestring | null
address_onestring | null
address_twostring | null
citystring | null
zipstring