Create Payment Token
POST/payment-tokens
Tokenizes payment details for use in subsequent transactions. The same payment method can be tokenized a few times.
Request
- application/json
Body
required
An object containing payment method details
Processing entityId
provided by Nuvei.
80aef199-b89a-4d59-ba0c-f2cd3c25d5cd
Merchant Reference for a business entity (token, subscription, etc.)
Possible values: <= 50 characters
MREF_6f06168d-ff6e-448b-8401-30051eb6b1af
paymentOption
object
required
card
object
The cardholder name.
Possible values: <= 70 characters
Jada Pinkett
The full credit card number.
Possible values: non-empty
and <= 20 characters
5113981660016597
The card expiration month.
Possible values: Value must match regular expression ^(0[1-9]|1[0-2])$
06
The card expiration year.
Possible values: Value must match regular expression ^(\d{4}|\d{2})$
2022
The CVV/CVC security code.
Possible values: <= 4 characters
591
alternativePaymentMethod
object
Possible values: non-empty
and <= 50 characters
ACH
data
object
temporaryPaymentToken
object
1eaf1356-a9a2-4a16-a0c1-290ba2265257
Possible values: [recurring
, unscheduled
]
{"hello":"world"}
Responses
- 201
- 400
- 401
- 403
- 500
OK
- application/json
- Schema
- Example (from schema)
- Card Payment Token
- ACH Payment Token
Schema
paymentToken
object
1eaf1356-a9a2-4a16-a0c1-290ba2265257
ID of card in the Gateway. Values: 1 = VISA | 2 = MasterCard | 3 = Amex | 4 = Diners | 5 = JCB | 6 = Discover
1
paymentOption
object
required
card
object
The cardholder name.
Possible values: <= 70 characters
Jada Pinkett
The masked credit card number.
Possible values: <= 20 characters
5***6597
The first six or eight digits from the credit card number for identifying the processing bank. The rest of the number is not displayed.
Possible values: <= 8 characters
546221
The card expiration month.
Possible values: Value must match regular expression ^(0[1-9]|1[0-2])$
06
The card expiration year.
Possible values: Value must match regular expression ^(\d{4}|\d{2})$
2022
The type of card used in the transaction.
Possible values: [Credit
, Debit
]
The card brand used in the transaction.
Possible values: [VISA
, MASTERCARD
, AMEX
, DINERS
]
Indicates if the card is prepaid or not.
Possible values: >= 2 characters
and <= 2 characters
DE
alternativePaymentMethod
object
Possible values: non-empty
and <= 50 characters
ACH
data
object
result
object
required
Possible values: [success
, error
]
errors
object
If an error occurred on the request side, an error code is returned in this parameter.
Possible values: <= 11 characters
7000.1000
If an error occurred on the request side, then an error reason is returned in this parameter.
Possible values: <= 400 characters
Unexpected error
{
"paymentToken": {
"paymentTokenId": "1eaf1356-a9a2-4a16-a0c1-290ba2265257",
"cccId": 1,
"paymentOption": {
"card": {
"cardHolderName": "Jada Pinkett",
"maskedCardNumber": "5***6597",
"bin": "546221",
"expirationMonth": "06",
"expirationYear": "2022",
"cardType": "Credit",
"cardBrand": "VISA",
"cardProduct": "string",
"cardProgram": "string",
"cardProductType": "string",
"isPrepaid": true,
"issuingCountry": "DE",
"isVirtual": true,
"isDynamicCurrencyConversionSupported": true
},
"alternativePaymentMethod": {
"name": "ACH",
"data": {
"accountNumber": "11345739548759",
"routingNumber": "847937857"
}
}
}
},
"result": {
"status": "success",
"errors": {
"code": "7000.1000",
"reason": "Unexpected error"
}
}
}
Card Payment Token
{
"paymentToken": {
"paymentTokenId": "1eaf1356-a9a2-4a16-a0c1-290ba2265257",
"cccId": 1,
"paymentOption": {
"card": {
"cardHolderName": "John Doe",
"maskedCardNumber": "4***1111",
"bin": "411111",
"expirationMonth": "06",
"expirationYear": "2028",
"cardType": "Credit",
"cardBrand": "VISA"
}
}
},
"result": {
"status": "success"
}
}
ACH Payment Token
{
"paymentToken": {
"paymentTokenId": "1eaf1356-a9a2-4a16-a0c1-290ba2265257",
"cccId": 573,
"paymentOption": {
"alternativePaymentMethod": {
"name": "ACH",
"data": {
"accountNumber": "11345739548759",
"routingNumber": "847937857"
}
}
}
},
"result": {
"status": "success"
}
}
Bad Request
- application/json
- Schema
- Example (from schema)
- Invalid Value
- Missing Mandatory Field Value
Schema
paymentToken
object
1eaf1356-a9a2-4a16-a0c1-290ba2265257
ID of card in the Gateway. Values: 1 = VISA | 2 = MasterCard | 3 = Amex | 4 = Diners | 5 = JCB | 6 = Discover
1
paymentOption
object
required
card
object
The cardholder name.
Possible values: <= 70 characters
Jada Pinkett
The masked credit card number.
Possible values: <= 20 characters
5***6597
The first six or eight digits from the credit card number for identifying the processing bank. The rest of the number is not displayed.
Possible values: <= 8 characters
546221
The card expiration month.
Possible values: Value must match regular expression ^(0[1-9]|1[0-2])$
06
The card expiration year.
Possible values: Value must match regular expression ^(\d{4}|\d{2})$
2022
The type of card used in the transaction.
Possible values: [Credit
, Debit
]
The card brand used in the transaction.
Possible values: [VISA
, MASTERCARD
, AMEX
, DINERS
]
Indicates if the card is prepaid or not.
Possible values: >= 2 characters
and <= 2 characters
DE
alternativePaymentMethod
object
Possible values: non-empty
and <= 50 characters
ACH
data
object
result
object
required
Possible values: [success
, error
]
errors
object
If an error occurred on the request side, an error code is returned in this parameter.
Possible values: <= 11 characters
7000.1000
If an error occurred on the request side, then an error reason is returned in this parameter.
Possible values: <= 400 characters
Unexpected error
{
"paymentToken": {
"paymentTokenId": "1eaf1356-a9a2-4a16-a0c1-290ba2265257",
"cccId": 1,
"paymentOption": {
"card": {
"cardHolderName": "Jada Pinkett",
"maskedCardNumber": "5***6597",
"bin": "546221",
"expirationMonth": "06",
"expirationYear": "2022",
"cardType": "Credit",
"cardBrand": "VISA",
"cardProduct": "string",
"cardProgram": "string",
"cardProductType": "string",
"isPrepaid": true,
"issuingCountry": "DE",
"isVirtual": true,
"isDynamicCurrencyConversionSupported": true
},
"alternativePaymentMethod": {
"name": "ACH",
"data": {
"accountNumber": "11345739548759",
"routingNumber": "847937857"
}
}
}
},
"result": {
"status": "success",
"errors": {
"code": "7000.1000",
"reason": "Unexpected error"
}
}
}
{
"result": {
"status": "error",
"errors": {
"code": "5000.1000",
"reason": "[paymentOption.card.expirationMonth] must match \"^(0[1-9]|1[0-2])$\""
}
}
}
{
"result": {
"status": "error",
"errors": {
"code": "5000.1000",
"reason": "[processingEntityId] must not be null"
}
}
}
Unauthorized
- application/json
- Schema
- Example (from schema)
- Authorization Error
Schema
paymentToken
object
1eaf1356-a9a2-4a16-a0c1-290ba2265257
ID of card in the Gateway. Values: 1 = VISA | 2 = MasterCard | 3 = Amex | 4 = Diners | 5 = JCB | 6 = Discover
1
paymentOption
object
required
card
object
The cardholder name.
Possible values: <= 70 characters
Jada Pinkett
The masked credit card number.
Possible values: <= 20 characters
5***6597
The first six or eight digits from the credit card number for identifying the processing bank. The rest of the number is not displayed.
Possible values: <= 8 characters
546221
The card expiration month.
Possible values: Value must match regular expression ^(0[1-9]|1[0-2])$
06
The card expiration year.
Possible values: Value must match regular expression ^(\d{4}|\d{2})$
2022
The type of card used in the transaction.
Possible values: [Credit
, Debit
]
The card brand used in the transaction.
Possible values: [VISA
, MASTERCARD
, AMEX
, DINERS
]
Indicates if the card is prepaid or not.
Possible values: >= 2 characters
and <= 2 characters
DE
alternativePaymentMethod
object
Possible values: non-empty
and <= 50 characters
ACH
data
object
result
object
required
Possible values: [success
, error
]
errors
object
If an error occurred on the request side, an error code is returned in this parameter.
Possible values: <= 11 characters
7000.1000
If an error occurred on the request side, then an error reason is returned in this parameter.
Possible values: <= 400 characters
Unexpected error
{
"paymentToken": {
"paymentTokenId": "1eaf1356-a9a2-4a16-a0c1-290ba2265257",
"cccId": 1,
"paymentOption": {
"card": {
"cardHolderName": "Jada Pinkett",
"maskedCardNumber": "5***6597",
"bin": "546221",
"expirationMonth": "06",
"expirationYear": "2022",
"cardType": "Credit",
"cardBrand": "VISA",
"cardProduct": "string",
"cardProgram": "string",
"cardProductType": "string",
"isPrepaid": true,
"issuingCountry": "DE",
"isVirtual": true,
"isDynamicCurrencyConversionSupported": true
},
"alternativePaymentMethod": {
"name": "ACH",
"data": {
"accountNumber": "11345739548759",
"routingNumber": "847937857"
}
}
}
},
"result": {
"status": "success",
"errors": {
"code": "7000.1000",
"reason": "Unexpected error"
}
}
}
{
"result": {
"status": "error",
"errors": {
"code": "7300.3000",
"reason": "Authorization error."
}
}
}
Forbidden
- application/json
- Schema
- Example (from schema)
- Authorization Error
Schema
paymentToken
object
1eaf1356-a9a2-4a16-a0c1-290ba2265257
ID of card in the Gateway. Values: 1 = VISA | 2 = MasterCard | 3 = Amex | 4 = Diners | 5 = JCB | 6 = Discover
1
paymentOption
object
required
card
object
The cardholder name.
Possible values: <= 70 characters
Jada Pinkett
The masked credit card number.
Possible values: <= 20 characters
5***6597
The first six or eight digits from the credit card number for identifying the processing bank. The rest of the number is not displayed.
Possible values: <= 8 characters
546221
The card expiration month.
Possible values: Value must match regular expression ^(0[1-9]|1[0-2])$
06
The card expiration year.
Possible values: Value must match regular expression ^(\d{4}|\d{2})$
2022
The type of card used in the transaction.
Possible values: [Credit
, Debit
]
The card brand used in the transaction.
Possible values: [VISA
, MASTERCARD
, AMEX
, DINERS
]
Indicates if the card is prepaid or not.
Possible values: >= 2 characters
and <= 2 characters
DE
alternativePaymentMethod
object
Possible values: non-empty
and <= 50 characters
ACH
data
object
result
object
required
Possible values: [success
, error
]
errors
object
If an error occurred on the request side, an error code is returned in this parameter.
Possible values: <= 11 characters
7000.1000
If an error occurred on the request side, then an error reason is returned in this parameter.
Possible values: <= 400 characters
Unexpected error
{
"paymentToken": {
"paymentTokenId": "1eaf1356-a9a2-4a16-a0c1-290ba2265257",
"cccId": 1,
"paymentOption": {
"card": {
"cardHolderName": "Jada Pinkett",
"maskedCardNumber": "5***6597",
"bin": "546221",
"expirationMonth": "06",
"expirationYear": "2022",
"cardType": "Credit",
"cardBrand": "VISA",
"cardProduct": "string",
"cardProgram": "string",
"cardProductType": "string",
"isPrepaid": true,
"issuingCountry": "DE",
"isVirtual": true,
"isDynamicCurrencyConversionSupported": true
},
"alternativePaymentMethod": {
"name": "ACH",
"data": {
"accountNumber": "11345739548759",
"routingNumber": "847937857"
}
}
}
},
"result": {
"status": "success",
"errors": {
"code": "7000.1000",
"reason": "Unexpected error"
}
}
}
Authorization error
{
"result": {
"status": "error",
"errors": {
"code": "7300.3000",
"reason": "Authorization error."
}
}
}
Internal Server Error
- application/json
- Schema
- Example (from schema)
- Internal Processing Error
Schema
paymentToken
object
1eaf1356-a9a2-4a16-a0c1-290ba2265257
ID of card in the Gateway. Values: 1 = VISA | 2 = MasterCard | 3 = Amex | 4 = Diners | 5 = JCB | 6 = Discover
1
paymentOption
object
required
card
object
The cardholder name.
Possible values: <= 70 characters
Jada Pinkett
The masked credit card number.
Possible values: <= 20 characters
5***6597
The first six or eight digits from the credit card number for identifying the processing bank. The rest of the number is not displayed.
Possible values: <= 8 characters
546221
The card expiration month.
Possible values: Value must match regular expression ^(0[1-9]|1[0-2])$
06
The card expiration year.
Possible values: Value must match regular expression ^(\d{4}|\d{2})$
2022
The type of card used in the transaction.
Possible values: [Credit
, Debit
]
The card brand used in the transaction.
Possible values: [VISA
, MASTERCARD
, AMEX
, DINERS
]
Indicates if the card is prepaid or not.
Possible values: >= 2 characters
and <= 2 characters
DE
alternativePaymentMethod
object
Possible values: non-empty
and <= 50 characters
ACH
data
object
result
object
required
Possible values: [success
, error
]
errors
object
If an error occurred on the request side, an error code is returned in this parameter.
Possible values: <= 11 characters
7000.1000
If an error occurred on the request side, then an error reason is returned in this parameter.
Possible values: <= 400 characters
Unexpected error
{
"paymentToken": {
"paymentTokenId": "1eaf1356-a9a2-4a16-a0c1-290ba2265257",
"cccId": 1,
"paymentOption": {
"card": {
"cardHolderName": "Jada Pinkett",
"maskedCardNumber": "5***6597",
"bin": "546221",
"expirationMonth": "06",
"expirationYear": "2022",
"cardType": "Credit",
"cardBrand": "VISA",
"cardProduct": "string",
"cardProgram": "string",
"cardProductType": "string",
"isPrepaid": true,
"issuingCountry": "DE",
"isVirtual": true,
"isDynamicCurrencyConversionSupported": true
},
"alternativePaymentMethod": {
"name": "ACH",
"data": {
"accountNumber": "11345739548759",
"routingNumber": "847937857"
}
}
}
},
"result": {
"status": "success",
"errors": {
"code": "7000.1000",
"reason": "Unexpected error"
}
}
}
Internal processing error
{
"result": {
"status": "error",
"errors": {
"code": "7000.1000",
"reason": "Internal Processing Error."
}
}
}