Invoice
Pay Invoice

Pay an invoice

This action allows you to pay an invoice.

API call to pay an invoice.

Authentication Information:

All requests sent to the Payunit REST API must be authenticated. Payunit supports two forms of authentication, both using HTTP Basic Authentication, which uses the following authentication schemes:

  • API USER and API PASSWORD
  • Application token

BASE_URL: https://gateway.payunit.net (opens in a new tab)

HTTP Headers: HTTP header specifications for all API calls.

HTTP HeaderDescription
Content-TypeThe supported content type is application/json
AuthorizationBasic HTTP authentication is Base64 encoded and formatted as follows: Basic Base64(api_user:api_password)
x-api-keyYour application token
modeLive or test mode. Your application's current mode

Request to create a standard invoice on Payunit

curl --location '{{base_url}}/api/gateway/invoice/payment' \
--header 'x-api-key: live_xxxxxxxxxxxxxxx' \
--header 'mode: live' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic xxxxxxxx' \
--data '{
"amount": 120000,
"invoice_id": "25983991-ec59-4f2f-98fc-d67d8f1b783b",
"installment_id": "257a5cfb-ac75-4494-bfdd-ad00a811eceb"
}'
 
'

End point: {BASE_URL}/api/gateway/invoice/create

Request body: POST

Request body:

ParameterRequiredDescription
amountYesThe amount to pay
invoice_idYesThe invoice ID
installment_idNoThe installment ID, required if the invoice type is INSTALLMENT

Response body:

 
{ 
"status": "SUCCESS", 
"statusCode": 200, 
"message": "Payment Initiated", 
"data": { 
"transaction_url": "https://pu.payunit.net/#/hostedPayment/payment?t_id=YTYyNTNlYmNmZWQ0M2VkNmFkY2E3Zjg2ZTg5NWQyMjY3NTMwZjE=&t_sum=YzM1NDU3YzU4MA==&t_url=OWUxMDEzODVjM2I4MjBjZWZkODcyYWQ3YjI5OGQwNjAyNjcwYTRiMWRiODlkNDVmZjFkZWI0MjU5NTlmZTE5ZTk5M2JjNzUxMWM1ODYwYTZlZWNjMGE1YmQ4NjU3NTUyYzZiMmM5ZjRlY2EwNzZmNjE2OTdjZGRiZDM=",
"transaction_id": "PAYINV1749136xxxx",
"reference_id": "INSTALLMENT170307562xxx"
}
}
ParameterDescription
statusThe transaction status.
statusCodeThe transaction status code.
messageThe API return message.
dataThe data returned by the API
transaction_urlThe payment link
Last updated on June 6, 2025