> For the complete documentation index, see [llms.txt](https://docs.alternativepayments.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.alternativepayments.io/api-reference/payment-methods.md).

# Payment Methods

## Register CVV for a card payment

> Register an encrypted CVV token for a specific card and invoice

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.2.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":["payments:write"]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"checkout:read":"Read checkout data","checkout:write":"Create checkout tokens","customers:read":"Read customers and payment methods","customers:write":"Create and update customers and payment methods","invoices:read":"Read invoices","invoices:write":"Create and update invoices","payments:read":"Read payments and payment requests","payments:write":"Create payments and payment requests","payouts:read":"Read payouts","refunds:read":"Read refunds","refunds:write":"Create refunds","tags:read":"Read customer tags","tags:write":"Create, update and delete customer tags, and add or remove them on customers","webhooks:read":"Read webhook subscriptions and events","webhooks:write":"Manage webhook subscriptions"}}}}},"schemas":{"CreateCardCvvResponse":{"description":"Create card CVV response","properties":{"success":{"type":"boolean"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"},"CreateCardCvvInput":{"description":"CVV registration information","properties":{"cvv_secret":{"type":"string"},"product_id":{"type":"string"},"product_type":{"enum":["invoice"],"type":"string"},"provider":{"enum":["evervault"],"type":"string"}},"type":"object"}}},"paths":{"/customers/{id}/payment-methods/{card_id}/cvv":{"post":{"description":"Register an encrypted CVV token for a specific card and invoice","operationId":"verifyCardCvv","parameters":[{"schema":{"type":"string"},"description":"Customer ID","in":"path","name":"id","required":true},{"schema":{"type":"string"},"description":"Card ID","in":"path","name":"card_id","required":true}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCardCvvResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Register CVV for a card payment","tags":["PaymentMethods"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCardCvvInput"}}},"description":"CVV registration information","required":true}}}}}
```

## Calculate card payment fees

> Calculate payment fees for a specific card payment method

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.2.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":["customers:read"]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"checkout:read":"Read checkout data","checkout:write":"Create checkout tokens","customers:read":"Read customers and payment methods","customers:write":"Create and update customers and payment methods","invoices:read":"Read invoices","invoices:write":"Create and update invoices","payments:read":"Read payments and payment requests","payments:write":"Create payments and payment requests","payouts:read":"Read payouts","refunds:read":"Read refunds","refunds:write":"Create refunds","tags:read":"Read customer tags","tags:write":"Create, update and delete customer tags, and add or remove them on customers","webhooks:read":"Read webhook subscriptions and events","webhooks:write":"Manage webhook subscriptions"}}}}},"schemas":{"GetCardPaymentFeesResponse":{"description":"Response containing calculated payment fees for card payments","properties":{"fee_percentage_for_customer":{"type":"string"},"fee_percentage_for_partner":{"type":"string"},"fixed_fee_amount_customer":{"type":"string"},"fixed_fee_amount_partner":{"type":"string"},"relative_fee_amount_customer":{"type":"string"},"relative_fee_amount_partner":{"type":"string"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"},"GetCardPaymentFeesRequest":{"description":"Request body for calculating card payment fees","properties":{"amount":{"type":"string"},"currency":{"enum":["USD","CAD"],"type":"string"}},"type":"object"}}},"paths":{"/customers/{id}/payment-methods/{card_id}/fees":{"post":{"description":"Calculate payment fees for a specific card payment method","operationId":"getCardPaymentFees","parameters":[{"schema":{"type":"string"},"description":"Customer ID","in":"path","name":"id","required":true},{"schema":{"type":"string"},"description":"Card ID","in":"path","name":"card_id","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCardPaymentFeesResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Calculate card payment fees","tags":["PaymentMethods"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCardPaymentFeesRequest"}}},"description":"Fee calculation request","required":true}}}}}
```

## Delete a customer's payment method

> Delete this payment method

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.2.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":["payments:write"]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"checkout:read":"Read checkout data","checkout:write":"Create checkout tokens","customers:read":"Read customers and payment methods","customers:write":"Create and update customers and payment methods","invoices:read":"Read invoices","invoices:write":"Create and update invoices","payments:read":"Read payments and payment requests","payments:write":"Create payments and payment requests","payouts:read":"Read payouts","refunds:read":"Read refunds","refunds:write":"Create refunds","tags:read":"Read customer tags","tags:write":"Create, update and delete customer tags, and add or remove them on customers","webhooks:read":"Read webhook subscriptions and events","webhooks:write":"Manage webhook subscriptions"}}}}},"schemas":{"DeletePaymentMethodResponse":{"description":"Delete a payment method","properties":{"response":{"type":"string"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}}},"paths":{"/customers/{id}/payment-methods/{method_id}":{"delete":{"description":"Delete this payment method","operationId":"deletePaymentMethod","parameters":[{"schema":{"type":"string"},"description":"Customer ID","in":"path","name":"id","required":true},{"schema":{"type":"string"},"description":"Payment Method ID","in":"path","name":"method_id","required":true}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePaymentMethodResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Delete a customer's payment method","tags":["PaymentMethods"]}}}}
```

## Change a customer's default payment method

> Change the customer's default payment method to this one

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.2.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":["payments:write"]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"checkout:read":"Read checkout data","checkout:write":"Create checkout tokens","customers:read":"Read customers and payment methods","customers:write":"Create and update customers and payment methods","invoices:read":"Read invoices","invoices:write":"Create and update invoices","payments:read":"Read payments and payment requests","payments:write":"Create payments and payment requests","payouts:read":"Read payouts","refunds:read":"Read refunds","refunds:write":"Create refunds","tags:read":"Read customer tags","tags:write":"Create, update and delete customer tags, and add or remove them on customers","webhooks:read":"Read webhook subscriptions and events","webhooks:write":"Manage webhook subscriptions"}}}}},"schemas":{"ChangeDefaultResponse":{"description":"Change default method response","properties":{"response":{"type":"string"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}}},"paths":{"/customers/{id}/payment-methods/{method_id}/default":{"patch":{"description":"Change the customer's default payment method to this one","operationId":"setDefaultPaymentMethod","parameters":[{"schema":{"type":"string"},"description":"Customer ID","in":"path","name":"id","required":true},{"schema":{"type":"string"},"description":"Payment Method ID","in":"path","name":"method_id","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeDefaultResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Change a customer's default payment method","tags":["PaymentMethods"]}}}}
```

