{"components":{"responses":{"Error":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request failed. `error.code` is stable; `error.message` explains it."}},"schemas":{"ActiveOrgResponse":{"properties":{"activeOrganizationId":{"format":"uuid","type":"string"}},"required":["activeOrganizationId"],"type":"object"},"AddPickupShipmentsRequest":{"properties":{"shipment_ids":{"description":"Ids of purchased shipments.","items":{"format":"uuid","type":"string"},"type":"array"}},"required":["shipment_ids"],"type":"object"},"AddShipmentRequest":{"properties":{"shipment_id":{"description":"One shipment to add.","format":"uuid","type":"string"},"shipment_ids":{"description":"Several shipments to add.","items":{"format":"uuid","type":"string"},"type":"array"}},"type":"object"},"AddressDefaultsResponse":{"properties":{"default_from":{"$ref":"#/components/schemas/AddressResponse"},"default_to":{"$ref":"#/components/schemas/AddressResponse"}},"type":"object"},"AddressResponse":{"properties":{"city":{"description":"City.","type":"string"},"company":{"description":"Company name.","type":"string"},"country":{"description":"Two-letter country code, e.g. `CA`, `US`.","type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"email":{"description":"Email address.","type":"string"},"id":{"format":"uuid","type":"string"},"is_default_from":{"type":"boolean"},"is_default_to":{"type":"boolean"},"is_residential":{"description":"True for a home address. Some carriers charge more for residential delivery.","type":"boolean"},"line2":{"description":"Apartment, suite or unit.","type":"string"},"name":{"type":"string"},"nickname":{"type":"string"},"phone":{"description":"Phone number. Carriers need one for the recipient on most international and express services.","type":"string"},"postal_code":{"description":"Postal or ZIP code.","type":"string"},"state":{"description":"Province or state code, e.g. `ON`, `BC`, `NY`.","type":"string"},"street":{"description":"Street address.","type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"}},"required":["id","nickname","name","street","city","state","postal_code","country","is_residential","tags","is_default_from","is_default_to","created_at","updated_at"],"type":"object"},"AddressSourceGroup":{"properties":{"addresses":{"items":{"$ref":"#/components/schemas/AddressResponse"},"type":"array"},"is_personal":{"type":"boolean"},"name":{"type":"string"},"organization_id":{"format":"uuid","type":"string"}},"required":["organization_id","name","is_personal","addresses"],"type":"object"},"AddressSourcesResponse":{"properties":{"active":{"$ref":"#/components/schemas/AddressSourceGroup"},"business_address_id":{"format":"uuid","type":"string"},"personal":{"$ref":"#/components/schemas/AddressSourceGroup"}},"required":["active"],"type":"object"},"AddressesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AddressResponse"},"type":"array"}},"required":["items"],"type":"object"},"ApiClientTokenRequest":{"properties":{"client_id":{"description":"The key's client id (`ph_client_…`).","type":"string"},"client_secret":{"description":"The key's secret (`ph_secret_…`), shown once when the key was created.","type":"string"}},"required":["client_id","client_secret"],"type":"object"},"ApiClientTokenResponse":{"properties":{"access_token":{"type":"string"},"expires_at":{"type":"string"},"kid":{"type":"string"}},"required":["access_token","expires_at","kid"],"type":"object"},"ApiKeyConnectBody":{"properties":{"channel":{"description":"Store platform code from `GET /v1/integrations`, e.g. `woocommerce` or `wix`.","type":"string"},"fields":{"description":"That platform's connection fields (for example store URL, key and secret)."}},"required":["channel","fields"],"type":"object"},"ArchivePickupRequest":{"properties":{"archived":{"description":"`true` to archive (the default), `false` to bring it back.","type":"boolean"}},"type":"object"},"ArchiveShipmentRequest":{"properties":{"archived":{"description":"`true` to archive (the default), `false` to bring it back.","type":"boolean"}},"type":"object"},"BatchDraftRow":{"properties":{"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"package_count":{"type":"integer"},"step":{"type":"string"},"to_city":{"type":"string"},"to_country":{"description":"Ship-to country code.","type":"string"},"to_name":{"type":"string"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"}},"required":["id","step","package_count","created_at","updated_at"],"type":"object"},"BatchDraftsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BatchDraftRow"},"type":"array"}},"required":["items"],"type":"object"},"BatchLabelsResponse":{"properties":{"skipped":{"items":{"format":"uuid","type":"string"},"type":"array"},"url":{"type":"string"}},"required":["url","skipped"],"type":"object"},"BatchResponse":{"properties":{"batchNumber":{"type":"string"},"branchId":{"format":"uuid","type":"string"},"createdAt":{"format":"date-time","type":"string"},"draftCount":{"type":"integer"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"notes":{"description":"Free-text notes.","type":"string"},"shipmentCount":{"type":"integer"},"source":{"description":"Where the shipment came from. Leave out (it becomes `manual`) or name your integration, e.g. `api`.","type":"string"},"sourceName":{"type":"string"},"status":{"type":"string"},"storeId":{"format":"uuid","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"userId":{"format":"uuid","type":"string"}},"required":["id","batchNumber","name","userId","status","source","shipmentCount","draftCount","createdAt","updatedAt"],"type":"object"},"BatchShipmentRow":{"properties":{"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"createdAt":{"format":"date-time","type":"string"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"finalRateCents":{"type":"integer"},"id":{"format":"uuid","type":"string"},"orderNumber":{"type":"string"},"service":{"type":"string"},"status":{"type":"string"},"toAddress":{},"trackingNumber":{"type":"string"}},"required":["id","orderNumber","carrier","service","status","toAddress","finalRateCents","currency","createdAt"],"type":"object"},"BatchShipmentsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BatchShipmentRow"},"type":"array"}},"required":["items"],"type":"object"},"BatchesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BatchResponse"},"type":"array"}},"required":["items"],"type":"object"},"BestSaving":{"properties":{"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"kind":{"type":"string"},"reference_cents":{"type":"integer"},"saved_cents":{"type":"integer"},"service":{"type":"string"},"shipment_id":{"format":"uuid","type":"string"},"to_city":{"type":"string"},"to_state":{"type":"string"}},"required":["shipment_id","carrier","service","to_city","to_state","saved_cents","reference_cents","kind"],"type":"object"},"BucketCount":{"properties":{"count":{"type":"integer"},"key":{"type":"integer"}},"required":["key","count"],"type":"object"},"CancelShipmentRequest":{"properties":{"reason":{"description":"Why the label is being voided.","type":"string"}},"type":"object"},"CarrierCutoffItem":{"properties":{"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"cutoff_time":{"type":"string"},"display_name":{"type":"string"},"note":{"type":"string"},"source":{"description":"Where the shipment came from. Leave out (it becomes `manual`) or name your integration, e.g. `api`.","type":"string"},"supports_pickup":{"type":"boolean"}},"required":["carrier","display_name","supports_pickup"],"type":"object"},"CarrierWithNoOptions":{"properties":{"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"carrier_display_name":{"description":"Carrier name to show to people.","type":"string"},"reason":{"type":"string"}},"required":["carrier","carrier_display_name","reason"],"type":"object"},"ChatAvailabilityResponse":{"properties":{"hours":{"type":"string"},"is_online":{"type":"boolean"},"next_available":{"type":"string"}},"required":["is_online","hours"],"type":"object"},"CityRow":{"properties":{"city":{"description":"City.","type":"string"},"country":{"description":"Two-letter country code, e.g. `CA`, `US`.","type":"string"},"region":{"type":"string"},"shipments":{"type":"integer"}},"required":["city","region","country","shipments"],"type":"object"},"ClaimDiscountResponse":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"outcome":{"type":"string"}},"required":["outcome","message"],"type":"object"},"ClaimResponse":{"properties":{"armed":{"type":"boolean"},"bonusCents":{"type":"integer"},"creditedCents":{"type":"integer"},"minTopupCents":{"type":"integer"},"walletAvailableCents":{"type":"integer"}},"required":["creditedCents","walletAvailableCents","armed"],"type":"object"},"ConfirmPickupDraftRequest":{"properties":{"discount_code":{"description":"A discount code to apply.","type":"string"}},"type":"object"},"ConfirmTopUpResponse":{"properties":{"bonus_cents":{"type":"integer"},"bonus_kind":{"type":"string"},"transaction":{"$ref":"#/components/schemas/WalletTransactionResponse"}},"required":["transaction"],"type":"object"},"ConnectBody":{"properties":{"channel":{"description":"Store platform code from `GET /v1/integrations`, e.g. `shopify`.","type":"string"},"shop":{"description":"The store's domain, where the platform needs it (Shopify: `your-store.myshopify.com`).","type":"string"}},"required":["channel"],"type":"object"},"CreateBatchRequest":{"properties":{"branch_id":{"description":"Leave out.","format":"uuid","type":"string"},"name":{"type":"string"},"notes":{"description":"Notes for the batch.","type":"string"},"source":{"description":"Where the shipment came from. Leave out (it becomes `manual`) or name your integration, e.g. `api`.","type":"string"},"source_name":{"description":"A name for that source, e.g. your app's name.","type":"string"},"store_id":{"description":"Leave out.","format":"uuid","type":"string"}},"required":["name"],"type":"object"},"CreateCommentRequest":{"properties":{"body":{"description":"The note.","type":"string"}},"required":["body"],"type":"object"},"CreateCustomsItem":{"properties":{"country_of_origin":{"description":"Two-letter code of the country where the item was made.","type":"string"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"description":{"description":"What the item is, specifically (\"cotton t-shirt\", not \"clothing\").","type":"string"},"gross_weight_g":{"description":"Weight including packaging, in grams (optional).","type":"integer"},"hs_code":{"description":"Harmonized System code. Find one with `GET /v1/public/hs-codes?q=…`.","type":"string"},"hs_code_version_id":{"description":"Leave out; set by the dashboard's HS-code picker.","format":"uuid","type":"string"},"manufacturer_country":{"description":"Country of the manufacturer, if different from the origin.","type":"string"},"net_weight_g":{"description":"Weight of all units of this item, in grams.","type":"integer"},"package_index":{"description":"Which box the item is in (from 0).","type":"integer"},"position":{"description":"Order of the item in the list (from 0).","type":"integer"},"quantity":{"description":"How many.","type":"integer"},"sku":{"description":"Your product code.","type":"string"},"unit_value_cents":{"description":"Value of one unit, in cents of `currency`.","type":"integer"}},"required":["package_index","position","description","quantity","unit_value_cents","currency","hs_code","country_of_origin","net_weight_g"],"type":"object"},"CreateDeclarationRequest":{"properties":{"contents_type":{"description":"`merchandise`, `documents`, `gift`, `commercial_sample`, `returned_goods` or `other`.","type":"string"},"declaration_currency":{"description":"Currency of the item values. Use one currency for the whole declaration.","type":"string"},"from_country":{"description":"Ship-from country code.","type":"string"},"hs_code_version_id":{"description":"Leave out; set by the dashboard's HS-code picker.","format":"uuid","type":"string"},"incoterm":{"description":"Who pays duties and taxes: `DAP` (the recipient, on delivery) or `DDP` (you, prepaid with the label, where `GET /v1/shipments/duties-availability` says it is offered).","type":"string"},"invoice_date":{"description":"Invoice date (`YYYY-MM-DD`).","format":"date","type":"string"},"invoice_number":{"description":"Your commercial invoice or order number.","type":"string"},"items":{"description":"Every item in the shipment.","items":{"$ref":"#/components/schemas/CreateCustomsItem"},"type":"array"},"non_delivery_option":{"description":"If it cannot be delivered: `return` (default) or `abandon`.","type":"string"},"reason_for_export":{"description":"`sale`, `gift`, `sample`, `repair`, `return`, `personal` or `other`.","type":"string"},"restrictions_note":{"description":"Any restriction or licence to declare.","type":"string"},"signed_by":{"description":"Name of the person certifying the declaration.","type":"string"},"tax_ids":{"description":"Tax numbers where the destination asks for them, e.g. `{\"IOSS\": \"…\", \"recipient\": \"…\", \"recipient_type\": \"personal\"}`. Brazil, Argentina, Israel and some other countries require the recipient's number."},"to_country":{"description":"Ship-to country code.","type":"string"}},"required":["contents_type","declaration_currency","incoterm","signed_by","from_country","to_country","items"],"type":"object"},"CreateDraftRequest":{"properties":{"batch_id":{"description":"A batch from `GET /v1/batches`.","format":"uuid","type":"string"},"delivery_instructions":{"description":"Instructions for the driver.","type":"string"},"email_notifications":{"description":"Email tracking updates to the recipient.","type":"boolean"},"from":{"allOf":[{"$ref":"#/components/schemas/CreateShipmentAddress"}],"description":"Ship-from address."},"packages":{"description":"One entry per box.","items":{"$ref":"#/components/schemas/CreateShipmentPackage"},"type":"array"},"reference_number":{"description":"Your reference, e.g. an order number. Printed on the label where the carrier allows.","type":"string"},"ship_date":{"description":"Day the parcel will be handed to the carrier (`YYYY-MM-DD`). Leave out for today; up to 7 days ahead.","format":"date","type":"string"},"signature_option":{"description":"Signature on delivery: `none`, `required` or `adult`. Carriers charge extra for a signature.","type":"string"},"to":{"allOf":[{"$ref":"#/components/schemas/CreateShipmentAddress"}],"description":"Ship-to address."}},"required":["from","to"],"type":"object"},"CreateMessageRequest":{"properties":{"attachments":{"description":"Files uploaded in the dashboard (optional).","items":{"type":"string"},"type":"array"},"content":{"description":"The message.","type":"string"}},"required":["content"],"type":"object"},"CreatePickupDraftRequest":{"properties":{"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"shipment_ids":{"description":"Ids of purchased shipments.","items":{"format":"uuid","type":"string"},"type":"array"}},"required":["carrier"],"type":"object"},"CreatePickupRequest":{"properties":{"address":{"description":"Pickup address: the same fields as an address book entry."},"building_type":{"description":"Kind of building: `Office`, `Warehouse`, `Residential` or `Other`.","type":"string"},"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"discount_code":{"description":"A discount code to apply.","type":"string"},"instructions":{"description":"Instructions for the driver.","type":"string"},"pickup_date":{"description":"Pickup day (`YYYY-MM-DD`).","format":"date","type":"string"},"pickup_location":{"description":"Where the parcels will be, e.g. front door, reception.","type":"string"},"shipment_ids":{"description":"Ids of purchased shipments.","items":{"format":"uuid","type":"string"},"type":"array"},"time_window_end":{"description":"Latest pickup time, local (`HH:MM:SS`).","format":"time","type":"string"},"time_window_start":{"description":"Earliest pickup time, local (`HH:MM:SS`).","format":"time","type":"string"}},"required":["carrier","pickup_date","time_window_start","time_window_end","address","shipment_ids"],"type":"object"},"CreateReturnRequest":{"properties":{"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"delivery_instructions":{"description":"Instructions for the driver.","type":"string"},"discount_code":{"description":"A discount code to apply.","type":"string"},"email_notifications":{"description":"Email tracking updates to the recipient.","type":"boolean"},"from":{"allOf":[{"$ref":"#/components/schemas/CreateShipmentAddress"}],"description":"Ship-from address."},"label_size":{"description":"`thermal` (4×6 in) or `standard` (8.5×11 in). Defaults to the account's shipping preference.","type":"string"},"notes":{"description":"Notes for the return.","type":"string"},"packages":{"description":"One entry per box.","items":{"$ref":"#/components/schemas/CreateShipmentPackage"},"type":"array"},"reason":{"description":"`damaged`, `wrong_item`, `not_as_described`, `refused`, `no_longer_needed` or `other`.","type":"string"},"reference_number":{"description":"Your reference, e.g. an order number. Printed on the label where the carrier allows.","type":"string"},"return_type":{"description":"`print_label` (default).","type":"string"},"service_code":{"description":"Service code, as returned with each rate. Treat it as opaque and send it back unchanged when you buy: it can carry routing details for that exact rate.","type":"string"},"service_name":{"description":"Service name to show to people.","type":"string"},"signature_option":{"description":"Signature on delivery: `none`, `required` or `adult`. Carriers charge extra for a signature.","type":"string"},"to":{"allOf":[{"$ref":"#/components/schemas/CreateShipmentAddress"}],"description":"Ship-to address."}},"type":"object"},"CreateReturnResponse":{"properties":{"return":{"$ref":"#/components/schemas/ShipmentReturnResponse"},"shipment":{"$ref":"#/components/schemas/ShipmentDetailResponse"}},"required":["shipment","return"],"type":"object"},"CreateShipmentAddress":{"properties":{"city":{"description":"City.","type":"string"},"company":{"description":"Company name.","type":"string"},"country":{"description":"Two-letter country code, e.g. `CA`, `US`.","type":"string"},"email":{"description":"Email address.","type":"string"},"is_residential":{"description":"True for a home address. Some carriers charge more for residential delivery.","type":"boolean"},"line2":{"description":"Apartment, suite or unit.","type":"string"},"name":{"type":"string"},"phone":{"description":"Phone number. Carriers need one for the recipient on most international and express services.","type":"string"},"postal_code":{"description":"Postal or ZIP code.","type":"string"},"state":{"description":"Province or state code, e.g. `ON`, `BC`, `NY`.","type":"string"},"street":{"description":"Street address.","type":"string"}},"required":["name","street","city","state","postal_code","country"],"type":"object"},"CreateShipmentItem":{"properties":{"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"customs_description":{"description":"Description for customs, if different.","type":"string"},"description":{"description":"What the item is.","type":"string"},"hs_code":{"description":"Harmonized System code.","type":"string"},"origin_country":{"description":"Two-letter code of the country where the item was made.","type":"string"},"quantity":{"description":"How many.","type":"integer"},"sku":{"description":"Your product code.","type":"string"},"unit_value_cents":{"description":"Value of one unit, in cents.","type":"integer"}},"required":["description","quantity","unit_value_cents","currency"],"type":"object"},"CreateShipmentPackage":{"properties":{"box_id":{"description":"A standard box from `GET /v1/package-boxes`, if one was used.","format":"uuid","type":"string"},"dimension_unit":{"description":"`in` or `cm`.","type":"string"},"height":{"description":"Height, in `dimension_unit`.","type":"number"},"items":{"description":"What is in this box (optional for domestic shipments).","items":{"$ref":"#/components/schemas/CreateShipmentItem"},"type":"array"},"length":{"description":"Length, in `dimension_unit`.","type":"number"},"name":{"type":"string"},"preset_id":{"description":"A saved box from `GET /v1/package-presets`, if one was used.","format":"uuid","type":"string"},"weight":{"description":"Weight of the box with its contents, in `weight_unit`.","type":"number"},"weight_unit":{"description":"`lb` or `kg`.","type":"string"},"width":{"description":"Width, in `dimension_unit`.","type":"number"}},"required":["weight","weight_unit","length","width","height","dimension_unit","items"],"type":"object"},"CreateShipmentRequest":{"properties":{"carrier":{"description":"The `carrier` of the chosen rate, exactly as `POST /v1/rates` returned it.","type":"string"},"customs_declaration_id":{"description":"A customs declaration from `POST /v1/customs/declarations`. Needed for shipments that cross a border.","format":"uuid","type":"string"},"delivery_instructions":{"description":"Instructions for the driver.","type":"string"},"discount_code":{"description":"A discount code to apply.","type":"string"},"email_notifications":{"description":"Email tracking updates to the recipient.","type":"boolean"},"from":{"allOf":[{"$ref":"#/components/schemas/CreateShipmentAddress"}],"description":"Ship-from address."},"label_size":{"description":"`thermal` (4×6 in) or `standard` (8.5×11 in). Defaults to the account's shipping preference.","type":"string"},"packages":{"description":"One entry per box.","items":{"$ref":"#/components/schemas/CreateShipmentPackage"},"type":"array"},"quote_id":{"description":"The `quote_id` from the `POST /v1/rates` response the chosen rate came from.","format":"uuid","type":"string"},"reference_number":{"description":"Your reference, e.g. an order number. Printed on the label where the carrier allows.","type":"string"},"service_code":{"description":"The `service_code` of the chosen rate.","type":"string"},"service_name":{"description":"The `service_name` of the chosen rate.","type":"string"},"ship_date":{"description":"Day the parcel will be handed to the carrier (`YYYY-MM-DD`). Leave out for today; up to 7 days ahead.","format":"date","type":"string"},"signature_option":{"description":"Signature on delivery: `none`, `required` or `adult`. Carriers charge extra for a signature.","type":"string"},"source":{"description":"Where the shipment came from. Leave out (it becomes `manual`) or name your integration, e.g. `api`.","type":"string"},"source_name":{"description":"A name for that source, e.g. your app's name.","type":"string"},"to":{"allOf":[{"$ref":"#/components/schemas/CreateShipmentAddress"}],"description":"Ship-to address."}},"required":["carrier","service_code","service_name","from","to","packages"],"type":"object"},"CreateTicketRequest":{"properties":{"attachments":{"description":"Files uploaded in the dashboard (optional).","items":{"type":"string"},"type":"array"},"category":{"description":"`shipments`, `pickups`, `wallet_dropoff` (wallet, billing and drop-offs), `designs`, `prints` or `other`.","type":"string"},"description":{"description":"The details.","type":"string"},"priority":{"description":"`low`, `medium`, `high` or `urgent`.","type":"string"},"related_items":{"description":"Shipments, pickups or invoices the ticket is about.","items":{"type":"string"},"type":"array"},"subject":{"description":"A short summary.","type":"string"}},"required":["category","priority","subject"],"type":"object"},"CustomsDeclarationResponse":{"properties":{"contents_type":{"type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"declaration_currency":{"type":"string"},"eei_reason":{"type":"string"},"eei_required":{"type":"boolean"},"hs_code_version_id":{"description":"Leave out; set by the dashboard's HS-code picker.","format":"uuid","type":"string"},"id":{"format":"uuid","type":"string"},"incoterm":{"type":"string"},"invoice_date":{"format":"date","type":"string"},"invoice_number":{"type":"string"},"items":{"items":{"$ref":"#/components/schemas/CustomsItemResponse"},"type":"array"},"non_delivery_option":{"type":"string"},"reason_for_export":{"type":"string"},"restrictions_note":{"type":"string"},"shipment_id":{"format":"uuid","type":"string"},"signed_by":{"type":"string"},"tax_ids":{},"total_value_cents":{"type":"integer"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"}},"required":["id","contents_type","declaration_currency","incoterm","signed_by","non_delivery_option","eei_required","total_value_cents","tax_ids","created_at","updated_at","items"],"type":"object"},"CustomsInvoiceUrlResponse":{"properties":{"filename":{"type":"string"},"url":{"type":"string"}},"required":["url","filename"],"type":"object"},"CustomsItemResponse":{"properties":{"country_of_origin":{"type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"description":{"type":"string"},"gross_weight_g":{"type":"integer"},"hs_code":{"description":"Harmonized System code.","type":"string"},"hs_code_version_id":{"description":"Leave out; set by the dashboard's HS-code picker.","format":"uuid","type":"string"},"id":{"format":"uuid","type":"string"},"manufacturer_country":{"type":"string"},"net_weight_g":{"type":"integer"},"package_index":{"type":"integer"},"position":{"type":"integer"},"quantity":{"description":"How many.","type":"integer"},"sku":{"description":"Your product code.","type":"string"},"unit_value_cents":{"type":"integer"}},"required":["id","package_index","position","description","quantity","unit_value_cents","currency","hs_code","country_of_origin","net_weight_g","created_at"],"type":"object"},"DeleteAddressResponse":{"properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"type":"object"},"DeletePaymentMethodResponse":{"properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"type":"object"},"DeletePresetResponse":{"properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"type":"object"},"DetachShipmentResponse":{"properties":{"empty":{"type":"boolean"},"pickup":{"$ref":"#/components/schemas/PickupResponse"},"remaining_shipments":{"type":"integer"}},"required":["pickup","remaining_shipments","empty"],"type":"object"},"DispositionRequestBody":{"properties":{"action":{"description":"`return_to_merchant`, `continue_storage`, `auction`, `donate` or `destroy`.","type":"string"},"notes":{"description":"Free-text notes.","type":"string"}},"required":["action"],"type":"object"},"DispositionResponse":{"properties":{"action":{"type":"string"},"executed_at":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"responded_at":{"format":"date-time","type":"string"},"return_item_id":{"format":"uuid","type":"string"}},"required":["id","return_item_id","action"],"type":"object"},"DraftBatchFacet":{"properties":{"batch_id":{"description":"A batch from `GET /v1/batches`.","format":"uuid","type":"string"},"count":{"type":"integer"},"name":{"type":"string"},"status":{"type":"string"}},"required":["count"],"type":"object"},"DraftResponse":{"properties":{"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"customs_declaration_id":{"description":"A customs declaration from `POST /v1/customs/declarations`. Needed for shipments that cross a border.","format":"uuid","type":"string"},"delivery_instructions":{"description":"Instructions for the driver.","type":"string"},"discount_code":{"description":"A discount code to apply.","type":"string"},"email_notifications":{"description":"Email tracking updates to the recipient.","type":"boolean"},"expires_at":{"format":"date-time","type":"string"},"from":{"description":"Ship-from address.","type":"string"},"id":{"format":"uuid","type":"string"},"label_size":{"description":"`thermal` (4×6 in) or `standard` (8.5×11 in). Defaults to the account's shipping preference.","type":"string"},"packages":{"description":"One entry per box.","type":"string"},"processed_at":{"format":"date-time","type":"string"},"reference_number":{"description":"Your reference, e.g. an order number. Printed on the label where the carrier allows.","type":"string"},"selected_amount_cents":{"type":"integer"},"selected_carrier":{"type":"string"},"selected_currency":{"type":"string"},"selected_service_code":{"type":"string"},"selected_service_name":{"type":"string"},"ship_date":{"description":"Day the parcel will be handed to the carrier (`YYYY-MM-DD`). Leave out for today; up to 7 days ahead.","format":"date","type":"string"},"shipment_id":{"format":"uuid","type":"string"},"signature_option":{"description":"Signature on delivery: `none`, `required` or `adult`. Carriers charge extra for a signature.","type":"string"},"step":{"type":"string"},"to":{"description":"Ship-to address.","type":"string"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"}},"required":["id","from","to","packages","step","label_size","email_notifications","created_at","updated_at"],"type":"object"},"DraftSummary":{"properties":{"batch_id":{"description":"A batch from `GET /v1/batches`.","format":"uuid","type":"string"},"batch_name":{"type":"string"},"batch_status":{"type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"expires_at":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"package_count":{"type":"integer"},"selected_amount_cents":{"type":"integer"},"selected_carrier":{"type":"string"},"selected_currency":{"type":"string"},"selected_service_name":{"type":"string"},"shipment_id":{"format":"uuid","type":"string"},"step":{"type":"string"},"to_city":{"type":"string"},"to_country":{"description":"Ship-to country code.","type":"string"},"to_name":{"type":"string"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"}},"required":["id","step","package_count","created_at","updated_at"],"type":"object"},"DraftsListResponse":{"properties":{"batches":{"items":{"$ref":"#/components/schemas/DraftBatchFacet"},"type":"array"},"items":{"items":{"$ref":"#/components/schemas/DraftSummary"},"type":"array"},"total":{"type":"integer"}},"required":["items","total","batches"],"type":"object"},"DutiesAvailabilityResponse":{"properties":{"international":{"type":"boolean"},"us":{"type":"boolean"}},"required":["us","international"],"type":"object"},"EligibilityDto":{"properties":{"eligible":{"type":"boolean"},"progressCurrent":{"type":"integer"},"progressRequired":{"type":"integer"},"reason":{"type":"string"}},"required":["eligible","reason"],"type":"object"},"EmailRow":{"properties":{"email":{"description":"Email address.","type":"string"},"id":{"format":"uuid","type":"string"},"isPrimary":{"type":"boolean"},"isVerified":{"type":"boolean"}},"required":["id","email","isPrimary","isVerified"],"type":"object"},"Error":{"properties":{"error":{"properties":{"code":{"description":"Stable code: `validation_error` (400), `unauthorized` (401), `forbidden` (403), `not_found` (404), `conflict` (409, e.g. `insufficient_funds`), `rate_limited` (429), `service_unavailable` (503: a carrier did not answer; retry).","type":"string"},"message":{"type":"string"}},"required":["code","message"],"type":"object"},"ok":{"const":false,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","error"],"type":"object"},"ImportBody":{"properties":{"batch_id":{"description":"Batch the shipments join when their labels are bought. Leave out for the store's own batch.","format":"uuid","type":"string"},"batch_name":{"description":"Name for the store's own batch, if this import creates it.","type":"string"},"connection_id":{"description":"The connected store's id.","type":"string"},"external_order_ids":{"description":"The `id` of each order from `GET /v1/integrations/orders`.","items":{"type":"string"},"type":"array"},"shop_name":{"description":"Store name to show as the shipment's source.","type":"string"}},"required":["connection_id","external_order_ids"],"type":"object"},"ImportedOrderMatch":{"properties":{"draft_id":{"format":"uuid","type":"string"},"imported_at":{"format":"date-time","type":"string"},"order_id":{"type":"string"},"shipment_id":{"format":"uuid","type":"string"},"source":{"description":"Where the shipment came from. Leave out (it becomes `manual`) or name your integration, e.g. `api`.","type":"string"},"status":{"type":"string"},"step":{"type":"string"},"tracking_number":{"description":"The carrier's tracking number.","type":"string"}},"required":["order_id","imported_at","status"],"type":"object"},"ImportsLookupRequest":{"properties":{"order_ids":{"description":"Order ids to check.","items":{"type":"string"},"type":"array"}},"required":["order_ids"],"type":"object"},"ImportsLookupResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ImportedOrderMatch"},"type":"array"}},"required":["items"],"type":"object"},"InsightsResponse":{"properties":{"best_saving":{"$ref":"#/components/schemas/BestSaving"},"bucket":{"type":"string"},"cities":{"items":{"$ref":"#/components/schemas/CityRow"},"type":"array"},"current":{"$ref":"#/components/schemas/PeriodTotals"},"from":{"description":"Ship-from address.","format":"date","type":"string"},"lifetime":{"$ref":"#/components/schemas/PeriodTotals"},"month":{"$ref":"#/components/schemas/MonthPace"},"previous":{"$ref":"#/components/schemas/PeriodTotals"},"range":{"type":"string"},"regions":{"items":{"$ref":"#/components/schemas/RegionRow"},"type":"array"},"series":{"items":{"$ref":"#/components/schemas/SeriesPoint"},"type":"array"},"services":{"items":{"$ref":"#/components/schemas/ServiceRow"},"type":"array"},"to":{"description":"Ship-to address.","format":"date","type":"string"},"transit":{"items":{"$ref":"#/components/schemas/BucketCount"},"type":"array"},"weekdays":{"items":{"$ref":"#/components/schemas/BucketCount"},"type":"array"},"weight_bands_kg":{"items":{"type":"number"},"type":"array"},"weights":{"items":{"$ref":"#/components/schemas/BucketCount"},"type":"array"}},"required":["range","bucket","from","to","current","previous","lifetime","series","services","regions","cities","weight_bands_kg","weights","transit","weekdays","month"],"type":"object"},"IntakeResponse":{"properties":{"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"inbound_carrier":{"type":"string"},"inbound_tracking":{"type":"string"},"organization_id":{"format":"uuid","type":"string"},"received_at":{"format":"date-time","type":"string"},"sender_name":{"type":"string"},"status":{"type":"string"},"warehouse_id":{"format":"uuid","type":"string"}},"required":["id","warehouse_id","status","created_at"],"type":"object"},"IntakesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/IntakeResponse"},"type":"array"}},"required":["items"],"type":"object"},"InviteRow":{"properties":{"email":{"description":"Email address.","type":"string"},"expiresAt":{"type":"string"},"id":{"format":"uuid","type":"string"},"inviteNumber":{"type":"string"},"role":{"type":"string"},"status":{"type":"string"}},"required":["id","inviteNumber","email","role","status","expiresAt"],"type":"object"},"InvoicePdfResponse":{"properties":{"url":{"type":"string"}},"required":["url"],"type":"object"},"InvoiceResponse":{"properties":{"billing_status":{"type":"string"},"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"currency_code":{"type":"string"},"discount_amount_cents":{"type":"integer"},"duties_cents":{"description":"Destination duties and taxes prepaid with this label (DDP), when offered.","type":"integer"},"id":{"format":"uuid","type":"string"},"invoice_for":{"type":"string"},"invoice_number":{"type":"string"},"invoice_type":{"type":"string"},"refund_amount_cents":{"type":"integer"},"refund_reason":{"type":"string"},"refunded_at":{"format":"date-time","type":"string"},"service":{"type":"string"},"shipment_id":{"format":"uuid","type":"string"},"status":{"type":"string"},"subtotal_cents":{"type":"integer"},"tax_cents":{"description":"Sales tax, in cents.","type":"integer"},"tax_type":{"type":"string"},"total_cents":{"description":"Total, in cents.","type":"integer"},"wallet_transaction_id":{"format":"uuid","type":"string"}},"required":["id","invoice_number","invoice_type","carrier","service","subtotal_cents","discount_amount_cents","tax_cents","duties_cents","total_cents","currency_code","status","billing_status","refund_amount_cents","created_at"],"type":"object"},"InvoicesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InvoiceResponse"},"type":"array"}},"required":["items"],"type":"object"},"ItemPhotoResponse":{"properties":{"content_type":{"type":"string"},"filename":{"type":"string"},"id":{"format":"uuid","type":"string"},"object_key":{"type":"string"},"taken_at":{"format":"date-time","type":"string"},"url":{"type":"string"}},"required":["id","object_key","filename","taken_at"],"type":"object"},"ItemPresetResponse":{"properties":{"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"description":{"type":"string"},"hs_code":{"description":"Harmonized System code.","type":"string"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"origin_country":{"description":"Two-letter code of the country where the item was made.","type":"string"},"quantity":{"description":"How many.","type":"integer"},"sku":{"description":"Your product code.","type":"string"},"unit_value":{"type":"number"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"},"usage_count":{"type":"integer"}},"required":["id","name","description","quantity","unit_value","currency","usage_count","created_at","updated_at"],"type":"object"},"ItemPresetUpsert":{"properties":{"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"description":{"type":"string"},"hs_code":{"description":"Harmonized System code.","type":"string"},"name":{"type":"string"},"origin_country":{"description":"Two-letter code of the country where the item was made.","type":"string"},"quantity":{"description":"How many.","type":"integer"},"sku":{"description":"Your product code.","type":"string"},"unit_value":{"description":"Value of one unit, in `currency` (e.g. `15.00`).","type":"number"}},"required":["name"],"type":"object"},"ItemPresetsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ItemPresetResponse"},"type":"array"}},"required":["items"],"type":"object"},"LabelUrlResponse":{"properties":{"tracking_number":{"description":"The carrier's tracking number.","type":"string"},"url":{"type":"string"}},"required":["url"],"type":"object"},"MemberRow":{"properties":{"email":{"description":"Email address.","type":"string"},"joinedAt":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"userId":{"format":"uuid","type":"string"}},"required":["userId","name","role","joinedAt"],"type":"object"},"MonthPace":{"properties":{"days_elapsed":{"type":"integer"},"days_in_month":{"type":"integer"},"shipments":{"type":"integer"},"spend_cents":{"type":"integer"}},"required":["shipments","spend_cents","days_elapsed","days_in_month"],"type":"object"},"MyDiscountCampaignResponse":{"properties":{"campaign":{"$ref":"#/components/schemas/PublicDiscountCampaign"},"claimed":{"type":"boolean"},"code":{"type":"string"}},"required":["campaign","claimed"],"type":"object"},"MyOverview":{"properties":{"description":{"type":"string"},"scope":{"type":"string"}},"required":["scope","description"],"type":"object"},"MyPromoResponse":{"properties":{"campaign":{"$ref":"#/components/schemas/PublicCampaign"},"claimedAt":{"format":"date-time","type":"string"},"claimedCents":{"type":"integer"},"eligibility":{"$ref":"#/components/schemas/EligibilityDto"}},"required":["campaign","eligibility"],"type":"object"},"MyReferralsResponse":{"properties":{"code":{"type":"string"},"enabled":{"type":"boolean"},"program":{"$ref":"#/components/schemas/ProgramDto"},"referrals":{},"rewards":{},"shareUrl":{"type":"string"},"stats":{}},"required":["enabled","program","stats","referrals","rewards"],"type":"object"},"MyTimelineEventResponse":{"properties":{"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"event_type":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string"}},"required":["event_type","severity","message","created_at"],"type":"object"},"MyTimelineResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MyTimelineEventResponse"},"type":"array"}},"required":["items"],"type":"object"},"NotificationPrefs":{"properties":{"emailBilling":{"type":"boolean"},"emailPickups":{"type":"boolean"},"emailShipments":{"type":"boolean"},"emailSupport":{"type":"boolean"},"marketingEmails":{"type":"boolean"}},"required":["emailShipments","emailPickups","emailSupport","emailBilling","marketingEmails"],"type":"object"},"OrgSmsPrefs":{"properties":{"delivered":{"type":"boolean"},"exception":{"type":"boolean"},"inTransit":{"type":"boolean"},"isPersonal":{"type":"boolean"},"organizationId":{"format":"uuid","type":"string"},"organizationName":{"type":"string"},"readyForPickup":{"type":"boolean"}},"required":["organizationId","organizationName","isPersonal","readyForPickup","inTransit","exception","delivered"],"type":"object"},"OrgSummary":{"properties":{"businessStatus":{"type":"string"},"deletionScheduledFor":{"type":"string"},"externalId":{"type":"string"},"id":{"format":"uuid","type":"string"},"isPersonal":{"type":"boolean"},"name":{"type":"string"},"role":{"type":"string"},"status":{"type":"string"},"systemPaid":{"type":"boolean"}},"required":["id","externalId","name","role","isPersonal","systemPaid","status"],"type":"object"},"PackageBoxResponse":{"properties":{"carrier_scope":{"type":"string"},"code":{"type":"string"},"dimension_unit":{"description":"`in` or `cm`.","type":"string"},"height":{"description":"Height, in `dimension_unit`.","type":"number"},"id":{"format":"uuid","type":"string"},"length":{"description":"Length, in `dimension_unit`.","type":"number"},"max_weight":{"type":"number"},"name":{"type":"string"},"weight_unit":{"description":"`lb` or `kg`.","type":"string"},"width":{"description":"Width, in `dimension_unit`.","type":"number"}},"required":["id","code","name","length","width","height","dimension_unit","weight_unit"],"type":"object"},"PackageBoxesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PackageBoxResponse"},"type":"array"}},"required":["items"],"type":"object"},"PackagePresetResponse":{"properties":{"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"default_weight":{"description":"Usual weight, in `weight_unit` (optional).","type":"number"},"dimension_unit":{"description":"`in` or `cm`.","type":"string"},"height":{"description":"Height, in `dimension_unit`.","type":"number"},"id":{"format":"uuid","type":"string"},"length":{"description":"Length, in `dimension_unit`.","type":"number"},"name":{"type":"string"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"},"usage_count":{"type":"integer"},"weight_unit":{"description":"`lb` or `kg`.","type":"string"},"width":{"description":"Width, in `dimension_unit`.","type":"number"}},"required":["id","name","length","width","height","dimension_unit","weight_unit","usage_count","created_at","updated_at"],"type":"object"},"PackagePresetUpsert":{"properties":{"default_weight":{"description":"Usual weight, in `weight_unit` (optional).","type":"number"},"dimension_unit":{"description":"`in` or `cm`.","type":"string"},"height":{"description":"Height, in `dimension_unit`.","type":"number"},"length":{"description":"Length, in `dimension_unit`.","type":"number"},"name":{"type":"string"},"weight_unit":{"description":"`lb` or `kg`.","type":"string"},"width":{"description":"Width, in `dimension_unit`.","type":"number"}},"required":["name","length","width","height","dimension_unit","weight_unit"],"type":"object"},"PackagePresetsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PackagePresetResponse"},"type":"array"}},"required":["items"],"type":"object"},"PatchBatchRequest":{"properties":{"name":{"type":"string"},"notes":{"description":"Free-text notes.","type":"string"},"status":{"description":"`open` or `closed`.","type":"string"}},"type":"object"},"PatchDraftRequest":{"properties":{"customs_declaration_id":{"description":"A customs declaration from `POST /v1/customs/declarations`. Needed for shipments that cross a border.","format":"uuid","type":"string"},"delivery_instructions":{"description":"Instructions for the driver.","type":"string"},"discount_code":{"description":"A discount code to apply.","type":"string"},"email_notifications":{"description":"Email tracking updates to the recipient.","type":"boolean"},"from":{"allOf":[{"$ref":"#/components/schemas/CreateShipmentAddress"}],"description":"Ship-from address."},"label_size":{"description":"`thermal` (4×6 in) or `standard` (8.5×11 in). Defaults to the account's shipping preference.","type":"string"},"packages":{"description":"One entry per box.","items":{"$ref":"#/components/schemas/CreateShipmentPackage"},"type":"array"},"quote_id":{"description":"The `quote_id` from the `POST /v1/rates` response the chosen rate came from.","format":"uuid","type":"string"},"reference_number":{"description":"Your reference, e.g. an order number. Printed on the label where the carrier allows.","type":"string"},"selected_amount_cents":{"description":"The chosen rate's `amount_cents`.","type":"integer"},"selected_carrier":{"description":"The chosen rate's `carrier`.","type":"string"},"selected_currency":{"description":"The chosen rate's `currency`.","type":"string"},"selected_duties_cents":{"description":"The chosen rate's `duties_cents`, if any.","type":"integer"},"selected_service_code":{"description":"The chosen rate's `service_code`.","type":"string"},"selected_service_name":{"description":"The chosen rate's `service_name`.","type":"string"},"ship_date":{"description":"Day the parcel will be handed to the carrier (`YYYY-MM-DD`). Leave out for today; up to 7 days ahead.","format":"date","type":"string"},"signature_option":{"description":"Signature on delivery: `none`, `required` or `adult`. Carriers charge extra for a signature.","type":"string"},"to":{"allOf":[{"$ref":"#/components/schemas/CreateShipmentAddress"}],"description":"Ship-to address."}},"type":"object"},"PayInvoiceResponse":{"properties":{"invoice":{"$ref":"#/components/schemas/InvoiceResponse"},"new_available_cents":{"type":"integer"},"wallet_transaction_id":{"format":"uuid","type":"string"}},"required":["invoice","wallet_transaction_id","new_available_cents"],"type":"object"},"PaymentMethodResponse":{"properties":{"brand":{"type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"exp_month":{"type":"integer"},"exp_year":{"type":"integer"},"holder_name":{"type":"string"},"id":{"format":"uuid","type":"string"},"is_default":{"type":"boolean"},"last4":{"type":"string"},"stripe_payment_method_id":{"type":"string"}},"required":["id","stripe_payment_method_id","brand","last4","exp_month","exp_year","is_default","created_at"],"type":"object"},"PaymentMethodsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PaymentMethodResponse"},"type":"array"}},"required":["items"],"type":"object"},"PeriodTotals":{"properties":{"avg_options":{"type":"number"},"avg_transit_days":{"type":"number"},"compare_labels":{"type":"integer"},"compare_saved_cents":{"type":"integer"},"delivered":{"type":"integer"},"domestic":{"type":"integer"},"exceptions":{"type":"integer"},"international":{"type":"integer"},"on_time":{"type":"integer"},"on_time_measured":{"type":"integer"},"quoted_labels":{"type":"integer"},"retail_labels":{"type":"integer"},"retail_saved_cents":{"type":"integer"},"saved_cents":{"type":"integer"},"shipments":{"type":"integer"},"spend_cents":{"type":"integer"},"transit_measured":{"type":"integer"},"usa":{"type":"integer"}},"required":["shipments","spend_cents","saved_cents","retail_saved_cents","retail_labels","compare_saved_cents","compare_labels","quoted_labels","avg_options","delivered","transit_measured","avg_transit_days","on_time_measured","on_time","exceptions","domestic","usa","international"],"type":"object"},"PickupCarrierItem":{"properties":{"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"display_name":{"type":"string"}},"required":["carrier","display_name"],"type":"object"},"PickupCountsResponse":{"properties":{"active":{"type":"integer"},"archived":{"description":"`true` to archive (the default), `false` to bring it back.","type":"integer"},"cancelled":{"type":"integer"},"draft":{"type":"integer"},"exceptions":{"type":"integer"},"history":{"type":"integer"}},"required":["draft","active","history","cancelled","exceptions","archived"],"type":"object"},"PickupOptions":{"properties":{"allow_same_day":{"type":"boolean"},"same_day_cutoff_hour":{"type":"integer"}},"required":["allow_same_day","same_day_cutoff_hour"],"type":"object"},"PickupQuoteResponse":{"properties":{"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"discountCents":{"type":"integer"},"feeCents":{"type":"integer"},"taxCents":{"type":"integer"},"taxJurisdiction":{"type":"string"},"totalCents":{"type":"integer"}},"required":["feeCents","discountCents","taxCents","totalCents","currency","taxJurisdiction"],"type":"object"},"PickupResponse":{"properties":{"address":{},"archived":{"description":"`true` to archive (the default), `false` to bring it back.","type":"boolean"},"archived_at":{"format":"date-time","type":"string"},"building_type":{"description":"Kind of building: `Office`, `Warehouse`, `Residential` or `Other`.","type":"string"},"cancelled_at":{"format":"date-time","type":"string"},"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"carrier_pickup_id":{"type":"string"},"carrier_status":{"type":"string"},"confirmation_number":{"type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"dispatch_attempts":{"type":"integer"},"fee_cents":{"type":"integer"},"id":{"format":"uuid","type":"string"},"instructions":{"description":"Instructions for the driver.","type":"string"},"last_dispatch_error":{"type":"string"},"last_synced_at":{"format":"date-time","type":"string"},"pickup_date":{"description":"Pickup day (`YYYY-MM-DD`).","format":"date","type":"string"},"pickup_location":{"description":"Where the parcels will be, e.g. front door, reception.","type":"string"},"pickup_number":{"type":"string"},"shipment_ids":{"description":"Ids of purchased shipments.","items":{"format":"uuid","type":"string"},"type":"array"},"status":{"type":"string"},"tax_cents":{"description":"Sales tax, in cents.","type":"integer"},"tax_jurisdiction":{"type":"string"},"time_window_end":{"description":"Latest pickup time, local (`HH:MM:SS`).","type":"string"},"time_window_start":{"description":"Earliest pickup time, local (`HH:MM:SS`).","type":"string"},"total_cents":{"description":"Total, in cents.","type":"integer"}},"required":["id","pickup_number","carrier","pickup_date","time_window_start","time_window_end","address","status","dispatch_attempts","created_at","fee_cents","tax_cents","total_cents","currency","archived","shipment_ids"],"type":"object"},"PickupsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PickupResponse"},"type":"array"},"total":{"type":"integer"}},"required":["items","total"],"type":"object"},"PricePreviewRequest":{"properties":{"amount_cents":{"description":"The chosen rate's price before tax, in cents.","type":"integer"},"discount_code":{"description":"A discount code to apply.","type":"string"},"duties_cents":{"description":"The chosen rate's prepaid duties (`duties_cents` on the rate), if any.","type":"integer"},"from_country":{"description":"Ship-from country code.","type":"string"},"to_country":{"description":"Ship-to country code.","type":"string"},"to_state":{"description":"Destination province or state: Canadian sales tax follows it.","type":"string"}},"required":["amount_cents","from_country","to_country"],"type":"object"},"PricePreviewResponse":{"properties":{"discount_cents":{"description":"Discount applied, in cents.","type":"integer"},"duties_cents":{"description":"Destination duties and taxes prepaid with this label (DDP), when offered.","type":"integer"},"subtotal_cents":{"type":"integer"},"system_paid":{"type":"boolean"},"tax_cents":{"description":"Sales tax, in cents.","type":"integer"},"tax_lines":{"items":{"$ref":"#/components/schemas/PricePreviewTaxLine"},"type":"array"},"tax_rate_bps":{"type":"integer"},"tax_region":{"type":"string"},"total_cents":{"description":"Total, in cents.","type":"integer"}},"required":["subtotal_cents","discount_cents","tax_cents","tax_rate_bps","tax_lines","duties_cents","total_cents","system_paid"],"type":"object"},"PricePreviewTaxLine":{"properties":{"amount_cents":{"description":"Amount in cents.","type":"integer"},"rate_bps":{"type":"integer"},"tax_type":{"type":"string"}},"required":["tax_type","rate_bps","amount_cents"],"type":"object"},"ProfileResponse":{"properties":{"avatarUrl":{"type":"string"},"clientNumber":{"type":"string"},"email":{"description":"Email address.","type":"string"},"emails":{"items":{"$ref":"#/components/schemas/EmailRow"},"type":"array"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"pickupMapViewEnabled":{"type":"boolean"},"referralsEnabled":{"type":"boolean"},"shipmentMapViewEnabled":{"type":"boolean"}},"required":["id","name","emails","referralsEnabled","shipmentMapViewEnabled","pickupMapViewEnabled"],"type":"object"},"ProgramDto":{"properties":{"headline":{"type":"string"},"stage1Cents":{"type":"integer"},"stage1ThresholdCents":{"type":"integer"},"stage2Cents":{"type":"integer"},"stage2ThresholdCents":{"type":"integer"},"subtitle":{"type":"string"}},"required":["stage1Cents","stage1ThresholdCents","stage2Cents","stage2ThresholdCents"],"type":"object"},"PublicCampaign":{"properties":{"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"carrierLabel":{"type":"string"},"claimCount":{"type":"integer"},"creditCents":{"type":"integer"},"endsAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"kind":{"type":"string"},"maxClaims":{"type":"integer"},"minTopupCents":{"type":"integer"},"remaining":{"type":"integer"},"requiredShipments":{"type":"integer"},"startsAt":{"format":"date-time","type":"string"},"state":{"description":"Province or state code, e.g. `ON`, `BC`, `NY`.","type":"string"},"subtitle":{"type":"string"},"tiers":{"items":{"$ref":"#/components/schemas/PublicTopupTier"},"type":"array"},"title":{"type":"string"}},"required":["id","kind","creditCents","startsAt","endsAt","state","claimCount"],"type":"object"},"PublicDiscountCampaign":{"properties":{"appliesTo":{"items":{"type":"string"},"type":"array"},"claimCount":{"type":"integer"},"expiresAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"maxClaims":{"type":"integer"},"maxDiscountCents":{"type":"integer"},"minPurchaseCents":{"type":"integer"},"percentageBps":{"type":"integer"},"remaining":{"type":"integer"},"startsAt":{"format":"date-time","type":"string"},"state":{"description":"Province or state code, e.g. `ON`, `BC`, `NY`.","type":"string"},"subtitle":{"type":"string"},"theme":{"type":"string"},"title":{"type":"string"}},"required":["id","theme","percentageBps","appliesTo","claimCount","state"],"type":"object"},"PublicTopupTier":{"properties":{"bonusCents":{"type":"integer"},"minTopupCents":{"type":"integer"}},"required":["minTopupCents","bonusCents"],"type":"object"},"QuotePickupRequest":{"properties":{"address":{"description":"Pickup address: the same fields as an address book entry."},"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"discount_code":{"description":"A discount code to apply.","type":"string"},"pickup_date":{"description":"Pickup day (`YYYY-MM-DD`).","format":"date","type":"string"}},"required":["carrier","pickup_date","address"],"type":"object"},"RateAddress":{"properties":{"city":{"description":"City.","type":"string"},"company":{"description":"Company name.","type":"string"},"country":{"description":"Two-letter country code, e.g. `CA`, `US`.","type":"string"},"email":{"description":"Email address.","type":"string"},"is_residential":{"description":"True for a home address. Some carriers charge more for residential delivery.","type":"boolean"},"line2":{"description":"Apartment, suite or unit.","type":"string"},"name":{"type":"string"},"phone":{"description":"Phone number. Carriers need one for the recipient on most international and express services.","type":"string"},"postal_code":{"description":"Postal or ZIP code.","type":"string"},"state":{"description":"Province or state code, e.g. `ON`, `BC`, `NY`.","type":"string"},"street":{"description":"Street address.","type":"string"}},"required":["name","street","city","state","postal_code","country"],"type":"object"},"RatePackage":{"properties":{"dimension_unit":{"description":"`in` or `cm`.","type":"string"},"height":{"description":"Height, in `dimension_unit`.","type":"number"},"length":{"description":"Length, in `dimension_unit`.","type":"number"},"weight":{"description":"Weight of the box with its contents, in `weight_unit`.","type":"number"},"weight_unit":{"description":"`lb` or `kg`.","type":"string"},"width":{"description":"Width, in `dimension_unit`.","type":"number"}},"required":["weight","weight_unit","length","width","height","dimension_unit"],"type":"object"},"RateQuoteResponse":{"properties":{"adult_signature_supported":{"description":"False when the carrier has no adult signature option; `adult` becomes `required`.","type":"boolean"},"amount_cents":{"description":"Amount in cents.","type":"integer"},"carrier":{"description":"The carrier that delivers the parcel, e.g. `canada_post`, `ups`, `purolator`.","type":"string"},"carrier_description":{"type":"string"},"carrier_display_name":{"description":"The carrier's name to show, e.g. \"Canada Post\".","type":"string"},"carrier_logo_url":{"type":"string"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"duties_cents":{"description":"Destination duties and taxes prepaid with this label (DDP), when offered.","type":"integer"},"estimated_days":{"description":"Estimated business days in transit.","type":"integer"},"estimated_delivery":{"description":"Estimated delivery date and time.","format":"date-time","type":"string"},"pickup_supported":{"description":"False when the carrier cannot pick this parcel up: drop it off instead.","type":"boolean"},"promotion":{"description":"True for a discounted promotional rate shown without carrier branding.","type":"boolean"},"published_cents":{"description":"The carrier's own list price for this service, when the carrier publishes one.","type":"integer"},"service_code":{"description":"Service code, as returned with each rate. Treat it as opaque and send it back unchanged when you buy: it can carry routing details for that exact rate.","type":"string"},"service_description":{"type":"string"},"service_logo_url":{"type":"string"},"service_name":{"description":"Service name to show to people.","type":"string"},"tracking_available":{"description":"False for a service without tracking.","type":"boolean"}},"required":["carrier","carrier_display_name","service_code","service_name","amount_cents","currency","adult_signature_supported"],"type":"object"},"RateRequestBody":{"properties":{"carriers":{"description":"Only return rates from these carriers, e.g. `[\"canada_post\"]` or `[\"gls\", \"canpar\"]`. Codes: `canada_post`, `ups`, `fedex`, `purolator`, `canpar`, `gls`, `uniuni`, `dhl_express`. Leave it out for every carrier.","items":{"type":"string"},"type":"array"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"customs_declaration_id":{"description":"A customs declaration from `POST /v1/customs/declarations`. Needed for shipments that cross a border.","format":"uuid","type":"string"},"from":{"allOf":[{"$ref":"#/components/schemas/RateAddress"}],"description":"Ship-from address."},"packages":{"description":"One entry per box.","items":{"$ref":"#/components/schemas/RatePackage"},"type":"array"},"ship_date":{"description":"Day the parcel will be handed to the carrier (`YYYY-MM-DD`). Leave out for today; up to 7 days ahead.","format":"date","type":"string"},"signature_option":{"description":"Signature on delivery: `none`, `required` or `adult`. Carriers charge extra for a signature.","type":"string"},"to":{"allOf":[{"$ref":"#/components/schemas/RateAddress"}],"description":"Ship-to address."}},"required":["from","to","packages"],"type":"object"},"RateTicketRequest":{"properties":{"comment":{"description":"Anything to add (optional).","type":"string"},"rating":{"description":"1 to 5 stars.","type":"integer"},"resolved":{"description":"Whether the issue was resolved.","type":"boolean"}},"required":["rating","resolved"],"type":"object"},"RatesResponse":{"properties":{"carriers_with_no_options":{"items":{"$ref":"#/components/schemas/CarrierWithNoOptions"},"type":"array"},"items":{"items":{"$ref":"#/components/schemas/RateQuoteResponse"},"type":"array"},"quote_id":{"description":"The `quote_id` from the `POST /v1/rates` response the chosen rate came from.","format":"uuid","type":"string"}},"required":["items"],"type":"object"},"RefundRequestBody":{"properties":{"reason":{"description":"Why the refund is requested.","type":"string"}},"required":["reason"],"type":"object"},"RefundRequestResponse":{"properties":{"amount_cents":{"description":"Amount in cents.","type":"integer"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"reason":{"type":"string"},"status":{"type":"string"},"transaction_id":{"format":"uuid","type":"string"}},"required":["id","transaction_id","status","amount_cents","reason","created_at"],"type":"object"},"RefundRequestsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RefundRequestResponse"},"type":"array"}},"required":["items"],"type":"object"},"RegionRow":{"properties":{"country":{"description":"Two-letter country code, e.g. `CA`, `US`.","type":"string"},"region":{"type":"string"},"shipments":{"type":"integer"},"spend_cents":{"type":"integer"}},"required":["country","region","shipments","spend_cents"],"type":"object"},"RemoveShipmentRequest":{"properties":{"shipment_id":{"description":"One shipment to remove.","format":"uuid","type":"string"},"shipment_ids":{"description":"Several shipments to remove.","items":{"format":"uuid","type":"string"},"type":"array"}},"type":"object"},"ReturnAddressResponse":{"properties":{"formatted":{"items":{"type":"string"},"type":"array"},"routing_code":{"type":"string"},"warehouse":{"$ref":"#/components/schemas/WarehouseResponse"}},"required":["warehouse","routing_code","formatted"],"type":"object"},"ReturnAddressesResponse":{"properties":{"addresses":{"items":{"$ref":"#/components/schemas/ReturnAddressResponse"},"type":"array"}},"required":["addresses"],"type":"object"},"ReturnItemResponse":{"properties":{"condition":{"type":"string"},"description":{"type":"string"},"disposition_deadline":{"format":"date","type":"string"},"free_until":{"format":"date","type":"string"},"id":{"format":"uuid","type":"string"},"intake_id":{"format":"uuid","type":"string"},"lien_notice_sent_at":{"format":"date-time","type":"string"},"location_code":{"type":"string"},"organization_id":{"format":"uuid","type":"string"},"photos":{"items":{"$ref":"#/components/schemas/ItemPhotoResponse"},"type":"array"},"quantity":{"description":"How many.","type":"integer"},"sku":{"description":"Your product code.","type":"string"},"status":{"type":"string"},"stored_since":{"format":"date","type":"string"},"warehouse_id":{"format":"uuid","type":"string"},"weight_grams":{"type":"integer"}},"required":["id","organization_id","warehouse_id","intake_id","description","quantity","condition","status","stored_since","free_until","disposition_deadline","photos"],"type":"object"},"ReturnItemsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReturnItemResponse"},"type":"array"}},"required":["items"],"type":"object"},"ReturnsSummaryResponse":{"properties":{"stored":{"type":"integer"},"unpaid_cents":{"type":"integer"}},"required":["stored","unpaid_cents"],"type":"object"},"SearchHit":{"properties":{"amount_cents":{"description":"Amount in cents.","type":"integer"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"id":{"format":"uuid","type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"subtitle":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"}},"required":["kind","id","title","subtitle","url","created_at"],"type":"object"},"SearchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/SearchHit"},"type":"array"}},"required":["results"],"type":"object"},"SeriesPoint":{"properties":{"date":{"format":"date","type":"string"},"saved_cents":{"type":"integer"},"shipments":{"type":"integer"},"spend_cents":{"type":"integer"}},"required":["date","shipments","spend_cents","saved_cents"],"type":"object"},"ServiceRow":{"properties":{"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"on_time":{"type":"integer"},"on_time_measured":{"type":"integer"},"saved_cents":{"type":"integer"},"service":{"type":"string"},"shipments":{"type":"integer"},"spend_cents":{"type":"integer"},"transit_days_sum":{"type":"integer"},"transit_measured":{"type":"integer"}},"required":["carrier","service","shipments","spend_cents","saved_cents","transit_measured","transit_days_sum","on_time_measured","on_time"],"type":"object"},"ShipmentBatchRef":{"properties":{"batch_number":{"type":"string"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"required":["id","batch_number","name"],"type":"object"},"ShipmentCommentResponse":{"properties":{"author_kind":{"type":"string"},"author_name":{"type":"string"},"body":{"type":"string"},"can_delete":{"type":"boolean"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"is_internal":{"type":"boolean"},"metadata":{},"source":{"description":"Where the shipment came from. Leave out (it becomes `manual`) or name your integration, e.g. `api`.","type":"string"}},"required":["id","author_kind","author_name","body","metadata","created_at","can_delete","is_internal"],"type":"object"},"ShipmentCommentsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ShipmentCommentResponse"},"type":"array"}},"required":["items"],"type":"object"},"ShipmentCountsResponse":{"properties":{"all":{"type":"integer"},"archived":{"description":"`true` to archive (the default), `false` to bring it back.","type":"integer"},"delivered":{"type":"integer"},"drafts":{"type":"integer"},"exception":{"type":"integer"},"in_transit":{"type":"integer"},"ready":{"type":"integer"},"voided":{"type":"integer"}},"required":["all","drafts","ready","in_transit","delivered","exception","voided","archived"],"type":"object"},"ShipmentDetailResponse":{"properties":{"archived":{"description":"`true` to archive (the default), `false` to bring it back.","type":"boolean"},"base_rate_cents":{"description":"Label price before discount and tax, in cents.","type":"integer"},"batch":{"$ref":"#/components/schemas/ShipmentBatchRef"},"cancelled_at":{"format":"date-time","type":"string"},"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"carrier_display_name":{"description":"Carrier name to show to people.","type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"created_by_email":{"type":"string"},"created_by_name":{"type":"string"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"delivery_instructions":{"description":"Instructions for the driver.","type":"string"},"discount_cents":{"description":"Discount applied, in cents.","type":"integer"},"duties_cents":{"description":"Destination duties and taxes prepaid with this label (DDP), when offered.","type":"integer"},"email_notifications":{"description":"Email tracking updates to the recipient.","type":"boolean"},"final_rate_cents":{"description":"What was charged: price − discount + tax + prepaid duties, in cents.","type":"integer"},"from_address":{},"has_customs_invoice":{"type":"boolean"},"id":{"format":"uuid","type":"string"},"is_return":{"type":"boolean"},"label_size":{"description":"`thermal` (4×6 in) or `standard` (8.5×11 in). Defaults to the account's shipping preference.","type":"string"},"order_number":{"type":"string"},"packages":{"description":"One entry per box."},"paid_at":{"format":"date-time","type":"string"},"reference_number":{"description":"Your reference, e.g. an order number. Printed on the label where the carrier allows.","type":"string"},"refund_held_until":{"format":"date-time","type":"string"},"refund_pending":{"type":"boolean"},"refund_withheld":{"type":"boolean"},"refunded_cents":{"type":"integer"},"return_of":{"format":"uuid","type":"string"},"service":{"type":"string"},"ship_date":{"description":"Day the parcel will be handed to the carrier (`YYYY-MM-DD`). Leave out for today; up to 7 days ahead.","format":"date","type":"string"},"signature_option":{"description":"Signature on delivery: `none`, `required` or `adult`. Carriers charge extra for a signature.","type":"string"},"status":{"type":"string"},"tax_cents":{"description":"Sales tax, in cents.","type":"integer"},"tax_jurisdiction":{"type":"string"},"tax_rate_bps":{"type":"integer"},"to_address":{},"tracking_available":{"description":"False for a service without tracking.","type":"boolean"},"tracking_number":{"description":"The carrier's tracking number.","type":"string"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"},"wallet_transaction_id":{"format":"uuid","type":"string"}},"required":["id","order_number","tracking_available","carrier","carrier_display_name","service","status","from_address","to_address","base_rate_cents","discount_cents","tax_cents","tax_rate_bps","duties_cents","final_rate_cents","currency","refunded_cents","refund_pending","refund_withheld","has_customs_invoice","label_size","packages","email_notifications","created_at","updated_at","archived","is_return"],"type":"object"},"ShipmentIdsResponse":{"properties":{"ids":{"items":{"format":"uuid","type":"string"},"type":"array"},"total":{"type":"integer"}},"required":["ids","total"],"type":"object"},"ShipmentReturnResponse":{"properties":{"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"notes":{"description":"Free-text notes.","type":"string"},"original_shipment_id":{"format":"uuid","type":"string"},"reason":{"type":"string"},"return_shipment_id":{"format":"uuid","type":"string"},"return_type":{"type":"string"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"}},"required":["id","original_shipment_id","return_shipment_id","return_type","created_at","updated_at"],"type":"object"},"ShipmentSummaryResponse":{"properties":{"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"carrier_display_name":{"description":"Carrier name to show to people.","type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"created_by_name":{"type":"string"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"final_rate_cents":{"description":"What was charged: price − discount + tax + prepaid duties, in cents.","type":"integer"},"from_address":{},"id":{"format":"uuid","type":"string"},"is_return":{"type":"boolean"},"order_number":{"type":"string"},"return_of":{"format":"uuid","type":"string"},"service":{"type":"string"},"source":{"description":"Where the shipment came from. Leave out (it becomes `manual`) or name your integration, e.g. `api`.","type":"string"},"source_name":{"description":"A name for that source, e.g. your app's name.","type":"string"},"status":{"type":"string"},"to_address":{},"tracking_available":{"description":"False for a service without tracking.","type":"boolean"},"tracking_number":{"description":"The carrier's tracking number.","type":"string"}},"required":["id","order_number","tracking_available","carrier","carrier_display_name","service","status","final_rate_cents","currency","created_at","is_return","from_address","to_address","source"],"type":"object"},"ShipmentsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ShipmentSummaryResponse"},"type":"array"},"total":{"type":"integer"}},"required":["items"],"type":"object"},"ShippingPreferencesResponse":{"properties":{"delivery_instructions_default":{"description":"Delivery instructions put on new shipments.","type":"string"},"email_notifications_default":{"description":"Email tracking updates to recipients by default.","type":"boolean"},"label_size":{"description":"`thermal` (4×6 in) or `standard` (8.5×11 in). Defaults to the account's shipping preference.","type":"string"},"reference_number_default":{"description":"Reference put on new shipments.","type":"string"},"signature_option":{"description":"Signature on delivery: `none`, `required` or `adult`. Carriers charge extra for a signature.","type":"string"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"}},"required":["email_notifications_default","label_size","updated_at"],"type":"object"},"ShippingPreferencesUpsert":{"properties":{"delivery_instructions_default":{"description":"Delivery instructions put on new shipments.","type":"string"},"email_notifications_default":{"description":"Email tracking updates to recipients by default.","type":"boolean"},"label_size":{"description":"`thermal` (4×6 in) or `standard` (8.5×11 in). Defaults to the account's shipping preference.","type":"string"},"reference_number_default":{"description":"Reference put on new shipments.","type":"string"},"signature_option":{"description":"Signature on delivery: `none`, `required` or `adult`. Carriers charge extra for a signature.","type":"string"}},"required":["label_size"],"type":"object"},"StatementResponse":{"properties":{"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"due_date":{"format":"date","type":"string"},"id":{"format":"uuid","type":"string"},"paid_at":{"format":"date-time","type":"string"},"period_end":{"format":"date","type":"string"},"period_start":{"format":"date","type":"string"},"status":{"type":"string"},"total_cents":{"description":"Total, in cents.","type":"integer"}},"required":["id","period_start","period_end","due_date","status","total_cents","currency"],"type":"object"},"StatementsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/StatementResponse"},"type":"array"}},"required":["items"],"type":"object"},"SupportMessageResponse":{"properties":{"attachments":{"description":"Files uploaded in the dashboard (optional).","items":{"type":"string"},"type":"array"},"content":{"type":"string"},"contentJson":{},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"sender_avatar":{"type":"string"},"sender_id":{"type":"string"},"sender_name":{"type":"string"},"sender_role":{"type":"string"}},"required":["id","sender_id","sender_name","sender_role","content","attachments","created_at"],"type":"object"},"SupportTicketDetailResponse":{"properties":{"assigned_agent_avatar":{"type":"string"},"assigned_agent_name":{"type":"string"},"attachments":{"description":"Files uploaded in the dashboard (optional).","items":{"type":"string"},"type":"array"},"category":{"type":"string"},"closed_at":{"format":"date-time","type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"description":{"type":"string"},"id":{"format":"uuid","type":"string"},"messages":{"items":{"$ref":"#/components/schemas/SupportMessageResponse"},"type":"array"},"priority":{"type":"string"},"rated_at":{"format":"date-time","type":"string"},"related_items":{"items":{"type":"string"},"type":"array"},"satisfaction_comment":{"type":"string"},"satisfaction_rating":{"type":"integer"},"satisfaction_resolved":{"type":"boolean"},"status":{"type":"string"},"subject":{"type":"string"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"}},"required":["id","category","priority","status","subject","related_items","attachments","messages","created_at","updated_at"],"type":"object"},"SupportTicketListItem":{"properties":{"assigned_agent_avatar":{"type":"string"},"assigned_agent_name":{"type":"string"},"category":{"type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"description":{"type":"string"},"id":{"format":"uuid","type":"string"},"priority":{"type":"string"},"status":{"type":"string"},"subject":{"type":"string"},"updated_at":{"description":"When it last changed (ISO 8601, UTC).","format":"date-time","type":"string"}},"required":["id","category","priority","status","subject","created_at","updated_at"],"type":"object"},"SupportTicketsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SupportTicketListItem"},"type":"array"},"page":{"type":"integer"},"page_size":{"type":"integer"},"total":{"type":"integer"},"total_pages":{"type":"integer"}},"required":["items","total","page","page_size","total_pages"],"type":"object"},"TicketCreatedResponse":{"properties":{"id":{"format":"uuid","type":"string"}},"required":["id"],"type":"object"},"TopUpRequest":{"properties":{"amount_cents":{"description":"Amount to add, in cents.","type":"integer"},"draft_id":{"description":"Paying the shortfall for this draft's label at checkout.","format":"uuid","type":"string"},"expected_charge_cents":{"description":"With `draft_id`: the total shown to the customer, card fee included. The request is refused if the charge would differ.","type":"integer"},"payment_method_id":{"description":"The saved card's `stripe_payment_method_id` (`pm_…`) from `GET /v1/wallet/cards`.","type":"string"}},"required":["amount_cents"],"type":"object"},"TopUpResponse":{"properties":{"amount_cents":{"description":"Amount in cents.","type":"integer"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"stripe_payment_intent_id":{"type":"string"},"transaction_id":{"format":"uuid","type":"string"}},"required":["transaction_id","stripe_payment_intent_id","amount_cents","currency"],"type":"object"},"TopupBonusHint":{"properties":{"bonus_cents":{"type":"integer"},"kind":{"type":"string"},"min_topup_cents":{"type":"integer"}},"required":["kind","bonus_cents","min_topup_cents"],"type":"object"},"TopupConfigResponse":{"properties":{"bonuses":{"items":{"$ref":"#/components/schemas/TopupBonusHint"},"type":"array"},"enabled":{"type":"boolean"},"first_topup_eligible":{"type":"boolean"},"label_card_fee_bps":{"type":"integer"},"max_balance_cents":{"type":"integer"},"min_topup_cents":{"type":"integer"},"offer":{"$ref":"#/components/schemas/TopupOffer"}},"required":["enabled","min_topup_cents","max_balance_cents","first_topup_eligible","bonuses","label_card_fee_bps"],"type":"object"},"TopupOffer":{"properties":{"campaign_id":{"format":"uuid","type":"string"},"ends_at":{"format":"date-time","type":"string"},"joined":{"type":"boolean"},"tiers":{"items":{"$ref":"#/components/schemas/TopupOfferTier"},"type":"array"}},"required":["campaign_id","joined","tiers","ends_at"],"type":"object"},"TopupOfferTier":{"properties":{"bonus_cents":{"type":"integer"},"min_topup_cents":{"type":"integer"}},"required":["min_topup_cents","bonus_cents"],"type":"object"},"TrackingEventResponse":{"properties":{"event_code":{"type":"string"},"event_description":{"type":"string"},"location":{"type":"string"},"occurred_at":{"format":"date-time","type":"string"},"source":{"description":"Where the shipment came from. Leave out (it becomes `manual`) or name your integration, e.g. `api`.","type":"string"}},"required":["event_code","event_description","occurred_at","source"],"type":"object"},"TrackingResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TrackingEventResponse"},"type":"array"}},"required":["items"],"type":"object"},"UnpaidBalanceResponse":{"properties":{"amount_cents":{"description":"Amount in cents.","type":"integer"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"}},"required":["amount_cents","currency"],"type":"object"},"UpdatePickupDraftRequest":{"properties":{"address":{"description":"Pickup address: the same fields as an address book entry."},"building_type":{"description":"Kind of building: `Office`, `Warehouse`, `Residential` or `Other`.","type":"string"},"carrier":{"description":"Carrier code, as returned with each rate.","type":"string"},"instructions":{"description":"Instructions for the driver.","type":"string"},"pickup_date":{"description":"Pickup day (`YYYY-MM-DD`).","format":"date","type":"string"},"pickup_location":{"description":"Where the parcels will be, e.g. front door, reception.","type":"string"},"shipment_ids":{"description":"Ids of purchased shipments.","items":{"format":"uuid","type":"string"},"type":"array"},"time_window_end":{"description":"Latest pickup time, local (`HH:MM:SS`).","format":"time","type":"string"},"time_window_start":{"description":"Earliest pickup time, local (`HH:MM:SS`).","format":"time","type":"string"}},"required":["carrier","pickup_date","time_window_start","time_window_end","address"],"type":"object"},"UpdatePrefsRequest":{"properties":{"emailBilling":{"description":"Billing and wallet emails.","type":"boolean"},"emailPickups":{"description":"Pickup updates.","type":"boolean"},"emailShipments":{"description":"Shipment updates.","type":"boolean"},"emailSupport":{"description":"Support ticket replies.","type":"boolean"},"marketingEmails":{"description":"News and offers.","type":"boolean"}},"required":["emailShipments","emailPickups","emailSupport","emailBilling","marketingEmails"],"type":"object"},"UpdateSmsPrefsRequest":{"properties":{"delivered":{"description":"Text when a parcel is delivered.","type":"boolean"},"exception":{"description":"Text when there is a delivery problem.","type":"boolean"},"inTransit":{"description":"Text when a parcel is on its way.","type":"boolean"},"readyForPickup":{"description":"Text when a pickup is booked and ready.","type":"boolean"}},"required":["readyForPickup","inTransit","exception","delivered"],"type":"object"},"UpdateTicketStatusRequest":{"properties":{"status":{"description":"`closed` or `open`.","type":"string"}},"required":["status"],"type":"object"},"UpsertAddressRequest":{"properties":{"city":{"description":"City.","type":"string"},"company":{"description":"Company name.","type":"string"},"country":{"description":"Two-letter country code, e.g. `CA`, `US`.","type":"string"},"email":{"description":"Email address.","type":"string"},"is_default_from":{"description":"Also make this the default sender.","type":"boolean"},"is_default_to":{"description":"Also make this the default recipient.","type":"boolean"},"is_residential":{"description":"True for a home address. Some carriers charge more for residential delivery.","type":"boolean"},"line2":{"description":"Apartment, suite or unit.","type":"string"},"name":{"type":"string"},"nickname":{"description":"Label for the address book, e.g. \"Warehouse\".","type":"string"},"phone":{"description":"Phone number. Carriers need one for the recipient on most international and express services.","type":"string"},"postal_code":{"description":"Postal or ZIP code.","type":"string"},"state":{"description":"Province or state code, e.g. `ON`, `BC`, `NY`.","type":"string"},"street":{"description":"Street address.","type":"string"},"tags":{"description":"Your own labels for the address.","items":{"type":"string"},"type":"array"}},"required":["nickname","name","street","city","postal_code","country"],"type":"object"},"ValidateDiscountRequest":{"properties":{"code":{"description":"The discount code.","type":"string"},"subtotal_cents":{"description":"The amount the discount would apply to, in cents.","type":"integer"},"target_kind":{"description":"What it is for: `shipment`.","type":"string"}},"required":["code","subtotal_cents"],"type":"object"},"ValidateDiscountResponse":{"properties":{"applied_cents":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"},"ok":{"type":"boolean"},"rejection":{"type":"string"}},"required":["ok","applied_cents"],"type":"object"},"WalletBalanceResponse":{"properties":{"available_cents":{"description":"Wallet balance you can spend, in cents.","type":"integer"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"on_hold_cents":{"type":"integer"},"pending_cents":{"description":"Top-ups still being confirmed, in cents.","type":"integer"}},"required":["currency","available_cents","pending_cents","on_hold_cents"],"type":"object"},"WalletTransactionResponse":{"properties":{"amount_cents":{"description":"Amount in cents.","type":"integer"},"completed_at":{"format":"date-time","type":"string"},"created_at":{"description":"When it was created (ISO 8601, UTC).","format":"date-time","type":"string"},"currency":{"description":"Three-letter currency code, e.g. `CAD`.","type":"string"},"description":{"type":"string"},"id":{"format":"uuid","type":"string"},"reference":{"type":"string"},"status":{"type":"string"},"stripe_payment_intent_id":{"type":"string"},"transaction_number":{"type":"string"},"txn_type":{"type":"string"}},"required":["id","transaction_number","txn_type","status","amount_cents","currency","created_at"],"type":"object"},"WalletTransactionsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WalletTransactionResponse"},"type":"array"}},"required":["items"],"type":"object"},"WarehouseResponse":{"properties":{"city":{"description":"City.","type":"string"},"code":{"type":"string"},"country":{"description":"Two-letter country code, e.g. `CA`, `US`.","type":"string"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"postal_code":{"description":"Postal or ZIP code.","type":"string"},"province":{"type":"string"}},"required":["id","code","name","city","province","postal_code","country"],"type":"object"}},"securitySchemes":{"bearer":{"description":"An access token from `POST /v1/api-clients/token`.","scheme":"bearer","type":"http"}}},"externalDocs":{"description":"Guides","url":"https://docs.parcelhub.ca/api"},"info":{"contact":{"name":"ParcelHub support","url":"https://my.parcelhub.ca/support"},"description":"Ship with ParcelHub from your own code: live rates from every carrier, labels paid from your prepaid wallet, tracking, pickups, customs, batches and connected stores.\n\n**Base URL:** `https://api.parcelhub.ca/v1`\n\n**Authentication:** create an API key at my.parcelhub.ca → Account → API keys, exchange it at `POST /v1/api-clients/token`, and send `Authorization: Bearer <access_token>` on every call. Tokens last about 15 minutes; get a new one when a call returns 401. A key acts for the account it was created in, with the permissions of the person who created it. Read-only keys may read and request quotes, nothing else.\n\n**Responses** are JSON: `{\"ok\": true, \"data\": …}` on success, `{\"ok\": false, \"error\": {\"code\", \"message\"}}` on failure. Every response carries a `request_id`; quote it when you contact support.\n\n**Money** is always integer cents (`amount_cents: 1299` is $12.99), in CAD unless a `currency` field says otherwise.\n\n**Spending money:** buying a label, booking a pickup, topping up the wallet and paying an invoice charge the account. Send an `Idempotency-Key` header when buying a label so a retry never buys twice.\n\nGuides: https://docs.parcelhub.ca/api","title":"ParcelHub API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/v1/active-organization":{"get":{"description":"The account calls are made for. Everything else (shipments, wallet, addresses…) belongs to this account.","operationId":"getActiveOrganization","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ActiveOrgResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Current account","tags":["Account"]}},"/v1/addresses":{"get":{"description":"The account's address book.","operationId":"listAddresses","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/AddressesResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List addresses","tags":["Addresses"]},"post":{"description":"Adds an address to the address book. It can be made the default sender or recipient at the same time.","operationId":"createAddress","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertAddressRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/AddressResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Add an address","tags":["Addresses"]}},"/v1/addresses/defaults":{"get":{"description":"The default ship-from and ship-to addresses, if set.","operationId":"getDefaultAddresses","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/AddressDefaultsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Default addresses","tags":["Addresses"]}},"/v1/addresses/sources":{"get":{"description":"Every address book this account can ship from: the account's own and, for a business account, the person's personal book.","operationId":"listAddressSources","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/AddressSourcesResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Address books","tags":["Addresses"]}},"/v1/addresses/{id}":{"delete":{"description":"Removes an address from the address book. Shipments already made keep their copy.","operationId":"deleteAddress","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DeleteAddressResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Delete an address","tags":["Addresses"]},"get":{"description":"One address book entry.","operationId":"getAddress","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/AddressResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get an address","tags":["Addresses"]},"patch":{"description":"Replaces an address book entry with the fields sent.","operationId":"updateAddress","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertAddressRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/AddressResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Update an address","tags":["Addresses"]}},"/v1/addresses/{id}/set-default-from":{"post":{"description":"Makes this address the default ship-from address.","operationId":"setDefaultSender","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/AddressResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Make default sender","tags":["Addresses"]}},"/v1/addresses/{id}/set-default-to":{"post":{"description":"Makes this address the default ship-to address.","operationId":"setDefaultRecipient","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/AddressResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Make default recipient","tags":["Addresses"]}},"/v1/api-clients/token":{"post":{"description":"Exchanges an API key (`client_id` + `client_secret`, created at my.parcelhub.ca → Account → API keys) for a bearer token. Tokens last about 15 minutes; when a call returns 401, get a new one. Send it as `Authorization: Bearer <access_token>` on every other call. A read-only key gets a token that may only read and request quotes.","operationId":"createAccessToken","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiClientTokenRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ApiClientTokenResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"security":[],"summary":"Get an access token","tags":["Authentication"]}},"/v1/batches":{"get":{"description":"Batches on the account, newest first.","operationId":"listBatches","parameters":[{"in":"query","name":"status","required":false,"schema":{"type":"string"}},{"description":"Most results to return.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/BatchesListResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List batches","tags":["Batches"]},"post":{"description":"Starts a new, open batch.","operationId":"createBatch","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBatchRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/BatchResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Create a batch","tags":["Batches"]}},"/v1/batches/{id}":{"get":{"description":"One batch with its totals.","operationId":"getBatch","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/BatchResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a batch","tags":["Batches"]},"patch":{"description":"Renames a batch, changes its notes, or closes it (`status: \"closed\"`). A closed batch takes no new shipments.","operationId":"updateBatch","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchBatchRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/BatchResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Update a batch","tags":["Batches"]}},"/v1/batches/{id}/drafts":{"get":{"description":"Drafts waiting to join this batch: they join when their label is bought.","operationId":"listBatchDrafts","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/BatchDraftsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Batch drafts","tags":["Batches"]}},"/v1/batches/{id}/labels":{"get":{"description":"One merged PDF of every label in the batch (short-lived link). `skipped` lists shipments whose label could not be included.","operationId":"getBatchLabels","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/BatchLabelsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Download all labels","tags":["Batches"]}},"/v1/batches/{id}/shipments":{"delete":{"description":"Takes shipments out of a batch. The shipments and their labels are not changed.","operationId":"removeBatchShipments","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveShipmentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/BatchResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Remove from a batch","tags":["Batches"]},"get":{"description":"Purchased shipments in a batch.","operationId":"listBatchShipments","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/BatchShipmentsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Batch shipments","tags":["Batches"]},"post":{"description":"Adds one or more purchased shipments to an open batch.","operationId":"addBatchShipments","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddShipmentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/BatchResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Add to a batch","tags":["Batches"]}},"/v1/customs/declarations":{"post":{"description":"Describes what is in a cross-border shipment: each item's description, quantity, value, HS code, country of origin and weight. Pass the returned `id` as `customs_declaration_id` when you get rates and buy the label. Look up HS codes with `GET /v1/public/hs-codes?q=…` (add `country=US` for 10-digit US codes).","operationId":"createCustomsDeclaration","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDeclarationRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/CustomsDeclarationResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Create a customs declaration","tags":["Customs"]}},"/v1/customs/declarations/{id}":{"get":{"description":"One customs declaration with its items.","operationId":"getCustomsDeclaration","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/CustomsDeclarationResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a customs declaration","tags":["Customs"]}},"/v1/dashboard/insights":{"get":{"description":"Shipment counts, spend, savings and delivery performance over a period, with points for charts.","operationId":"getInsights","parameters":[{"description":"`30d` (default, daily points), `90d` (weekly) or `12m` (monthly).","in":"query","name":"range","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/InsightsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Dashboard figures","tags":["Account"]}},"/v1/discounts/campaigns/{id}":{"get":{"description":"A discount campaign (from a my.parcelhub.ca/discount/… link) and whether this account can claim it.","operationId":"getDiscountCampaign","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/MyDiscountCampaignResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a discount campaign","tags":["Discounts"]}},"/v1/discounts/campaigns/{id}/claim":{"post":{"description":"Adds the campaign to the account so it applies at checkout.","operationId":"claimDiscountCampaign","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ClaimDiscountResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Claim a discount campaign","tags":["Discounts"]}},"/v1/discounts/validate":{"post":{"description":"Whether a code is valid and what it takes off an amount. Nothing is used up.","operationId":"checkDiscountCode","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateDiscountRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ValidateDiscountResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Check a discount code","tags":["Discounts"]}},"/v1/imports/lookup":{"post":{"description":"Which of the given order ids this account has already imported, so an import can skip them.","operationId":"lookupImportedOrders","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportsLookupRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ImportsLookupResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Check for imported orders","tags":["Drafts"]}},"/v1/integrations":{"get":{"description":"Stores connected to this account and the store platforms that can be connected.","operationId":"listStores","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Connected stores","tags":["Stores"]}},"/v1/integrations/connect":{"post":{"description":"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.","operationId":"connectStore","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Connect a store (sign-in)","tags":["Stores"]}},"/v1/integrations/connect-api-key":{"post":{"description":"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.","operationId":"connectStoreWithKeys","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyConnectBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Connect a store (API keys)","tags":["Stores"]}},"/v1/integrations/connections/{id}":{"delete":{"description":"Disconnects a store: its orders stop syncing. Shipments already made are kept.","operationId":"disconnectStore","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Disconnect a store","tags":["Stores"]}},"/v1/integrations/connections/{id}/sync":{"post":{"description":"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.","operationId":"syncStore","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Sync a store","tags":["Stores"]}},"/v1/integrations/import":{"post":{"description":"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.","operationId":"importStoreOrders","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Import store orders","tags":["Stores"]}},"/v1/integrations/orders":{"get":{"description":"Orders from connected stores, newest first, each marked with whether it was already imported. Page with `cursor` (the `next_cursor` of the previous page).","operationId":"listStoreOrders","parameters":[{"description":"Only orders from this connected store.","in":"query","name":"connection_id","required":false,"schema":{"type":"string"}},{"description":"Only this store platform, e.g. `shopify`.","in":"query","name":"channel","required":false,"schema":{"type":"string"}},{"description":"Order status, e.g. `unfulfilled`.","in":"query","name":"status","required":false,"schema":{"type":"string"}},{"description":"Orders created on or after this date (`YYYY-MM-DD` or an ISO time).","in":"query","name":"since","required":false,"schema":{"type":"string"}},{"description":"The `next_cursor` of the previous page.","in":"query","name":"cursor","required":false,"schema":{"type":"string"}},{"description":"Most orders to return.","in":"query","name":"limit","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Store orders","tags":["Stores"]}},"/v1/integrations/orders/{id}":{"get":{"description":"One store order with its line items and ship-to address.","operationId":"getStoreOrder","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a store order","tags":["Stores"]}},"/v1/invoices":{"get":{"description":"Charges billed after the fact, such as a carrier's weight or size adjustment. These may be unpaid.","operationId":"listInvoices","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/InvoicesListResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List invoices","tags":["Billing"]}},"/v1/invoices/{id}":{"get":{"description":"One invoice with its line items.","operationId":"getInvoice","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/InvoiceResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get an invoice","tags":["Billing"]}},"/v1/invoices/{id}/pay":{"post":{"description":"Pays an unpaid invoice from the wallet. Returns 409 (`error.message` is `insufficient_funds`) when the balance does not cover it.\n\n**Charges the account's wallet.** Confirm with the account owner before calling it.","operationId":"payInvoice","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PayInvoiceResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Pay an invoice","tags":["Billing"],"x-charges-wallet":true}},"/v1/invoices/{id}/pdf":{"get":{"description":"A short-lived download link for the invoice or receipt PDF.","operationId":"getInvoicePdf","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/InvoicePdfResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Download an invoice","tags":["Billing"]}},"/v1/item-presets":{"get":{"description":"Saved products for customs declarations: description, value, HS code and country of origin.","operationId":"listItemPresets","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ItemPresetsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List item presets","tags":["Packages"]},"post":{"description":"Saves a product for reuse in customs declarations.","operationId":"createItemPreset","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemPresetUpsert"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ItemPresetResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Save an item preset","tags":["Packages"]}},"/v1/item-presets/{id}":{"delete":{"description":"Deletes a saved product.","operationId":"deleteItemPreset","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DeletePresetResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Delete an item preset","tags":["Packages"]},"patch":{"description":"Changes a saved product.","operationId":"updateItemPreset","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemPresetUpsert"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ItemPresetResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Update an item preset","tags":["Packages"]}},"/v1/item-presets/{id}/use":{"post":{"description":"Records that a saved product was used, so the most used are listed first.","operationId":"useItemPreset","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ItemPresetResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Record item use","tags":["Packages"]}},"/v1/notification-preferences":{"get":{"description":"Which optional email categories the person receives. Account, security and legal emails always go out.","operationId":"getEmailPreferences","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/NotificationPrefs"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Email preferences","tags":["Notifications"]},"put":{"description":"Turns optional email categories on or off.","operationId":"updateEmailPreferences","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePrefsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/NotificationPrefs"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Update email preferences","tags":["Notifications"]}},"/v1/notifications":{"delete":{"description":"Deletes every notification.","operationId":"deleteAllNotifications","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"integer"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Delete all notifications","tags":["Notifications"]},"get":{"description":"In-app notifications, newest first.","operationId":"listNotifications","parameters":[{"in":"query","name":"unread_only","required":false,"schema":{"type":"boolean"}},{"description":"Most results to return.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Results to skip, for paging.","in":"query","name":"offset","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"type":"string"},"type":"array"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List notifications","tags":["Notifications"]}},"/v1/notifications/read-all":{"post":{"description":"Marks every notification read.","operationId":"markAllNotificationsRead","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"integer"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Mark all as read","tags":["Notifications"]}},"/v1/notifications/unread-count":{"get":{"description":"How many notifications are unread.","operationId":"countUnreadNotifications","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"integer"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Unread count","tags":["Notifications"]}},"/v1/notifications/{id}":{"delete":{"description":"Deletes one notification.","operationId":"deleteNotification","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"boolean"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Delete a notification","tags":["Notifications"]}},"/v1/notifications/{id}/read":{"post":{"description":"Marks one notification read.","operationId":"markNotificationRead","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"boolean"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Mark as read","tags":["Notifications"]}},"/v1/openapi.json":{"get":{"description":"The full OpenAPI document for the token that fetches it, including dashboard-only endpoints not listed in this reference. Each operation has `x-caller-allowed`: whether this token may call it.","operationId":"getMySpec","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Spec for your key","tags":["Authentication"]}},"/v1/organization/invites":{"get":{"description":"Invitations to join the current account that have not been accepted yet.","operationId":"listInvites","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/InviteRow"},"type":"array"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List pending invites","tags":["Account"]}},"/v1/organization/members":{"get":{"description":"People on the current account and their roles.","operationId":"listMembers","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MemberRow"},"type":"array"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List members","tags":["Account"]}},"/v1/organizations":{"get":{"description":"Every ParcelHub account (personal and business) the person belongs to, with their role in each.","operationId":"listOrganizations","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OrgSummary"},"type":"array"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List accounts","tags":["Account"]}},"/v1/overview":{"get":{"description":"The signed-in person, the account (organization) the key acts for, and headline counts.","operationId":"getOverview","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/MyOverview"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Account overview","tags":["Account"]}},"/v1/package-boxes":{"get":{"description":"ParcelHub's catalog of standard box sizes.","operationId":"listStandardBoxes","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PackageBoxesResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Standard boxes","tags":["Packages"]}},"/v1/package-presets":{"get":{"description":"The account's saved box sizes, with an optional default weight.","operationId":"listPackagePresets","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PackagePresetsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List box presets","tags":["Packages"]},"post":{"description":"Saves a box size for reuse.","operationId":"createPackagePreset","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackagePresetUpsert"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PackagePresetResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Save a box preset","tags":["Packages"]}},"/v1/package-presets/{id}":{"delete":{"description":"Deletes a saved box.","operationId":"deletePackagePreset","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DeletePresetResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Delete a box preset","tags":["Packages"]},"patch":{"description":"Changes a saved box.","operationId":"updatePackagePreset","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackagePresetUpsert"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PackagePresetResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Update a box preset","tags":["Packages"]}},"/v1/package-presets/{id}/use":{"post":{"description":"Records that a saved box was used, so the most used boxes are listed first.","operationId":"usePackagePreset","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PackagePresetResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Record box use","tags":["Packages"]}},"/v1/pickups":{"get":{"description":"Pickups on the account, newest first. Filter by list (`tab`), status, dates or a search.","operationId":"listPickups","parameters":[{"description":"Which list: `active`, `history`, `exceptions`, `cancelled`, `archived` or `draft`.","in":"query","name":"tab","required":false,"schema":{"type":"string"}},{"description":"Free-text search.","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"Ship-from address.","in":"query","name":"from","required":false,"schema":{"format":"date","type":"string"}},{"description":"Ship-to address.","in":"query","name":"to","required":false,"schema":{"format":"date","type":"string"}},{"description":"Most results to return.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Results to skip, for paging.","in":"query","name":"offset","required":false,"schema":{"type":"integer"}},{"description":"`true` to archive (the default), `false` to bring it back.","in":"query","name":"archived","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupsListResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List pickups","tags":["Pickups"]},"post":{"description":"Books a carrier pickup for the given shipments and charges the wallet the pickup fee. Get the price with `POST /v1/pickups/quote` first.\n\n**Charges the account's wallet.** Confirm with the account owner before calling it.","operationId":"createPickup","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePickupRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Book a pickup","tags":["Pickups"],"x-charges-wallet":true}},"/v1/pickups/carriers":{"get":{"description":"Carriers this account can book a pickup with.","operationId":"listPickupCarriers","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PickupCarrierItem"},"type":"array"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Pickup carriers","tags":["Pickups"]}},"/v1/pickups/counts":{"get":{"description":"How many pickups are in each list.","operationId":"countPickups","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupCountsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Pickup counts","tags":["Pickups"]}},"/v1/pickups/cutoffs":{"get":{"description":"Each carrier's latest time to request a same-day pickup, for the pickup area.","operationId":"listPickupCutoffs","parameters":[{"description":"Pickup postal code (cutoffs vary by area for some carriers).","in":"query","name":"postal_code","required":false,"schema":{"type":"string"}},{"description":"Pickup province.","in":"query","name":"province","required":false,"schema":{"type":"string"}},{"description":"Two-letter country code, e.g. `CA`, `US`.","in":"query","name":"country","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CarrierCutoffItem"},"type":"array"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Pickup cutoff times","tags":["Pickups"]}},"/v1/pickups/draft":{"post":{"description":"Starts a pickup without booking it, for building one up in steps.","operationId":"createPickupDraft","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePickupDraftRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Start a pickup draft","tags":["Pickups"]}},"/v1/pickups/draft/{id}":{"patch":{"description":"Sets the date, time window, address and shipments of a pickup draft.","operationId":"updatePickupDraft","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePickupDraftRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Update a pickup draft","tags":["Pickups"]}},"/v1/pickups/draft/{id}/confirm":{"post":{"description":"Books the pickup draft with the carrier and charges the wallet the pickup fee.\n\n**Charges the account's wallet.** Confirm with the account owner before calling it.","operationId":"confirmPickupDraft","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPickupDraftRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Book a pickup draft","tags":["Pickups"],"x-charges-wallet":true}},"/v1/pickups/options":{"get":{"description":"Whether same-day pickups can be booked right now, and the same-day cutoff hour.","operationId":"getPickupOptions","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupOptions"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Pickup scheduling options","tags":["Pickups"]}},"/v1/pickups/quote":{"post":{"description":"The pickup fee, discount and tax for a carrier, date and address. Nothing is booked or charged.","operationId":"quotePickup","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotePickupRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupQuoteResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Quote a pickup","tags":["Pickups"]}},"/v1/pickups/{id}":{"delete":{"description":"Deletes a pickup draft. A booked pickup is cancelled instead (`POST /v1/pickups/{id}/cancel`).","operationId":"deletePickupDraft","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Delete a pickup draft","tags":["Pickups"]},"get":{"description":"One pickup: carrier, date, time window, address, shipments, charges and status.","operationId":"getPickup","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a pickup","tags":["Pickups"]}},"/v1/pickups/{id}/archive":{"post":{"description":"Hides a finished pickup from the normal lists, or brings it back with `archived: false`.","operationId":"archivePickup","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchivePickupRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Archive a pickup","tags":["Pickups"]}},"/v1/pickups/{id}/cancel":{"post":{"description":"Cancels a booked pickup with the carrier and refunds its fee to the wallet.","operationId":"cancelPickup","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Cancel a pickup","tags":["Pickups"]}},"/v1/pickups/{id}/retry":{"post":{"description":"Sends a pickup whose booking failed to the carrier again. No new charge.","operationId":"retryPickup","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Retry a failed pickup","tags":["Pickups"]}},"/v1/pickups/{id}/shipments":{"post":{"description":"Adds shipments to a booked pickup that has not been cancelled.","operationId":"addPickupShipments","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddPickupShipmentsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PickupResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Add shipments to a pickup","tags":["Pickups"]}},"/v1/pickups/{id}/shipments/{shipment_id}":{"delete":{"description":"Takes one shipment off a pickup; the pickup stays booked. If it was the last shipment, the response says `empty: true`: cancel the pickup if it is no longer needed.","operationId":"removePickupShipment","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"shipment_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DetachShipmentResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Remove a shipment from a pickup","tags":["Pickups"]}},"/v1/pickups/{id}/timeline":{"get":{"description":"Everything that happened to the pickup: booking, carrier confirmation, charges and changes.","operationId":"getPickupTimeline","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/MyTimelineResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Pickup timeline","tags":["Pickups"]}},"/v1/preferences/shipping":{"get":{"description":"Defaults applied to new shipments: label size, signature option, reference, delivery instructions and whether recipients get tracking emails.","operationId":"getShippingPreferences","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShippingPreferencesResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Shipping defaults","tags":["Packages"]},"put":{"description":"Replaces the account's shipping defaults.","operationId":"updateShippingPreferences","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShippingPreferencesUpsert"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShippingPreferencesResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Update shipping defaults","tags":["Packages"]}},"/v1/profile":{"get":{"description":"Name, contact details and email addresses of the person the key belongs to. Profile changes are made in the dashboard, not with an API key.","operationId":"getProfile","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ProfileResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Profile","tags":["Account"]}},"/v1/promos/{id}":{"get":{"description":"A promotion (from a my.parcelhub.ca/promo/… link) and whether this account can claim it.","operationId":"getPromo","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/MyPromoResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a promotion","tags":["Discounts"]}},"/v1/promos/{id}/claim":{"post":{"description":"Claims the promotion onto the account.","operationId":"claimPromo","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ClaimResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Claim a promotion","tags":["Discounts"]}},"/v1/rates":{"post":{"description":"Live quotes from every carrier the account can use, cheapest first, with delivery estimates. The response has a `quote_id`; pass it when you buy so the purchase is linked to the quote. For a shipment that crosses a border, create a customs declaration first and pass `customs_declaration_id` so carriers can quote duties and international services. Nothing is charged.","operationId":"getRates","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateRequestBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/RatesResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get rates","tags":["Rates"]}},"/v1/rates/dropoffs":{"get":{"description":"The nearest carrier drop-off points (post offices, UPS, FedEx, Purolator and other counters) around an address, by carrier, with distance and opening hours where known.","operationId":"listDropoffLocations","parameters":[{"description":"The address to search around, usually the ship-from address.","in":"query","name":"address","required":true,"schema":{"type":"string"}},{"description":"Comma-separated carrier codes, e.g. `canada_post,ups`. Leave out for all.","in":"query","name":"carriers","required":false,"schema":{"type":"string"}},{"description":"Search radius in kilometres.","in":"query","name":"radiusKm","required":false,"schema":{"type":"number"}},{"description":"Most results to return.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Find drop-off locations","tags":["Rates"]}},"/v1/rates/quick":{"post":{"description":"A faster, lighter estimate across carriers, for showing a price before all details are known. Use `POST /v1/rates` before buying. Nothing is charged.","operationId":"getQuickRates","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateRequestBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/RatesResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Quick estimate","tags":["Rates"]}},"/v1/receipts":{"get":{"description":"Settled top-ups, label purchases and refunds.","operationId":"listReceipts","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/InvoicesListResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List receipts","tags":["Billing"]}},"/v1/receipts/{id}":{"get":{"description":"One receipt with its line items.","operationId":"getReceipt","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/InvoiceResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a receipt","tags":["Billing"]}},"/v1/referrals":{"get":{"description":"The account's referral link, the people it referred and the credit earned.","operationId":"getReferrals","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/MyReferralsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Referrals","tags":["Discounts"]}},"/v1/returns/address":{"get":{"description":"The warehouse address to give customers for returns.","operationId":"getReturnsAddress","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ReturnAddressesResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Return address","tags":["Returns"]}},"/v1/returns/intakes":{"get":{"description":"Return parcels received at the warehouse.","operationId":"listReturnIntakes","parameters":[{"description":"Most results to return.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/IntakesResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Received parcels","tags":["Returns"]}},"/v1/returns/items":{"get":{"description":"Items received at the warehouse.","operationId":"listReturnItems","parameters":[{"in":"query","name":"status","required":false,"schema":{"type":"string"}},{"description":"Most results to return.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ReturnItemsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Returned items","tags":["Returns"]}},"/v1/returns/items/{id}":{"get":{"description":"One item: photos, condition, storage time and what can be done with it.","operationId":"getReturnItem","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ReturnItemResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a returned item","tags":["Returns"]}},"/v1/returns/items/{id}/disposition":{"post":{"description":"`return_to_merchant` ships it back to the account (postage may apply), `continue_storage` keeps it, and `auction`, `donate` or `destroy` give it up, which cannot be undone.","operationId":"setReturnDisposition","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispositionRequestBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DispositionResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Decide what happens to an item","tags":["Returns"]}},"/v1/returns/statements":{"get":{"description":"Storage and handling statements.","operationId":"listReturnStatements","parameters":[{"description":"Most results to return.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/StatementsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Statements","tags":["Returns"]}},"/v1/returns/summary":{"get":{"description":"Counts of returned items by status and the account's ReturnHub balances.","operationId":"getReturnsSummary","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ReturnsSummaryResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Returns summary","tags":["Returns"]}},"/v1/returns/{id}":{"get":{"description":"A return created with `POST /v1/shipments/{id}/return`.","operationId":"getReturnLabel","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShipmentReturnResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a return label","tags":["Shipments"]}},"/v1/search":{"get":{"description":"One search across shipments, pickups, wallet transactions and invoices: order number, tracking number, name, amount and more. Results are grouped by kind.","operationId":"search","parameters":[{"description":"What to search for.","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"Most results per kind (default 6, max 20).","in":"query","name":"limit","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/SearchResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Search","tags":["Account"]}},"/v1/shipments":{"get":{"description":"Purchased shipments, newest first. Filter by status, dates, source or a search (order number, tracking number, recipient name, company or city). Page with `limit` and `offset`.","operationId":"listShipments","parameters":[{"description":"Only shipments with this status.","in":"query","name":"status","required":false,"schema":{"type":"string"}},{"description":"Most results to return.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Results to skip, for paging.","in":"query","name":"offset","required":false,"schema":{"type":"integer"}},{"description":"Created on or after this day (`YYYY-MM-DD`, UTC).","in":"query","name":"from","required":false,"schema":{"format":"date","type":"string"}},{"description":"Created on or before this day (`YYYY-MM-DD`, UTC).","in":"query","name":"to","required":false,"schema":{"format":"date","type":"string"}},{"description":"`true` for return shipments only, `false` to leave them out.","in":"query","name":"is_return","required":false,"schema":{"type":"boolean"}},{"description":"`true` for the Archived list. Archived shipments are left out otherwise.","in":"query","name":"archived","required":false,"schema":{"type":"boolean"}},{"description":"Only shipments from this source: `manual`, `csv`, `xlsx`, `api` or a store platform such as `shopify`.","in":"query","name":"source","required":false,"schema":{"type":"string"}},{"description":"Matches order number, tracking number, or the recipient's name, company or city.","in":"query","name":"search","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShipmentsListResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List shipments","tags":["Shipments"]},"post":{"description":"Buys a label for one of the rates from `POST /v1/rates` and charges the wallet. Send the same addresses and packages you quoted, the chosen `carrier`, `service_code` and `service_name`, and the `quote_id`. Shipments that cross a border need `customs_declaration_id`. Send an `Idempotency-Key` header (any unique string per purchase): retrying with the same key returns the first shipment instead of buying a second label. Returns 409 (`error.message` is `insufficient_funds`) when the wallet does not cover the price: top up and retry.\n\n**Charges the account's wallet.** Confirm with the account owner before calling it.","operationId":"createShipment","parameters":[{"description":"Any unique string per purchase. A retry with the same key returns the first result instead of buying again.","in":"header","name":"Idempotency-Key","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateShipmentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShipmentDetailResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Buy a label","tags":["Shipments"],"x-charges-wallet":true}},"/v1/shipments/counts":{"get":{"description":"How many shipments are in each list (in transit, delivered, exceptions, drafts…).","operationId":"countShipments","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShipmentCountsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Shipment counts","tags":["Shipments"]}},"/v1/shipments/draft":{"post":{"description":"Saves a shipment without buying it. A draft can hold a chosen rate, and be bought later with `POST /v1/shipments/draft/{id}/process`.","operationId":"createDraft","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDraftRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DraftResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Save a draft","tags":["Drafts"]}},"/v1/shipments/draft/{id}":{"delete":{"description":"Deletes an unpurchased draft.","operationId":"deleteDraft","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Delete a draft","tags":["Drafts"]},"get":{"description":"One draft: addresses, packages, add-ons and the selected rate, if any.","operationId":"getDraft","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DraftResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a draft","tags":["Drafts"]},"patch":{"description":"Changes a draft. Fields you leave out stay as they are; `null` clears a field that can be cleared. To choose a rate, send the `selected_*` fields and the `quote_id` from `POST /v1/rates`.","operationId":"updateDraft","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDraftRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DraftResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Update a draft","tags":["Drafts"]}},"/v1/shipments/draft/{id}/process":{"post":{"description":"Buys the label for the rate selected on the draft and charges the wallet. The draft becomes a shipment.\n\n**Charges the account's wallet.** Confirm with the account owner before calling it.","operationId":"buyDraft","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShipmentDetailResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Buy a draft","tags":["Drafts"],"x-charges-wallet":true}},"/v1/shipments/drafts":{"get":{"description":"Unpurchased shipments, newest first: saved forms and orders imported from stores or files.","operationId":"listDrafts","parameters":[{"description":"Most results to return.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Results to skip, for paging.","in":"query","name":"offset","required":false,"schema":{"type":"integer"}},{"description":"Only drafts for this batch, or `none` for drafts without a batch.","in":"query","name":"batch_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DraftsListResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List drafts","tags":["Drafts"]}},"/v1/shipments/duties-availability":{"get":{"description":"Whether prepaid duties and taxes (DDP: the recipient pays nothing on delivery) are offered right now, for US-bound parcels and for other countries.","operationId":"getDutiesAvailability","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DutiesAvailabilityResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Prepaid duties availability","tags":["Rates"]}},"/v1/shipments/ids":{"get":{"description":"Only the ids of the shipments a `GET /v1/shipments` query would return, in the same order. Takes the same filters.","operationId":"listShipmentIds","parameters":[{"description":"Only shipments with this status.","in":"query","name":"status","required":false,"schema":{"type":"string"}},{"description":"Most results to return.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Results to skip, for paging.","in":"query","name":"offset","required":false,"schema":{"type":"integer"}},{"description":"Created on or after this day (`YYYY-MM-DD`, UTC).","in":"query","name":"from","required":false,"schema":{"format":"date","type":"string"}},{"description":"Created on or before this day (`YYYY-MM-DD`, UTC).","in":"query","name":"to","required":false,"schema":{"format":"date","type":"string"}},{"description":"`true` for return shipments only, `false` to leave them out.","in":"query","name":"is_return","required":false,"schema":{"type":"boolean"}},{"description":"`true` for the Archived list. Archived shipments are left out otherwise.","in":"query","name":"archived","required":false,"schema":{"type":"boolean"}},{"description":"Only shipments from this source: `manual`, `csv`, `xlsx`, `api` or a store platform such as `shopify`.","in":"query","name":"source","required":false,"schema":{"type":"string"}},{"description":"Matches order number, tracking number, or the recipient's name, company or city.","in":"query","name":"search","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShipmentIdsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List shipment ids","tags":["Shipments"]}},"/v1/shipments/price-preview":{"post":{"description":"The exact total for a chosen rate: sales tax for the route, any discount (a code you pass, or the best promotion already claimed on the account) and prepaid duties. Nothing is charged.","operationId":"previewPrice","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricePreviewRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PricePreviewResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Checkout total","tags":["Rates"]}},"/v1/shipments/{id}":{"get":{"description":"One shipment in full: addresses, packages, carrier and service, charges, tracking number and status.","operationId":"getShipment","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShipmentDetailResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a shipment","tags":["Shipments"]}},"/v1/shipments/{id}/archive":{"post":{"description":"Moves a shipment to the Archived list, or back with `archived: false`. Nothing changes with the carrier.","operationId":"archiveShipment","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveShipmentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShipmentDetailResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Archive a shipment","tags":["Shipments"]}},"/v1/shipments/{id}/cancel":{"post":{"description":"Voids an unused label with the carrier and refunds it to the wallet. Some carriers refund only after they confirm the label was not used. Cannot be undone.","operationId":"cancelShipment","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelShipmentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShipmentDetailResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Void a label","tags":["Shipments"]}},"/v1/shipments/{id}/comments":{"get":{"description":"Notes on a shipment, from the account and from ParcelHub support.","operationId":"listShipmentComments","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShipmentCommentsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List comments","tags":["Shipments"]},"post":{"description":"Adds a note to a shipment. ParcelHub support can see it.","operationId":"addShipmentComment","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCommentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ShipmentCommentResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Add a comment","tags":["Shipments"]}},"/v1/shipments/{id}/comments/{comment_id}":{"delete":{"description":"Deletes a note the account wrote.","operationId":"deleteShipmentComment","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"comment_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Delete a comment","tags":["Shipments"]}},"/v1/shipments/{id}/customs-invoice":{"get":{"description":"A download link for the commercial invoice the carrier made for a cross-border label, valid for about 15 minutes.","operationId":"getCustomsInvoice","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/CustomsInvoiceUrlResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Download the commercial invoice","tags":["Shipments"]}},"/v1/shipments/{id}/label":{"get":{"description":"A download link for the label PDF, valid for about 15 minutes. For a shipment with several boxes, `box` returns one box's label.","operationId":"getLabel","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Box number (from 1) to get only that box's label.","in":"query","name":"box","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/LabelUrlResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Download the label","tags":["Shipments"]}},"/v1/shipments/{id}/return":{"post":{"description":"Buys a return label for an existing shipment and charges the wallet. By default it goes from the original recipient back to the sender with the same packages; any field you send replaces the original. Send an `Idempotency-Key` header, as when buying a label.\n\n**Charges the account's wallet.** Confirm with the account owner before calling it.","operationId":"createReturnLabel","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Any unique string per purchase. A retry with the same key returns the first result instead of buying again.","in":"header","name":"Idempotency-Key","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReturnRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/CreateReturnResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Buy a return label","tags":["Shipments"],"x-charges-wallet":true}},"/v1/shipments/{id}/timeline":{"get":{"description":"Everything that happened to the shipment on ParcelHub: purchase, label, pickup, tracking milestones, refunds and charges.","operationId":"getShipmentTimeline","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/MyTimelineResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Timeline","tags":["Shipments"]}},"/v1/shipments/{id}/tracking":{"get":{"description":"Tracking events from the carrier, newest first, with the current status.","operationId":"getTracking","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/TrackingResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Tracking","tags":["Shipments"]}},"/v1/sms-preferences":{"get":{"description":"Text-message updates for each account the person belongs to. Texts need a verified phone number.","operationId":"getSmsPreferences","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OrgSmsPrefs"},"type":"array"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"SMS preferences","tags":["Notifications"]}},"/v1/sms-preferences/{org_id}":{"put":{"description":"Turns text-message updates on or off for one account.","operationId":"updateSmsPreferences","parameters":[{"in":"path","name":"org_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSmsPrefsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"boolean"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Update SMS preferences","tags":["Notifications"]}},"/v1/support/chat-availability":{"get":{"description":"Whether the support team is available right now, and the usual hours.","operationId":"getSupportAvailability","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ChatAvailabilityResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Support hours","tags":["Support"]}},"/v1/support/tickets":{"get":{"description":"Support tickets on the account, newest first.","operationId":"listTickets","parameters":[{"in":"query","name":"page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"page_size","required":false,"schema":{"type":"integer"}},{"in":"query","name":"status","required":false,"schema":{"type":"string"}},{"in":"query","name":"category","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/SupportTicketsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"List tickets","tags":["Support"]},"post":{"description":"Opens a ticket with ParcelHub support. Link the shipments or pickups it is about in `related_items`.","operationId":"createTicket","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTicketRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/TicketCreatedResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Open a ticket","tags":["Support"]}},"/v1/support/tickets/{id}":{"get":{"description":"One ticket with its full conversation.","operationId":"getTicket","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/SupportTicketDetailResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a ticket","tags":["Support"]}},"/v1/support/tickets/{id}/messages":{"post":{"description":"Adds a message to a ticket.","operationId":"replyToTicket","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessageRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/SupportMessageResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Reply to a ticket","tags":["Support"]}},"/v1/support/tickets/{id}/rating":{"post":{"description":"Rates how a resolved or closed ticket was handled. Sending again replaces the earlier rating.","operationId":"rateTicket","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateTicketRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/SupportTicketDetailResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Rate a ticket","tags":["Support"]}},"/v1/support/tickets/{id}/status":{"patch":{"description":"`closed` when the issue is sorted; `open` to reopen a resolved or closed ticket.","operationId":"setTicketStatus","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTicketStatusRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/SupportTicketDetailResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Close or reopen a ticket","tags":["Support"]}},"/v1/wallet":{"get":{"description":"The wallet balance and limits.","operationId":"getWallet","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/WalletBalanceResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Wallet balance","tags":["Wallet"]}},"/v1/wallet/cards":{"get":{"description":"Cards saved on the account: brand, last 4 digits, expiry and which is the default. Full card numbers are never returned. New cards are added by the customer on Stripe's secure form in the dashboard (my.parcelhub.ca/wallet/add-card), never through the API.","operationId":"listCards","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PaymentMethodsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Saved cards","tags":["Wallet"]}},"/v1/wallet/cards/{id}":{"delete":{"description":"Deletes a saved card.","operationId":"deleteCard","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DeletePaymentMethodResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Remove a card","tags":["Wallet"]}},"/v1/wallet/cards/{id}/default":{"post":{"description":"Makes a saved card the default for top-ups.","operationId":"setDefaultCard","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PaymentMethodResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Make a card the default","tags":["Wallet"]}},"/v1/wallet/refunds":{"get":{"description":"Requests to refund unused wallet funds, with their status.","operationId":"listWalletRefunds","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/RefundRequestsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Refund requests","tags":["Wallet"]}},"/v1/wallet/refunds/{transaction_id}":{"post":{"description":"Asks for unused funds from a past top-up to be refunded to the card that paid for it (never anywhere else). ParcelHub staff review each request. `transaction_id` is the top-up's wallet transaction.","operationId":"requestWalletRefund","parameters":[{"in":"path","name":"transaction_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundRequestBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/RefundRequestResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Request a refund","tags":["Wallet"]}},"/v1/wallet/top-up":{"post":{"description":"Charges a saved card straight away. `payment_method_id` is the card's `stripe_payment_method_id` (`pm_…`) from `GET /v1/wallet/cards`. Then call `POST /v1/wallet/top-up/{transaction_id}/confirm` with the returned `transaction_id` to credit the wallet. Check `GET /v1/wallet/topup-bonuses` for the minimum and maximum.\n\n**Charges the account's wallet.** Confirm with the account owner before calling it.","operationId":"topUpWallet","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/TopUpResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Top up the wallet","tags":["Wallet"],"x-charges-wallet":true}},"/v1/wallet/top-up/{transaction_id}/confirm":{"post":{"description":"Checks a top-up's payment with the card processor and credits the wallet (and any top-up bonus) once it succeeded. Calling it again is safe. If the bank asks for extra verification (3-D Secure) the error message contains `requires_action`: only the cardholder can finish that, at my.parcelhub.ca/wallet/top-up.","operationId":"confirmTopUp","parameters":[{"in":"path","name":"transaction_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ConfirmTopUpResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Confirm a top-up","tags":["Wallet"]}},"/v1/wallet/topup-bonuses":{"get":{"description":"The minimum top-up, the maximum balance and any bonus this account can get on its next top-up.","operationId":"listTopUpBonuses","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/TopupConfigResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Top-up options","tags":["Wallet"]}},"/v1/wallet/transactions":{"get":{"description":"Top-ups, label and pickup charges, refunds and bonuses, newest first. Filter with `type`.","operationId":"listWalletTransactions","parameters":[{"description":"Only this kind: `top_up`, `payment` (labels, pickups, invoices), `refund` or `adjustment` (credits and corrections).","in":"query","name":"type","required":false,"schema":{"type":"string"}},{"description":"Most results to return.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/WalletTransactionsResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Wallet history","tags":["Wallet"]}},"/v1/wallet/transactions/{id}":{"get":{"description":"One wallet transaction in detail.","operationId":"getWalletTransaction","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/WalletTransactionResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Get a transaction","tags":["Wallet"]}},"/v1/wallet/unpaid":{"get":{"description":"The total of unpaid invoices; 0 when nothing is owed.","operationId":"getUnpaidTotal","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/UnpaidBalanceResponse"},"ok":{"const":true,"type":"boolean"},"request_id":{"type":"string"}},"required":["ok","data"],"type":"object"}}},"description":"Success."},"default":{"$ref":"#/components/responses/Error"}},"summary":"Amount owed","tags":["Wallet"]}}},"security":[{"bearer":[]}],"servers":[{"url":"https://api.parcelhub.ca","description":"ParcelHub API"}],"tags":[{"description":"Exchange an API key for a short-lived access token.","name":"Authentication"},{"description":"Who the key acts as, the account's people, search and dashboard figures.","name":"Account"},{"description":"Live quotes from every carrier, checkout totals and drop-off locations.","name":"Rates"},{"description":"Buy labels, download them, track parcels, void labels and make return labels.","name":"Shipments"},{"description":"Shipments saved without buying, including orders imported from stores and files.","name":"Drafts"},{"description":"Customs declarations for shipments that cross a border.","name":"Customs"},{"description":"The address book: senders, recipients and the default ship-from / ship-to.","name":"Addresses"},{"description":"Saved box sizes, saved customs items and the account's shipping defaults.","name":"Packages"},{"description":"Groups of purchased shipments, for example one day's orders, with merged labels.","name":"Batches"},{"description":"Carrier pickups: options, quotes, booking, changes and cancellation.","name":"Pickups"},{"description":"The prepaid balance labels are paid from: balance, history, top-ups, saved cards and refunds.","name":"Wallet"},{"description":"Invoices (charges billed later, such as carrier adjustments) and receipts.","name":"Billing"},{"description":"Connected online stores (Shopify, WooCommerce, Wix and others) and their orders.","name":"Stores"},{"description":"ReturnHub: returns received at the ParcelHub warehouse for this account.","name":"Returns"},{"description":"Tickets with the ParcelHub support team.","name":"Support"},{"description":"In-app notifications and email / SMS preferences.","name":"Notifications"},{"description":"Discount codes, promotions and referrals.","name":"Discounts"}]}