Sign In

Expanding Responses

Many objects allow you to request additional information as an expanded response by using the expand request parameter. This parameter is available on all API requests, and applies to the response of that request only. You can expand responses in two ways.

In many cases, an object contains the ID of a related object in its response properties. You can expand these objects in line with the expand request parameter. The expand object button in this documentation indicates ID fields that you can expand into objects.

You can use the expand parameter on any endpoint that returns expandable fields, including list, create, and update endpoints.

GET /v1/customers/:customer/locations/:id

curl -X GET api.gpcoservices.com/v1/customers/076233c1-dd98-4f14-9914-810e844c1cd5/locations/8e1ce3cc-1df8-43c2-852f-4c8f5181d284 \ -H "GPC-Api-Key: {key}" \ -d expand="address" Copy

Expansions have different maximum depths. Each expandable object will include documentation informing you of it's maximum depth.

You can expand multiple objects at the same time by identifying multiple items in the expand array.

GET /v1/customers/:customer/locations/:id

curl -X GET api.gpcoservices.com/v1/customers/076233c1-dd98-4f14-9914-810e844c1cd5/locations/8e1ce3cc-1df8-43c2-852f-4c8f5181d284 \ -H "GPC-Api-Key: {key}" \ -d "expand[]"="address" \ -d "expand[]"="shipping.address" Copy
Check out the Customer Locations Model