API reference
Stores
Connected online stores (Shopify, WooCommerce, Wix and others) and their orders.
Connected stores
GET /v1/integrations
Stores connected to this account and the store platforms that can be connected.
Response in data
See the example on the right.
curl "https://api.parcelhub.ca/v1/integrations" \
-H "Authorization: Bearer $TOKEN"{
"ok": true,
"data": null,
"request_id": "01JBX7Q2…"
}Connect a store (sign-in)
POST /v1/integrations/connect
Starts connecting a store that uses a sign-in (such as Shopify). Returns a connect_url: the store owner opens it and approves the connection in their store.
Request body
channel• Required stringStore platform code from
GET /v1/integrations, e.g.shopify.shopstringThe store's domain, where the platform needs it (Shopify:
your-store.myshopify.com).
Response in data
See the example on the right.
curl -X POST "https://api.parcelhub.ca/v1/integrations/connect" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"channel": "shopify",
"shop": "your-store.myshopify.com"
}'{
"ok": true,
"data": null,
"request_id": "01JBX7Q2…"
}Connect a store (API keys)
POST /v1/integrations/connect-api-key
Connects a store that uses API keys, such as WooCommerce or Wix. fields holds that platform's keys; GET /v1/integrations lists which fields each platform needs.
Request body
channel• Required stringStore platform code from
GET /v1/integrations, e.g.woocommerceorwix.fields• Required anyThat platform's connection fields (for example store URL, key and secret).
Response in data
See the example on the right.
curl -X POST "https://api.parcelhub.ca/v1/integrations/connect-api-key" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"channel": "woocommerce",
"fields": null
}'{
"ok": true,
"data": null,
"request_id": "01JBX7Q2…"
}Disconnect a store
DELETE /v1/integrations/connections/{id}
Disconnects a store: its orders stop syncing. Shipments already made are kept.
Path parameters
id• Required string
Response in data
See the example on the right.
curl -X DELETE "https://api.parcelhub.ca/v1/integrations/connections/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f" \
-H "Authorization: Bearer $TOKEN"{
"ok": true,
"data": null,
"request_id": "01JBX7Q2…"
}Sync a store
POST /v1/integrations/connections/{id}/sync
Asks a connected store for its latest orders now. It runs in the background; orders appear in GET /v1/integrations/orders within about a minute.
Path parameters
id• Required string
Response in data
See the example on the right.
curl -X POST "https://api.parcelhub.ca/v1/integrations/connections/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f/sync" \
-H "Authorization: Bearer $TOKEN"{
"ok": true,
"data": null,
"request_id": "01JBX7Q2…"
}Import store orders
POST /v1/integrations/import
Turns store orders into shipment drafts, ready to rate and buy. Nothing is bought. When a label is bought the store is told it shipped, with the tracking number.
Request body
connection_id• Required stringThe connected store's id.
external_order_ids• Required array of stringsThe
idof each order fromGET /v1/integrations/orders.batch_iduuidBatch the shipments join when their labels are bought. Leave out for the store's own batch.
batch_namestringName for the store's own batch, if this import creates it.
shop_namestringStore name to show as the shipment's source.
Response in data
See the example on the right.
curl -X POST "https://api.parcelhub.ca/v1/integrations/import" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"batch_name": "string",
"connection_id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"external_order_ids": [
"3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f"
],
"shop_name": "string"
}'{
"ok": true,
"data": null,
"request_id": "01JBX7Q2…"
}Store orders
GET /v1/integrations/orders
Orders from connected stores, newest first, each marked with whether it was already imported. Page with cursor (the next_cursor of the previous page).
Query parameters
connection_idstringOnly orders from this connected store.
channelstringOnly this store platform, e.g.
shopify.statusstringOrder status, e.g.
unfulfilled.sincestringOrders created on or after this date (
YYYY-MM-DDor an ISO time).cursorstringThe
next_cursorof the previous page.limitstringMost orders to return.
Response in data
See the example on the right.
curl "https://api.parcelhub.ca/v1/integrations/orders" \
-H "Authorization: Bearer $TOKEN"{
"ok": true,
"data": null,
"request_id": "01JBX7Q2…"
}Get a store order
GET /v1/integrations/orders/{id}
One store order with its line items and ship-to address.
Path parameters
id• Required string
Response in data
See the example on the right.
curl "https://api.parcelhub.ca/v1/integrations/orders/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f" \
-H "Authorization: Bearer $TOKEN"{
"ok": true,
"data": null,
"request_id": "01JBX7Q2…"
}