Skip to main content

Audience:

Developers

Cancel a funding source

Cancel a funding source with the API; canceling the source also cancels its direct debit mandate.

Prerequisites

Guide

  1. Call the cancelFundingSource mutation.
  2. Enter the ID for the funding source you'd like to cancel.
  3. Add the success payload and rejections.

Mutation

Open in API Explorer
mutation CancelSource {
cancelFundingSource(input: { id: "$YOUR_FUNDING_SOURCE_ID" }) {
... on CancelFundingSourceSuccessPayload {
__typename
fundingSource {
statusInfo {
status
}
}
}
... on ForbiddenRejection {
__typename
message
}
... on NotFoundRejection {
id
message
}
}
}

Payload

The payload shows that the funding source is Canceled and can't be used anymore. The direct debit mandate is Canceled automatically after the funding source is Canceled.

{
"data": {
"cancelFundingSource": {
"__typename": "CancelFundingSourceSuccessPayload",
"fundingSource": {
"statusInfo": {
"status": "Canceled"
}
}
}
}
}