> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# ListInvoicesForMultipleOrders

# Package: orders

# Namespace: Invoices

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-invoices/list-invoices-for-multiple-orders.md

## Permission Scopes:
Read Orders: SCOPE.DC-STORES.READ-ORDERS

## Introduction

Retrieves the IDs of invoices associated with all specified orders.

---

## REST API

### Schema

```
 Method: listInvoicesForMultipleOrders
 Description: Retrieves the GUIDs of invoices associated with all specified orders.
 URL: https://www.wixapis.com/ecom/v1/invoices/list-by-ids
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  orderIds
 Method parameters: 
   param name: orderIds | type: array<orderIds> | description: Order GUIDs for which to retrieve invoices. | required: true | validation: minItems 0, maxItems 100, minLength 1, maxLength 100
 Return type: ListInvoicesForMultipleOrdersResponse
  - name: invoicesForOrder | type: array<InvoicesForOrder> | description: List of order GUIDs and their associated invoices.  
     - name: orderId | type: string | description: Order GUID.  
     - name: invoicesInfo | type: array<Invoice> | description: Invoices info.  | validation: maxItems 300
        - name: id | type: string | description: Invoice GUID.  
        - name: appId | type: string | description: GUID of the app that set the invoice.  


```

### Examples

### List Invoices For Multiple Orders
Retrieves invoices of the 2 requested order IDs

```curl
curl -X POST \
  'https://www.wixapis.com/ecom/v1/invoices/list-by-ids' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>' \
  --data-binary '{
    "orderIds": [
      "ba2553e1-548e-4b84-96d8-4978e74d7b3b",
      "5887eb1a-d695-4a8b-965a-b2a9dec463a9"
    ]
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.orderInvoices.listInvoicesForMultipleOrders(orderIds)
 Description: Retrieves the GUIDs of invoices associated with all specified orders.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  orderIds
 Method parameters: 
   param name: orderIds | type: array<string> | description: Order GUIDs for which to retrieve invoices. | required: true | validation: minItems 0, maxItems 100, minLength 1, maxLength 100
 Return type: PROMISE<ListInvoicesForMultipleOrdersResponse>
  - name: invoicesForOrder | type: array<InvoicesForOrder> | description: List of order GUIDs and their associated invoices.  
     - name: orderId | type: string | description: Order GUID.  
     - name: invoicesInfo | type: array<Invoice> | description: Invoices info.  | validation: maxItems 300
        - name: _id | type: string | description: Invoice GUID.  
        - name: appId | type: string | description: GUID of the app that set the invoice.  


```

### Examples

### List invoices for multiple orders
Retrieves the IDs of invoices associated with the specified orders.

```javascript
import { orderInvoices } from "@wix/ecom";

const orderIds = [
  "d5d43d01-6c4e-4a53-b5e8-73f656d97f39",
  "3a97f203-9b32-40ee-a4f6-4128f0e3efc1",
];

async function listInvoicesForMultipleOrders() {
  const response = await orderInvoices.listInvoicesForMultipleOrders(orderIds);
}

/* Promise resolves to:
 * {
 *   "invoicesForOrder": [
 *     {
 *       "orderId": "d5d43d01-6c4e-4a53-b5e8-73f656d97f39",
 *       "invoicesInfo": [
 *         {
 *           "id": "8ceb7a46-c8f2-42f8-9d8d-6b2c9b6ea4de",
 *           "appId": "13ee94c1-b635-8505-3391-97919052c16f"
 *         }
 *       ]
 *     },
 *     {
 *       "orderId": "3a97f203-9b32-40ee-a4f6-4128f0e3efc1",
 *       "invoicesInfo": []
 *     }
 *   ]
 * }
 */

```

### listInvoicesForMultipleOrders (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { orderInvoices } from '@wix/ecom';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { orderInvoices },
  // Include the auth strategy and host as relevant
});


async function listInvoicesForMultipleOrders(orderIds) {
  const response = await myWixClient.orderInvoices.listInvoicesForMultipleOrders(orderIds);
};
```

---