Assigning Payment Methods
This guide is for developers looking to assign both card and bank account payment methods via the Payarc API.
OverviewThis guide explains how to collect card and bank account details and assign them to a customer record for future use. By following these steps, sensitive payment data is handled safely while enabling future transactions. There are two paths: assigning a card (via tokenization) or assigning a bank account to a customer record.
Prerequisites
Before you begin, make sure you have:
- A valid Bearer token from Partner Hub— see API Authentication
- Access to the sandbox / test environment
- A customer record already created and its
customer_id— see Create Customer - A test card — see Test Cards
- A test bank account — see Test Bank Account
Option 1: Assign a Card
Step 1: Tokenize a Card
To securely assign card details, you must first tokenize the card using our Tokens API. Tokenization establishes a secure token that can safely be assigned and used for future transactions.
-
To tokenize a card, see the API Reference here
-
What you get back: The API response includes a token
id. This tokenidis required when attaching the card to a customer.
Tip: Be sure to use our test cards when working in the sandbox environment.
Step 2: Update Customer with Token
Update an existing customer record to securely attach the tokenized card, enabling it for future transactions.
- To assign a card to a customer record, see the API Reference here
- What you get back: The API response includes the updated customer object, with an assigned tokenized that can be used for future transactions.
Option 2: Assign a Bank Account
Step 1: Create and Assign a Bank Account
You can create a bank account and assign it to a customer record with a single API call by using the customer_id field. This allows you to securely save the customer’s ACH/bank details for future transactions.
- To create a bank account and assign it to a customer record, see the API Reference here
- What you get back: The API response will include a BankAccount object with a unique
id. Thisidrepresents the assigned bank account and can be used when creating an ACH charge.
Tip: Be sure to populate the
customer_idfield with thecustomer_idfrom the prerequisite.