Welcome to Zuora Product Documentation

Explore our rich library of product information

Option 1: Pass in card information and the tokenize flag

Learn how to pass card information and a tokenization flag to generate a token for processing payment transactions.

You can pass in the card information and a tokenization flag field. 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.

In your request, pass in the following required fields:

Required Field

Type

Description

accountKey

string

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

While this field is not required when creating an orphan payment method, specifying this field is highly recommended to associate a newly created payment method with an account.

cardNumber

string

The credit card number.

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

The 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:

{
    "accountKey": "8a90d6128d45df2b018d4b90681c05x0",
    "cardHolderInfo": {
        "cardHolderName": "Amy Lawrence"
    },
    "cardNumber": "4111111111111111",
    "cardType": "Visa",
    "expirationMonth": "03",
    "expirationYear": "2050",
    "securityCode": "733",
    "type": "CreditCard",
    "gatewayOptions": {
        "InvoiceNum": "I11",
        "RegisterNumber":"s",
        "cardPresence":"PRESENT"
    },
    "tokenize": true
}

For other optional fields, see Create a payment method .