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

Customer

Private Customer API endpoints

Endpoints
  • GET/customers
  • POST/customers
  • GET/customers/{customer_id}
  • PATCH/customers/{customer_id}
  • DELETE/customers/{customer_id}
  • POST/customers/{customer_id}/balance
  • POST/customers/{customer_id}/notes
  • PATCH/customers/{customer_id}/notes/{note_id}
  • DELETE/customers/{customer_id}/notes/{note_id}
  • POST/customers/{customer_id}/addresses
  • PATCH/customers/{customer_id}/addresses/{address_id}
  • DELETE/customers/{customer_id}/addresses/{address_id}
  • GET/customers/{customer_id}/pickup_info
  • POST/customers/{customer_id}/pickup_info
  • PATCH/customers/{customer_id}/pickup_info/{pickup_info_id}
  • DELETE/customers/{customer_id}/pickup_info/{pickup_info_id}
  • POST/customers/{customer_id}/payment_methods
  • DELETE/customers/{customer_id}/payment_methods/{payment_method_id}

Get list of customers

GET /customers

An API endpoint to get list of customers. Results are always ordered by customer ID, newest first.

Query parameters

pageoptionalinteger

Page number

per_pageoptionalinteger

Items per page

idsoptionalinteger[]

Filter by customer IDs

has_active_subscriptionoptionalinteger

1 keeps only customers with at least one active subscription, 0 keeps only customers without any active subscription. Send 1 or 0, not true/false.

Possible values: 0, 1.

tagsoptionalinteger[]

Keep only customers tagged with at least one of these tag IDs. Every ID must be a tag of your shop.

countryoptionalstring

Keep only customers with an address in this country. The value is the country name (for example United States), not a country code, and must match a known shipping country.

orders_countoptionalinteger

Keep only customers whose total order count equals this number exactly.

balanceoptionalobject

Filter on the customer's store credit balance, in minor units. Both keys are required as soon as balance is sent. Customers with no balance record are treated as 0 and are matched whenever the comparison holds for zero.

expand[]optionalstring[]

List of relations to expand. metadata, tags, tags_meta, balance and past_due_invoice_count are always present and do not need to be requested. Available keys: default_payment_method, payment_methods, subscriptions, notes, addresses. Nested keys are accepted too, e.g. subscriptions.items.

Returnsobject

Customers list response

Error responses

422object

One or more query parameters failed validation, for example a tag ID that does not belong to the shop, an unknown country name, or a balance filter missing its value or operator.

curl https://api.subbly.co/private/v1/customers \ -H 'X-API-KEY: <api-key>'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01 00:00:00", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" }, "payment_methods": [ { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" } ], "subscriptions": [ { "id": 1, "customer_id": 1, "customer": {}, "referred_by": 1, "product_id": 1, "product": {}, "quantity": 1, "shipping_address_id": 1, "shipping_address": {}, "shipping_method_id": 1, "billing_address_id": 1, "billing_address": {}, "payment_method_id": 1, "payment_method": {}, "currency_code": "USD", "survey": {}, "preferences": {}, "bundle": {}, "gift": { "message": "message", "starts_at": "2022-02-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ {} ], "discounts": [ {} ], "addons": [ {} ], "items": [ {} ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "notes": [ { "id": 91, "customer_id": 8435732, "note": "Called about the missing box.", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addresses": [ { "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" } ], "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-01 00:00:00" } ] }

Create a customer

POST /customers

Create a customer in your shop. When a user account already exists for the email it is reused and only the shop customer record is created, so first_name and last_name are ignored in that case; otherwise a new user account is registered with those names. The email must not already belong to a customer of this shop.

Query parameters

expand[]optionalstring[]

List of relations to expand. metadata, tags, tags_meta, balance and past_due_invoice_count are always present and do not need to be requested. Available keys: default_payment_method, payment_methods, subscriptions, notes, addresses. Nested keys are accepted too, e.g. subscriptions.items.

Request body

emailRequiredstring

Must not already belong to a customer of this shop. When a user account with this email already exists (for example because the person is a customer of another shop) that account is reused and first_name/last_name are ignored.

Format: email.

first_nameRequiredstring
last_nameRequiredstring
marketing_consentoptionalinteger

Marketing opt-in. Send 1 or 0, not true/false. Defaults to 0 when omitted.

Possible values: 0, 1.

external_idoptionalstring | null

