Save a Payment Method
Learn how to use the Payabli API to add and manage saved payment methods
This guide explains how to save a payment method for reuse via tokenization with the Payabli API. This call exchanges sensitive payment information for a token that you can use to process future transactions. The response returns a ReferenceId
, which is both the storedMethodId
to use with transactions, and the methodId
used to manage the payment method.
You can also use the Payabli API to:
See Tokenization and Saved Payment Methods Overview for more information on how tokenization works.
PCI information
Because improperly handling customer card data can result in fines and impact your ability to process transactions, you must understand and fulfill PCI security requirements. When using the direct-access APIs, you must make sure that your systems and practices meet PCI requirements.
If you have any questions about how to maintain PCI compliance, reach out to the Payabli team.
Build the request
First, choose an endpoint. If you’re testing, use the Sandbox endpoint. for your target environment. Make sure you use the right token for your selected environment.
Authenticate
Authenticate by sending your API token in the request header with the key requestToken
:
--header 'requestToken: API TOKEN'
Query parameters
For a full list of available parameters, see the API reference for this endpoint.
This request has query parameters.
Creates a temporary, one-time-use token for the payment method that expires in 12 hours.
When true
, enables real-time validation of ACH account. This is an add-on feature. Contact Payabli for more information.
When true
, the request creates a new customer record, regardless of whether the customer data matches an existing customer.
When true
, the request doesn’t require customer information, and creates the token with no customer information attached. When the token is used to make a payment for the first time, it will be associated to the customer making the payment.
Body parameter
This request has several available required fields in the body parameter.
Example request
Each example saves a payment method for a customer named John Doe.
Response
A successful request returns a 200 response with a JSON body. The value in “ReferenceId” is both the storedMethodId
for transactions, and the methodId
for managing the payment method.
Was this page helpful?