Securely tokenize and store payment cards for future charges, subscriptions, and recurring billing. Card data never touches your servers or EPD — it is tokenized directly by EPD Gateway's Collect.js.

Card vaulting is currently handled through EPD Gateway. A native EPD vaulting API is on our roadmap.

Prerequisites

Before you begin, make sure you have:

  • An EPD Gateway account with API credentials (security key)
  • A Collect.js tokenization key from your EPD Gateway merchant portal
  • An EPD API key (epd_live_sk_... or epd_test_sk_...)

Integration Flow

  1. Collect card details Client-side Customer enters card information into Collect.js hosted fields on your checkout page.

  2. Tokenize Client-side → EPD Gateway Collect.js sends the card data directly to EPD Gateway and returns a payment_token.

  3. Create vault Server-side → EPD Gateway Your backend creates an EPD Gateway customer vault using the token by POSTing to https://secure.easypaydirectgateway.com/api/transact.php with customer_vault=add_customer and the payment_token. EPD Gateway returns a customer_vault_id.

  4. Add card to vault Server-side → EPD Gateway Your backend adds the tokenized card to the vault by POSTing to the same EPD Gateway URL with customer_vault=add_billing, the customer_vault_id, and the payment_token. EPD Gateway returns a billing_id.

  5. Link to EPD Server-side → EPD Create or update an EPD customer with the epd_gateway_customer_vault_id. → Create Customer

  6. Payment method created Automatic EPD validates the vault, extracts card details (brand, last4, expiry), and creates a payment_method record.

The payment_token from Collect.js expires after approximately 15 minutes. Complete steps 3–5 promptly after tokenization.

Key Identifiers

Identifier Source Lifetime Description
payment_token Collect.js ~15 minutes One-time use token representing raw card data
customer_vault_id EPD Gateway Permanent Identifies the customer's card vault in EPD Gateway
billing_id EPD Gateway Permanent Identifies a specific card within a vault
payment_method_id (UUID) EPD Permanent EPD payment method ID (auto-created on vault association)

After Vaulting

Once the card is stored, you can use the payment_method for:

Security

Never log, store, or transmit raw card numbers. Always use Collect.js for client-side tokenization.

  • Keep EPD Gateway API keys server-side only — never expose them to the browser
  • Use HTTPS for all API calls to both EPD Gateway and EPD
  • Rotate EPD Gateway API keys periodically through your EPD Gateway merchant portal