Skip to main content

Orders — Mailhub API Reference

Create, list, retrieve, and update the fulfilment status of orders. An order's own `status` (Created, Packed, LabelCreated, Fulfilled, …) tracks fulfilment progress and is distinct from a shipment's tracking-oriented `status` field, which stays `Unknown` until real tracking is implemented — the two must not be conflated when reading a response. Create an Order with Rates creates the same public Order resource, then immediately requests Rates for each created Shipment.

Operations

GET /api/v1/orders

List orders

Returns a paginated list of orders for the authenticated account. Supports optional filtering by search term, date range, statuses, and sources. Each order reports a `source` indicating where it came from: `Manual` (created in the Mailhub app), `API` (created through this integration API), or `Shopify` (imported from a connected store). The `sources` filter takes the numeric values of those names — 1 `Manual`, 2 `API`, 3 `Shopify` — and is repeated to match several, e.g. `?sources=2&sources=3`. Omit it to return orders from every source.

Authentication: JWTBearerAuth, Bearer http, JWT

Parameters

NameInTypeRequiredDescription
searchquerystringoptional

Example: John Recipient

sortByNewestquerybooleanoptional

Example: true

dateFromquerystring (date-time)optional

Example: 2026-01-01T00:00:00Z

dateToquerystring (date-time)optional

Example: 2026-12-31T23:59:59Z

statusesqueryOrderStatus[]optional

Example: 7

sourcesqueryOrderSourceCode[]optional

Example: 2

pageNumberqueryinteger (int32)optional

Example: 1

pageSizequeryinteger (int32)optional

Example: 20

X-SubAccount-Idheaderstring (uuid)optionalOptional. If present, filters the returned orders to this sub-account only; omit to list all of the account's orders regardless of sub-account.

Example: 3a7d9e21-6b48-4c15-9f2e-7d0c5b83a614

Responses

StatusDescriptionBody
200Orders retrieved successfully

application/json — ListOrdersResponseEnvelope

400The request could not be read as sent — for example an `X-SubAccount-Id` header that is not a GUID.

application/json — ErrorEnvelope

401Not authenticated

application/json — ErrorEnvelope

403Authenticated, but not with an Open API integration token. Sent without a body.No response body.
404The sub-account given in `X-SubAccount-Id` does not exist or belongs to another account.

application/json — ErrorEnvelope

409The sub-account given in `X-SubAccount-Id` is not active.

application/json — ErrorEnvelope

422Validation errors

application/json — ErrorEnvelope

500The request could not be completed because of an unexpected server-side failure.

application/json — ErrorEnvelope

POST /api/v1/orders

Create an Order

Creates one Order containing one or more Shipments and returns the created Order. This standard creation flow does not request shipping Rates during the create operation.

Authentication: JWTBearerAuth, Bearer http, JWT

Parameters

NameInTypeRequiredDescription
X-SubAccount-Idheaderstring (uuid)optionalOptional. If present, tags the newly created order (and its shipments) with this sub-account.

Example: 3a7d9e21-6b48-4c15-9f2e-7d0c5b83a614

Idempotency-KeyheaderstringoptionalOptional. Identifies one creation attempt. Repeating a request with the same value returns the Order the first attempt created instead of creating a second one, which makes a request that timed out safe to repeat. Choose a new value for a genuinely new Order. The key is scoped to the account, not the sub-account: repeating it under a different X-SubAccount-Id still returns the first Order. Maximum 200 characters. Keys beginning with `ingestion:` are reserved for orders imported from a connected store and are rejected, whatever their casing.

Example: order-2026-09-07-0001

Request body (required)

application/json — CreateOrderRequest

{
  "fromAddress": {
    "name": "Jane Sender",
    "street1": "123 Main St",
    "city": "Austin",
    "state": "TX",
    "zip": "78701",
    "country": "US",
    "phone": "5125550100"
  },
  "toAddress": {
    "name": "John Recipient",
    "street1": "456 Oak Ave",
    "city": "Denver",
    "state": "CO",
    "zip": "80202",
    "country": "US",
    "phone": "3035550100"
  },
  "shipments": [
    {
      "parcel": {
        "weight": 16,
        "length": 10,
        "width": 8,
        "height": 4
      }
    }
  ]
}

Responses

StatusDescriptionBody
201Order created successfully

application/json — CreateOrderResponseEnvelope

400A required part of the request is missing: `fromAddress`, `toAddress`, `shipments`, or a shipment's `parcel`

