API reference
Discounts
Discount codes, promotions and referrals.
Get a discount campaign
GET /v1/discounts/campaigns/{id}
A discount campaign (from a my.parcelhub.ca/discount/… link) and whether this account can claim it.
Path parameters
id• Required string
Response in data
campaign• Required objectFields · 14
appliesTo• Required array of stringsclaimCount• Required integerid• Required uuidpercentageBps• Required integerstate• Required stringProvince or state code, e.g.
ON,BC,NY.theme• Required stringexpiresAttimestampmaxClaimsintegermaxDiscountCentsintegerminPurchaseCentsintegerremainingintegerstartsAttimestampsubtitlestringtitlestring
claimed• Required booleancodestring
curl "https://api.parcelhub.ca/v1/discounts/campaigns/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f" \
-H "Authorization: Bearer $TOKEN"{
"ok": true,
"data": {
"campaign": {
"appliesTo": [
"string"
],
"claimCount": 1,
"expiresAt": "2026-10-31T15:04:05Z",
"id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"maxClaims": 1,
"maxDiscountCents": 1,
"minPurchaseCents": 1,
"percentageBps": 1,
"remaining": 1,
"startsAt": "2026-10-31T15:04:05Z",
"state": "ON",
"subtitle": "string",
"theme": "string",
"title": "string"
},
"claimed": true,
"code": "string"
},
"request_id": "01JBX7Q2…"
}Claim a discount campaign
POST /v1/discounts/campaigns/{id}/claim
Adds the campaign to the account so it applies at checkout.
Path parameters
id• Required string
Response in data
message• Required stringoutcome• Required stringcodestring
curl -X POST "https://api.parcelhub.ca/v1/discounts/campaigns/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f/claim" \
-H "Authorization: Bearer $TOKEN"{
"ok": true,
"data": {
"code": "string",
"message": "string",
"outcome": "string"
},
"request_id": "01JBX7Q2…"
}Check a discount code
POST /v1/discounts/validate
Whether a code is valid and what it takes off an amount. Nothing is used up.
Request body
code• Required stringThe discount code.
subtotal_cents• Required integerThe amount the discount would apply to, in cents.
target_kindstringWhat it is for:
shipment.
Response in data
applied_cents• Required integerok• Required booleancodestringmessagestringrejectionstring
curl -X POST "https://api.parcelhub.ca/v1/discounts/validate" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"code": "string",
"subtotal_cents": 1299,
"target_kind": "shipment"
}'{
"ok": true,
"data": {
"applied_cents": 1299,
"code": "string",
"message": "string",
"ok": true,
"rejection": "string"
},
"request_id": "01JBX7Q2…"
}Get a promotion
GET /v1/promos/{id}
A promotion (from a my.parcelhub.ca/promo/… link) and whether this account can claim it.
Path parameters
id• Required string
Response in data
campaign• Required objectFields · 16
claimCount• Required integercreditCents• Required integerendsAt• Required timestampid• Required uuidkind• Required stringstartsAt• Required timestampstate• Required stringProvince or state code, e.g.
ON,BC,NY.carrierstringCarrier code, as returned with each rate.
carrierLabelstringmaxClaimsintegerminTopupCentsintegerremainingintegerrequiredShipmentsintegersubtitlestringtiersarray of objectsEach item · 2
bonusCents• Required integerminTopupCents• Required integer
titlestring
eligibility• Required objectFields · 4
eligible• Required booleanreason• Required stringprogressCurrentintegerprogressRequiredinteger
claimedAttimestampclaimedCentsinteger
curl "https://api.parcelhub.ca/v1/promos/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f" \
-H "Authorization: Bearer $TOKEN"{
"ok": true,
"data": {
"campaign": {
"carrier": "ups",
"carrierLabel": "string",
"claimCount": 1,
"creditCents": 1,
"endsAt": "2026-10-31T15:04:05Z",
"id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"kind": "string",
"maxClaims": 1,
"minTopupCents": 1,
"remaining": 1,
"requiredShipments": 1,
"startsAt": "2026-10-31T15:04:05Z",
"state": "ON",
"subtitle": "string",
"tiers": [
{
"bonusCents": 1,
"minTopupCents": 1
}
],
"title": "string"
},
"claimedAt": "2026-10-31T15:04:05Z",
"claimedCents": 1,
"eligibility": {
"eligible": true,
"progressCurrent": 1,
"progressRequired": 1,
"reason": "string"
}
},
"request_id": "01JBX7Q2…"
}Claim a promotion
POST /v1/promos/{id}/claim
Claims the promotion onto the account.
Path parameters
id• Required string
Response in data
armed• Required booleancreditedCents• Required integerwalletAvailableCents• Required integerbonusCentsintegerminTopupCentsinteger
curl -X POST "https://api.parcelhub.ca/v1/promos/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f/claim" \
-H "Authorization: Bearer $TOKEN"{
"ok": true,
"data": {
"armed": true,
"bonusCents": 1,
"creditedCents": 1,
"minTopupCents": 1,
"walletAvailableCents": 1
},
"request_id": "01JBX7Q2…"
}Referrals
GET /v1/referrals
The account's referral link, the people it referred and the credit earned.
Response in data
enabled• Required booleanprogram• Required objectFields · 6
stage1Cents• Required integerstage1ThresholdCents• Required integerstage2Cents• Required integerstage2ThresholdCents• Required integerheadlinestringsubtitlestring
referrals• Required anyrewards• Required anystats• Required anycodestringshareUrlstring
curl "https://api.parcelhub.ca/v1/referrals" \
-H "Authorization: Bearer $TOKEN"{
"ok": true,
"data": {
"code": "string",
"enabled": true,
"program": {
"headline": "string",
"stage1Cents": 1,
"stage1ThresholdCents": 1,
"stage2Cents": 1,
"stage2ThresholdCents": 1,
"subtitle": "string"
},
"referrals": null,
"rewards": null,
"shareUrl": "string",
"stats": null
},
"request_id": "01JBX7Q2…"
}