Extending responses
Our API endpoints and webhooks allow developers to extend responses with additional data in order to optimize calls, allowing for simpler and more efficient implementations.
The API supports including additional objects when using a GET request to retrieve a list or a GET request to retrieve a record by a specific id. This is achieved by using an include query parameter in the request URL. The include value contains the object or objects you want to include in the response of your request. On routes where multiple includes are available, you are able to pass multiple values separated by a comma (include=customer,metafields). The below table defines available include values for commonly used resources of the API.
Webhooks support included_objects on the topics listed below. Webhook included_objects accepts an array of supported values ("included_objects": [ "customer", "metafields"]). Specifying included_objects will return an enriched payload, containing the original resource and the associated included objects.
When including charge_activities in API calls or webhooks, note that only the last 90 days of activities will be included in the response.
| Resource | Endpoints | Webhook topics | Supported include values |
Supported included_objects values |
|---|---|---|---|---|
Addresses |
GET /addressesGET /addresses/{id} |
address/createdaddress/updated |
charge_activitiescustomerdiscountpayment_methodssubscriptions |
customerpayment_methods |
Charges |
GET /chargesGET /charges/{id} |
charge/createdcharge/failedcharge/max_retries_reachedcharge/paidcharge/refundedcharge/uncapturedcharge/upcomingcharge/updated charge/deleted |
charge_activities (beta)customermetafieldspayment_methods |
customermetafieldspayment_methods |
Customers |
GET /customersGET /customers/{id} |
customer/activatedcustomer/createdcustomer/deactivatedcustomer/payment_method_updatedcustomer/updatedcustomer/deleted |
addressesmetafieldspayment_methods subscriptionsreferral_info |
addressesmetafieldspayment_methods |
Orders |
GET /ordersGET /orders/{id} |
order/cancelledorder/createdorder/deletedorder/processedorder/payment_capturedorder/upcomingorder/updatedorder/success |
customermetafieldssubscriptions |
customermetafields |
Payment Methods |
GET /payment_methodsGET /payment_methods/{id} |
addresses |
addresses |
|
Subscriptions |
GET /subscriptionsGET /subscriptions/{id} |
subscription/activatedsubscription/cancelledsubscription/createdsubscription/deletedsubscription/skippedsubscription/updatedsubscription/unskippedsubscription/paused |
addresscharge_activitiescustomermetafieldsbundle_productbundle_selections |
customermetafields |