> 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`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetRemittanceInvoice

# Package: capital

# Namespace: RemittanceInvoiceService

# Method link: https://dev.wix.com/docs/api-reference/business-management/capital/remittance-invoices/get-remittance-invoice.md

## Permission Scopes:
Request and view Merchant Cash Advance: SCOPE.PAYMENTS.WIX-PAYMENTS-CAPITAL-MCA

## Introduction

Retrieves a remittance invoice.

A remittance invoice that belongs to a different site can't be retrieved, and the
call returns a not found error.

---

## REST API

### Schema

```
 Method: getRemittanceInvoice
 Description: Retrieves a remittance invoice.  A remittance invoice that belongs to a different site can't be retrieved, and the call returns a not found error.
 URL: https://www.wixapis.com/capital/v1/remittance-invoices/{remittanceInvoiceId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  remittanceInvoiceId
 Method parameters: 
   param name: remittanceInvoiceId | type:   none | required: true 
 Return type: GetRemittanceInvoiceResponse
  - name: remittanceInvoice | type: RemittanceInvoice | description: Retrieved remittance invoice.  
     - name: id | type: string | description: Remittance invoice GUID.  | validation: format GUID, immutable
     - name: amount | type: Money | description: Amount due to be collected as a remittance for the sales day.  Never negative. Equal to the sum of `cashAdvanceAmountPortion` and `cashAdvanceFeePortion`.  | validation: immutable
        - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative.  | validation: format DECIMAL_VALUE, decimalValue {"maxScale":8}
        - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD).  | validation: format CURRENCY
     - name: last | type: boolean | description: Whether this is the last remittance invoice for the cash advance agreement.  This indicates that no further invoices are issued for the agreement. It doesn't indicate whether the remittance has been collected.  | validation: immutable
     - name: cashAdvanceAmountPortion | type: Money | description: Portion of `amount` applied to the principal advanced under the agreement.  For example, a 100 USD remittance may cover 80 USD of the advanced amount and 20 USD of the fee.  | validation: immutable
     - name: cashAdvanceFeePortion | type: Money | description: Portion of `amount` applied to the agreement's fee.  | validation: immutable
     - name: salesAmount | type: Money | description: Total sales for the sales day that the remittance was calculated from.  | validation: immutable
     - name: salesStartDate | type: string | description: Date and time the sales day started.  | validation: format date-time, immutable
     - name: salesEndDate | type: string | description: Date and time the sales day ended.  | validation: format date-time, immutable
     - name: salesDay | type: string | description: Sales day the remittance covers, in the cash advance agreement's timezone.  Date in `YYYY-MM-DD` format.  | validation: format LOCAL_DATE, immutable
     - name: salesCount | type: integer | description: Number of sales included in the remittance.  | validation: format int32
     - name: accountId | type: string | description: Wix Payments account GUID.  | validation: format GUID, immutable
     - name: tenantId | type: string | description: Internal identifier. Not required for third-party integrations.  | read-only: true | validation: format GUID, immutable
     - name: siteId | type: string | description: GUID of the site the cash advance agreement belongs to.  | validation: format GUID, immutable
     - name: sandbox | type: boolean | description: Whether the remittance invoice was created in a test environment.  | read-only: true | validation: immutable
     - name: cashAdvanceAgreementId | type: string | description: GUID of the cash advance agreement the remittance invoice belongs to.  | validation: format GUID, immutable
     - name: financialOperationId | type: string | description: GUID of the financial operation that collected the remittance.  Populated when the remittance is collected. A remittance invoice with no `financialOperationId` has been calculated but not yet collected.  | validation: format GUID
     - name: createdDate | type: string | description: Date and time the remittance invoice was created.  | read-only: true | validation: format date-time, immutable
     - name: updatedDate | type: string | description: Date and time the remittance invoice was updated.  | read-only: true | validation: format date-time
     - name: revision | type: string | description: Revision number, which increments by 1 each time the remittance invoice is updated.  | read-only: true | validation: format int64


