download-customer-credit-note
Method: GET
Path: /orders/credit-notes/{number}/download
Tags: Returns
Summary
Download credit note
Description
Downloads a retained credit note for a Commerce Engine-issued invoice belonging to the current shopper and store. Other shoppers, stores and external documents return 404.
Storefront SDK Usage
SDK Method: sdk.order.downloadCreditNote()
Example:
typescript
const { data, error } = await sdk.order.downloadCreditNote({
number: "CN/2024-25/000045"
});
if (error) {
console.error("Failed to download credit note:", error.message);
} else {
const url = URL.createObjectURL(data);
window.open(url);
}TypeScript Definition
typescript
"download-customer-credit-note": {
parameters: {
query?: never;
header?: never;
path: {
/** @description The issued credit-note number. Percent-encode slashes when constructing the URL. */
number: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Retained credit-note PDF */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/pdf": string;
};
};
403: components["responses"]["Forbidden"];
/** @description Credit note not found. */
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
- number (path): The issued credit-note number. Percent-encode slashes when constructing the URL.
Responses
200
Retained credit-note 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
Credit note not found.
500
The request failed because of an unexpected error.
504
The request timed out.
OpenAPI Definition
json
{
"tags": [
"Returns"
],
"operationId": "download-customer-credit-note",
"summary": "Download credit note",
"description": "Downloads a retained credit note for a Commerce Engine-issued invoice belonging to the current shopper and store. Other shoppers, stores and external documents return 404.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/download-customer-credit-note",
"description": "API reference for the download-customer-credit-note operation"
},
"parameters": [
{
"name": "number",
"in": "path",
"description": "The issued credit-note number. Percent-encode slashes when constructing the URL.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Retained credit-note PDF",
"content": {
"application/pdf": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"description": "Credit note not found."
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"504": {
"$ref": "#/components/responses/GatewayTimeout"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "returns",
"x-speakeasy-ignore": false,
"x-speakeasy-name-override": "downloadCustomerCreditNote"
}Auto-generated from OpenAPI spec and TypeScript definitions