Skip to main content

Cancel Invoice

An invoice is a document you provide to your client after they purchase goods or services from you. It serves to both record the sale and request payment. For detailed information about PayTabs invoices, please refer to our articleWhat is PayTabs Invoice?



In this manual, we will guide you on the correct method to change the status of any invoice to "canceled" using the specified endpoint. We strongly recommend that you and your team review theInvoices | Payment Workflowmanual first to grasp the business logic behind this integration type.


In this tutorial, we will rely on the PayTabs cancel Transaction API Endpoint, mentioned on the PayTabs API endpoints postman collection, which you can access fromhere. The endpoint will need to be accessed with a POST request on the below-mentioned URL

POST{{domain}}payment/invoice/{{invoice_id}}/cancel
Be Aware Of

Please note that not using the proper endpoint URL {domain} will lead to authentication issues within your responses. To find the your proper domain you can read ourWhat is my (Region)/(endpoint URL)?tutorial article.

https://secure.paytabs.sapayment/invoice/{{invoice_id}}/cancel

How to Cancel Invoice ?


Once your invoice is initiated, it can be classified as one of three statuses: "paid," "pending," or "canceled." For more information on invoice statuses, please refer to our invoice status manual. This article specifically outlines the proper method for changing the status of a particular invoice using the Invoice Cancel request.



The Minimum Required Parameters

To initiate a query invoice request, there are minimum required parameters that need to be passed with valid information. The specification of these required parameters is clarified below according to the query type:

In the PUT request type, you can cancel the status by sending a PUT request with only the { invoice_id } as a parameter in the URL. Below is a sample request that demonstrates how to cancel an invoice with the ID "2075865."

Alt text

Sample Request Payloads

As we mentioned before, you can cancel the status by sending a PUT request with only the { invoice_id } as a parameter in the URL. Below is a sample request that demonstrates how to cancel an invoice with the ID "2075865."

Alt text

Sample Response Payloads

{
"message": "Invoice has been cancelled"
}

We are glad to be always in help. We aim to serve you better each time. As such, please spare a minute to share feedback about your recent experience with PayTabs Developers , on Trustpilot, or Google Reviews.