```

### Examples

### Retrieve a remittance invoice
Retrieves a single remittance invoice by ID.

```curl
curl -X GET \
'https://www.wixapis.com/capital/v1/remittance-invoices/d7a341c4-196b-46e7-813c-2b0fc1847ec6' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.capital.remittanceInvoices.getRemittanceInvoice(remittanceInvoiceId)
 Description: Retrieves a remittance invoice.  A remittance invoice that belongs to a different site can't be retrieved, and the call returns a not found error.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  remittanceInvoiceId
 Method parameters: 
   param name: remittanceInvoiceId | type: string | description: GUID of the remittance invoice to retrieve. | required: true | validation: format GUID
 Return type: PROMISE<RemittanceInvoice>
  - name: _id | type: string | description: Remittance invoice GUID.  | validation: format GUID, immutable
  - name: amount | type: Money | description: Amount due to be collected as a remittance for the sales day.  Never negative. Equal to the sum of `cashAdvanceAmountPortion` and `cashAdvanceFeePortion`.  | validation: immutable
     - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative.  | validation: format DECIMAL_VALUE, decimalValue {"maxScale":8}
     - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD).  | validation: format CURRENCY
  - name: last | type: boolean | description: Whether this is the last remittance invoice for the cash advance agreement.  This indicates that no further invoices are issued for the agreement. It doesn't indicate whether the remittance has been collected.  | validation: immutable
  - name: cashAdvanceAmountPortion | type: Money | description: Portion of `amount` applied to the principal advanced under the agreement.  For example, a 100 USD remittance may cover 80 USD of the advanced amount and 20 USD of the fee.  | validation: immutable
  - name: cashAdvanceFeePortion | type: Money | description: Portion of `amount` applied to the agreement's fee.  | validation: immutable
  - name: salesAmount | type: Money | description: Total sales for the sales day that the remittance was calculated from.  | validation: immutable
  - name: salesStartDate | type: Date | description: Date and time the sales day started.  | validation: immutable
  - name: salesEndDate | type: Date | description: Date and time the sales day ended.  | validation: immutable
  - name: salesDay | type: string | description: Sales day the remittance covers, in the cash advance agreement's timezone.  Date in `YYYY-MM-DD` format.  | validation: format LOCAL_DATE, immutable
  - name: salesCount | type: integer | description: Number of sales included in the remittance.  | validation: format int32
  - name: accountId | type: string | description: Wix Payments account GUID.  | validation: format GUID, immutable
  - name: tenantId | type: string | description: Internal identifier. Not required for third-party integrations.  | read-only: true | validation: format GUID, immutable
  - name: siteId | type: string | description: GUID of the site the cash advance agreement belongs to.  | validation: format GUID, immutable
  - name: sandbox | type: boolean | description: Whether the remittance invoice was created in a test environment.  | read-only: true | validation: immutable
  - name: cashAdvanceAgreementId | type: string | description: GUID of the cash advance agreement the remittance invoice belongs to.  | validation: format GUID, immutable
  - name: financialOperationId | type: string | description: GUID of the financial operation that collected the remittance.  Populated when the remittance is collected. A remittance invoice with no `financialOperationId` has been calculated but not yet collected.  | validation: format GUID
  - name: _createdDate | type: Date | description: Date and time the remittance invoice was created.  | read-only: true | validation: immutable
  - name: _updatedDate | type: Date | description: Date and time the remittance invoice was updated.  | read-only: true 
  - name: revision | type: string | description: Revision number, which increments by 1 each time the remittance invoice is updated.  | read-only: true | validation: format int64


```

### Examples

### Retrieve a remittance invoice
Retrieves a single remittance invoice by ID.

```javascript
import { remittanceInvoices } from "@wix/capital";

async function getRemittanceInvoice() {
  const response = await remittanceInvoices.getRemittanceInvoice(
    "d7a341c4-196b-46e7-813c-2b0fc1847ec6",
  );
}

/* Promise resolves to:
 * {
 *   "_id": "d7a341c4-196b-46e7-813c-2b0fc1847ec6",
 *   "amount": {
 *     "value": "124.50",
 *     "currency": "USD"
 *   },
 *   "last": false,
 *   "cashAdvanceAmountPortion": {
 *     "value": "99.60",
 *     "currency": "USD"
 *   },
 *   "cashAdvanceFeePortion": {
 *     "value": "24.90",
 *     "currency": "USD"
 *   },
 *   "salesAmount": {
 *     "value": "830.00",
 *     "currency": "USD"
 *   },
 *   "salesStartDate": "2024-01-15T00:00:00.000Z",
 *   "salesEndDate": "2024-01-15T23:59:59.999Z",
 *   "salesDay": "2024-01-15",
 *   "salesCount": 17,
 *   "accountId": "5f2c1a83-6b4e-4d19-9c87-1e0a2f3b4c5d",
 *   "tenantId": "8a1b2c3d-4e5f-4a6b-8c9d-0e1f2a3b4c5d",
 *   "siteId": "b3f9e2d1-7c48-4a35-9e6f-2d8c1a4b7e90",
 *   "sandbox": false,
 *   "cashAdvanceAgreementId": "6e4d3c2b-1a09-4f8e-7d6c-5b4a39281706",
 *   "financialOperationId": "9c8b7a65-4321-4fed-cba9-876543210fed",
 *   "_createdDate": "2024-01-16T00:12:44.318Z",
 *   "_updatedDate": "2024-01-16T04:30:12.905Z",
 *   "revision": "2"
 * }
 */

```

### getRemittanceInvoice (self-hosted)
Self-hosted 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 { remittanceInvoices } from '@wix/capital';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function getRemittanceInvoice(remittanceInvoiceId) {
  const response = await myWixClient.remittanceInvoices.getRemittanceInvoice(remittanceInvoiceId);
};
```

---