> For the complete documentation index, see [llms.txt](https://docs.aquanow.io/pay/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aquanow.io/pay/api-endpoints/invoicing-api/v2-invoicing-apis.md).

# V2 Invoicing APIs

### General Information <a href="#general-information" id="general-information"></a>

{% hint style="danger" %}
Payment Services will recycle the generated payment address. Please DO NOT keep it for a prolonged period of time for receiving additional deposits.
{% endhint %}

## Generate Invoice&#x20;

<mark style="color:green;">`POST`</mark> `https://api.aquanow.io/payment/v2/invoice`

Generate an invoice for invoicing.&#x20;

#### Request Body

| Name                                                | Type                                               | Description                                                                                                                                                                                                                                                        |
| --------------------------------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| amountDue<mark style="color:red;">\*</mark>         | string                                             | The amount you wish to have receive                                                                                                                                                                                                                                |
| currency<mark style="color:red;">\*</mark>          | "CAD" \| "USD" \| "EUR" \| "AED" \| "GBP"          | The fiat currency you wish to receive                                                                                                                                                                                                                              |
| accountId<mark style="color:red;">\*</mark>         | string                                             | e.g., `CA1000012R` Specify the `accountId` of the account you wish to make the transaction for                                                                                                                                                                     |
| customerPaysFee<mark style="color:red;">\*</mark>   | boolean                                            | <p>If the customer pays the fee → The invoiced amount includes both the amount due and the fee. </p><p></p><p>If the customer does NOT pay the fee </p><p>→ The invoiced amount includes only the amount due, and your business pays the fee after conversion.</p> |
| customerReferenceId                                 | string                                             | Text form for message                                                                                                                                                                                                                                              |
| paymentOriginator<mark style="color:red;">\*</mark> | "self" \| "third party"                            | Payment origin: if sender is 'third party', kycInfo is required                                                                                                                                                                                                    |
| kycInfo                                             | [KYC V2](/pay/data-objects-and-statuses/kyc-v2.md) | PII Data required for KYC. Required if paymentOriginator is "third party"                                                                                                                                                                                          |

{% tabs %}
{% tab title="200 : Success" %}

```javascript
{
    "invoiceId": "df48e2fd-1b84-4118-83ab-667765fac4c9",
    "username": "woojpay",
    "customerReferenceId": "HKJ10040321",
    "invoiceStatus": "CREATED",
    "paymentStatus": "NOT_PAID",
    "customerPaysFee": false,
    "invoiceSymbol": "USD",
    "amountDue": 100,
    "strategy": "ACA",
    "invoicingFee": 0,
    "invoiceReceivedAmount": 0,
    "processingFee": 0,
    "invoiceAmount": 100,
    "accountId": "CA1001112C"
}
```

{% endtab %}

{% tab title="400: If required fields are missing" %}

```json

{
    "errors": [
        {
            "id": "3df2d175-f3de-4f99-abed-4b6ce7e000df",
            "message": "kycInfo/address must have required property 'addressLine1'"
        }
    ]
}
```

{% endtab %}

{% tab title="400: Country must conform to valid ISO 3166-2 code" %}

```json
{
    "errors": [
        {
            "id": "4110cb04-bca2-4cf0-9791-e94a16c3dcf2",
            "message": "kycInfo/country must be a valid ISO 3166-1 alpha-2 country code"
        }
    ]
}
```

{% endtab %}

{% tab title="400: Invalid Postal Code" %}

```json
{
    "errors": [
        {
            "id": "a61dff73-5af4-4404-8104-1afb888156af",
            "message": "Invalid postal code V5A1gS1 for country CA"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Generate Bill &#x20;

<mark style="color:green;">`POST`</mark> `https://api.aquanow.io/payment/v2/bill`

Generate a bill under an invoice to get address

#### Request Body

<table><thead><tr><th width="249.2265625">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>invoiceId<mark style="color:red;">*</mark></td><td>String</td><td>invoiceId to associate the bill with</td></tr><tr><td>cryptoType<mark style="color:red;">*</mark></td><td>"BTC" | "ETH" | "BCH" | "USDT" | "LTC" | "USDC" | "POL" | "SOL" </td><td>The crypto you wish the deposit</td></tr><tr><td>networkSymbol<mark style="color:red;">*</mark></td><td>string</td><td>The network you wish to use for a speicfic currency</td></tr><tr><td>walleType<mark style="color:red;">*</mark></td><td>"VASP" | "SELF_HOSTED" | "OTHER_VASP"</td><td></td></tr><tr><td>vaspId</td><td>uuid</td><td>required if walletType === "VASP", refere to <a data-mention href="/pay/api-endpoints/wallet-types-api.md">Wallet Types API</a></td></tr><tr><td>vaspName</td><td>string</td><td>required if walletTypes === "OTHER_VASP" (the vasp you are using does not have a vaspId) specify the name. </td></tr><tr><td>vaspWebsite</td><td>string</td><td>If walletTypes === "OTHER_VASP" (the vasp you are using does not have a vaspId) specify the url. </td></tr><tr><td>feeModel</td><td>"SPREAD" | "EXPLICIT" </td><td>Determines how you the fee to be charged.  <br><br>If the invoice's <code>customerPaysFee</code> is set to true; you cannot select SPREAD<br><br>Defaults to EXPLICIT</td></tr></tbody></table>

{% tabs %}
{% tab title="200 Success" %}

```
{
    "deposit_address": "tb1q5qfkjx5p926hy95ek8fpyfp24q9wgm4469ha6t",
    "price": 97663.96674673,
    "expiryTime": 1738819669926,
    "quantity": 0.00102392,
    "paymentId": "95991db8-8361-4e55-a3f1-b31472953980"
}
```

{% endtab %}

{% tab title="400 Validation Error" %}

```json
{
    "errors": [
        {
            "id": "0f9191ec-baad-4d1f-be02-026897b6e524",
            "message": "data/cryptoType must be equal to one of the allowed values"
        }
    ]
}
```

{% endtab %}

{% tab title="400: If walletType = OTHER\_VASP but no vaspNames provided" %}

```json
{
    "errors": [
        {
            "id": "d3ecbe49-3276-45a3-ba99-45d89ca60de1",
            "message": "data must have required property 'vaspName'"
        }
    ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aquanow.io/pay/api-endpoints/invoicing-api/v2-invoicing-apis.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
