Cancel a payout
client.payouts.cancel(stringid, PayoutCancelParams { reason, correlationID, idempotencyKey, 2 more } params, RequestOptionsoptions?): PayoutV1 { data, meta, response_type }
/v1/payouts/{id}/cancel
Cancel a payout to prevent it from being processed. The status of the payout must be created, scheduled, or on_hold.
Parameters
id: string
Returns
Cancel a payout
import Straddle from '@straddlecom/straddle';
const client = new Straddle({
apiKey: 'My API Key',
});
const payoutV1 = await client.payouts.cancel('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { reason: 'reason' });
console.log(payoutV1.data);
{
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"amount": 10000,
"config": {
"sandbox_outcome": "standard"
},
"currency": "currency",
"description": "description",
"device": {
"ip_address": "192.168.1.1"
},
"external_id": "external_id",
"funding_ids": [
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
],
"paykey": "paykey",
"payment_date": "2019-12-27",
"status": "created",
"status_details": {
"changed_at": "2019-12-27T18:11:19.117Z",
"message": "Payment successfully created and awaiting validation.",
"reason": "insufficient_funds",
"source": "system",
"code": null
},
"status_history": [
{
"changed_at": "2019-12-27T18:11:19.117Z",
"message": "Payment successfully created and awaiting validation.",
"reason": "insufficient_funds",
"source": "watchtower",
"status": "created",
"code": null
}
],
"created_at": "2019-12-27T18:11:19.117Z",
"customer_details": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"customer_type": "individual",
"email": "ron@swanson.com",
"name": "Ron Swanson",
"phone": "+1234567890"
},
"effective_at": "2019-12-27T18:11:19.117Z",
"metadata": {
"foo": "string"
},
"paykey_details": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"customer_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"label": "Bank of America ****1234",
"balance": 0
},
"payment_rail": "ach",
"processed_at": "2019-12-27T18:11:19.117Z",
"updated_at": "2019-12-27T18:11:19.117Z"
},
"meta": {
"api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"api_request_timestamp": "2019-12-27T18:11:19.117Z"
},
"response_type": "object"
}Returns Examples
{
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"amount": 10000,
"config": {
"sandbox_outcome": "standard"
},
"currency": "currency",
"description": "description",
"device": {
"ip_address": "192.168.1.1"
},
"external_id": "external_id",
"funding_ids": [
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
],
"paykey": "paykey",
"payment_date": "2019-12-27",
"status": "created",
"status_details": {
"changed_at": "2019-12-27T18:11:19.117Z",
"message": "Payment successfully created and awaiting validation.",
"reason": "insufficient_funds",
"source": "system",
"code": null
},
"status_history": [
{
"changed_at": "2019-12-27T18:11:19.117Z",
"message": "Payment successfully created and awaiting validation.",
"reason": "insufficient_funds",
"source": "watchtower",
"status": "created",
"code": null
}
],
"created_at": "2019-12-27T18:11:19.117Z",
"customer_details": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"customer_type": "individual",
"email": "ron@swanson.com",
"name": "Ron Swanson",
"phone": "+1234567890"
},
"effective_at": "2019-12-27T18:11:19.117Z",
"metadata": {
"foo": "string"
},
"paykey_details": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"customer_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"label": "Bank of America ****1234",
"balance": 0
},
"payment_rail": "ach",
"processed_at": "2019-12-27T18:11:19.117Z",
"updated_at": "2019-12-27T18:11:19.117Z"
},
"meta": {
"api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"api_request_timestamp": "2019-12-27T18:11:19.117Z"
},
"response_type": "object"
}