# Invoice API

- Human documentation: https://www.myrepairapp.com/api-docs/invoice
- OpenAPI: https://www.myrepairapp.com/openapi.json
- Last updated: 2026-07-30T12:28:19.750Z

## The Invoice Model

The Invoice object represents an invoice in the system. Below is an example of an Invoice object with all possible fields.

> **Note:** The minimum invoice amount is **$5.01**. Invoices below this amount will be rejected by the payment processor.

```
{
  "customerId": "CUST12345",
  "tax": 10.5,
  "surchargeAmount": 3.5,
  "surchargeType": "PERCENTAGE",
  "description": "Monthly subscription fee",
  "recurringType": "MONTHLY",
  "descriptor": "Subscription Invoice",
  "startsFrom": "2025-02-01",
  "chargeOn": 1,
  "chargeUntil": 12,
  "invoiceItems": [
    {
      "inventoryItemId": "INV001",
      "originalPrice": 100.00,
      "originalCost": 50.00,
      "overriddenPrice": 95.00,
      "quantity": 1,
      "discount": 5.00,
      "tax": 10.50,
      "status": "Sold",
      "parts": [
        {
          "inventoryItemId": "PART001",
          "originalPrice": 20.00,
          "originalCost": 10.00,
          "quantity": 1,
          "discount": 0,
          "tax": 2.00,
          "status": "Sold"
        }
      ]
    }
  ],
  "sendEmail": true,
}
```

### Invoice Object Properties

| Field                            | Type      | Required | Description                                                                                           |
| -------------------------------- | --------- | -------- | ----------------------------------------------------------------------------------------------------- |
| `customerId`                     | `string`  | Yes      | The unique identifier for the customer.                                                               |
| `amount`                         | `number`  | No       | **⚠️ DEPRECATED** - This field is ignored. Invoice amount is calculated from `invoiceItems`.          |
| `tax`                            | `number`  | Yes      | The total tax amount for the invoice.                                                                 |
| `surchargeAmount`                | `number`  | Yes      | The surcharge amount (fixed amount or percentage based on `surchargeType`).                           |
| `surchargeType`                  | `enum`    | Yes      | The surcharge calculation type: `FIXED` or `PERCENTAGE`.                                              |
| `description`                    | `string`  | Yes      | A description of the invoice.                                                                         |
| `recurringType`                  | `enum`    | Yes      | The recurrence type: `ONETIME`, `DAILY`, `WEEKLY`, `BIWEEKLY`, `MONTHLY`, `QUARTERLY`, or `ANNUALLY`. |
| `descriptor`                     | `string`  | No       | The descriptor/subject for the invoice (max 25 characters).                                           |
| `startsFrom`                     | `string`  | No       | The start date for recurring invoices (ISO 8601 format).                                              |
| `chargeOn`                       | `number`  | No       | Day of week (0-6) for weekly/biweekly, or day of month (1-31) for monthly recurring invoices.         |
| `chargeUntil`                    | `number`  | No       | The number of billing cycles for recurring invoices.                                                  |
| `invoiceItems`                   | `array`   | No       | A list of items included in the invoice. Total must be at least $5.01.                                |
| `invoiceItems[].inventoryItemId` | `string`  | Yes      | The unique identifier of the inventory item.                                                          |
| `invoiceItems[].originalPrice`   | `number`  | Yes      | The original price of the item.                                                                       |
| `invoiceItems[].originalCost`    | `number`  | Yes      | The original cost of the item.                                                                        |
| `invoiceItems[].overriddenPrice` | `number`  | No       | An overridden price for the item (if different from original).                                        |
| `invoiceItems[].overriddenCost`  | `number`  | No       | An overridden cost for the item (if different from original).                                         |
| `invoiceItems[].quantity`        | `number`  | Yes      | The quantity of the item.                                                                             |
| `invoiceItems[].discount`        | `number`  | Yes      | The discount amount for the item.                                                                     |
| `invoiceItems[].tax`             | `number`  | Yes      | The tax amount for the item.                                                                          |
| `invoiceItems[].status`          | `enum`    | Yes      | Item status: `Sold`, `AvailableForReturn`, `Shipped`, `Declined`, or `Reconciled`.                    |
| `invoiceItems[].parts`           | `array`   | No       | Sub-parts associated with the invoice item (same structure as invoice items, without `createdAt`).    |
| `sendEmail`                      | `boolean` | Yes      | Indicates if an email should be sent with the invoice.                                                |

This model provides a structured way to manage invoices, including details about recurring payments, invoice items, and shipping information.

***

## Invoice Resources

### Get all invoices

This endpoint returns a list of all invoices.

HTTP Request

```
GET https://www.myrepairapp.com/api/v2/invoice
```

Response

If successful, the response will include a list of all invoices.

***

### Create an invoice

This endpoint creates a new invoice.

HTTP Request

```
POST https://www.myrepairapp.com/api/v2/invoice
```

Request Body

The request body must contain a valid Invoice object. The total amount (calculated from `invoiceItems`) must be at least **$5.01**.

Response

If successful, the response will include the created invoice's details.

Error Responses

| Status | Description                                                    |
| ------ | -------------------------------------------------------------- |
| 400    | Invalid invoice data                                           |
| 401    | Unauthorized - missing or invalid authentication               |
| 500    | Invoice amount must be at least $5.01, or other internal error |
