Cancel a Transaction
POSThttps://useast.api.elasticpath.com/v2/orders/:orderID/transactions/:transactionID/cancel
Use this endpoint to cancel or void a pending or authorized transaction. The transaction can be canceled or voided when it is in pending
and completed
statuses.
caution
This endpoint works only for Stripe and PayPal and does not work for manual gateway.
Request
Path Parameters
orderID stringrequired
The unique identifier of the order.
transactionID stringrequired
The unique identifier of the transaction to be canceled or voided.
- application/json
Body
data object
Responses
- 200
- 401
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
data object
{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"reference": "string",
"name": "string",
"custom_reference": "string",
"gateway": "adyen",
"amount": 0,
"refunded_amount": 0,
"currency": "string",
"transaction-type": "string",
"status": "string",
"relationships": {
"order": {
"data": {
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
},
"meta": {
"display_price": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"display_refunded_amount": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"timestamps": {
"created_at": "string"
}
}
}
}
Unauthorized
- application/json
- Schema
- Example (from schema)
- Example
Schema
detail string
status string
title string
[
null
]
{
"errors": {
"status": 401,
"title": "Unauthorized"
}
}
Authorization: http
name: bearerAuthtype: httpscheme: bearer
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://useast.api.elasticpath.com/v2/orders/:orderID/transactions/:transactionID/cancel' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"data": {
"options": {},
"reason": "string"
}
}'
ResponseClear