Skip to content

Merchant Workflows

This page outlines common Merchant workflows.

Saving Customer Information

The Customer Vault is our primary solution for storing customer payment details.

Using Customer Vault Endpoints

Customer payment details can be saved using our Customer Vault API. Please review our documentation here for more information.

Vault records can also be created, updated, or retrieved, using a token generated by our Tokenizer.

Once a customer's payment details are converted into a token via Tokenizer, that token can be stored in the Customer Vault by passing it in the body of the request:

Example
json
{
  "default_payment": {
    "token": "hnxngM33E12CZP0LavWJU7OHDA0Sb8RM" // token generated by Tokenizer
  },
  "default_billing_address": {
    "first_name": "John",
    "last_name": "Smith",
    "company": "Some Business",
    "address_line_1": "123 Some St",
    "address_line_2": "STE 1",
    "city": "Some Town",
    "state": "IL",
    "postal_code": "60187",
    "country": "US",
    "email": "user@somesite.com",
    "phone": "5555555555",
    "fax": "555555555"
  },
  "default_shipping_address": {
    "first_name": "John",
    "last_name": "Smith",
    "company": "Some Business",
    "address_line_1": "123 Some St",
    "address_line_2": "STE 1",
    "city": "Some Town",
    "state": "IL",
    "postal_code": "60187",
    "country": "US",
    "email": "user@somesite.com",
    "phone": "5555555555",
    "fax": "555555555"
  }
}

Using Transaction Endpoint

When submitting a payment to /api/transaction, you can pass in "create_vault_record: true" to the request body. This will return a customer_id and customer_payment_id which can then be used for future transactions.

Example
json
{
  "type": "sale",
  "currency": "USD",
  "amount": 2299,
  "create_vault_record": true, // Tells the API to create a customer record
  "payment_method": {
    "card": {
      "number": "4111111111111111",
      "expiration_date": "12/25",
      "cvc": "123"
    }
  },
  "billing_address": {
    "first_name": "Bob",
    "last_name": "Hoover",
    "address_line_1": "123 State St",
    "address line_2": "Apt 456",
    "city": "Nashville",
    "state": "Tennessee",
    "postal_code": "37209",
    "email": "bob.hoover@gmail.com",
    "phone": "1234562222"
  },
  "shipping_address": {
    "first_name": "Bob",
    "last_name": "Hoover",
    "address_line_1": "123 State St",
    "address line_2": "Apt 456",
    "city": "Nashville",
    "state": "Tennessee",
    "postal_code": "37209",
    "email": "bob.hoover@gmail.com",
    "phone": "1234562222"
  }
}

You can now use the customer_id and customer_payment_id from the API response above in place of the full customer payment details.

Example
json
{
  "type": "sale",
  "currency": "USD",
  "amount": 1699,
  "payment_method": {
    "customer": {
      "id": "d0mcb9fsvrv400qfdt5g", // customer_id
      "payment_method_id": "d0mcb9fsvrv400qfdt50" // customer_payment_id
    }
  }
}

Card Verification

To send a card verification, all you need to do is make a regular transaction POST request, with type verification:

json
'type': 'verification'

Note: An amount is not required for verification purposes.

Example