Your own identifier for this customer.

ReturnsCustomer

Customer object response

Error responses

422object

Validation failed, for example the email already belongs to a customer of this shop, or a required name is missing or longer than 50 characters.

curl -X POST https://api.subbly.co/private/v1/customers \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "email": "test@test.com", "first_name": "John", "last_name": "Smith", "marketing_consent": 0, "external_id": "external_id" }'
Response
{ "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01 00:00:00", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" }, "payment_methods": [ { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" } ], "subscriptions": [ { "id": 1, "customer_id": 1, "customer": {}, "referred_by": 1, "product_id": 1, "product": {}, "quantity": 1, "shipping_address_id": 1, "shipping_address": {}, "shipping_method_id": 1, "billing_address_id": 1, "billing_address": {}, "payment_method_id": 1, "payment_method": {}, "currency_code": "USD", "survey": {}, "preferences": {}, "bundle": {}, "gift": { "message": "message", "starts_at": "2022-02-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ {} ], "discounts": [ {} ], "addons": [ {} ], "items": [ {} ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "notes": [ { "id": 91, "customer_id": 8435732, "note": "Called about the missing box.", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addresses": [ { "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" } ], "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-01 00:00:00" }

Get customer by ID

GET /customers/{customer_id}

A detailed description of the customer.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

Query parameters

expand[]optionalstring[]

List of relations to expand. metadata, tags, tags_meta, balance and past_due_invoice_count are always present and do not need to be requested. Available keys: default_payment_method, payment_methods, subscriptions, notes, addresses. Nested keys are accepted too, e.g. subscriptions.items.

ReturnsCustomer

Customer object response

Error responses

404object

The customer does not exist or belongs to another shop.

curl https://api.subbly.co/private/v1/customers/{customer_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01 00:00:00", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" }, "payment_methods": [ { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" } ], "subscriptions": [ { "id": 1, "customer_id": 1, "customer": {}, "referred_by": 1, "product_id": 1, "product": {}, "quantity": 1, "shipping_address_id": 1, "shipping_address": {}, "shipping_method_id": 1, "billing_address_id": 1, "billing_address": {}, "payment_method_id": 1, "payment_method": {}, "currency_code": "USD", "survey": {}, "preferences": {}, "bundle": {}, "gift": { "message": "message", "starts_at": "2022-02-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ {} ], "discounts": [ {} ], "addons": [ {} ], "items": [ {} ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "notes": [ { "id": 91, "customer_id": 8435732, "note": "Called about the missing box.", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addresses": [ { "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" } ], "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-01 00:00:00" }

Update a customer

PATCH /customers/{customer_id}

Partially update a customer. Only the keys present in the body are applied, every other field is left untouched. marketing_consent and tos_consent are grant-only - once either is granted, sending it again (with any value) is rejected with a validation error - and default_payment_method_id must reference a payment method of this customer.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

Query parameters

expand[]optionalstring[]

List of relations to expand. metadata, tags, tags_meta, balance and past_due_invoice_count are always present and do not need to be requested. Available keys: default_payment_method, payment_methods, subscriptions, notes, addresses. Nested keys are accepted too, e.g. subscriptions.items.

Request body

marketing_consentoptionalinteger

Marketing opt-in, grant-only. Send 1 or 0, not true/false. 1 records the opt-in. Once it is granted the field can no longer be sent at all - any further marketing_consent in the body, 1 or 0, is rejected with a validation error (422). While it is still ungranted, 0 is accepted and does nothing. It is independent of tos_consent; neither one requires the other.

Possible values: 0, 1.

tos_consentoptionalinteger

Terms-of-service consent, grant-only. Send 1 or 0, not true/false. 1 requires tos_consent_at and stores that date as the consent date. Once tos_consent_at is set the field can no longer be sent at all - any further tos_consent in the body, 1 or 0, is rejected with a validation error (422), so an existing consent date is never overwritten and consent cannot be withdrawn. While it is still unset, 0 is accepted and does nothing.

Possible values: 0, 1.

tos_consent_atoptionalstring

The date and time the customer accepted the terms of service. Required when tos_consent is 1 and not accepted otherwise. Any parsable date is accepted and the value is normalised to UTC before it is stored.

Format: date-time.

default_payment_method_idoptionalinteger | null

Must be a payment method belonging to this customer. null clears the default.

tagsoptionalobject

Tag changes to apply to the customer.

ReturnsCustomer

Customer object response

Error responses

404object

The customer does not exist or belongs to another shop.

422object

Validation failed, for example a default_payment_method_id that is not a payment method of this customer, a tags.delete ID that is not a tag of this shop, or a duplicated tags.create value.

curl -X PATCH https://api.subbly.co/private/v1/customers/{customer_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "marketing_consent": 0, "tos_consent": 0, "tos_consent_at": "2026-08-01T10:00:00Z", "default_payment_method_id": 1, "tags": { "create": [ { "value": "VIP" } ], "delete": [ { "id": 1 } ] } }'
Response
{ "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01 00:00:00", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" }, "payment_methods": [ { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" } ], "subscriptions": [ { "id": 1, "customer_id": 1, "customer": {}, "referred_by": 1, "product_id": 1, "product": {}, "quantity": 1, "shipping_address_id": 1, "shipping_address": {}, "shipping_method_id": 1, "billing_address_id": 1, "billing_address": {}, "payment_method_id": 1, "payment_method": {}, "currency_code": "USD", "survey": {}, "preferences": {}, "bundle": {}, "gift": { "message": "message", "starts_at": "2022-02-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ {} ], "discounts": [ {} ], "addons": [ {} ], "items": [ {} ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "notes": [ { "id": 91, "customer_id": 8435732, "note": "Called about the missing box.", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addresses": [ { "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" } ], "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-01 00:00:00" }

Delete a customer

DELETE /customers/{customer_id}

Permanently delete the customer. Abandoned cart tracking for the email is cleared, and the underlying user account is deleted as well when this was their only customer record and they are not a merchant. Stored payment methods are left untouched. The endpoint is only available while GDPR handling is enabled for the shop.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

ReturnsDeletedObject

The customer was deleted.

Error responses

400object

GDPR handling is disabled for the shop.

404object

The customer does not exist or belongs to another shop.

curl -X DELETE https://api.subbly.co/private/v1/customers/{customer_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 8435732, "deleted": true }

Credit a customer's store credit balance

POST /customers/{customer_id}/balance

Add store credit to the customer's balance and return the customer with the updated balance. Credits only - amount cannot be negative, so this endpoint can never lower a balance. Every change is recorded in the customer's balance history and flagged as made by the shop owner.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

Query parameters

expand[]optionalstring[]

List of relations to expand. metadata, tags, tags_meta, balance and past_due_invoice_count are always present and do not need to be requested. Available keys: default_payment_method, payment_methods, subscriptions, notes, addresses. Nested keys are accepted too, e.g. subscriptions.items.

Request body

amountRequiredinteger

Amount added to the customer's store credit balance, in minor units.

ReturnsCustomer

Customer object response, with the updated balance

Error responses

404object

The customer does not exist or belongs to another shop.

422object

Validation failed, for example amount is missing, is not an integer, is negative, or is above 9999999.

curl -X POST https://api.subbly.co/private/v1/customers/{customer_id}/balance \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "amount": 500 }'
Response
{ "id": 8435732, "user_id": 5512, "first_name": "John", "last_name": "Smith", "email": "test@test.com", "marketing_consent": false, "tos_consent_at": "2022-04-01 00:00:00", "external_id": "crm-8842", "default_payment_method_id": 1, "default_payment_method": { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" }, "payment_methods": [ { "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" } ], "subscriptions": [ { "id": 1, "customer_id": 1, "customer": {}, "referred_by": 1, "product_id": 1, "product": {}, "quantity": 1, "shipping_address_id": 1, "shipping_address": {}, "shipping_method_id": 1, "billing_address_id": 1, "billing_address": {}, "payment_method_id": 1, "payment_method": {}, "currency_code": "USD", "survey": {}, "preferences": {}, "bundle": {}, "gift": { "message": "message", "starts_at": "2022-02-24 04:00:00", "order_limit": 1 }, "commitment_term_total_payments": 1, "cancel_at_end_of_commitment": true, "next_payment_date": "2023-04-23 00:45:00", "starts_at": "2023-04-23 00:45:00", "past_due": false, "successful_charges_count": 1, "charges_limit": 1, "status": "active", "cancel_at_period_end": true, "cancellations": [ {} ], "discounts": [ {} ], "addons": [ {} ], "items": [ {} ], "last_payment_at": "2023-04-23 00:45:00", "unpaid": false, "cancellation_requested": false, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "past_due_invoice_count": 0, "balance": 1500, "tags": [ "VIP" ], "tags_meta": [ { "id": 12, "value": "VIP" } ], "notes": [ { "id": 91, "customer_id": 8435732, "note": "Called about the missing box.", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "addresses": [ { "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" } ], "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-01 00:00:00" }

Create a customer note

POST /customers/{customer_id}/notes

Add an internal note to the customer. Notes are only visible through the private API.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

Request body

noteRequiredstring

Note body.

ReturnsNote

Note object response

Error responses

404object

The customer does not exist or belongs to another shop.

422object

Validation failed, for example note is missing or longer than 65535 characters.

curl -X POST https://api.subbly.co/private/v1/customers/{customer_id}/notes \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "note": "Called about the missing box." }'
Response
{ "id": 91, "customer_id": 8435732, "note": "Called about the missing box.", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Update a customer note

PATCH /customers/{customer_id}/notes/{note_id}

Replace the body of a note. The note must belong to the customer in the path.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

note_idRequiredinteger

Note ID

Format: integer.

Request body

noteRequiredstring

Note body.

ReturnsNote

Note object response

Error responses

404object

The customer or the note does not exist, the customer belongs to another shop, or the note belongs to another customer.

422object

Validation failed, for example note is missing or longer than 65535 characters.

curl -X PATCH https://api.subbly.co/private/v1/customers/{customer_id}/notes/{note_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "note": "note" }'
Response
{ "id": 91, "customer_id": 8435732, "note": "Called about the missing box.", "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Delete a customer note

DELETE /customers/{customer_id}/notes/{note_id}

Permanently delete a note. The note must belong to the customer in the path.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

note_idRequiredinteger

Note ID

Format: integer.

ReturnsDeletedObject

The note was deleted.

Error responses

404object

The customer or the note does not exist, the customer belongs to another shop, or the note belongs to another customer.

curl -X DELETE https://api.subbly.co/private/v1/customers/{customer_id}/notes/{note_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 8435732, "deleted": true }

Create a customer address

POST /customers/{customer_id}/addresses

Add a delivery address to the customer. 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.

Path parameters

customer_idRequiredinteger

Customer 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 customer does not exist or belongs to another 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 POST https://api.subbly.co/private/v1/customers/{customer_id}/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" }'
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 a customer address

PATCH /customers/{customer_id}/addresses/{address_id}

Update a customer 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 the customer in the path.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

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 customer or the address does not exist, the customer belongs to another shop, or the address belongs to another customer.

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/customers/{customer_id}/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 a customer address

DELETE /customers/{customer_id}/addresses/{address_id}

Delete a customer 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

customer_idRequiredinteger

Customer ID

Format: integer.

address_idRequiredinteger

Address ID

Format: integer.

ReturnsAddress

The deleted address

Error responses

404object

The customer or the address does not exist, the customer belongs to another shop, or the address belongs to another customer.

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/customers/{customer_id}/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" }

Get list of customer pickup info

GET /customers/{customer_id}/pickup_info

List the customer's local pickup contacts. Without shipping_method_id, and for a pickup-point shipping method, only entries with no linked pickup point are returned. For a custom local pickup method, only entries whose pickup point is in that method's country are returned. The response is not paginated.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

Query parameters

shipping_method_idoptionalinteger | null

A published local pickup shipping method of your shop, used to narrow the list.

Returnsobject

Customer pickup info list response

Error responses

404object

The customer does not exist or belongs to another shop.

422object

shipping_method_id is not a published local pickup method of this shop.

curl https://api.subbly.co/private/v1/customers/{customer_id}/pickup_info \ -H 'X-API-KEY: <api-key>'
Response
{ "data": [ { "id": 3487, "pickup_point": { "id": 45, "external_id": "FR-012345", "country_id": 74, "country_code": "FR", "country_name": "France", "type": "mondial_relay", "city": "Paris", "address_one": "address_one", "address_two": "address_two", "zip": "75001" }, "phone": "+13232380656", "first_name": "John", "last_name": "Smith" } ] }

Create customer pickup info

POST /customers/{customer_id}/pickup_info

Add a local pickup contact to the customer. Sending pickup_point_id together with pickup_point_type links an external pickup point, which is looked up at the provider and must sit in a country covered by one of the shop's published local pickup methods. Omit both to store a plain pickup contact.

Path parameters

customer_idRequiredinteger

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

pickup_point_idoptionalstring

External pickup point reference, prefixed with the ISO country code. Required as soon as pickup_point_type is sent. The country must be covered by one of the shop's published local pickup methods and the point must exist at the provider.

pickup_point_typeoptionalstring

Required as soon as pickup_point_id is sent.

Possible values: mondial_relay.

ReturnsCustomerPickupInfo

Customer pickup info object response

Error responses

404object

The customer does not exist or belongs to another shop.

422object

Validation failed, for example a missing name, an invalid phone number, a pickup_point_id that does not match the CC-123456 format or is unknown at the provider, or only one of pickup_point_id/pickup_point_type being sent.

curl -X POST https://api.subbly.co/private/v1/customers/{customer_id}/pickup_info \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "first_name": "John", "last_name": "Smith", "phone": "+13232380656", "pickup_point_id": "FR-012345", "pickup_point_type": "mondial_relay" }'
Response
{ "id": 3487, "pickup_point": { "id": 45, "external_id": "FR-012345", "country_id": 74, "country_code": "FR", "country_name": "France", "type": "mondial_relay", "city": "Paris", "address_one": "address_one", "address_two": "address_two", "zip": "75001" }, "phone": "+13232380656", "first_name": "John", "last_name": "Smith" }

Update customer pickup info

PATCH /customers/{customer_id}/pickup_info/{pickup_info_id}

Update the contact details of a local pickup entry. Only the name and phone number can be changed; the linked pickup point is fixed at creation time. Unlike a customer address, this payload is not merged - a phone left out is cleared when the shop makes phone numbers optional. The entry must belong to the customer in the path.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

pickup_info_idRequiredinteger

Pickup info 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.

ReturnsCustomerPickupInfo

Customer pickup info object response

Error responses

404object

The customer or the pickup info does not exist, the customer belongs to another shop, or the pickup info belongs to another customer.

422object

Validation failed, for example a missing first_name/last_name or an invalid phone number.

curl -X PATCH https://api.subbly.co/private/v1/customers/{customer_id}/pickup_info/{pickup_info_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "first_name": "first_name", "last_name": "last_name", "phone": "phone" }'
Response
{ "id": 3487, "pickup_point": { "id": 45, "external_id": "FR-012345", "country_id": 74, "country_code": "FR", "country_name": "France", "type": "mondial_relay", "city": "Paris", "address_one": "address_one", "address_two": "address_two", "zip": "75001" }, "phone": "+13232380656", "first_name": "John", "last_name": "Smith" }

Delete customer pickup info

DELETE /customers/{customer_id}/pickup_info/{pickup_info_id}

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

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

pickup_info_idRequiredinteger

Pickup info ID

Format: integer.

ReturnsCustomerPickupInfo

The deleted pickup info

Error responses

404object

The customer or the pickup info does not exist, the customer belongs to another shop, or the pickup info belongs to another customer.

422object

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

curl -X DELETE https://api.subbly.co/private/v1/customers/{customer_id}/pickup_info/{pickup_info_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 3487, "pickup_point": { "id": 45, "external_id": "FR-012345", "country_id": 74, "country_code": "FR", "country_name": "France", "type": "mondial_relay", "city": "Paris", "address_one": "address_one", "address_two": "address_two", "zip": "75001" }, "phone": "+13232380656", "first_name": "John", "last_name": "Smith" }

Create a customer payment method

POST /customers/{customer_id}/payment_methods

Store a payment method for the customer from a gateway-side token. The token is exchanged with the gateway; only the shape of token is validated up front, so a token the gateway rejects surfaces as a server error rather than a validation error.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

Request body

gateway_idRequiredinteger

ID of a payment gateway belonging to your shop.

tokenRequiredstring

Gateway-side token for the payment instrument, for example a Stripe payment method ID or a Braintree nonce. It is exchanged with the gateway on the spot.

ReturnsPaymentMethod

Payment method object response

Error responses

404object

The customer does not exist or belongs to another shop.

422object

Validation failed, for example a missing token or a gateway_id that does not belong to this shop.

curl -X POST https://api.subbly.co/private/v1/customers/{customer_id}/payment_methods \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "gateway_id": 1, "token": "token" }'
Response
{ "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" }

Delete a customer payment method

DELETE /customers/{customer_id}/payment_methods/{payment_method_id}

Remove a stored payment method and detach it at the gateway. When it was the customer's default payment method, the default is cleared as well. The payment method must belong to the customer in the path.

Path parameters

customer_idRequiredinteger

Customer ID

Format: integer.

payment_method_idRequiredinteger

Payment method ID

Format: integer.

ReturnsPaymentMethod

The deleted payment method

Error responses

404object

The customer or the payment method does not exist, the customer belongs to another shop, or the payment method belongs to another customer.

curl -X DELETE https://api.subbly.co/private/v1/customers/{customer_id}/payment_methods/{payment_method_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 567, "type": "card", "identifier": "4242", "currencies": [ "USD", "EUR" ], "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-01 00:00:00" }
valueRequiredinteger
operatorRequiredstring

Possible values: gt, gte, lt, lte, eq, neq.

paginationobject
dataCustomer[]
idinteger
user_idinteger | null

ID of the user account behind this customer. The same user account can back a customer record in several shops.

first_namestring
last_namestring
emailstring

Format: email.

marketing_consentboolean | null
tos_consent_atstring | null

Format: date-time.

external_idstring | null

Your own identifier for this customer.

default_payment_method_idinteger | null
default_payment_methodPaymentMethod | null

Expandable link to the customer's default payment method

payment_methodsPaymentMethod[] | null

Expandable link to all customer's payment methods

subscriptionsSubscription[] | null

Expandable link to all customer's subscriptions

past_due_invoice_countinteger
balanceinteger

The customer's store credit balance, in minor units.

tagsstring[]

Names of the tags attached to the customer. Always present; does not need to be requested via expand.

tags_metaCustomerTag[]

The same tags with their IDs. Always present; does not need to be requested via expand.

notesNote[] | null

Expandable list of the customer's internal notes

addressesAddress[] | null

Expandable list of the customer's delivery addresses

metadataEntityMetadata[] | null

Customer metadata attributes

created_atstring | null

Format: date-time.

idinteger
user_idinteger | null

ID of the user account behind this customer. The same user account can back a customer record in several shops.

first_namestring
last_namestring
emailstring

Format: email.

marketing_consentboolean | null
tos_consent_atstring | null

Format: date-time.

external_idstring | null

Your own identifier for this customer.

default_payment_method_idinteger | null
default_payment_methodPaymentMethod | null

Expandable link to the customer's default payment method

payment_methodsPaymentMethod[] | null

Expandable link to all customer's payment methods

subscriptionsSubscription[] | null

Expandable link to all customer's subscriptions

past_due_invoice_countinteger
balanceinteger

The customer's store credit balance, in minor units.

tagsstring[]

Names of the tags attached to the customer. Always present; does not need to be requested via expand.

tags_metaCustomerTag[]

The same tags with their IDs. Always present; does not need to be requested via expand.

notesNote[] | null

Expandable list of the customer's internal notes

addressesAddress[] | null

Expandable list of the customer's delivery addresses

metadataEntityMetadata[] | null

Customer metadata attributes

created_atstring | null

Format: date-time.

createoptionalobject[]

Tag names to attach. A tag of this shop with that name is reused, otherwise a new one is created. Values must be distinct within the request, and tags the customer already carries are skipped.

deleteoptionalobject[]

Tags to detach. Each ID must be a tag of this shop.

idinteger
user_idinteger | null

ID of the user account behind this customer. The same user account can back a customer record in several shops.

first_namestring
last_namestring
emailstring

Format: email.

marketing_consentboolean | null
tos_consent_atstring | null

Format: date-time.

external_idstring | null

Your own identifier for this customer.

default_payment_method_idinteger | null
default_payment_methodPaymentMethod | null

Expandable link to the customer's default payment method

payment_methodsPaymentMethod[] | null

Expandable link to all customer's payment methods

subscriptionsSubscription[] | null

Expandable link to all customer's subscriptions

past_due_invoice_countinteger
balanceinteger

The customer's store credit balance, in minor units.

tagsstring[]

Names of the tags attached to the customer. Always present; does not need to be requested via expand.

tags_metaCustomerTag[]

The same tags with their IDs. Always present; does not need to be requested via expand.

notesNote[] | null

Expandable list of the customer's internal notes

addressesAddress[] | null

Expandable list of the customer's delivery addresses

metadataEntityMetadata[] | null

Customer metadata attributes

created_atstring | null

Format: date-time.

idinteger

ID of the deleted record.

deletedboolean
idinteger
user_idinteger | null

ID of the user account behind this customer. The same user account can back a customer record in several shops.

first_namestring
last_namestring
emailstring

Format: email.

marketing_consentboolean | null
tos_consent_atstring | null

Format: date-time.

external_idstring | null

Your own identifier for this customer.

default_payment_method_idinteger | null
default_payment_methodPaymentMethod | null

Expandable link to the customer's default payment method

payment_methodsPaymentMethod[] | null

Expandable link to all customer's payment methods

subscriptionsSubscription[] | null

Expandable link to all customer's subscriptions

past_due_invoice_countinteger
balanceinteger

The customer's store credit balance, in minor units.

tagsstring[]

Names of the tags attached to the customer. Always present; does not need to be requested via expand.

tags_metaCustomerTag[]

The same tags with their IDs. Always present; does not need to be requested via expand.

notesNote[] | null

Expandable list of the customer's internal notes

addressesAddress[] | null

Expandable list of the customer's delivery addresses

metadataEntityMetadata[] | null

Customer metadata attributes

created_atstring | null

Format: date-time.

idinteger
customer_idinteger
notestring
created_atstring | null

Format: date-time.

updated_atstring | null

Format: date-time.

idinteger
customer_idinteger
notestring
created_atstring | null

Format: date-time.

updated_atstring | null

Format: date-time.

idinteger

ID of the deleted record.

deletedboolean
idinteger
first_namestring
last_namestring
country_idinteger | null
region_idinteger | null
countrystring
regionstring | null
phonestring | null
company_namestring | null
address_onestring
address_twostring | null
citystring
zipstring
idinteger
first_namestring
last_namestring
country_idinteger | null
region_idinteger | null
countrystring
regionstring | null
phonestring | null
company_namestring | null
address_onestring
address_twostring | null
citystring
zipstring
idinteger
first_namestring
last_namestring
country_idinteger | null
region_idinteger | null
countrystring
regionstring | null
phonestring | null
company_namestring | null
address_onestring
address_twostring | null
citystring
zipstring
dataCustomerPickupInfo[]
idinteger
pickup_pointPickupPoint | null

The linked external pickup point, or null for a plain local pickup contact.

phonestring | null
first_namestring
last_namestring
idinteger
pickup_pointPickupPoint | null

The linked external pickup point, or null for a plain local pickup contact.

phonestring | null
first_namestring
last_namestring
idinteger
pickup_pointPickupPoint | null

The linked external pickup point, or null for a plain local pickup contact.

phonestring | null
first_namestring
last_namestring
idinteger
typestring

Possible values: paypal, card, ideal, sofort, bancontact, sepa_debit, acss_debit, us_bank_account, link, cashapp, amazon_pay.

identifierstring | null
currenciesstring[]

Codes of the currencies the payment method can be charged in — the shop currencies attached to its gateway. A subscription created with this payment method must bill in one of them.

cardobject | null

Only applicable for the card type

idealobject | null

Only applicable for the ideal type

bancontactobject | null

Only applicable for the bancontact type

acss_debitobject | null

Only applicable for the acss_debit type

us_bank_accountobject | null

Only applicable for the us_bank_account type

sepa_debitobject | null

Only applicable for the sepa_debit type

sofortobject | null

Only applicable for the sofort type

linkobject | null

Only applicable for the link type

cashappobject | null

Only applicable for the cashapp type

created_atstring | null

Format: date-time.

idinteger
typestring

Possible values: paypal, card, ideal, sofort, bancontact, sepa_debit, acss_debit, us_bank_account, link, cashapp, amazon_pay.

identifierstring | null
currenciesstring[]

Codes of the currencies the payment method can be charged in — the shop currencies attached to its gateway. A subscription created with this payment method must bill in one of them.

cardobject | null

Only applicable for the card type

idealobject | null

Only applicable for the ideal type

bancontactobject | null

Only applicable for the bancontact type

acss_debitobject | null

Only applicable for the acss_debit type

us_bank_accountobject | null

Only applicable for the us_bank_account type

sepa_debitobject | null

Only applicable for the sepa_debit type

sofortobject | null

Only applicable for the sofort type

linkobject | null

Only applicable for the link type

cashappobject | null

Only applicable for the cashapp type

created_atstring | null

Format: date-time.