Customer-initiated transactions
A customer-initiated transaction (CIT) is a payment where the cardholder is actively involved in the purchase. This includes a one-off purchase, the first payment in an automated subscription or instalment series, or a returning one-click payment.
Card details must be supplied in full (including CVV) if the transaction is an initial payment. Where the transaction is subsequent, CVV is optional. Alternatively, if the card information has been stored in our vault, then the vault instrument id can be used instead of card information.
A Hosted Forms payment can be an initial CIT, and can store the card details in our vault. Subsequent CITs cannot use Hosted Forms.
CIT properties:
As described in Credential-on-file payments, a CIT payment request must include a credential_on_file object.
The credential_on_file object must include:
-
initiator: Must be set tocustomer. -
intent: Specifies the type of payment series the transaction belongs to and must be set toscheduled,unscheduled, orinstallment. -
stage: Specifies whether the transaction is theinitialorsubsequentpayment in the series. -
initial_payment_ids: Required when stage issubsequent. It must contain one of the following properties:paytently: If the initial CIT was processed through Paytently, pass the Paytently payment ID.scheme: If the initial CIT was processed through another provider, pass the scheme transaction ID.
The schedule object is required when credential_on_file.intent is set to scheduled or installment.
-
end_date: Required for bothscheduledandinstallmentpayments. Specifies the expected end date of the payment series. If an end date cannot be provided, use2099-01-01. -
interval: Required for bothscheduledandinstallmentpayments. Specifies the expected timeframe between payments using amount and unit, for example,2andmonth. -
min_interval_days: Required for bothscheduledandinstallmentpayments. Specifies the minimum number of days that must elapse between charges in the series. -
installment_count: Required whencredential_on_file.intentis set toinstallment. Specifies the expected number of installments in the plan.
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
Request:
- Initial scheduled
- Initial installment
- Subsequent unscheduled
curl --location 'https://sandbox.api.paytently.io/payments'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer token_here'
--data-raw '{
"reference": "ord123",
"amount": 100,
"currency": "EUR",
"customer": {
"id": "customer123",
"first_name": "Joe",
"last_name": "Bloggs",
"birth_date": "1991-06-03",
"nationality": "GBR",
"contact": {
"phone": {
"country_code": "44",
"number": "07700900123"
},
"email": "email@example.com"
}
},
"method": {
"type": "card",
"card": {
"number": "4000000000002503",
"cvv": "110",
"expiry_year": "28",
"expiry_month": "06",
"name_on_card": "J Bloggs"
}
},
"credential_on_file": {
"initiator": "customer",
"intent": "scheduled",
"stage": "initial"
},
"schedule": {
"external": {
"end_date": "2027-06-29",
"interval": {
"amount": 12,
"unit": "Day"
},
"min_interval_days": 30
}
},
"billing_address": {
"line_one": "80 Queens Road",
"city": "Manchester",
"postal_code": "M63X 7TH",
"country": "GBR"
},
"device_ip_address": "123.123.123.123",
"urls": {
"authorize": {
"success": "https://success.com",
"failure": "https://failure.com"
},
"webhook": "https://example.com/paytently/webhooks",
"merchant_website": "https://example.com"
},
"metadata": {
"key": "value"
}
}'
curl --location 'https://sandbox.api.paytently.io/payments'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer token_here'
--data-raw '{
"reference": "ord123",
"amount": 100,
"currency": "EUR",
"customer": {
"id": "customer123",
"first_name": "Joe",
"last_name": "Bloggs",
"birth_date": "1991-06-03",
"nationality": "GBR",
"contact": {
"phone": {
"country_code": "44",
"number": "07700900123"
},
"email": "email@example.com"
}
},
"method": {
"type": "card",
"card": {
"number": "4000000000002503",
"cvv": "110",
"expiry_year": "28",
"expiry_month": "06",
"name_on_card": "J Bloggs"
}
},
"credential_on_file": {
"initiator": "customer",
"intent": "installment",
"stage": "initial"
},
"schedule": {
"external": {
"end_date": "2027-06-29",
"installment_count": 3
"interval": {
"amount": 12,
"unit": "Day"
},
"min_interval_days": 30
}
},
"billing_address": {
"line_one": "80 Queens Road",
"city": "Manchester",
"postal_code": "M63X 7TH",
"country": "GBR"
},
"device_ip_address": "123.123.123.123",
"urls": {
"authorize": {
"success": "https://success.com",
"failure": "https://failure.com"
},
"webhook": "https://example.com/paytently/webhooks",
"merchant_website": "https://example.com"
},
"metadata": {
"key": "value"
}
}'
curl --location 'https://sandbox.api.paytently.io/payments'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer token_here'
--data-raw '{
"reference": "ord123",
"amount": 100,
"currency": "EUR",
"customer": {
"id": "customer123",
"first_name": "Joe",
"last_name": "Bloggs",
"birth_date": "1991-06-03",
"nationality": "GBR",
"contact": {
"phone": {
"country_code": "44",
"number": "07700900123"
},
"email": "email@example.com"
}
},
"method": {
"type": "card",
"card": {
"number": "4000000000002503",
"cvv": "110",
"expiry_year": "28",
"expiry_month": "06",
"name_on_card": "J Bloggs"
}
},
"credential_on_file": {
"initiator": "customer",
"intent": "unscheduled",
"stage": "subsequent"
},
"billing_address": {
"line_one": "80 Queens Road",
"city": "Manchester",
"postal_code": "M63X 7TH",
"country": "GBR"
},
"device_ip_address": "123.123.123.123",
"urls": {
"authorize": {
"success": "https://success.com",
"failure": "https://failure.com"
},
"webhook": "https://example.com/paytently/webhooks",
"merchant_website": "https://example.com"
},
"metadata": {
"key": "value"
}
}'
Response:
- 202
- 400
- 422
- 500
{
"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"
}
}
}
{
"trace_id": "12345",
"errors": [
{
"property": "metadata",
"code": "malformed_request",
"reason": "",
"docs": "https://docs.paytently.io/api/reference"
}
]
}
{
"trace_id": "12345",
"errors": [
{
"property": "reference",
"code": "reference_invalid",
"reason": "reference must not be more than 64 characters",
"detail": "Invalid length: 70",
"docs": "https://docs.paytently.io/api/reference"
},
{
"property": "reference",
"code": "reference_invalid",
"reason": "reference must only contain letters, numbers and accepted special characters: _-",
"detail": "Invalid characters: @",
"docs": "https://docs.paytently.io/api/reference"
}
]
}
{
"title": "Server error",
"status": 500,
"trace_id": "12345"
}