Skip to content

E-invoicing

Update payment status

Set the payment status of an invoice to PENDING, PAID or REJECTED.

POST{baseUrl}/{stage}/external/businesses/{businessId}/invoices/update-payment/{invoiceIrn}

Update the payment status of an existing invoice to PENDING, PAID, or REJECTED.

Request

Headers

Content-Typerequired
application/json or */*
Acceptrequired
application/json or */*
X-Business-Keyrequired

Path Parameters

businessIdstring (UUID)required
Your business FIRS ID
invoiceIrnstringrequired
Invoice Reference Number

Query Parameters

invoiceStatusstringrequired
PENDING, PAID, REJECTED

Payment Status Values:

  • PENDING - Invoice awaiting payment
  • PAID - Invoice fully paid
  • REJECTED - Payment declined or rejected

Response

Success (200)

The full success response is in the Response panel.

responseCode
"00" = success
responseMessage
Status update confirmation

Errors

404 - Invoice Not Found

JSON
{
  "responseCode": "404",
  "responseMessage": "Invoice not found with IRN: INV999-INVALID"
}

→ Verify invoiceIrn exists and belongs to businessId

400 - Invalid Status

JSON
{
  "responseCode": "400",
  "responseMessage": "Invalid status value"
}

→ Use only PENDING, PAID, or REJECTED

403 - Unauthorized

JSON
{
  "responseCode": "403",
  "responseMessage": "Unauthorized: Business ID doesn't match invoice owner"
}

→ Ensure correct businessId matches invoice owner

422 - Invalid Transition

JSON
{
  "responseCode": "422",
  "responseMessage": "Status change not permitted"
}

→ Check current invoice status and business rules

Example Requests

Mark as Paid:

cURL
curl -X POST "{baseUrl}/{stage}/external/businesses/b4009129-ece8-45fc-9584-976fcbe35f8d/invoices/update-payment/INV237-1070ECE8-20250826?invoiceStatus=PAID" \
  --header 'X-Business-Key: BK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-DEV-XXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
"

Mark as Pending:

cURL
curl -X POST "{baseUrl}/{stage}/external/businesses/b4009129-ece8-45fc-9584-976fcbe35f8d/invoices/update-payment/INV237-1070ECE8-20250826?invoiceStatus=PENDING" \
  --header 'X-Business-Key: BK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-DEV-XXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
"

Mark as Rejected:

cURL
curl -X POST "{baseUrl}/{stage}/external/businesses/b4009129-ece8-45fc-9584-976fcbe35f8d/invoices/update-payment/INV237-1070ECE8-20250826?invoiceStatus=REJECTED" \
  --header 'X-Business-Key: BK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-DEV-XXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
"

Status Transitions

Typical Flow:

Text
PENDING → PAID (payment received)
PENDING → REJECTED (payment declined)
REJECTED → PENDING (retry payment)

Note: Changing PAID back to PENDING may require special permissions

Common Issues

"Invoice not found" → Verify IRN format and business ownership

"Status change not permitted" → Cannot change PAID invoices back to PENDING without authorization

Status not updating → Check invoice is not cancelled or in final state

Best Practices

  • Log updates - Maintain audit trail of status changes
  • Verify first - Check invoice exists before updating
  • Handle errors - Implement proper error handling for failed updates
  • Reconcile regularly - Match payment status with actual payment records

Security Notes

  • Validate business ownership before status updates
  • Maintain audit logs of who updated status and when
  • Implement rate limiting to prevent abuse