Swaps
Cancel swap
Cancels a swap in awaiting_deposit status. Requires api:write scope and Idempotency-Key.
POST
/
swaps
/
{swapId}
/
cancel
Cancel swap
curl --request POST \
--url http://localhost:4000/v1/swaps/{swapId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('http://localhost:4000/v1/swaps/{swapId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:4000/v1/swaps/{swapId}/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text){
"status": "error",
"message": "Swap cannot be cancelled in current status"
}Authorizations
API key created in the Remitflex Dashboard at dashboard.remitflex.io (rmf_live_... or rmf_test_...).
Key management endpoints require a dashboard JWT and are not part of this reference.
Headers
Unique key for safe retries on mutating API-key requests. Cached for 24 hours per org, method, and path.
Maximum string length:
255Example:
"7f3c2a1b-4e5d-6c7b-8a9f-0e1d2c3b4a5f"
Path Parameters
RemitFlex swap UUID (id from POST /swaps or GET /swaps).
Response
Swap cancelled
⌘I
Cancel swap
curl --request POST \
--url http://localhost:4000/v1/swaps/{swapId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('http://localhost:4000/v1/swaps/{swapId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:4000/v1/swaps/{swapId}/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text){
"status": "error",
"message": "Swap cannot be cancelled in current status"
}