Recalling Payment Method
This guide will walk you through calling back payment method tokens for a specific payor using our API.
Understanding the payment method token object
Payment Method Tokens are meant to store info that represents a tokenized Bank Account, Credit Card, or Debit Card.
This is what the token object looks like
javascript
{
payment_method_id: String
merchant_uid: String
payor: Payor
payment_type: PaymentType
last_four: String
exp_date: String
full_name: String
}
| Key | type | description |
|---|---|---|
| payment_method_id | string | The unique payment method id. |
| merchant_uid | string | The Pay Theory unique identifier assigned to the merchant that the payment_method_token belongs to. |
| payor | PayorObject | The payor object. Refer to the Payor docs for more info. |
| payment_type | PaymentType | The type of payment method.
|
| last_four | string | The last four digits of the card or bank account number. |
| exp_date | string | The expiration date of the card. Null if the payment_type is not a card. Format: MMYY |
| full_name | string | The name on the card or bank account. |
How to query payment method tokens for a payor
Tokens are used to reference a payment method and enable transactions rather than managing credit card numbers and bank account information directly.
Additional Query information
If you are unfamiliar with query writing, you can learn about fundamental query structure from the information provided below.
View Query DetailsGraphQL
const GET_PAYMENT_METHOD_TOKENS = gql`
query paymentMethodTokens(direction: FORWARD, limit: 10, query:{
query_list:[{
key: "exp_date",
value: "05%",
operator : LIKE
conjunctive_operator: OR_NEXT
},
{
key: "card_brand",
value: "DISCOVER",
operator: EQUAL
}]
})
{
items {
payment_method_id
merchant_uid
payor(query_list: [QueryPair]) {
payor_id
...
}
payment_type
last_four
exp_date
card_brand
full_name
}
total_row_count
}
The output response will come back in JSON format as an array of payment method token objects under the items key.
Next Steps
You can also refer to how to make one time payment Transaction