application/json — ErrorEnvelope

401Not authenticated

application/json — ErrorEnvelope

403Authenticated, but not with an Open API integration token. Sent without a body.No response body.
404The sub-account given in `X-SubAccount-Id` does not exist or belongs to another account.

application/json — ErrorEnvelope

409The sub-account given in `X-SubAccount-Id` is not active.

application/json — ErrorEnvelope

415The request was sent with a `Content-Type` other than `application/json`. Answered by middleware ahead of authentication, so it is reachable on every write operation.

application/json — ErrorEnvelope

422The addresses were readable but not usable — an address failed validation

application/json — ErrorEnvelope

500The request could not be completed because of an unexpected server-side failure.

application/json — ErrorEnvelope

GET /api/v1/orders/{orderId}

Get order

Returns detailed information about a single order including shipment and package details. shipment.labelAssets carries one entry per printable format, each with a temporary pre-signed url when the asset has been generated. The link downloads the file directly from storage with no API token, expires (24 hours by default) and cannot be revoked before it does — treat it as a credential. This endpoint is the way to obtain fresh links after earlier ones lapse: request the order again.

Authentication: JWTBearerAuth, Bearer http, JWT

Parameters

NameInTypeRequiredDescription
orderIdpathstring (guid)required

Example: 5f2c1a10-2b3d-4e5f-8a9b-0c1d2e3f4a5b

X-SubAccount-Idheaderstring (uuid)optionalOptional. If present, the order must belong to this sub-account; omit to look up orders across the authenticated account.

Example: 3a7d9e21-6b48-4c15-9f2e-7d0c5b83a614

Responses

StatusDescriptionBody
200Order retrieved successfully

application/json — GetOrderResponseEnvelope

400The request could not be read as sent — for example an `X-SubAccount-Id` header that is not a GUID.

application/json — ErrorEnvelope

401Not authenticated

application/json — ErrorEnvelope

403Authenticated, but not with an Open API integration token. Sent without a body.No response body.
404Order not found

application/json — ErrorEnvelope

409The sub-account given in `X-SubAccount-Id` is not active.

application/json — ErrorEnvelope

500The request could not be completed because of an unexpected server-side failure.

application/json — ErrorEnvelope

PATCH /api/v1/orders/{orderId}/status

Update order status

Changes the order status using order workflow rules.

Authentication: JWTBearerAuth, Bearer http, JWT

Parameters

NameInTypeRequiredDescription
orderIdpathstring (guid)required

Example: 5f2c1a10-2b3d-4e5f-8a9b-0c1d2e3f4a5b

X-SubAccount-Idheaderstring (uuid)optionalOptional but has no effect on this operation: the order is looked up and updated by account only, regardless of which sub-account it is tagged with or which sub-account this header specifies.

Example: 3a7d9e21-6b48-4c15-9f2e-7d0c5b83a614

Request body (required)

application/json — UpdateOrderStatusRequest

{
  "status": 7,
  "reason": "Packed and ready to ship",
  "source": "warehouse-scanner"
}

Responses

StatusDescriptionBody
200Order status updated successfully.

application/json — UpdateOrderStatusResponseEnvelope

400Bad request.

application/json — ErrorEnvelope

401The request carries no usable credential: missing, malformed, expired, or revoked.

application/json — ErrorEnvelope

403Authenticated, but not with an Open API integration token. Sent without a body.No response body.
404Order not found.

application/json — ErrorEnvelope

409Status transition is not allowed.

application/json — ErrorEnvelope

415The request was sent with a `Content-Type` other than `application/json`. Answered by middleware ahead of authentication, so it is reachable on every write operation.

application/json — ErrorEnvelope

422The requested status, or the resume status it needs, is not usable.

application/json — ErrorEnvelope

500The request could not be completed because of an unexpected server-side failure.

application/json — ErrorEnvelope

POST /api/v2/orders

Create an Order with Rates

Creates one Order using the same Order-creation workflow as POST /api/v1/orders, then immediately requests Rates for each created Shipment. The response returns the created Order and Rates grouped by Shipment. Use the V1 operation when you want to create the Order first and request Rates later. Use this operation when you want creation and initial rating in one request. This operation creates one Order per request, not a batch endpoint, and Label purchase remains a separate step.

Authentication: JWTBearerAuth, Bearer http, JWT

Parameters

