Payment Cancellation Webhook
In this article, you will learn how to set up the Payment Cancellation webhook and enable email notifications to notify salespeople if there is an error during the synchronization process with an external system so they take appropriate action.
User Roles: Admin and Setup.
Step one: Create the Payment Cancellation Webhook in Your System
When creating the endpoint in your system, it is important to consider the following details:
URL: https://theexternalsystem.com
Content-Type: application/JSON
Method: POST
companyId (integer)
Company ID.
paymentId (integer)
Payment ID.
paymentNumber (string)
Payment number.
{
"companyId": 6316,
"paymentId" : 222125,
"paymentNumber": "2271"
}
{
"companyId": 6316,
"paymentId" : 222125,
"paymentNumber": "2271",
"orderIds": "17899,17900"
}Response
Content-Type: application/JSON
Body
status (boolean)
Result of the request.
Valid values: 0 = Error | 1 = Success
message (string)
This parameter allows you to enter a customized message describing the status. The message will be reflected in Komet Sales.
Response Example
{
"status":"1",
"message":"<<Custom Success Message>>"
Step two: Set up the Payment Cancellation Webhook
Once you have created the endpoint in your system, you need to add it to your Komet Sales account.
To add your endpoint, do the following instructions:
Go to Setup and select Settings.
Click on Webhooks from the Integrations group of settings.
Select Payment Cancellation from the dropdown list.
Enter the URL that Komet Sales will call when this webhook is triggered.
Select your authentication type:
Basic. Enter your username and password.
Bearer Token. Enter your authentication token.
Enter the email addresses that the system will notify when an error occurs in the external system in the Error Notification field. You can enter up to 5 email addresses.
Click on Save.
This URL is the one you created from your external system in step one.
Error Notification sample
This is an example of the email notification the users will receive.