Welcome to Zuora Product Documentation

Explore our rich library of product information

Set up PayPal through the REST API approach

Learn how to set up a PayPal payment method using the REST API in Braintree v2.0, including tokenization and validation in Zuora.

You can create a PayPal payment method on Braintree v2.0 through the Create a payment method REST API operation, with type set to PayPalCP . For details about the required and optional request fields, see the Create a payment method API Reference document.

To create a tokenized PayPal payment method, use one of the following options:

Option

Description

Example

Pass in the account information and the tokenization flag

Pass in the following fields:

  • type: PayPalCP

  • accountKey

  • BAID

  • email

  • tokenize: true

The token, which is the payment method ID, will be generated. The BAID, email, and token information will all be stored in Zuora, and token will be used in the subsequent recurring payments.

{
   "type": "PayPalCP",
   "accountKey": "8a90d6128d45df2b018d4b90681c05x0",
   "BAID": "I-1TJ3GAGG82Y9",
   "email": "customer@example.com",
   "tokenize": true
}

Pass in the existing token

Pass in the following fields:

  • type: PayPalCP

  • accountKey

  • tokens

    • gatewayType: Braintree

    • tokenId: paymentMethodId

  • tokenize: true

The token will be stored in Zuora and used in the subsequent recurring payments.

{
   "type": "PayPalCP",
   "accountKey": "402881868ab1b937018ab2314b91234a",
    "tokens": {
        "gatewayType": "Braintree",
        "tokenId": "testTokenId"
    },
   "tokenize": true
}

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, turn on the following settings on the gateway instance configuration page:

  • Verify new payment method

  • Verify updated payment method