post https://api.zenoti.com/v1/invoices//online_payments
This API helps you to charge a tip amount for the specified invoice from a guest's saved credit/debit card.
You can add the tip while taking payment for the invoice amount. You can also 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.
You must provide appropriate data for the invoice_id
parameter.
Request Body Details
Name | Type | Description |
---|---|---|
account_id | guid | Unique 32-character ID of the guest's saved card, if the tip amount is to be charged from a saved card. This is an optional parameter. |
center_id | guid | Unique 32-character ID of the center. |
tip_amount | decimal | Tip amount charged from the guest's card. |
Reponse Details
Name | Type | Description |
---|---|---|
invoice_transaction_id | guid | Unique 32-character ID of the invoice payment. |
token_id | string | Token to initialize the charging of the tip amount as part of the invoice payment. |
success | boolean | If true , it indicates that the tip amount was successfully charged by using the guest's card. |
Error Message Details
Error Message | Error Code | Description |
---|---|---|
InvalidInput | 502 | If the request is not valid. |
MissingInput | 503 | If the invoice_id is not specified. |
InvoiceNotFound | 418 | If the invoice_id could not be found. |
ApiPaymentCannotBeAddedForClosedInvoice | 728 | If the invoice has already been closed. Tips cannot be added for a closed invoice. |
MissingInput | 503 | If the center_id is not valid. |
UserNotFound | 405 | If the guest could not be found. |
UserNotAuthorized | 438 | If the Zenoti user does not have the permissions to charge tips from the guest's card. |
PaymentIsAlreadyMade | 460 | If the guest has already paid the invoice amount. |
InvoiceinGroup | 928 | If the invoice is associated to a group. Payment cannot be added for an invoice that is associated to a group. |
CardReaderNotFound | 900 | If the payment configuration of the card reader has not been done. |
PaymentAccountNotFound | 421 | If the payment account with ID as PaymentaccountID was not found. |
InvoiceDeteleted | 912 | If the invoice has already been deleted. |
PaymentAmountMoreThanDue | 913 | If the payment amount is more than the due amount. You must reload the invoice and then proceed. |
ScheduleAlreadyCollected | 914 | If the payment for this schedule of the employee has already been processed. |
SomethingWentWrong | 4023 | If it was not possible to initiate the credit card payment for the guest. |