Warehouse / Guides

Getting started

Send your first request to the PackCloud GraphQL API.

Choose the right schema

Use the Organization API for commercial and configuration data. Use the Warehouse API for daily warehouse operations. Use the Tenant API to manage your clients, pricing, and billing as a fulfilment provider. A request is always scoped by the identifier in its endpoint.

Organizationhttps://api.pack.cloud/v1/organizations/{organizationId}/graphql
Warehousehttps://api.pack.cloud/v1/warehouses/{warehouseId}/graphql
Tenanthttps://api.pack.cloud/v1/tenants/{tenantId}/graphql

How a GraphQL request works

GraphQL uses one endpoint per schema. Your request contains an operation that names the fields you need; the response mirrors that field structure.

OperationA query reads data; a mutation changes data.
FieldsSelect only the response fields your integration needs.
Type markersSquare brackets mean a list; an exclamation mark means non-null.
VariablesPass IDs, filters, and input separately from the operation text.
ConnectionA paginated list with edges, nodes, cursors, and pageInfo.

Make a request

Replace the path identifier and token, then send a JSON POST request.

curl --request POST "https://api.pack.cloud/v1/warehouses/{warehouseId}/graphql" \
--header "Authorization: Bearer $PACKCLOUD_TOKEN" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{"query":"query FirstPage { orders(first: 1) { edges { node { id } } } }"}'

GraphQL responses return JSON. A successful request can still contain an errors array, so inspect the response body as well as the HTTP status.

Next steps

Create an API key as described in Authentication. Pagination and Search queries explain how to page through and filter lists.