Delete payment method

This API is used to delete a saved card or bank account.

It returns the deleted ID. The method no longer appears in List payment methods and can no longer be used for transfers.

Note: For a bank account the token is also deleted at the gateway; if the gateway rejects it, nothing is deleted and the error is returned.

URL

{{interface_url}}/{{version}}/customers/{{customer_id}}/payment-methods/{{payment_method_id}}

Method

DELETE

Headers

Authorization: Bearer {access_token} (or Api-Key)

Request Parameters

None.

URL Parameters

ParameterRequired/OptionalTypeDescription
customer_idRequiredIntegerOur customer ID (id returned by Create customer).
payment_method_idRequiredIntegerPayment method ID (id returned by List payment methods).

Example Request (cURL)

curl --location --request DELETE '{{interface_url}}/{{version}}/customers/{{customer_id}}/payment-methods/{{payment_method_id}}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{access_token}}'

Example Response (JSON) — 200

{
  "id": 90311,
  "deleted": true
}

Error Responses

Format: { "error": { "code", "name", "message", "details" } }

StatusErrorWhen
404payment_method_not_foundWrong ID, or not in your scope.
4xx / 5xxexternal_api_errorThe gateway could not delete the bank account token.


Path Params
string
required
string
required
string
required
Response

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here!