Adding multiple items in an invoice
This document provide guidance to integrators who would like to add more than one item on an invoice.
Important Note
Each invoice item will have their own individual UUID. This invoice item UUID can be used to specify which item an integrator choose to refund.
An invoice with multiple invoice item will only be charge a transaction fees once, as compared to how many individual invoice is create for each of the items.
Creating an invoice with multiple invoice item
The API to create an invoice with multiple items is similar to how you would normally create an invoice using Ezypay's API. The main focus is on the "items" section. Below is an example of how an invoice can be created with multiple items. Ezypay calls this "invoice items".
[POST] https://api-sandbox.ezypay.com/v2/billing/invoices
API Endpoint Documentation: https://developer.ezypay.com/reference#create-an-invoice
{
"paymentMethodToken": "{{PaymentMethodToken}}",
"customerId": "{{Ezypay_Customer_Id}}",
"items": [
{
"amount": {
"currencyCode": "AUD",
"value": 4
},
"taxs": {
"rate": 0
},
"description": "Gym Towel",
"accountingCode": "GYM_1123"
},
{
"amount": {
"currencyCode": "AUD",
"value": 2
},
"taxs": {
"rate": 0
},
"description": "1.5 ml Coke",
"accountingCode": "GYM_1123"
},
{
"amount": {
"currencyCode": "AUD",
"value": 20
},
"taxs": {
"rate": 0
},
"description": "Extra 20 minutes",
"accountingCode": "GYM_1123"
}
]
}
{
"id": "ad008038-26d8-4669-b3ae-793386c39aad",
"documentNumber": "IN0000000000002944",
"date": "2020-12-11",
"dueDate": "2020-12-11",
"scheduledPaymentDate": null,
"status": "PROCESSING",
"memo": null,
"items": [
{
"description": "Gym Towel",
"amount": {
"currency": "AUD",
"value": 4.00,
"type": null
},
"tax": {
"rate": 10.00
},
"id": "08193719-9fe5-4a88-a0f7-e0b430f85535",
"type": "on_demand_payment",
"discounted": {
"currency": "AUD",
"value": 0.00,
"type": null
},
"accountingCode": "GYM_1123"
},
{
"description": "1.5 ml Coke",
"amount": {
"currency": "AUD",
"value": 2.00,
"type": null
},
"tax": {
"rate": 10.00
},
"id": "28ba21da-7eff-466f-b65b-5cab70024509",
"type": "addon_payment",
"discounted": {
"currency": "AUD",
"value": 0.00,
"type": null
},
"accountingCode": "GYM_1123"
},
{
"description": "Extra 20 minutes",
"amount": {
"currency": "AUD",
"value": 20.00,
"type": null
},
"tax": {
"rate": 10.00
},
"id": "035c015b-9ab4-48f9-baf9-badd0679be96",
"type": "addon_payment",
"discounted": {
"currency": "AUD",
"value": 0.00,
"type": null
},
"accountingCode": "GYM_1123"
},
{
"description": "Transaction Fee",
"amount": {
"currency": "AUD",
"value": 0.65,
"type": null
},
"tax": {
"rate": 10.00
},
"id": "2a47d4d0-0a63-4863-88a9-c8a69609039f",
"type": "transaction_fee",
"discounted": {
"currency": "AUD",
"value": 0.00,
"type": null
},
"accountingCode": "GYM_1123"
}
],
"amount": {
"currency": "AUD",
"value": 26.65,
"type": null
},
"amountWithoutDiscount": {
"currency": "AUD",
"value": 26.65,
"type": null
},
"totalDiscounted": {
"currency": "AUD",
"value": 0.00,
"type": null
},
"totalRefunded": {
"currency": "AUD",
"value": 0.00,
"type": null
},
"totalTax": {
"currency": "AUD",
"value": 2.42,
"type": null
},
"customerId": "{{Ezypay_CustomerId}}",
"subscriptionId": null,
"checkoutId": null,
"subscriptionName": null,
"paymentMethodToken": "{{PaymentMethodToken}}",
"autoPayment": true,
"processingModel": "RECURRING",
"createdOn": "2020-12-11T07:11:18.572",
"payNowUrl": null,
"channel": "api"
}
Updated over 2 years ago