API ReferenceEndpointsPublic API (v1)Buy a shipping label via the installed shipping app

Buy a shipping label via the installed shipping app

Buys a label through the shipping app that issued rateId and stores the tracking number on the order. Billing goes straight to the merchant carrier account. Refused for a read-only (imported) order.

POST
/v1/orders/{id}/shipments/app-label
AuthorizationBearer <token>

Admin API key (server-to-server). Issue via the dashboard at Settings → API keys. Plain-text key is shown once — store in a secret manager. Format: Authorization: Bearer brainerce_xxxxxxxxx.

In: header

Path Parameters

idstring

Order ID

rateIdstring

Opaque rate id returned by the installed shipping app, passed back verbatim. Do not parse it.

parcel?CreateAppLabelParcelDto

Override default parcel dimensions from app config

labelFormat?string

Label file format. ZPL/EPL drive warehouse thermal printers; PDF prints from a browser. If the carrier cannot produce the requested format it returns its closest match.

Default"PDF"
Value in"PDF" | "PNG" | "ZPL" | "EPL"
customsContentsType?string

Customs contents type for a cross-border shipment. Ignored for domestic labels.

Default"merchandise"
Value in"merchandise" | "gift" | "documents" | "sample" | "return"
curl -X POST "https://api.brainerce.com/api/v1/orders/string/shipments/app-label" \  -H "Content-Type: application/json" \  -d '{    "rateId": "rate_8f123456789abcdef"  }'
{
  "shipmentId": "clx1a2b3c4d5e6f7g8h9",
  "labelUrl": "https://labels.example.com/label-1042.pdf",
  "trackingNumber": "1Z999AA10123456784",
  "carrier": "ups"
}

{
  "statusCode": 400,
  "code": "VALIDATION_FAILED",
  "message": "name should not be empty, price must be a positive number",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/v1/orders/{id}/shipments/app-label"
}

{
  "statusCode": 401,
  "code": "UNAUTHORIZED",
  "message": "Invalid or expired credential",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/v1/orders/{id}/shipments/app-label"
}

{
  "statusCode": 403,
  "code": "INSUFFICIENT_SCOPE",
  "message": "API key does not have the required scope: products:write",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/v1/orders/{id}/shipments/app-label"
}

{
  "statusCode": 404,
  "code": "RESOURCE_NOT_FOUND",
  "message": "Resource not found",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/v1/orders/{id}/shipments/app-label"
}

{
  "statusCode": 409,
  "code": "CONFLICT",
  "message": "The request conflicts with the current state of the resource",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/v1/orders/{id}/shipments/app-label"
}

{
  "statusCode": 429,
  "code": "RATE_LIMITED",
  "message": "Too many requests",
  "details": {
    "retryAfterSeconds": 12
  },
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/v1/store"
}

{
  "statusCode": 503,
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/v1/orders/{id}/shipments/app-label"
}