NameInTypeRequiredDescription
X-SubAccount-Idheaderstring (uuid)optionalOptional. If present, tags the newly created order (and its shipments) with this sub-account — the same behavior as POST /api/v1/orders, since this operation creates through the same path.

Example: 3a7d9e21-6b48-4c15-9f2e-7d0c5b83a614

Idempotency-KeyheaderstringoptionalOptional. Identifies one creation attempt. Repeating a request with the same value returns the Order the first attempt created instead of creating a second one, which makes a request that timed out safe to repeat. Choose a new value for a genuinely new Order. The key is scoped to the account, not the sub-account: repeating it under a different X-SubAccount-Id still returns the first Order. Maximum 200 characters. Keys beginning with `ingestion:` are reserved for orders imported from a connected store and are rejected, whatever their casing.

Example: order-2026-09-07-0001

Request body (required)

application/json — CreateOrderV2Request

{
  "order": {
    "fromAddress": {
      "name": "Jane Sender",
      "street1": "123 Main St",
      "city": "Austin",
      "state": "TX",
      "zip": "78701",
      "country": "US",
      "phone": "5125550100"
    },
    "toAddress": {
      "name": "John Recipient",
      "street1": "456 Oak Ave",
      "city": "Denver",
      "state": "CO",
      "zip": "80202",
      "country": "US",
      "phone": "3035550100"
    },
    "shipments": [
      {
        "parcel": {
          "weight": 16,
          "length": 10,
          "width": 8,
          "height": 4
        }
      }
    ]
  }
}

Responses

StatusDescriptionBody
200Order created with at least one carrier rate

application/json — CreateOrderV2ResponseEnvelope

400The request could not be read as sent — for example an `X-SubAccount-Id` header that is not a GUID.

application/json — ErrorEnvelope

401Not authenticated

application/json — ErrorEnvelope

403Authenticated, but not with an Open API integration token. Sent without a body.No response body.
404The sub-account given in `X-SubAccount-Id` does not exist or belongs to another account.

application/json — ErrorEnvelope

409The sub-account given in `X-SubAccount-Id` is not active.

application/json — ErrorEnvelope

415The request was sent with a `Content-Type` other than `application/json`. Answered by middleware ahead of authentication, so it is reachable on every write operation.

application/json — ErrorEnvelope

422Invalid Order input, or the carrier rejected the shipment for a reason the caller can correct. If no created Shipment returned a Rate, the Order may already have been created before this response is returned. Send an Idempotency-Key header and repeat the same request with the same key to find out: the first attempt's Order is returned rather than a second one being created.

application/json — ErrorEnvelope

500No rates could be produced and the failure could not be classified

application/json — ErrorEnvelope

503No rates could be produced because a carrier is temporarily unavailable. Nothing to correct; retry later

application/json — ErrorEnvelope

Schemas

The public schemas the operations above reference. Each is listed once; a type name in the tables above links to its fields here.

ApiError

One thing that went wrong.

FieldTypeRequiredDescription
codestringrequiredMachine-readable error identifier, dotted and stable — for example Order.NotFound. Branch on this rather than on message.
messagestringrequiredReadable explanation of the failure. Wording may change; do not parse it.
metaDataobject nullableoptionalExtra detail about this particular failure. Its shape depends on code.

CarrierRateResult

The outcome of asking one carrier for rates. Present for every carrier that was asked, so a carrier that returned nothing can be told apart from a carrier that was never contacted.

FieldTypeRequiredDescription
carrierstringrequiredThe carrier that was asked for rates.
errorCodestring nullablerequiredMachine-readable reason the carrier returned no rates.
errorMessagestring nullablerequiredReadable explanation of why the carrier returned no rates.
successbooleanrequiredWhether that carrier returned rates.

CreateOrderRequest

An order to create. Accepts either the wrapped form — { "order": { … } } — or the flat form, { "fromAddress": …, "toAddress": …, "shipments": [ … ] }. Send one or the other; when both are present the wrapped order wins.

FieldTypeRequiredDescription
fromAddressOrderAddressRequest nullableoptionalFlat payload: { "fromAddress": …, "toAddress": …, "shipments": … }.
orderOrderRequest nullableoptionalWrapped payload: { "order": { "fromAddress": … } }.
shipmentsOrderShipmentRequest[] nullableoptionalPackages to ship, in the flat form of the payload. One shipment per package.
toAddressOrderAddressRequest nullableoptional

CreateOrderResponse

