Create payment methods
Create Credit Card payment methods using REST API operations, including required fields and tokenization options.
You can create Credit Card payment methods by using the REST API operations for creating payment methods, such as Create a payment method . In your request, pass in the following required fields.
|
Required Field |
Type |
Description |
|---|---|---|
|
accountKey |
string |
Zuora internal ID of the customer account that will own the payment method. |
|
cardHolderInfo |
object |
Container for cardholder information. The nested
|
|
cardMaskNumber |
string |
The masked card number. |
|
cardNumber |
string |
The card number. |
|
cardType |
string |
The type of the credit card. |
|
expirationMonth |
integer |
One or two-digit expiration month (1-12) of the credit card. |
|
expirationYear |
integer |
Four-digit expiration year of the credit card. |
|
tokenize |
boolean |
Default: false
Specify
|
|
tokens |
object |
The container for the token information. Pass in your existing token information through the following nested fields:
|
|
type |
string |
The type of the payment method. Specify
|
Here is an example of the API request for creating a tokenized Credit Card payment method:
{
"accountKey": "8ad08e669299aa0a01929f0ac6af4748",
"cardHolderInfo": {
"addressLine1": "123 test street",
"addressLine2": "",
"cardHolderName": "Amy Lawrence",
"city": "Fremont",
"country": "USA",
"email": "amy@testaddress.com",
"phone": "4155551234",
"state": "California",
"zipCode": "94020"
},
"cardNumber": "4111111111111111",
"cardMaskNumber": "************1234",
"expirationMonth": "06",
"expirationYear": "2025",
"cardType": "Visa",
"type": "CreditCard",
"tokenize": true,
"tokens": {
"gatewayType": "Planet",
"tokenId": "4111111111590001318379"
}
}
For other optional fields, see Create a payment method .
For tokenized payment methods, you must validate them in Zuora so that payments made with these payment methods are successful. To validate tokenized payment methods, enable the following settings on the gateway instance configuration page:
-
Verify new payment method
-
Verify updated payment method