Delete Invoice

The API endpoint for deleting an invoice is the following:

DELETE /api/v2/invoices/:key:

Request

curl -X DELETE https://secure.usaepay.com/api/v2/invoices/7skjkdcxz7800mz3
  -H "Content-Type: application/json"
  -H "Authorization: Basic X1Y4N1F0YjUxM0NkM3ZhYk03UkMwVGJ0SldlU284cDc6czIvYWJjZGVmZ2hpamtsbW5vcC9iNzRjMmZhOTFmYjBhMDk3NTVlMzc3ZWU4ZTIwYWE4NmQyYjkyYzNkMmYyNzcyODBkYjU5NWY2MzZiYjE5MGU2"

This cURL request is an example of a request to delete a specific invoice.

Response

{
    "status": "success"
}

This is the sample response object sent back from the server.

Parameters

Request

The request parameters are listed below

Parameter Required Type Description
key Required string Invoice identifier generated by gateway.

Response

Parameter Description
status If invoice is sent then status will be returned as success. If invoice is not sent, an error will be returned instead.

Errors

Code Message Description
49 Merchant ID Mismatch for record locator key Invoice does not belong to this merchant
3003 Unable To Delete Invoice. Please Contact Support. Unable to delete one or more Invoices due to current status.
3007 Unable to delete Invoice due to current status
3008 Unable to delete Invoice due to current status Invoice has already been cancelled or Cannot cancel invoice that has not been sent.
19001 The field '[field]' is required. Field is invalid.
21003 Access Denied You do not have the permission to perform this action.
99999 Invoice Not Found The invoice key is incorrect.

Change Log

Date Change
2018-02-27 Added page.

Click here for the full REST API change log.