An order as Mailhub recorded it, with the addresses and shipments it now owns.

FieldTypeRequiredDescription
createdAtstring (date-time)requiredUTC instant the order was created.

Format: date-time

fromAddressOrderAddressResponserequired
idstringrequiredIdentifier of the created order. Use it on the order retrieval and status operations.
isReturnbooleanrequiredWhether the order is a return shipment back to the sender.
shipmentsOrderShipmentResponse[]requiredThe packages recorded on the order, one entry per shipment sent in the request.
statusOrderStatusrequiredOrder status as its numeric OrderStatus value — a newly created order reads 0 (Created). The full set is listed on the OrderStatus schema, and the order retrieval, list and status-update operations use these same numbers.
toAddressOrderAddressResponserequired
updatedAtstring (date-time)requiredUTC instant the order was last modified.

Format: date-time

CreateOrderResponseEnvelope

The envelope every JSON operation answers with: a success flag and either a result or errors.

FieldTypeRequiredDescription
dataCreateOrderResponse nullablerequiredThe operation's result. Absent when the call failed.
errorsApiError[] nullablerequiredWhat went wrong. Absent when the call succeeded.
successbooleanrequiredWhether the operation succeeded. When false, read errors.

CreateOrderV2Request

An order to create and immediately fetch rates for.

FieldTypeRequiredDescription
orderOrderRequestrequired

CreateOrderV2Response

The created order together with the rates fetched for its shipments.

FieldTypeRequiredDescription
errorsApiError[]requiredFailures that did not stop the order being created — a rate lookup that failed, for example.
orderCreateOrderResponse nullablerequiredThe order that was created.
shipmentRatesCreateOrderV2ShipmentRates[]requiredRates fetched for each shipment on the new order, one entry per shipment.
statusstringrequiredFixed acknowledgement returned on a successful combined create-and-rate call — always the string created. It is not an order status: the order's own lifecycle value is the numeric OrderStatus on order.status. A call that produced no rates at all fails instead of returning this response.

Allowed values: created

CreateOrderV2ResponseEnvelope

The envelope every JSON operation answers with: a success flag and either a result or errors.

FieldTypeRequiredDescription
dataCreateOrderV2Response nullablerequiredThe operation's result. Absent when the call failed.
errorsApiError[] nullablerequiredWhat went wrong. Absent when the call succeeded.
successbooleanrequiredWhether the operation succeeded. When false, read errors.

CreateOrderV2ShipmentRates

The rates available for one shipment on the order.

FieldTypeRequiredDescription
carrierResponsesCarrierRateResult[]requiredOne entry per carrier that was asked, including the ones that returned nothing, so a missing carrier can be told apart from a carrier that declined.
errorsApiError[]requiredFailures encountered while rating this shipment.
ratesRateQuote[]requiredThe rates available for this shipment. Buy one by sending its id to the label operation.
shipmentIdstringrequiredIdentifier of the shipment these rates belong to.

ErrorEnvelope

The envelope every JSON operation answers with: a success flag and either a result or errors.

FieldTypeRequiredDescription
dataobject nullablerequiredThe operation's result. Absent when the call failed.
errorsApiError[]requiredWhat went wrong. Absent when the call succeeded.
successbooleanrequiredWhether the operation succeeded. When false, read errors.

GetOrderResponse

One order, with its recipient, destination and most recent shipment.

FieldTypeRequiredDescription
customerOrderCustomerrequired
destinationOrderDestinationrequired
idstring (guid)requiredIdentifier of the order.

Format: guid

labelIdstring (guid) nullablerequiredIdentifier of the most recent label bought for the order, when one exists.

Format: guid

orderDatestring (date-time)requiredUTC instant the order was created.

Format: date-time

shipmentOrderShipmentSummary nullablerequiredThe order's most recent shipment, when it has one. An order with no shipment yet has none.
shipmentIdstring (guid) nullablerequiredIdentifier of the order's most recent shipment, when it has one.

Format: guid

statusOrderStatusrequired

GetOrderResponseEnvelope

The envelope every JSON operation answers with: a success flag and either a result or errors.

FieldTypeRequiredDescription
dataGetOrderResponse nullablerequiredThe operation's result. Absent when the call failed.
errorsApiError[] nullablerequiredWhat went wrong. Absent when the call succeeded.
successbooleanrequiredWhether the operation succeeded. When false, read errors.

LabelStatus

