Skip to content

get-customer-shipment-invoice ​

Method: GET
Path: /shipping/shipments/{reference_number}/invoice

Tags: Orders

Summary ​

Retrieve a shipment's 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. Includes cancelled and unscheduled shipments' retained CE-issued invoices. Returns 404 if CE has not issued a document for the shipment.

Storefront SDK Usage ​

SDK Method: sdk.order.getShipmentInvoice()

Example:

typescript
const { data, error } = await sdk.order.getShipmentInvoice({
  reference_number: "SHP-2024-001"
});

if (error) {
  console.error("Failed to get shipment invoice:", error.message);
} else {
  console.log("Invoice:", data.invoice.invoice_number);
  console.log("Items:", data.invoice.items.length);
}

TypeScript Definition ​

typescript
"get-customer-shipment-invoice": {
        parameters: {
            query?: never;
            header?: never;
            path: {
                /** @description The shopper's shipment reference. */
                reference_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 ​

ReferenceResolves To
components["schemas"]["OrderInvoiceDetail"]OrderInvoiceDetail
components["responses"]["Forbidden"]Forbidden
components["responses"]["InternalServerError"]InternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Parameters ​

  • reference_number (path): The shopper's shipment reference.

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-shipment-invoice",
  "summary": "Retrieve a shipment's 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. Includes cancelled and unscheduled shipments' retained CE-issued invoices. Returns 404 if CE has not issued a document for the shipment.",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/get-customer-shipment-invoice",
    "description": "API reference for the get-customer-shipment-invoice operation"
  },
  "parameters": [
    {
      "name": "reference_number",
      "in": "path",
      "description": "The shopper's shipment reference.",
      "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": "getCustomerShipmentInvoice"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: