When processing a payment
Payment credentials can also be stored in the vault as part of a payment request. To do this, set method.create_vault_instrument to true and include a urls.vault.webhook URL and the credential_on_file object in your request.
For a Hosted Forms payment, send method with create_vault_instrument set to true and no type. The hosted form collects the card details, and credential_on_file.stage must be initial.
If the payment is captured successfully, the payment credentials are stored asynchronously and a vault instrument is created. Updates regarding the vault instruments are delivered via webhook, or can be retrieved using the relevant GET endpoint. The instrument_created webhook event includes an initiator.payment_id property, which can be used to correlate the vault instrument with the payment.
A vault instrument can be used to process payments once its status is active, as described here.
For information on modifying existing vault instruments, see Managing vault instruments.
Details on required fields and validation can be found in our Open API specification.
- Production
- Sandbox
POST https://api.paytently.io/payments
POST https://sandbox.api.paytently.io/payments
Properties to include in the payment request:
{
...
"method": {
"type": "card",
"card": {
"number": "4000000000002503",
"cvv": "111",
"expiry_year": "30",
"expiry_month": "01",
"name_on_card": "Bob Bobinson"
},
"create_vault_instrument": true
},
...
"credential_on_file": {
"initiator": "customer",
"intent": "unscheduled",
"stage": "initial",
},
...
"urls":{
"vault": {
"webhook": "https://example.com/paytently/webhooks"
},
"authorize": {
"success": "https://success.com",
"failure": "https://failure.com"
},
}
...
}