State of a purchased label, published as the numeric value: 0 = Unknown — no label state recorded. 1 = Created — bought and live at the carrier. 2 = Printed — printed; still live, and still blocks a second purchase for the shipment. 3 = Cancelled — cancelled at the carrier, which returns its order to Packed. 4 = Error — the purchase failed and no usable label exists. This is the label's own state: not the shipment's tracking status, and not the per-format rendering progress reported by labelProcessingStatus.

Allowed values: 0, 1, 2, 3, 4

Type integer.

ListOrdersResponse

Type object.

ListOrdersResponseEnvelope

The envelope every JSON operation answers with: a success flag and either a result or errors.

FieldTypeRequiredDescription
dataListOrdersResponse nullablerequiredThe operation's result. Absent when the call failed.
errorsApiError[] nullablerequiredWhat went wrong. Absent when the call succeeded.
successbooleanrequiredWhether the operation succeeded. When false, read errors.

OrderAddressRequest

A postal address supplied on an order.

FieldTypeRequiredDescription
carrierFacilitystring nullableoptionalCarrier facility this address refers to, when the shipment is dropped at or collected from a named facility rather than the street address.
citystringrequiredCity or locality.
companystring nullableoptionalCompany name at the address.
countrystringrequiredTwo-letter ISO 3166-1 alpha-2 country code, for example US.
emailstring nullableoptionalContact email address.
federalTaxIdstring nullableoptionalFederal tax identifier of the party at this address, used on customs paperwork for international shipments.
namestring nullableoptionalContact name at the address.
phonestringrequiredContact phone number. FedEx and DHL reject shipments whose addresses carry no phone number, so supply one whenever those carriers may be used.
residentialboolean nullableoptionalWhether the address is residential. Carriers price residential delivery differently, so an incorrect value can change the rates you are quoted.
statestringrequiredState, province or region. For US addresses, the two-letter state code.
stateTaxIdstring nullableoptionalState tax identifier of the party at this address, used on customs paperwork for international shipments.
street1stringrequiredFirst street line — house or building number and street.
street2string nullableoptionalSecond street line: apartment, suite, unit or floor.
zipstringrequiredPostal or ZIP code.

OrderAddressResponse

A postal address as Mailhub stored it.

FieldTypeRequiredDescription
carrierFacilitystring nullablerequiredCarrier facility this address refers to, when one was supplied.
citystringrequiredCity or locality.
companystring nullablerequiredCompany name at the address.
countrystringrequiredTwo-letter ISO 3166-1 alpha-2 country code, for example US.
createdAtstring (date-time)requiredUTC instant the address record was created.

Format: date-time

emailstring nullablerequiredContact email address.
federalTaxIdstring nullablerequiredFederal tax identifier recorded for customs paperwork.
idstringrequiredIdentifier of the stored address record.
namestring nullablerequiredContact name at the address.
phonestring nullablerequiredContact phone number.
residentialboolean nullablerequiredWhether the address is residential.
statestringrequiredState, province or region. For US addresses, the two-letter state code.
stateTaxIdstring nullablerequiredState tax identifier recorded for customs paperwork.
street1stringrequiredFirst street line — house or building number and street.
street2string nullablerequiredSecond street line: apartment, suite, unit or floor.
updatedAtstring (date-time)requiredUTC instant the address record was last modified.

Format: date-time

zipstringrequiredPostal or ZIP code.

OrderCustomer

Who the order is going to.

FieldTypeRequiredDescription
emailstring nullablerequiredRecipient email recorded on the destination address.
namestring nullablerequiredRecipient name recorded on the destination address.
phonestring nullablerequiredRecipient phone recorded on the destination address.

OrderDestination

Where the order is going.

FieldTypeRequiredDescription
citystringrequiredDestination city or locality.
countrystringrequiredDestination country as a two-letter ISO 3166-1 alpha-2 code.
statestring nullablerequiredDestination state, province or region.
street1string nullablerequiredFirst street line of the destination address.
street2string nullablerequiredSecond street line of the destination address.
zipstring nullablerequiredDestination postal or ZIP code.

OrderLabelAsset

A label asset and, when it has been generated, a temporary link that downloads it directly from storage without an API token.

FieldTypeRequiredDescription
formatstringrequiredThe label file format this entry describes: PDF, ZPL203DPI, ZPL300DPI or ZPL600DPI.

Allowed values: PDF, ZPL300DPI, ZPL203DPI, ZPL600DPI

statusstringrequiredcompleted when the file exists and url is filled in, processing while it is still being rendered. Every listed format is eventually produced, so processing means "come back", not "unavailable".

Allowed values: completed, processing

urlstring nullablerequiredTime-limited link that downloads the file directly, without an API token. It expires; request the order again for a fresh one.

OrderListItem

One order in a list page — enough to identify it and show where it is going.

FieldTypeRequiredDescription
carrierstring nullablerequiredName of the carrier on the rate that was bought.
customerNamestring nullablerequiredRecipient name recorded on the destination address.
destinationCitystringrequiredDestination city or locality.
destinationCountrystringrequiredDestination country as a two-letter ISO 3166-1 alpha-2 code.
destinationZipstring nullablerequiredDestination postal or ZIP code.
idstring (guid)requiredIdentifier of the order. Pass it to the order retrieval operation for the full record.

Format: guid

labelIdstring (guid) nullablerequiredIdentifier of the most recent label bought for the order, when one exists.

Format: guid

orderDatestring (date-time)requiredUTC instant the order was created.

Format: date-time

serviceLevelstring nullablerequiredHuman-readable name of the service on the rate that was bought, for example USPS Priority Mail. Note that the single-order operation returns the carrier's raw service code in its field of the same name; the two are not interchangeable.
shipDatestring (date-time) nullablerequiredDate the label was mailed on, falling back to the instant the label was created when the carrier supplied no mailing date.

Format: date-time

shipmentIdstring (guid) nullablerequiredIdentifier of the order's most recent shipment, when it has one.

Format: guid

sourceOrderSourcerequired
statusOrderStatusrequired
trackingNumberstring nullablerequiredCarrier tracking number for the shipment, once a label has been bought.

OrderListPage

One page of results, with enough counters to walk the rest.

FieldTypeRequiredDescription
hasNextbooleanrequiredWhether a page follows this one.
hasPreviousbooleanrequiredWhether a page precedes this one.
itemsOrderListItem[]requiredThe entries on this page.
pageNumberinteger (int32)requiredWhich page this is, counting from 1.

Format: int32

pageSizeinteger (int32)requiredMaximum number of entries a page may hold.

Format: int32

totalItemsCountinteger (int32)requiredTotal number of entries across all pages, not just this one.

Format: int32

totalPagesinteger (int32)requiredHow many pages the full result set spans.

Format: int32

OrderPackage

Dimensions and weight recorded for the shipment.

FieldTypeRequiredDescription
heightnumber (decimal) nullablerequiredShortest side of the package in inches, as supplied on the order.

Format: decimal

lengthnumber (decimal) nullablerequiredLongest side of the package in inches, as supplied on the order.

Format: decimal

predefinedPackagestring nullablerequiredCarrier-defined packaging named on the order, when dimensions were not given.
weightnumber (decimal) nullablerequiredPackage weight in pounds.

Format: decimal

widthnumber (decimal) nullablerequiredSecond-longest side of the package in inches, as supplied on the order.

Format: decimal

OrderParcelRequest

The physical package. Give explicit dimensions, or name a carrier predefinedPackage.

FieldTypeRequiredDescription
heightnumber (decimal) nullableoptionalShortest side of the package, in inches.

Format: decimal

lengthnumber (decimal) nullableoptionalLongest side of the package, in inches. Supply length, width and height together, or supply predefinedPackage instead. Dimensions are sent to every carrier in inches.

Format: decimal

predefinedPackagestring nullableoptionalCarrier-defined packaging to use instead of explicit dimensions, for example a flat-rate box. The accepted values depend on the carrier.
weightnumber (decimal)requiredPackage weight in pounds.

Format: decimal

widthnumber (decimal) nullableoptionalSecond-longest side of the package, in inches.

Format: decimal

OrderParcelResponse

The physical package recorded for a shipment.

FieldTypeRequiredDescription
createdAtstring (date-time)requiredUTC instant the parcel record was created.

Format: date-time

heightnumber (decimal) nullablerequiredShortest side of the package in inches, as supplied on the order.

Format: decimal

idstringrequiredIdentifier of the stored parcel record.
lengthnumber (decimal) nullablerequiredLongest side of the package in inches, as supplied on the order.

Format: decimal

predefinedPackagestring nullablerequiredCarrier-defined packaging named on the order, when dimensions were not given.
updatedAtstring (date-time)requiredUTC instant the parcel record was last modified.

Format: date-time

weightnumber (decimal)requiredPackage weight in pounds.

Format: decimal

widthnumber (decimal) nullablerequiredSecond-longest side of the package in inches, as supplied on the order.

Format: decimal

OrderRequest

The order itself: where it ships from, where it ships to, and the packages it contains.

FieldTypeRequiredDescription
fromAddressOrderAddressRequestrequired
shipmentsOrderShipmentRequest[]requiredPackages to ship. One shipment per package; each is rated and labelled on its own.
toAddressOrderAddressRequestrequired

OrderShipmentRequest

One package within an order. Each shipment is rated and labelled independently.

FieldTypeRequiredDescription
parcelOrderParcelRequestrequired

OrderShipmentResponse

One package on the order, as Mailhub recorded it.

FieldTypeRequiredDescription
createdAtstring (date-time)requiredUTC instant the shipment was created.

Format: date-time

fromAddressOrderAddressResponserequired
idstringrequiredIdentifier of the shipment. Use it on the rate and label-purchase operations.
isReturnbooleanrequiredWhether the shipment is a return back to the sender.
parcelOrderParcelResponserequired
statusstringrequiredShipment status as the enum member name. Values are Unknown, PreTransit, InTransit, OutForDelivery, Delivered, AvailableForPickup, ReturnToSender, Failure, Cancelled and Error. Carrier tracking is not yet wired in, so in practice this reads Unknown.

Allowed values: Unknown, PreTransit, InTransit, OutForDelivery, Delivered, AvailableForPickup, ReturnToSender, Failure, Cancelled, Error

toAddressOrderAddressResponserequired
updatedAtstring (date-time)requiredUTC instant the shipment was last modified.

Format: date-time

OrderShipmentSummary

The order's most recent shipment and the label bought for it, if any.

FieldTypeRequiredDescription
carrierstring nullablerequiredName of the carrier on the rate that was bought.
labelAssetsOrderLabelAsset[]requiredOne entry per printable label format, each with a temporary download link when the asset exists. The links expire, so this is also how to obtain fresh ones after the links returned at purchase time have lapsed: request the order again — there is no refresh call.
labelIdstring (guid) nullablerequiredIdentifier of the most recent label bought for this shipment, when one exists.

Format: guid

labelStatusLabelStatus nullablerequiredStatus of the most recent label: 0 = Unknown, 1 = Created, 2 = Printed, 3 = Cancelled, 4 = Error.
packageOrderPackage nullablerequiredDimensions and weight recorded for the shipment.
serviceLevelstring nullablerequiredThe carrier's own service code for the rate that was bought, for example Priority or GroundAdvantage — the raw code, not a display name. Note that the order list operation returns a human-readable service name in its field of the same name; the two are not interchangeable.
shipDatestring (date-time) nullablerequiredDate the label was mailed on, falling back to the instant the label was created when the carrier supplied no mailing date.

Format: date-time

shipmentIdstring (guid)requiredIdentifier of the shipment.

Format: guid

trackingNumberstring nullablerequiredCarrier tracking number for the shipment, once a label has been bought.

OrderSource

Where an order came from, in the product's own vocabulary.

Allowed values: Manual, API, Shopify

Type string.

OrderSourceCode

Where an order came from, in the product's own vocabulary.

Allowed values: 1, 2, 3

Type integer.

OrderStatus

Where an order stands in the fulfilment workflow, published as the numeric value: 0 = Created — saved and workable; a label can be bought from here. 1 = Requested — reserved for e-commerce intake; no path sets it yet. 2 = OnHold — paused, and not shippable while paused; resuming returns it to the status it was held from. 3 = Cancelled — cancelled before a label was bought; terminal. 4 = Fulfilled — handed over to the carrier. 5 = Processing — being prepared. 6 = Picked — items picked. 7 = Packed — packed and ready for a label; also where an order lands when its label is cancelled. 8 = LabelCreated — a label is live at the carrier. Set by the purchase itself, never accepted from a caller. 9 = Returned — returned after fulfilment; terminal. 10 = Error — a failure state the system sets for itself; rejected if a caller tries to set it. 11 = Draft — a wizard draft: persisted, but omitted from order list results until it is saved or labelled.

Allowed values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11

Type integer.

RateQuote

One priced shipping option for a package: which carrier and service, what it costs and how fast it is expected to be. Returned by the rate and combined create-and-rate operations.

FieldTypeRequiredDescription
billingTypestring nullablerequiredHow the carrier bills this rate, in the carrier's own vocabulary.
carrierstringrequiredThe carrier offering the rate, for example USPS or UPS.
carrierCodestring nullablerequiredThe carrier's own account or brand code, when the carrier supplies one.
currencystringrequiredCurrency of rate, as an ISO 4217 three-letter code. The set of codes a carrier may return is not constrained by this contract.
deliveryDateGuaranteedbooleanrequiredWhether the carrier guarantees the delivery date rather than estimating it.
deliveryDaysinteger (int32)requiredCarrier-supplied transit estimate, in days. This is not a commitment: every carrier integration fills deliveryDays and estDeliveryDays from one quantity, so the two always carry the same number on a given rate. 0 means the carrier supplied no transit time for this rate, not same-day delivery. The day basis is the carrier's own — UPS reports business days in transit, USPS a span derived from its quoted delivery window — so do not compare the number across carriers. Read deliveryDateGuaranteed for whether anything is guaranteed.

Format: int32

destinationEntryFacilityTypestring nullablerequiredUSPS destination entry facility the price assumes, when the carrier is USPS.
estDeliveryDaysinteger (int32)requiredCarrier-supplied transit estimate, in days. Currently always equal to deliveryDays: both are filled from the same carrier quantity on every integration, and neither is a separate estimated-versus-committed figure. 0 means the carrier supplied no transit time.

Format: int32

estimatedDeliveryDatestring (date-time) nullablerequiredDate the carrier expects to deliver on. null when the carrier supplied no date, which is the common case for carriers that report transit days instead. The label-purchase response republishes this same value under the name selectedRate.deliveryDate.

Format: date-time

idstring (guid) nullablerequiredIdentifier of this rate. Send it as rate.id to the label operation to buy this exact option; a rate cannot be reconstructed from its other fields.

Format: guid

listCurrencystring nullablerequiredCurrency of listRate, as an ISO 4217 three-letter code.
listRatenumber (decimal) nullablerequiredThe carrier's published list price for the same service, when the carrier publishes one. Like retailRate, a comparison figure rather than the charged amount.

Format: decimal

mailClassstring nullablerequiredUSPS mail class for the rate, when the carrier is USPS.
processingCategorystring nullablerequiredUSPS processing category for the package, when the carrier is USPS.
ratenumber (decimal)requiredThe amount your account is charged if this rate is bought.

Format: decimal

rateIndicatorstring nullablerequiredUSPS rate indicator describing how the price was derived, when the carrier is USPS.
retailCurrencystring nullablerequiredCurrency of retailRate, as an ISO 4217 three-letter code.
retailRatenumber (decimal) nullablerequiredThe carrier's over-the-counter retail price for the same service, when the carrier publishes one. It is a comparison figure, not what you are charged.

Format: decimal

serviceCodestringrequiredThe carrier's own code for the service, for example GroundAdvantage. This is the machine value; serviceName is the readable one.
serviceNamestringrequiredReadable name of the service, for example USPS Ground Advantage. Suitable for display; match on serviceCode rather than on this.
skustring nullablerequiredThe carrier's own product code for this rate, when it supplies one.
zonestring nullablerequiredCarrier delivery zone between origin and destination, when the carrier reports one.

UpdateOrderStatusRequest

Moves an order to a new status.

FieldTypeRequiredDescription
reasonstring nullableoptionalFree-text note explaining why the status was changed. Recorded on the order's status history.
sourcestring nullableoptionalFree-text label for what triggered the change, recorded alongside the reason. This is your own annotation and does not affect how Mailhub processes the order.
statusOrderStatusoptional

UpdateOrderStatusResponse

The status change that was applied: previousStatus is where the order was, currentStatus is where it is now.

FieldTypeRequiredDescription
currentStatusOrderStatusrequired
orderIdstring (guid)requiredIdentifier of the order whose status changed.

Format: guid

previousStatusOrderStatusrequired
updatedAtstring (date-time)requiredUTC instant the change was applied.

Format: date-time

UpdateOrderStatusResponseEnvelope

The envelope every JSON operation answers with: a success flag and either a result or errors.

FieldTypeRequiredDescription
dataUpdateOrderStatusResponse nullablerequiredThe operation's result. Absent when the call failed.
errorsApiError[] nullablerequiredWhat went wrong. Absent when the call succeeded.
successbooleanrequiredWhether the operation succeeded. When false, read errors.