curl --request POST \
--url https://api.cubbo.com/v1/orders/create-and-ship \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"store_id": 1234,
"order_number": "PS-0001",
"shipping_method_id": 12,
"shipping": {
"first_name": "Jaime",
"last_name": "Carrera",
"phone": "5555555555",
"email": "buyer@example.com",
"address1": "Av. Reforma 123",
"country": "MX",
"city": "Ciudad de México",
"province": "CDMX",
"zip_code": "06600"
},
"products": [
{
"sku": "SKU-RED-M",
"quantity": 1
}
],
"packages": [
{
"weight_kg": 1.2,
"length_cm": 30,
"width_cm": 20,
"height_cm": 10
}
]
}
'[
{
"id": 778899,
"order_id": 987655,
"billing_file": null,
"shipping_number": "1234567890",
"label_file": {
"path": "/rails/active_storage/blobs/redirect/abc123/label.pdf",
"url": "https://api.cubbo.com/rails/active_storage/blobs/redirect/abc123/label.pdf",
"filename": "label.pdf",
"byte_size": 48213,
"content_type": "application/pdf"
},
"label_type": "shipping",
"tracking_url": "https://carrier.example.com/track/1234567890",
"cubbo_tracking_url": "https://tracking.cubbo.com/t/abc123"
}
]Create a pick-and-ship order and buy its labels
Creates a pick-and-ship order and generates its carrier shipping labels in the same call,
returning the labels instead of the order. Use it when your own warehouse packs the parcel
and only needs Cubbo’s carrier contract: you declare the physical packages (weight and
dimensions) and Cubbo buys one label per package. Unlike POST /orders, the order is
validated synchronously, the shipping method must be resolvable now, and the order is left
packed with its labels ready to download.
- Choose the carrier with exactly one of
shipping_method_id(a Cubbo shipping method) orintegration_shipping_method(the name of a shipping configuration of your integration). Sending both, or neither, is refused. productsis optional; lines are not picked from Cubbo stock, they only describe the content. Each SKU must exist in the store.- Every package is matched to the closest Cubbo package size by the larger of its real
weight and its volumetric weight; if none fits, the request fails with
NO_COMPATIBLE_PACKAGE. - Not available for stores where Cubbo issues fiscal invoices (for example Brazil): those
answer
INVOICING_NOT_IMPLEMENTED. - The order is always a consumer (D2C), paid, non cash-on-delivery order with zero prices.
- Colombia:
shipping.city_codeworks as inPOST /orders, except that a code Cubbo does not know is refused with 422UNRECOGNIZED_CITY_CODE, since the labels are generated now. - Duplicate protection works like
POST /orders: 422ORDER_ALREADY_EXISTSfor an existingorder_number, 409DUPLICATE_REQUEST_IN_FLIGHTwhile another request for the sameorder_numberis in progress.
curl --request POST \
--url https://api.cubbo.com/v1/orders/create-and-ship \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"store_id": 1234,
"order_number": "PS-0001",
"shipping_method_id": 12,
"shipping": {
"first_name": "Jaime",
"last_name": "Carrera",
"phone": "5555555555",
"email": "buyer@example.com",
"address1": "Av. Reforma 123",
"country": "MX",
"city": "Ciudad de México",
"province": "CDMX",
"zip_code": "06600"
},
"products": [
{
"sku": "SKU-RED-M",
"quantity": 1
}
],
"packages": [
{
"weight_kg": 1.2,
"length_cm": 30,
"width_cm": 20,
"height_cm": 10
}
]
}
'[
{
"id": 778899,
"order_id": 987655,
"billing_file": null,
"shipping_number": "1234567890",
"label_file": {
"path": "/rails/active_storage/blobs/redirect/abc123/label.pdf",
"url": "https://api.cubbo.com/rails/active_storage/blobs/redirect/abc123/label.pdf",
"filename": "label.pdf",
"byte_size": 48213,
"content_type": "application/pdf"
},
"label_type": "shipping",
"tracking_url": "https://carrier.example.com/track/1234567890",
"cubbo_tracking_url": "https://tracking.cubbo.com/t/abc123"
}
]Authorizations
Body
Id of a Cubbo shipping method. Get it from GET /shipping-methods/quote: each option in the response has a shipping_method_id. Exactly one of shipping_method_id or integration_shipping_method must be sent. Coverage for the destination is validated through the order validation (errors response).
12
Exact name of a shipping method you created in the Cubbo app, under Integrations, your Open API integration, Shipping Methods (field Integration Delivery Method). It must match character by character: the comparison is case-sensitive and does not trim spaces. Cubbo uses the shipping configuration assigned to that method to pick the carrier. See Set up your integration. Exactly one of shipping_method_id or integration_shipping_method must be sent. There is no fallback here: an unknown name returns 422 MISSING_INTEGRATION_SHIPPING_METHOD.
"Express"
Response
Order created and packed; one shipping label per requested package.