Pay By Card

This guide is for developers integrating card payments - either against an existing customer record or as a one-time payment.

📰

Overview

This guide walks through creating and capturing a card payment using the Payarc API. It covers two paths: charging a card already associated with an existing customer record, and submitting a one-time card charge without any prior customer profile. Both paths result in a Charge object that confirms the payment. Choose the path that matches your integration model before you begin.

Prerequisites

Before you begin, make sure you have:


Option 1: Existing Customer

💡

Tip: Option 1 is the right path when you want to assign the card for future charges, subscriptions, or recurring billing. The assigned card id can be reused across multiple charges without re-tokenizing.

Step 1: Create a Customer

Create a basic customer profile to associate the card and charge with. At a minimum, an email address is required, although the Create a Customer endpoint allows for additional parameters.

  • To Create a Customer, see the API Reference: here
  • What you get back: A new Customer object with a generated customer_id.
💡

Tip: Take note of the generated customer_id (e.g., KPxMADVnxMV4nNjp) — you will need it in Steps 3 and 4.


Step 2: Tokenize Card

Create a single-use token that represents the customer's credit or debit card. Payarc does support multi-use tokens: see your dedicated Relationship Manager for more information.

  • To Create a Token for a Card, see the API Reference: here
  • What you get back: A new Token object with a corresponding id.
💡

Tip: Take note of the token id (e.g., 8YmNlwY0qY0mwEq0) — you will need it in Step 3.


Step 3: Assign Card to Customer

Assign the card's token id from Step 2 to the Customer object created in Step 1. This assigns the card to the customer record for use in the charge step.

  • To assign the card's token id to the Customer, see the API Reference: here
  • What you get back: The updated Customer object with the card attached.
💡

Tip: Take note of the assigned card id (e.g., P19v20v519L10M5y) — you will need it in Step 4.


Step 4: Create and Capture a Charge

With the card assigned to the customer, initiate and capture the charge. Supply the customer_id from Step 1, the assigned card id from Step 3, and any additional customer details alongside the charge amount to the Create a Keyed Charge API endpoint. Additionally, the API call defaults the capture parameter to 1 to authorize and capture immediately. If capture is set to 0, the charge is only authorized.

  • To Create a Keyed Charge, see the API Reference: here
  • What you get back: A Charge object. The id field (e.g., nBoLWODLMLLoOXyb) confirms the charge.
💡

Tip: API call defaults capture parameter to 1. If set to 0, charge is only authorized.


Option 2: One-Time Payment

Step 1: Tokenize Card

Create a single-use token that represents the customer's credit or debit card. This is the same tokenization step as Option 1 — the token is used directly in the charge request that follows. This token can only be used once, to either create a new transaction or attach a new card to an existing customer.

  • To Create a Token for a Card, see the API Reference: here
  • What you get back: A new Token object with a corresponding id.
💡

Tip: Take note of the Token id (e.g., 8YmNlwY0qY0mwEq0) — you will need it in Step 2.


Step 2: Create a Charge

With the card now tokenized, one can proceed to creating the charge. The API call defaults the capture parameter to 1, capturing the charge immediately. If set to 0, the charge is only authorized.

  • To Create a Charge, see the API Reference: here
  • What you get back: A Charge object. The id field (e.g., nBoLWODLMLLoOXyb) confirms the completed payment.
💡

Tip: The one-time path is ideal for guest checkout or non-recurring scenarios where storing the card is not needed. If you want to reuse the card for future charges, use Option 1 instead.


What's Next

Now that you've created a card charge, you can: