pos-get-order-invoice
Method: GET
Path: /pos/orders/{order_number}/invoice
Tags: Orders
Summary
Retrieve order invoice
Description
Retrieves an order's invoice. Staff can retrieve orders across all store locations.
Pos SDK Usage
SDK Method: pos.getOrderInvoice()
Example:
typescript
// Get invoice as JSON
const { data, error } = await pos.getOrderInvoice(
{ order_number: "ORD-2024-001234" }
);
if (error) {
console.error("Failed to get order invoice:", error.message);
} else {
data?.invoices?.forEach(invoice => {
console.log(`Invoice: ${invoice.invoice_number}`);
console.log(`Date: ${invoice.invoice_date}`);
console.log(`Total: ${invoice.grand_total}`);
console.log(`Items:`, invoice.items);
});
}TypeScript Definition
typescript
"pos-get-order-invoice": {
parameters: {
query?: {
/** @description Omit to use the seller invoice when one exists, otherwise the store invoice. Specify seller or default to choose explicitly. */
invoice_source?: "default" | "seller";
};
header?: never;
path: {
/** @description order number */
order_number: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
invoices: components["schemas"]["OrderInvoiceDetail"][];
};
};
};
};
400: components["responses"]["AdminBadRequest"];
401: components["responses"]["AdminUnauthorized"];
403: components["responses"]["Forbidden"];
/** @description The order was not found, or it is unpaid or cancelled and has no invoice. */
404: components["responses"]["AdminNotFound"];
500: components["responses"]["AdminInternalServerError"];
504: components["responses"]["GatewayTimeout"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["OrderInvoiceDetail"] | OrderInvoiceDetail |
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): Omit to use the seller invoice when one exists, otherwise the store invoice. Specify seller or default to choose explicitly.
- order_number (path): order 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-order-invoice",
"summary": "Retrieve order invoice",
"description": "Retrieves an order's invoice. Staff can retrieve orders across all store locations.",
"parameters": [
{
"name": "invoice_source",
"in": "query",
"description": "Omit to use the seller invoice when one exists, otherwise the store invoice. Specify seller or default to choose explicitly.",
"schema": {
"type": "string",
"enum": [
"default",
"seller"
]
}
},
{
"name": "order_number",
"in": "path",
"description": "order number",
"required": true,
"schema": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"pattern": "^[A-Za-z0-9_-]{1,128}$"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"invoices": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OrderInvoiceDetail"
}
}
},
"required": [
"invoices"
],
"type": "object"
}
},
"required": [
"message",
"success",
"content"
]
}
}
}
},
"400": {
"$ref": "#/components/responses/AdminBadRequest"
},
"401": {
"$ref": "#/components/responses/AdminUnauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"description": "The order was not found, or it is unpaid or cancelled and has no invoice.",
"$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-order-invoice"
},
"security": [
{
"Authorization": []
}
],
"tags": [
"Orders"
],
"x-speakeasy-group": "pos"
}Auto-generated from OpenAPI spec and TypeScript definitions