get-customer-invoice
Method: GET
Path: /orders/invoices/{invoice_number}
Tags: Orders
Summary
Retrieve an issued invoice
Description
Returns only a Commerce Engine-issued invoice belonging to the current shopper and store. Seller and external invoices return 404. Reads an already issued document and never issues one.
Storefront SDK Usage
SDK Method: sdk.order.getInvoice()
Example:
typescript
const { data, error } = await sdk.order.getInvoice({
invoice_number: "INV/2024-25/000123"
});
if (error) {
console.error("Failed to get invoice:", error.message);
} else {
console.log("Invoice date:", data.invoice.invoice_date);
console.log("Total:", data.invoice.grand_total);
data.invoice.tax_summary?.forEach(row => {
console.log(`${row.tax_rate}%: ${row.tax}`);
});
}TypeScript Definition
typescript
"get-customer-invoice": {
parameters: {
query?: never;
header?: never;
path: {
/** @description The complete number exactly as issued, including slashes. Percent-encode slashes when constructing the URL. */
invoice_number: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Document retrieved. */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
invoice: components["schemas"]["OrderInvoiceDetail"];
};
};
};
};
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["schemas"]["OrderInvoiceDetail"] | OrderInvoiceDetail |
components["responses"]["Forbidden"] | Forbidden |
components["responses"]["InternalServerError"] | InternalServerError |
components["responses"]["GatewayTimeout"] | GatewayTimeout |
Parameters
- invoice_number (path): The complete number exactly as issued, including slashes. Percent-encode slashes when constructing the URL.
Responses
200
Document retrieved.
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
json
{
"tags": [
"Orders"
],
"operationId": "get-customer-invoice",
"summary": "Retrieve an issued invoice",
"description": "Returns only a Commerce Engine-issued invoice belonging to the current shopper and store. Seller and external invoices return 404. Reads an already issued document and never issues one.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/get-customer-invoice",
"description": "API reference for the get-customer-invoice operation"
},
"parameters": [
{
"name": "invoice_number",
"in": "path",
"description": "The complete number exactly as issued, including slashes. Percent-encode slashes when constructing the URL.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Document retrieved.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"message",
"success",
"content"
],
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"invoice": {
"$ref": "#/components/schemas/OrderInvoiceDetail"
}
},
"required": [
"invoice"
],
"type": "object"
}
}
}
}
}
},
"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": "getCustomerInvoice"
}Auto-generated from OpenAPI spec and TypeScript definitions