Edit in GitHubLog an issue

deletePaymentToken mutation

The deletePaymentToken mutation deletes a payment token from the system. Use the customerPaymentTokens query to retrieve all stored payment methods associated with a particular customer.

Syntax

Copied to your clipboard
mutation {
deletePaymentToken(
public_hash: String!
) {
DeletePaymentTokenOutput
}
}

Reference

The deletePaymentToken reference provides detailed information about the types and fields defined in this mutation.

Example usage

The following example deletes the Discover Card listed in the results of the customerPaymentTokens query. The public_hash you specify will be unique to your application.

Request:

Copied to your clipboard
mutation {
deletePaymentToken(
public_hash: "377c1514e0..."
) {
result
customerPaymentTokens {
items {
details
public_hash
payment_method_code
type
}
}
}
}

Response:

Copied to your clipboard
{
"data": {
"deletePaymentToken": {
"result": true,
"customerPaymentTokens": {
"items": [
{
"details": "{\"type\":\"VI\",\"maskedCC\":\"1111\",\"expirationDate\":\"09\\/2022\"}",
"public_hash": "f5816fe2ab...",
"payment_method_code": "braintree",
"type": "card"
}
]
}
}
}
}

Errors

ErrorDescription
Could not find a token using public hash: xxxxxxxx
The customer token specified in the public_hash argument does not exist in the vault_payment_token table.
The current customer isn't authorized.
The current customer is not currently logged in, or the customer's token does not exist in the oauth_token table.

customerPaymentTokens query

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.