This API enables you to collect payment for an invoice by using a guest's previously-saved credit or debit card.
You must specify appropriate details for the invoice_id
parameter in the request URL. In addition, you must specify necessary details for the account_id
and center_id
in the API request body, and this API will collect online payment for the invoice.
If the guest's credit/debit card requires a Three-Domain Secure (3D S) authentication, you must pass the redirect_uri
parameter in the API request. Furthermore, if a hosted_payment
value is generated in the API response, you will be redirected to the redirect_uri
to collect the 3D S card payment.
In addition, you can use this API to either add a tip amount while taking payment for the invoice amount or charge only the tip amount for an invoice, after the invoice payment has been completed.
For example, if the amount of an invoice is $100 and the tip amount is $15, you can charge a total of $115 from the guest's card at one go. Alternatively, you can first complete the invoice payment of $100 and then add the $15 tip amount.
After you have taken payment for the invoice amount and tip amount, you can close the invoice.
Response details
Name | Type | Description |
---|---|---|
invoice_transaction_id | guid | Transaction id of the invoice payment. |
token_id | string | Token or Reference number for processing the online payment transaction. |
hosted_payment_uri | string | Represents the hosted payment URI that redirects the cardholder to the 3D S screen. |
success | boolean | Indicates whether the online invoice payment has been successfully collected. |
error | object | Object that contains error message and error code details. For more information, refer to the error Object table. |
error Object
code | message |
---|---|
418 | Invoice with id : not found. |
460 | Payment is already made in full. |
4023 | Something Went Wrong. |