pos-get-shipment-invoice
Method: GET
Path: /pos/shipping/shipments/{reference_number}/invoice
Tags: POSAdmin
Summary
Retrieve shipment invoice
Description
Retrieve shipment invoice
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" },
{ format: "json" }
);
if (error) {
console.error("Failed to get shipment invoice:", error.message);
} else {
const invoice = data.content?.invoice;
console.log(`Invoice: ${invoice?.invoice_number}`);
console.log(`Date: ${invoice?.invoice_date}`);
console.log(`Total: ${invoice?.grand_total}`);
console.log(`Items:`, invoice?.items);
}
// Get shipment invoice as PDF
const { data: pdfData, error: pdfError } = await pos.getShipmentInvoice(
{ reference_number: "SHIP-2024-001234" },
{ format: "pdf" }
);TypeScript Definition
typescript
"pos-get-shipment-invoice": {
parameters: {
query?: {
/** @description Response data format */
format?: "json" | "pdf";
};
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"]["InvoiceDetail"];
};
};
"application/pdf": Record<string, never>;
};
};
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["InvoiceDetail"] | InvoiceDetail |
Parameters
- format (query): Response data format
- reference_number (path): Shipment reference number
Responses
200
OK
OpenAPI Definition
json
{
"operationId": "pos-get-shipment-invoice",
"summary": "Retrieve shipment invoice",
"description": "Retrieve shipment invoice",
"parameters": [
{
"name": "format",
"in": "query",
"description": "Response data format",
"schema": {
"type": "string",
"default": "json",
"enum": [
"json",
"pdf"
]
}
},
{
"name": "reference_number",
"in": "path",
"description": "Shipment reference number",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"invoice": {
"$ref": "#/components/schemas/InvoiceDetail"
}
},
"type": "object"
}
}
}
},
"application/pdf": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"POSAdmin"
],
"x-speakeasy-group": "pos",
"x-speakeasy-ignore": true
}Auto-generated from OpenAPI spec and TypeScript definitions