Invoices
Invoices serve as records of the outstanding balances owed by customers and can be generated either on a one-time basis or periodically for subscription-based services.
Platforms typically have the capability to autonomously generate invoices for their businesses, or to integrate with accounting software platforms to retrieve invoices from there.
Continuous updates on every invoice created by vendors using the payment solution powered by Unipaas are essential. These updates allow us to establish a seamless connection between invoices and transactions on our end, ensuring compliance with regulatory requirements and improved user experience.
Benefits of matching invoices to transactions
Section titled “Benefits of matching invoices to transactions”Regulatory compliance assurance: Unipaas uses invoice information to stay compliant with relevant financial regulations and industry standards, ensuring a secure and trustworthy payment environment for both your platform and your customers.
Seamless payment collection with Direct Debit: Unipaas leverages invoice data to enable smooth and hassle-free payment collection through Direct Debit, streamlining the payment process for users.
Enhanced user experience: Unipaas aims to clearly display the correlation between payments and corresponding invoices, providing users with enhanced transparency, improved reconciliation and better understanding of their financial activity.
Accurate invoice references at checkout: Unipaas ensures that checkout pages present the correct and up-to-date invoice references, reducing errors and offering a more reliable payment experience to buyers.
Tailored payment options: Leveraging the insights from invoice data, Unipaas is able to offer relevant and appropriate payment methods, differentiating between recurring and one-time invoices to meet diverse user needs effectively.
Invoice endpoint
Section titled “Invoice endpoint”It is highly recommended to set up automatic forwarding for every invoice to Unipaas whenever it is created or modified on your platform.
Post invoice (one-time or recurring)
Post invoice
Section titled “Post invoice”When to use
Section titled “When to use”Every time a new invoice is created on your platform.
How to use
Section titled “How to use”POST/platform/vendors/{vendorId}/invoices
The invoice object
Section titled “The invoice object”{ "reference": "INV-1234", "currency": "GBP", "totalAmount": 99.5, "vatAmount": 19.9, "dueDate": "2026-12-12T08:42:52.933Z", "paymentMethods":["directDebit"], "paymentStatus": "unpaid", "totalPaid": 0, "customer": { "reference": "1234", "email": "test@gmail.com", "name": "Kevin Malone" }, "lineItems": [ { "description": "line 1", "unitPrice": 10.6, "quantity": 3 }, { "description": "line 2", "unitPrice": 19.3, "quantity": 1 } ], "isRecurring": true, "subscriptionId": "sub-123", "external":false, "batchId": "batch-777", "publicUrl": "http://yourcompany.com/invoice.pdf", "invoiceObject": {}}Attributes
Name | Is Required | Type | Description |
|---|---|---|---|
| Yes | String | The invoice number on your system. Must be unique per vendor - a duplicate |
| Yes | String | The currency of the invoice. One of |
| Yes | Number | The total invoice amount |
| No | Number | The total VAT amount for the invoice (can be 0). |
| Yes | Date | The invoice due date. Use ISO 8601, and for a specific day prefer date-only ( Non-ISO slash and dash formats are parsed as MM/DD/YYYY, not DD/MM/YYYY - so A local time with a UTC offset (for example For Direct Debit invoices, |
| No | Number | The total amount paid so far on this invoice. |
| No | String | The ID of the batch that this invoice was included in. |
| No | String | A public URL to the invoice PDF version. |
| Yes | Array | Line item object - see table below. The key is required, but an empty array ( |
| Yes | Object | Customer object - see table below. |
| Yes | Enum | Current invoice payment status: |
| No | Array, Enum | States which payment methods will be available for this specific invoice. For Available payment methods:
Check the response to see whether money is moving, not just what was stored: |
| No | Object | The invoice object in its original form as created on your platform. |
| Yes | Boolean | Indicates if this invoice is a recurring one. |
| No | Boolean | Indicates if this invoice was paid using external (non Unipaas). payment method. If value is set to ‘false’ it is an indication that an invoice paid with Unipaas. |
| No | String | The recurring invoice subscription identifier. |
lineItem attributes:
| Name | Is Required | Type | Description |
|---|---|---|---|
description | Yes | String | A description for a specific line item |
unitPrice | Yes | Number | The price of a unit for a specific line item |
quantity | Yes | Number | The quantity of a unit for a specific line item |
customer attributes:
| Name | Is Required | Type | Description |
|---|---|---|---|
reference | No | String | Platform customer identifier. Optional to the schema, but for Direct Debit to be offered it must match the consumer reference used when the mandate was created. |
name | No | String | The customer full name. |
id | No | String | Unipaas customer identifier. |
email | No | String | The customer email address. |
Response example
Section titled “Response example”{ "id": "6539271a23ebdaa55bae0e4f", "merchantId": "6440ca5ec6f5484043645595", "vendorId": "64b2acf5e59cc36181291f8d", "currency": "GBP", "totalAmount": 99.5, "totalPaid": 0, "vatAmount": 19.9, "reference": "INV-1234", "publicUrl": "http://yourcompany.com/invoice.pdf", "invoiceObject": {}, "subscriptionId": "sub-123", "isRecurring": true, "batchId": "batch-777", "customer": { "reference": "1234567", "email": "test@gmail.com", "name": "orel reast" }, "lineItems": [ { "description": "line 1", "unitPrice": 10.6, "quantity": 3 }, { "description": "line 2", "unitPrice": 19.3, "quantity": 1 } ], "paymentStatus": "unpaid", "dueDate": "2022-12-12T08:42:52.933Z", "paymentMethods": [ "directDebit" ], "external": false, "authorizationId": "65392719bd672b26f20d53ca", "signedLinkId": "RGJ4_2wLWr", "checkoutLink": "https://dev-checkout.unipaas.com/RGJ4_2wLWr/", "sessionToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElkIjoiNjJmYzk5YjI0YzcyOGIzZjAyZmM2MzRmIiwibWVyY2hhbnROYW1lIjoiTmV3IFBsYXRmb3JtIiwiYW1vdW50IjoxMCwiY3VycmVuY3kiOiJHQlAiLCJlbWFpbCI6InVzZXJAdGVzdC5jb20iLCJjb3VudHJ5IjoiR0IiLCJzZWxsZXJJZCI6IjY1MWU2ODRhZDAwNjg5MWIzNWJkZGQ2OCIsInZlbmRvcklkIjoiNjUxZTY4NGFkMDA2ODkxYjM1YmRkZDY4IiwicGhvbmUiOiIrNDQxNjE0OTYwMjU1Iiwic2NvcGVzIjpbIndlYnNka19hY2Nlc3MiLCJkaXJlY3RfZGViaXRfcmVhZCJdLCJpc1JlY3VycmluZyI6ZmFsc2UsImVudiI6ImxvY2FsIiwicGF5bWVudExpbmtJZCI6Ik0zc09laFU1ZEMiLCJpYXQiOjE3MjcwOTc5NTMsImV4cCI6MTcyNzEwMTU1M30.mR_rA3cF5UTANKHcgPVyyfidXg8JieBg_otX6Iz_5V8", "createdAt": "2023-10-25T14:32:58.566Z", "updatedAt": "2023-10-25T14:32:58.566Z"}| Name | Type | Description |
|---|---|---|
id | String | The value you obtained in the response to POST request, serves to identify this invoice in Unipaas |
authorizationId | String | Populated when a payment has been initiated for this invoice. For a Direct Debit invoice against an active mandate this is set at creation, and GET /pay-ins/{authorizationId} returns the scheduled collection including its collectionDate. Null where no payment has been initiated. |
checkoutLink | String | The checkout link for the invoice, which includes the available payment methods for buyer. |
Recurring invoices
Section titled “Recurring invoices”Report each recurring invoice to the invoice endpoint as it is created, following the instructions provided above, and set isRecurring to true so it is recorded as recurring.
Direct Debit collection depends on an active mandate on the consumer whose reference matches the invoice’s customer.reference. isRecurring does not affect this - without a matching active mandate, directDebit is dropped from paymentMethods regardless of its value.
Where that mandate exists and directDebit is sent, posting the invoice schedules the collection. You do not need to call POST /pay-ins separately for this flow. See the warning above regarding due dates. To set up the mandate, see Implement Direct Debit via API.
Update invoice
Section titled “Update invoice”When to use
Section titled “When to use”- When an existing invoice has been edited, e.g. changes to the total amount or due date.
- When an existing invoice has been fully or partially paid.
The following invoice parameters might affect the payment:
totalAmounttotalPaidpaymentMethodspaymentStatusdueDate
How to use
Section titled “How to use”PATCH/vendors/{vendorId}/invoices/{invoiceId}
The updated invoice object example
Section titled “The updated invoice object example”You may only update the values that have been changed.
In this example, the invoice was subject to a partial payment of 60 GBP, leading to a change in the payment status, and the payment method was switched by user to Direct Debit.
{ "id": "6391fd42a38e34b15b118d9b", "totalPaid": 60.0, "paymentStatus": "partially_paid", "paymentMethods":["directDebit"]}Attributes
Name | Is Required | Type | Description |
|---|---|---|---|
| No | String | Ignored. The invoice to update is identified solely by the |
| No | String | The invoice number on your system. Mutable via PATCH. The per-vendor uniqueness constraint still applies, so a rename that collides with another invoice’s |
| No | Number | The total amount paid so far on this invoice |
| No | Number | The total invoice amount. Where a Direct Debit collection is scheduled, this changes the amount to be collected. |
| No | Date | The invoice due date. Where a Direct Debit collection is scheduled, this reschedules it. Same format rules as on POST. |
| No | Enum | Current invoice payment status |
| No | Array, | States which payment methods will be available for this specific invoice. Available payment methods: As on POST, |
| No | Array | Replaces the existing line items wholesale - it does not merge. Sending a single line item discards any items already on the invoice, so always send the full set. |