pos-get-shipment-invoice
Method: GET
Path: /pos/shipping/shipments/{reference_number}/invoice
Tags: Shipments
Summary
Retrieve shipment invoice
Description
Retrieves the shipment invoice using the existing default/seller selection. Cancelled or unscheduled shipments return their retained default invoice, otherwise their retained seller invoice, without issuing; 404 when none exists. Active shipments keep their existing resolution behavior.
Pos SDK Usage
SDK Method: pos.getShipmentInvoice()
Example:
typescript
// Get shipment invoice as JSON
const { data, error } = await pos.getShipmentInvoice(
{ reference_number: "SHIP-2024-001234" }
);
if (error) {
console.error("Failed to get shipment invoice:", error.message);
} else {
const invoice = data?.invoice;
console.log(`Invoice: ${invoice?.invoice_number}`);
console.log(`Date: ${invoice?.invoice_date}`);
console.log(`Total: ${invoice?.grand_total}`);
console.log(`Items:`, invoice?.items);
}
// Select the seller invoice (JSON)
const { data: sellerInvoice } = await pos.getShipmentInvoice(
{ reference_number: "SHIP-2024-001234" },
{ invoice_source: "seller" }
);TypeScript Definition
typescript
"pos-get-shipment-invoice": {
parameters: {
query?: {
/** @description Select the store invoice (default) or seller invoice. */
invoice_source?: "default" | "seller";
};
header?: never;
path: {
/** @description Shipment reference number */
reference_number: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
invoice: components["schemas"]["ShipmentInvoiceDetail"];
};
};
};
};
400: components["responses"]["AdminBadRequest"];
401: components["responses"]["AdminUnauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["AdminNotFound"];
500: components["responses"]["AdminInternalServerError"];
504: components["responses"]["GatewayTimeout"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["ShipmentInvoiceDetail"] | ShipmentInvoiceDetail |
components["responses"]["AdminBadRequest"] | AdminBadRequest |
components["responses"]["AdminUnauthorized"] | AdminUnauthorized |
components["responses"]["Forbidden"] | Forbidden |
components["responses"]["AdminNotFound"] | AdminNotFound |
components["responses"]["AdminInternalServerError"] | AdminInternalServerError |
components["responses"]["GatewayTimeout"] | GatewayTimeout |
Parameters
- invoice_source (query): Select the store invoice (default) or seller invoice.
- reference_number (path): Shipment reference number
Responses
200
OK
400
401
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
500
504
The request timed out.
OpenAPI Definition
json
{
"operationId": "pos-get-shipment-invoice",
"summary": "Retrieve shipment invoice",
"description": "Retrieves the shipment invoice using the existing default/seller selection. Cancelled or unscheduled shipments return their retained default invoice, otherwise their retained seller invoice, without issuing; 404 when none exists. Active shipments keep their existing resolution behavior.",
"parameters": [
{
"name": "invoice_source",
"in": "query",
"description": "Select the store invoice (default) or seller invoice.",
"schema": {
"type": "string",
"default": "default",
"enum": [
"default",
"seller"
]
}
},
{
"name": "reference_number",
"in": "path",
"description": "Shipment reference number",
"required": true,
"schema": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"pattern": "^(?:[A-Za-z0-9_-]{1,128}|MS:[A-Za-z0-9_-]{1,125})$"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"invoice": {
"$ref": "#/components/schemas/ShipmentInvoiceDetail"
}
},
"required": [
"invoice"
],
"type": "object"
}
},
"required": [
"message",
"success",
"content"
]
}
}
}
},
"400": {
"$ref": "#/components/responses/AdminBadRequest"
},
"401": {
"$ref": "#/components/responses/AdminUnauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/AdminNotFound"
},
"500": {
"$ref": "#/components/responses/AdminInternalServerError"
},
"504": {
"$ref": "#/components/responses/GatewayTimeout"
}
},
"externalDocs": {
"url": "https://llm-docs.commercengine.io/admin-pos/operations/pos-get-shipment-invoice"
},
"security": [
{
"Authorization": []
}
],
"tags": [
"Shipments"
],
"x-speakeasy-group": "pos"
}Auto-generated from OpenAPI spec and TypeScript definitions