CALM Bulk Enrollment Sample
Sample is running on Sandbox by default. In order to run on Live environment specify value of live
for ENVIRONMENT
environment variable.
To send VGS aliases directly to CALM API you need to perform the following steps.
- In your existing VGS Vault (where you store card data) you need to configure an outbound route for sending data to CALM API. There are two ways to do it:
- Go to Vault Dashboard. Select your vault -> Routes -> Add Route (From YAML file) -> Add
routes/calm_outbound.yaml
route. - Using VGS CLI:
vgs apply routes --vault <VAULT_ID> -f routes/calm_outbound.yaml
where<VAULT_ID>
corresponds to your vault id in which you store card data.
- Go to Vault Dashboard. Select your vault -> Routes -> Add Route (From YAML file) -> Add
- Generate Vault Credentials on Vault Dashboard and save them.
- Generate CALM API Credentials and save them.
- Run Docker daemon.
csv/aliased_cards.csv
file should contain cardholder name, card number aliases from your existing vault, expiration month and expiration year of the card (you can adjust the sample code to contain billing address too according to our API Reference).
For testing purposes you can use new sandbox vault and redact testing card numbers data. To do it
- Add
alias_inbound.yaml
route to your vault following steps in "Pre-requisites" section. - Run sample in Docker replacing
<VAULT_ID>
with your test vault id (or change it indocker-compose.yaml
):docker compose build
VAULT_ID='<VAULT_ID>' docker compose run alias-test-cards
To start enrollment process of cards in csv/aliased_cards.csv
file use values from "Pre-requisites" step 2 and 3. In command below:
- Replace
<VAULT_ID>
with your test vault id. - Replace
<VAULT_USERNAME>
and<VAULT_PASSWORD>
with your vault username and password from "Pre-requisites" step 2. - Replace
<CALM_CLIENT_ID>
and<CALM_CLIENT_SECRET>
with API credentials client id and secret values from "Pre-requisites" step 3.
Run:
VAULT_ID='<VAULT_ID>' \
VAULT_USERNAME='<VAULT_USERNAME>' \
VAULT_PASSWORD='<VAULT_PASSWORD>' \
CALM_CLIENT_ID='<CALM_CLIENT_ID>' \
CALM_CLIENT_SECRET='<CALM_CLIENT_SECRET>' \
docker compose run bulk-aliases-enrollment
As a result you will get aliased updated cards:
- Create vault on Vault Dashboard.
- Use Vault ID to generate CALM API Credentials and save them.
- Run Docker daemon.
Add your card data to csv/card_numbers.csv
file according to its format.
To start enrollment process of cards in csv/card_numbers.csv
file use values from "Pre-requisites" step 2 and
replace <CALM_CLIENT_ID>
and <CALM_CLIENT_SECRET>
with API credentials client id and secret values.
Run:
CALM_CLIENT_ID='<CALM_CLIENT_ID>' \
CALM_CLIENT_SECRET='<CALM_CLIENT_SECRET>' \
docker compose run bulk-raw-enrollment
After enrolling your cards, you can get updated cards with synchronous pull or asynchronous push model.