Skip to content

API Integration

The Vault4x REST API provides direct access to tokenization and payment proxy services. Use this integration method when you need server-to-server communication or custom implementations.

PCI DSS Compliance Required

To use the tokenization API directly, your server must be PCI DSS compliant as it will handle raw payment card data. Consider using Form Integration instead to avoid this requirement.

Base URL

All API requests should be made to:

https://maow6cposl.execute-api.eu-west-3.amazonaws.com/default

Authentication

Include your API key in the x-api-key header for all requests:

bash
curl -H "x-api-key: vk4x_your_api_key_here" \
     https://maow6cposl.execute-api.eu-west-3.amazonaws.com/default/token

Tokenization API

Create Token

Tokenize payment card information to receive a secure token.

Endpoint: POST /token

Headers:

x-api-key: vk4x_your_api_key_here
Content-Type: application/json

Request Body:

javascript
{
  "number": "4242424242424242",
  "holderName": "Jean Dupont",
  "expiryMonth": 10,
  "expiryYear": 2029,
  "cvv": 789
}

Success Response:

javascript
{
  "token": "tok.fpXi4kthiCfj9FU0dNJQkrdzo4uq",
  "last4": "4242",
  "brand": "visa",
  "expiryMonth": 10,
  "expiryYear": 2029
}

Example cURL:

bash
curl -X POST https://maow6cposl.execute-api.eu-west-3.amazonaws.com/default/token \
  -H "x-api-key: vk4x_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "number": "4242424242424242",
    "holderName": "Jean Dupont",
    "expiryMonth": 10,
    "expiryYear": 2029,
    "cvv": 789
  }'

Node.js Example:

javascript
const response = await fetch("https://maow6cposl.execute-api.eu-west-3.amazonaws.com/default/token", {
  method: "POST",
  headers: {
    "x-api-key": process.env.VAULT4X_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    number: "4242424242424242",
    holderName: "Jean Dupont",
    expiryMonth: 10,
    expiryYear: 2029,
    cvv: 789,
  }),
});

const result = await response.json();
console.log("Token:", result.token);

Proxy API

The proxy endpoint acts as a secure proxy between your application and any Payment Service Provider (PSP). It replaces sensitive data placeholders with actual card information before forwarding the request.

Process Payment

Endpoint: POST /proxy

Headers:

x-api-key: vk4x_your_api_key_here
Content-Type: application/json

Request Body:

json
{
  "method": "post",
  "token": "tok.sMwj7BExEHMD670nCb8I4JggrULn",
  "pspUrl": "https://api.your-psp.com/payments",
  "pspHeaders": {
    "Authorization": "Bearer your-psp-api-key",
    "Content-Type": "application/json"
  },
  "pspBody": "{\"card_number\":\"[CARD_NUMBER]\",\"card_expiry_month\":\"[CARD_EXPIRY_MONTH]\",\"card_expiry_year\":\"[CARD_EXPIRY_YEAR]\",\"cvc\":\"[CARD_CVV]\", \"card_holder\": \"[CARD_HOLDER]\"}"
}

Placeholders:

The following placeholders in pspBody will be replaced with actual card data:

PlaceholderDescription
[CARD_NUMBER]Full card number
[CARD_EXPIRY_MONTH]Expiry month (2 digits)
[CARD_EXPIRY_YEAR]Expiry year (4 digits)
[CARD_CVV]Card verification value

Success Response: The response will be the exact response from your PSP, proxied through Vault4x.

Example cURL:

bash
curl -X POST https://maow6cposl.execute-api.eu-west-3.amazonaws.com/default/proxy \
  -H "x-api-key: vk4x_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "post",
    "token": "tok.sMwj7BExEHMD670nCb8I4JggrULn",
    "pspUrl": "https://api.stripe.com/v1/payment_intents",
    "pspHeaders": {
      "Authorization": "Bearer sk_test_...",
    },
    "pspBody": "{\"card_number\":\"[CARD_NUMBER]\",\"card_expiry_month\":\"[CARD_EXPIRY_MONTH]\",\"card_expiry_year\":\"[CARD_EXPIRY_YEAR]\",\"cvc\":\"[CARD_CVV]\", \"card_holder\": \"[CARD_HOLDER]\"}"
  }'

Error Handling

Common Error Responses

Invalid API Key (401):

The API key may be invalid or your IP address is not whitelisted on the dashboard.

Validation Error (400):

The provided data are not valid

Test Cards

Use these test card numbers in development:

Card NumberBrandDescription
4242424242424242VisaSuccess
4000000000000002VisaDeclined
5555555555554444MastercardSuccess
2223003122003222MastercardSuccess
378282246310005American ExpressSuccess

Testing

Use any future expiry date and any 3-4 digit CVV for test cards.