Welcome to Zuora Product Documentation

Explore our rich library of product information

Option 3: Pass in card information and the tokenize flag

Learn how to pass in card information and use the tokenize flag to generate a token for secure payment processing.

In your request, pass in the following required fields. A token is generated when validating the payment method with the gateway. Both the card information and the token are stored for the payment method but the token is used in processing subsequent payment transactions.

Required Field

Type

Description

accountKey

string

Zuora internal ID of the customer account that will own the payment method.

cardNumber

string

Credit card number.

securityCode

string

CVV or CVV2 security code of the credit card. To ensure PCI compliance, this value is not stored and cannot be queried.

cardHolderInfo

object

Container for cardholder information.

The nested cardHolderName field is required. Pass in the card holder's full name as it appears on the card, such as "Amy Lawrence", 50 characters or less.

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.

type

string

Type of the payment method. Specify CreditCard in this field.

tokenize

boolean

Default: false

Specify true for this field to tokenize the payment method with the card number.

Here is an example of the API request for creating a tokenized Credit Card payment method:

{
    "type": "CreditCard",
    "accountKey": "402880e58fbd6560018fbd73d76c00b4",
    "cardType": "Visa",
    "cardHolderInfo": {
        "cardHolderName": "Joe Bloggs"
    },
    "cardNumber": "4111111111111111",
    "expirationMonth": 12,
    "expirationYear": 2025,
    "securityCode": 977,
    "tokenize": true
}

For other optional fields, see Create a payment method .