E-invoicing
Reverse invoice
Reverse an invoice you issued in error.
POST{baseUrl}/{stage}/external/businesses/{businessId}/invoices/reversal
Reverse an existing invoice by providing its Invoice Reference Number (IRN). This operation creates a credit note on that invoice.
Quick Reference
| Method | Endpoint | Content-Type |
|---|---|---|
POST | {baseUrl}/{stage}/external/businesses/{businessId}/invoices/reversal | application/json |
Request Structure
Path Parameters
businessIdstringrequired
The unique identifier of the business
Headers
Content-Typerequired
application/json or */*Acceptrequired
application/json or */*X-Business-Keyrequired
Request Body
irnstringrequired
Invoice Reference NumberValidation: Must be a valid IRN format
Example: INV236-1070ECE8-20250826
Response Format
Success Response (200)
{
"responseCode": "00",
"responseMessage": "Success",
"data": {
"requestType": null,
"invoiceId": 134,
"invoiceBusinessId": "26ede24b-ac50-475f-aacc-5ea6339f0863",
"invoiceEntityId": "107",
"invoiceIssueDate": "2025-08-26",
"invoiceIrn": "INV236-1070ECE8-20250826",
"invoiceDueDate": "2025-08-26",
"invoiceIssueTime": "12:57:15",
"invoiceTypeCode": "389",
"invoicePaymentStatus": "PAID",
"invoiceNote": "August Electricity Bill - Mr Ridwan",
"invoiceTaxPointDate": "2025-08-26",
"invoiceDocumentCurrencyCode": "NGN",
"invoiceTaxCurrencyCode": "NGN",
"invoiceStatus": "PENDING",
"invoiceCreatedAt": "2025-08-27T09:25:35.694193",
"invoiceUpdatedAt": "2025-08-27T08:33:50.756293",
"invoiceCustomerPartyTin": "68721523-8104",
"invoiceCustomerPartyEmail": "supplier_business@email.com",
"invoiceCustomerPartyTelephone": "+23480254099000",
"invoiceCustomerPartyBusinessDescription": "this entity is into sales of Cement and building materials",
"invoiceCustomerPartyName": "Dangote Group",
"invoiceCustomerCityName": "Gwarikpa",
"invoiceCustomerPostalZone": "023401",
"invoiceCustomerCountry": "NG",
"invoiceCustomerStreetName": "32, owonikoko street",
"invoiceCustomerLga": "Aba",
"invoiceCustomerState": "Abia",
"invoiceSupplierPartyId": "b4009129-ece8-45fc-9584-976fcbe35f8d",
"invoiceSupplierPartyTin": "68721523-8104",
"invoiceSupplierPartyEmail": "redtech@gmail.com",
"invoiceSupplierPartyTelephone": "+234447784433",
"invoiceSupplierPartyBusinessDescription": "AEDC Electricity Supply",
"invoiceSupplierPartyName": "alias-sit-fuga-ex",
"invoiceSupplierLga": "Aba",
"invoiceSupplierState": "Abia",
"invoiceSupplierCityName": "Aba",
"invoiceSupplierPostalZone": "101245",
"invoiceSupplierCountry": "NG",
"invoiceSupplierStreetName": "vi",
"invoiceLineExtensionAmount": 30030,
"invoiceTaxExclusiveAmount": 30030,
"invoiceTaxInclusiveAmount": 30255.22,
"invoicePayableAmount": 30255.22,
"invoiceLine": [
{
"invoiceLineInvoiceId": 134,
"invoiceLineProductCategory": "Electrical energy",
"invoiceLineDiscountRate": 0.1,
"invoiceLineDiscountAmount": 30,
"invoiceLineFeeRate": 0.2,
"invoiceLineFeeAmount": 60,
"invoiceLineInvoicedQuantity": 200,
"invoiceLineExtensionAmount": 30030,
"invoiceLineHsnCode": "2716.00",
"invoiceLineItemDescription": "Electricity Units",
"invoiceLineItemSellersItemIdentification": "Electricity Units",
"invoiceLineItemName": "Electricity Supply",
"invoiceLinePriceBaseQuantity": 1,
"invoiceLinePriceUnit": "NGN PER 1",
"invoiceLinePriceAmount": 150
}
],
"invoiceTaxTotal": [
{
"invoiceTaxTotalInvoiceId": 134,
"invoiceTaxTotalAmount": null,
"invoiceTaxTotalSubTotal": [
{
"taxSubTotalTaxableAmount": 30030,
"taxSubTotalTaxAmount": 225.22,
"taxSubTotalCategoryId": "STANDARD_VAT",
"taxSubTotalCategoryPercent": 0.75
}
]
}
]
}
}Response Fields
Top-Level Response
responseCodestring
Response status code (
"00" = success)responseMessagestring
Human-readable response message
dataobject
Invoice data object
Invoice Core Details
invoiceIdnumber
Unique invoice identifier
invoiceBusinessIdstring
Business ID associated with invoice
invoiceEntityIdstring
Entity ID for the invoice
invoiceIrnstring
Invoice Reference Number
invoiceIssueDatestring
Date invoice was issued (YYYY-MM-DD)
invoiceDueDatestring
Payment due date (YYYY-MM-DD)
invoiceIssueTimestring
Time invoice was issued (HH:MM:SS)
invoiceTypeCodestring
Invoice type code
invoicePaymentStatusstring
Payment status (e.g., "PAID", "UNPAID")
invoiceStatusstring
Current invoice status (e.g., "PENDING", "REVERSED")
invoiceNotestring
Additional notes or description
invoiceDocumentCurrencyCodestring
Invoice currency code
invoiceTaxCurrencyCodestring
Tax currency code
invoiceCreatedAtstring
Timestamp when invoice was created
invoiceUpdatedAtstring
Timestamp when invoice was last updated
Customer Information
invoiceCustomerPartyTinstring
Customer Tax Identification Number
invoiceCustomerPartyEmailstring
Customer email address
invoiceCustomerPartyTelephonestring
Customer phone number
invoiceCustomerPartyNamestring
Customer name
invoiceCustomerPartyBusinessDescriptionstring
Customer business description
invoiceCustomerCityNamestring
Customer city
invoiceCustomerPostalZonestring
Customer postal code
invoiceCustomerCountrystring
Customer country code
invoiceCustomerStreetNamestring
Customer street address
invoiceCustomerLgastring
Customer Local Government Area
invoiceCustomerStatestring
Customer state
Supplier Information
invoiceSupplierPartyIdstring
Supplier party ID
invoiceSupplierPartyTinstring
Supplier Tax Identification Number
invoiceSupplierPartyEmailstring
Supplier email address
invoiceSupplierPartyTelephonestring
Supplier phone number
invoiceSupplierPartyNamestring
Supplier name
invoiceSupplierPartyBusinessDescriptionstring
Supplier business description
invoiceSupplierCityNamestring
Supplier city
invoiceSupplierPostalZonestring
Supplier postal code
invoiceSupplierCountrystring
Supplier country code
invoiceSupplierStreetNamestring
Supplier street address
invoiceSupplierLgastring
Supplier Local Government Area
invoiceSupplierStatestring
Supplier state
Financial Summary
invoiceLineExtensionAmountnumber
Line extension total amount
invoiceTaxExclusiveAmountnumber
Total amount excluding tax
invoiceTaxInclusiveAmountnumber
Total amount including tax
invoicePayableAmountnumber
Total amount payable
Line Items
invoiceLinearray
Array of invoice line items
invoiceLineInvoiceIdnumber
Associated invoice ID
invoiceLineProductCategorystring
Product category
invoiceLineDiscountRatenumber
Discount rate applied
invoiceLineDiscountAmountnumber
Discount amount
invoiceLineFeeRatenumber
Fee rate applied
invoiceLineFeeAmountnumber
Fee amount
invoiceLineInvoicedQuantitynumber
Quantity invoiced
invoiceLineExtensionAmountnumber
Line item total amount
invoiceLineHsnCodestring
HSN classification code
invoiceLineItemDescriptionstring
Item description
invoiceLineItemNamestring
Item name
invoiceLinePriceBaseQuantitynumber
Base quantity for pricing
invoiceLinePriceUnitstring
Price unit description
invoiceLinePriceAmountnumber
Price per unit
Tax Information
invoiceTaxTotalarray
Array of tax totals
invoiceTaxTotalInvoiceIdnumber
Associated invoice ID
invoiceTaxTotalAmountnumber
Total tax amount
invoiceTaxTotalSubTotalarray
Array of tax subtotals by category
taxSubTotalTaxableAmountnumber
Taxable amount
taxSubTotalTaxAmountnumber
Tax amount for this category
taxSubTotalCategoryIdstring
Tax category identifier
taxSubTotalCategoryPercentnumber
Tax percentage rate
Example Request
cURL Example
curl -X POST "https://api-dev.nairainvoice.com/dev/external/businesses/b4009129-ece8-45fc-9584-976fcbe35f8d/invoices/reversal" \
-H "accept: */*" \
-H "X-Business-Key: BK_QUBYK4S2X97J" \
-H "Content-Type: application/json" \
-d '{
"irn": "INV123456-10EC108B-25670494"
}'JSON Request Body
{
"irn": "INV123456-10EC108B-25670494"
}Validation Rules
Request Validation
- businessId: Must be a valid UUID format in the URL path
- X-Business-Key: Required authentication header, must be valid
- irn: Required field, must match an existing invoice IRN
Business Logic Validation
- The specified invoice must exist in the system
- The invoice must belong to the specified business
- The invoice must be in a reversible state
- User must have appropriate permissions to reverse invoices
Error Responses
Common Error Codes
| Status Code | Response Code | Description |
|---|---|---|
| 400 | - | Bad Request - Invalid IRN format or missing required fields |
| 401 | - | Unauthorized - Invalid or missing X-Business-Key |
| 404 | - | Not Found - Invoice with specified IRN does not exist |
| 403 | - | Forbidden - Insufficient permissions to reverse invoice |
| 409 | - | Conflict - Invoice cannot be reversed (already reversed or in invalid state) |
Error Response Format
{
"responseCode": "ERROR_CODE",
"responseMessage": "Error description",
"data": null
}Use Cases
When to Use This Endpoint
- Accounting Corrections: Reverse an invoice that was issued incorrectly
- Transaction Cancellations: Cancel a transaction that needs to be voided
- Credit Note Generation: Create a reversal for issuing credits to customers
- Compliance Requirements: Maintain audit trails for reversed transactions
Important Considerations
- A reversal will trigger the creation of a credit note or adjustment entry
- Reversed invoices usually cannot be un-reversed; a new invoice must be created instead
Workflow Example
1. Create Invoice (POST /invoices)
↓
2. Invoice Issued (Status: TRANSMITTING/TRANSMITTED)
↓
3. Need to Reverse (Error/Cancellation)
↓
4. Call Reversal Endpoint (POST /invoices/reversal)
↓
5. Invoice Reversed (creates a credit note on that invoice)
↓
6. Create New Corrected Invoice (if needed)Qorpy API by Qucoon Limited, an NRS-approved Access PointAPI version v1