download-customer-shipment-invoice
Method: GET
Path: /shipping/shipments/{reference_number}/download-invoice
Tags: Orders
Summary
Download a shipment invoice
Description
Downloads the shopper's shipment invoice using the existing seller/default selection. A cancelled or unscheduled shipment returns a retained invoice; requesting a missing default falls back to the retained seller invoice. Active shipments retain their existing resolution behavior.
Storefront SDK Usage
SDK Method: sdk.order.downloadShipmentInvoice()
Example:
const { data, error } = await sdk.order.downloadShipmentInvoice(
{ reference_number: "SHP-2024-001" },
{ invoice_source: "seller" }
);
if (error) {
console.error("Failed to download shipment invoice:", error.message);
} else {
const url = URL.createObjectURL(data);
window.open(url);
}TypeScript Definition
"download-customer-shipment-invoice": {
parameters: {
query?: {
/** @description Omit for the existing preferred source, or request a source explicitly. */
invoice_source?: "default" | "seller";
/** @description Include the invoice page layout. */
with_layout?: boolean;
};
header?: never;
path: {
/** @description The shopper's shipment reference. */
reference_number: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Shipment invoice PDF */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/pdf": string;
};
};
403: components["responses"]["Forbidden"];
/** @description Document or order not found, or belongs to another shopper or store. */
404: {
headers: {
[name: string]: unknown;
};
content?: never;
};
500: components["responses"]["InternalServerError"];
504: components["responses"]["GatewayTimeout"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["responses"]["Forbidden"] | Forbidden |
components["responses"]["InternalServerError"] | InternalServerError |
components["responses"]["GatewayTimeout"] | GatewayTimeout |
Parameters
- invoice_source (query): Omit for the existing preferred source, or request a source explicitly.
- reference_number (path): The shopper's shipment reference.
- with_layout (query): Include the invoice page layout.
Responses
200
Shipment invoice PDF
403
Access denied. token-required requires an authenticated session; permission-denied means the caller cannot access this resource. On POS, session-expired requires signing in again.
404
Document or order not found, or belongs to another shopper or store.
500
The request failed because of an unexpected error.
504
The request timed out.
OpenAPI Definition
{
"tags": [
"Orders"
],
"operationId": "download-customer-shipment-invoice",
"summary": "Download a shipment invoice",
"description": "Downloads the shopper's shipment invoice using the existing seller/default selection. A cancelled or unscheduled shipment returns a retained invoice; requesting a missing default falls back to the retained seller invoice. Active shipments retain their existing resolution behavior.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/download-customer-shipment-invoice",
"description": "API reference for the download-customer-shipment-invoice operation"
},
"parameters": [
{
"name": "invoice_source",
"in": "query",
"description": "Omit for the existing preferred source, or request a source explicitly.",
"schema": {
"type": "string",
"enum": [
"default",
"seller"
]
}
},
{
"name": "reference_number",
"in": "path",
"description": "The shopper's shipment reference.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "with_layout",
"in": "query",
"description": "Include the invoice page layout.",
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Shipment invoice PDF",
"content": {
"application/pdf": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"description": "Document or order not found, or belongs to another shopper or store."
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"504": {
"$ref": "#/components/responses/GatewayTimeout"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "orders",
"x-speakeasy-ignore": false,
"x-speakeasy-name-override": "downloadCustomerShipmentInvoice"
}Auto-generated from OpenAPI spec and TypeScript definitions