Skip to main content

Payments using our Vault

If you choose to process CITs and MITs using payment credentials stored in our Vault, you can use the vault_instrument_id in the payment request instead of card details.

For more information on storing payment credentials and obtaining a vault_instrument_id, see Vault.

Payment flow using vault instrument​

When using a vault_instrument_id instead of card details, follow these steps:

  1. Store the card details

    You can store the card details in either of the following ways:

    a. Directly in our Vault using the separate Vault API (Using our Vault API service)

    b. As part of an initial CIT payment request. (When processing a payment)

  2. Retrieve the vault instrument

    After the payment credentials have been stored, you will receive the vault_instrument_id through a Vault API response or webhook. Store this ID so it can be used for future payments.

  3. Use the vault isntrument in subsequent payments

    Pass the vault_instrument_id in the method object of your CIT or MIT payment request instead of providing card details.

Network token vault instruments​

To pay with a network token vault instrument, set method.type to network_token and pass its vault_instrument_id.

"method": {
"type": "network_token",
"vault_instrument_id": "ins_67890"
}
note

Details on required fields and validation can be found in our Open API specification.


POST https://api.paytently.io/payments

Request:​

curl --location 'https://sandbox.api.paytently.io/payments'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer token_here'
--data-raw '{
"reference": "ord124",
"amount": 100,
"currency": "EUR",
"customer": {
"id": "customer123",
"first_name": "Joe",
"last_name": "Bloggs",
"birth_date": "2001-06-03",
"contact": {
"phone": {
"country_code": "44",
"number": "07700900123"
},
"email": "email@example.com"
}
},
"method": {
"type": "card",
"vault_instrument_id": "ins_12345"
},
"credential_on_file": {
"initiator": "merchant",
"intent": "installment",
"stage": "subsequent",
"initial_payment_ids": {
"paytently": "pay_12345"
}
},
"billing_address": {
"line_one": "80 Queens Road",
"city": "Manchester",
"postal_code": "M6Y 7TH",
"country": "GBR"
},
"device_ip_address": "123.123.123.123",
"metadata": {
"key": "value"
}
}'

Response:​

{
"id": "pay_12345",
"status": "pending",
"_links": {
"self": {
"href": "https://sandbox.api.paytently.io/payments/pay_12345",
"method": "GET"
},
"authorize": {
"href": "https://sandbox.payredirect.io/authorize/pay_12345",
"method": "GET"
}
}
}