# Invoice Bot

## Configuration

### PayPal

Settings for PayPal can be found in the paypal.json file located in the config folder; all except the clientId, secret, and emailAddress are optional:

* `isLive` : Sets whether the app is live or not. It's best to test in the PayPal sandbox before going live (false).
* `merchantInfo.businessName` : Your business's name, which will appear on the invoices
* `merchantInfo.emailAddress` : Your business's email address as listed in your account
* `merchantInfo.website` : Your business's website.
* `merchantInfo.logoUrl` : The logo that will appear on the invoice. This must be 250px wide and 90px high max.
* `merchantInfo.additionalNotes` : Additional notes for your invoice
* `invoiceDetails.currencyCode` : The three-character currency code for your invoice (default is USD)
* `invoiceDetails.note` : The notes for your invoice
* `invoiceDetails.termsAndConditions` : Your business's terms and conditions, which will be shown on the invoice
* `minimumAmount.enabled` : Enables or disabled the minimum amount (partial payments)
* `minimumAmount.percent` : The percentage to use when calculating the minimum amount

```javascript
...
    'paypal': {
        'isLive': false,
        'merchantInfo': {
            'businessName': 'Test Business',
            'emailAddress': '',
            'website': 'https://example.com',
            'logoUrl': '',
            'additionalNotes': '',
        },
        'invoiceDetails': {
            'currencyCode': 'USD',
            'note': '',
            'termsAndConditions': 'Your terms and conditions',
        },
        'fee': 0.05,
        'minimumAmount': {
            'enabled': true,
            'percent': 0.5,
        },
        'webhooks': {
            'enabled': false,
        },
    },
...
```

### Placeholders

Placeholders are used to display the info of an invoice. You may find the placeholders for the messages that support it below.

| Placeholder    | Description                   |
| -------------- | ----------------------------- |
| %invNumber%    | Invoice number                |
| %email%        | Customer's email              |
| %amountDue%    | Amount due                    |
| %total%        | The total cost of the invoice |
| %currencyCode% | Currency code for the invoice |
| %paymentLink%  | Invoice URL                   |
| %invStatus%    | Invoice status                |
| %invId%        | Invoice ID                    |
| %item%         | Item name                     |

All command messages are located under the `'messages':` group in the config


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bluedev.xyz/premade-bots/invoice-bot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
