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.

GET /v1/integrations
curl "https://api.parcelhub.ca/v1/integrations" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "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 string

    Store platform code from GET /v1/integrations, e.g. shopify.

  • shop string

    The store's domain, where the platform needs it (Shopify: your-store.myshopify.com).

Response in data

See the example on the right.

POST /v1/integrations/connect
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"
}'
Response
{
  "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 string

    Store platform code from GET /v1/integrations, e.g. woocommerce or wix.

  • fields • Required any

    That platform's connection fields (for example store URL, key and secret).

Response in data

See the example on the right.

POST /v1/integrations/connect-api-key
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
}'
Response
{
  "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.

DELETE /v1/integrations/connections/{id}
curl -X DELETE "https://api.parcelhub.ca/v1/integrations/connections/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "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.

POST /v1/integrations/connections/{id}/sync
curl -X POST "https://api.parcelhub.ca/v1/integrations/connections/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f/sync" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "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 string

    The connected store's id.

  • external_order_ids • Required array of strings

    The id of each order from GET /v1/integrations/orders.

  • batch_id uuid

    Batch the shipments join when their labels are bought. Leave out for the store's own batch.

  • batch_name string

    Name for the store's own batch, if this import creates it.

  • shop_name string

    Store name to show as the shipment's source.

Response in data

See the example on the right.

POST /v1/integrations/import
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"
}'
Response
{
  "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_id string

    Only orders from this connected store.

  • channel string

    Only this store platform, e.g. shopify.

  • status string

    Order status, e.g. unfulfilled.

  • since string

    Orders created on or after this date (YYYY-MM-DD or an ISO time).

  • cursor string

    The next_cursor of the previous page.

  • limit string

    Most orders to return.

Response in data

See the example on the right.

GET /v1/integrations/orders
curl "https://api.parcelhub.ca/v1/integrations/orders" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "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.

GET /v1/integrations/orders/{id}
curl "https://api.parcelhub.ca/v1/integrations/orders/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "ok": true,
  "data": null,
  "request_id": "01JBX7Q2…"
}