Invoice API
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 |
|---|---|---|---|
|
| Yes | The unique identifier for the customer. |
|
| No | ⚠️ DEPRECATED - This field is ignored. Invoice amount is calculated from |
|
| Yes | The total tax amount for the invoice. |
|
| Yes | The surcharge amount (fixed amount or percentage based on |
|
| Yes | The surcharge calculation type: |
|
| Yes | A description of the invoice. |
|
| Yes | The recurrence type: |
|
| No | The descriptor/subject for the invoice (max 25 characters). |
|
| No | The start date for recurring invoices (ISO 8601 format). |
|
| No | Day of week (0-6) for weekly/biweekly, or day of month (1-31) for monthly recurring invoices. |
|
| No | The number of billing cycles for recurring invoices. |
|
| No | A list of items included in the invoice. Total must be at least $5.01. |
|
| Yes | The unique identifier of the inventory item. |
|
| Yes | The original price of the item. |
|
| Yes | The original cost of the item. |
|
| No | An overridden price for the item (if different from original). |
|
| No | An overridden cost for the item (if different from original). |
|
| Yes | The quantity of the item. |
|
| Yes | The discount amount for the item. |
|
| Yes | The tax amount for the item. |
|
| Yes | Item status: |
|
| No | Sub-parts associated with the invoice item (same structure as invoice items, without |
|
| 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/invoiceResponse
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/invoiceRequest 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 |