- REST APIs
- Welcome
- Card Payments
- 3D Secure 2
- Vault
- Getting Started
- Using the API
- Typical API Calls
- Verify That the Service Is Accessible
- Create a Profile for a Customer
- Add an Address to a Profile
- Add a Card to a Profile
- Add a Bank Account to a Profile
- Create an Apple Pay Single-Use Token
- Create a Google Pay Single-Use Token
- Create a Mobile Single-Use Token
- Create a Direct Debit Single-Use Token
- Process a Transaction Using a Payment Token
- API Reference
- Test and Go Live
- Direct Debit
- Apple Pay
- Google Pay
- Alternate Payments
- Reports API
- ISV Reports
- Platforms
- Overview
- Accounts API V1
- Getting Started
- Using the API
- Typical API Calls
- Verify That the Service Is Accessible
- Create a New Merchant
- Create a New Merchant Account
- Create a New User
- Add an Address
- Create a Business Owner
- Add a Business Owner Address
- Add a Business Owner Identity Document
- Add a Merchant Bank Account
- Accept Our Terms and Conditions
- Activate the New Merchant Account
- Validate the Bank Account
- Enable Webhooks to Receive Application Statuses
- Test and Go Live
- Subaccounts
- Applications API
- Split Payouts
- Balance Transfers
- Paysafe Payments API
- Paysafe Checkout
- Paysafe JS
- Payments API
- Bad Bin API
- Reference Information
- SDKs
- Mobile SDKs
- Additional Documentation
- Resources and Support
- Shopping Carts
- Classic APIs
- Glossary
Cancel a Pending Order
DELETE /hosted/v1/orders/order_id
To cancel a pending order through the Hosted Payments API, submit a DELETE request as follows:
Request Example
curl -X DELETE \
-u jTxL2wsNysJ8Jzmpdwim:NAA043a7c53c66ac3826c5e \
https://api.test.netbanx.com/hosted/v1/orders/25TWPTLHRR81AIG1LF
It is possible to cancel an order only prior to it being processed. If an order has been processed or is "in flight", the cancel request will fail.
Assuming the cancellation request has been successfully processed, the following response will be returned:
Response Example
{
"currencyCode" : "GBP",
"extendedOptions" : [],
"link" : [
{
"rel" : "self",
"uri" : "https://jTxL2wsNysJ8Jzmpdwim:NAA043a7c53c66ac3826c5e@api.test.netbanx.com/hosted/v1/orders/25TWPTLHRR81AIG1LF"
}
],
"merchantRefNum" : "ABCDE12345",
"id" : "25TWPTLHRR81AIG1LF",
"totalAmount" : 1000,
"transaction" : {
"amount" : 1000,
"associatedTransactions" : [],
"authType" : "purchase",
"settled" : false,
"currencyCode" : "GBP",
"lastUpdate" : "2012-06-01T17:12:14",
"merchantRefNum" : "ABCDE12345",
"paymentType" : "card",
"refunded" : false,
"status" : "cancelled"
}
}
The status parameter in the response contains the confirmation that the request has been cancelled.
If you attempt to cancel an order that has already been processed, the cancellation request will fail and you will need to submit a refund request.