## Create a customer bank account

> Create a new bank account with the provided information. Only one of USAccountData or CAAccountData must be sent, matching AccountDataType.

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.2.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":["payments:write"]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"checkout:read":"Read checkout data","checkout:write":"Create checkout tokens","customers:read":"Read customers and payment methods","customers:write":"Create and update customers and payment methods","invoices:read":"Read invoices","invoices:write":"Create and update invoices","payments:read":"Read payments and payment requests","payments:write":"Create payments and payment requests","payouts:read":"Read payouts","refunds:read":"Read refunds","refunds:write":"Create refunds","tags:read":"Read customer tags","tags:write":"Create, update and delete customer tags, and add or remove them on customers","webhooks:read":"Read webhook subscriptions and events","webhooks:write":"Manage webhook subscriptions"}}}}},"schemas":{"CreateBankAccountResponse":{"description":"Create bank account response","properties":{"id":{"type":"string"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"},"CreateBankAccountInput":{"description":"Bank account information. Only one of USAccountData or CAAccountData must be sent, matching AccountDataType.","properties":{"account_data_type":{"enum":["us","ca"],"type":"string"},"ca_account_data":{"$ref":"#/components/schemas/payment_methods_api.CAAccountData"},"custom_name":{"type":"string"},"institution_name":{"type":"string"},"receiver_name":{"type":"string"},"subtype":{"enum":["checkings","savings"],"type":"string"},"type":{"enum":["depository"],"type":"string"},"us_account_data":{"$ref":"#/components/schemas/payment_methods_api.USAccountData"}},"type":"object"},"payment_methods_api.CAAccountData":{"properties":{"account_number":{"type":"string"},"institution_code":{"type":"string"},"transit_number":{"type":"string"}},"type":"object"},"payment_methods_api.USAccountData":{"properties":{"account_number":{"type":"string"},"routing_number":{"type":"string"}},"type":"object"}}},"paths":{"/customers/{id}/payment-methods/bank":{"post":{"description":"Create a new bank account with the provided information. Only one of USAccountData or CAAccountData must be sent, matching AccountDataType.","operationId":"createBankPaymentMethod","parameters":[{"schema":{"type":"string"},"description":"Customer ID","in":"path","name":"id","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBankAccountResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Create a customer bank account","tags":["PaymentMethods"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBankAccountInput"}}},"description":"BankAccount information","required":true}}}}}
```

## Create a customer card

> Create a new card with the provided tokenized information

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.2.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":["payments:write"]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"checkout:read":"Read checkout data","checkout:write":"Create checkout tokens","customers:read":"Read customers and payment methods","customers:write":"Create and update customers and payment methods","invoices:read":"Read invoices","invoices:write":"Create and update invoices","payments:read":"Read payments and payment requests","payments:write":"Create payments and payment requests","payouts:read":"Read payouts","refunds:read":"Read refunds","refunds:write":"Create refunds","tags:read":"Read customer tags","tags:write":"Create, update and delete customer tags, and add or remove them on customers","webhooks:read":"Read webhook subscriptions and events","webhooks:write":"Manage webhook subscriptions"}}}}},"schemas":{"CreateCardResponse":{"description":"Create card response","properties":{"id":{"type":"string"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"},"CreateCardInput":{"description":"Tokenized card information","properties":{"address":{"$ref":"#/components/schemas/AddressInput"},"card_provider_token":{"type":"string"},"custom_name":{"type":"string"},"provider":{"enum":["evervault"],"type":"string"}},"type":"object"},"AddressInput":{"description":"Address information","properties":{"city":{"type":"string"},"country":{"type":"string"},"country_code":{"type":"string"},"postal_code":{"type":"string"},"state":{"type":"string"},"state_code":{"type":"string"},"street_address":{"type":"string"},"subpremise":{"type":"string"}},"type":"object"}}},"paths":{"/customers/{id}/payment-methods/card":{"post":{"description":"Create a new card with the provided tokenized information","operationId":"createCardPaymentMethod","parameters":[{"schema":{"type":"string"},"description":"Customer ID","in":"path","name":"id","required":true}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCardResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Create a customer card","tags":["PaymentMethods"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCardInput"}}},"description":"Card information","required":true}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.alternativepayments.io/api-reference/payment-methods.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
