Skip to main content

Create a payment method of the defined type

Zuora

Create a payment method of the defined type

After you have enabled the custom payment method type you defined, you can then create the payment method of the defined type through the Zuora UI or the REST APIs. You can use the REST APIs for creating payment methods, creating accounts, and creating orders to create your custom payment method. The custom payment method can be electronic or external. The creation of the stored credential profile through the Zuora UI or REST APIs is not supported for the tokenized custom payment methods.

Note: Though the field name must be defined with a string starting with a capital letter, use this string with the first letter in lowercase when you create the payment method or use it in any other API operations. For example, AmazonToken is the defined value for name. In the request of the "Create a payment method" API operation, use amazonToken.

An example of using the Create a payment method API operation is provided below.

curl --location --request POST 'https://rest.apisandbox.zuora.com/apps/v1/payment-methods/' \
--header 'zuora-version: 215.0' \
--header 'Content-Type: application/json' \
--header 'apiAccessKeyId: demo@demo.com' \
--header 'apiSecretAccessKey: 345654323 \
--header 'Authorization: Basic vbfgjnjknjdvfd6dvdfvfdbvd7fvdf77db6dfbdvdfvdf' \
--data-raw '{
"type": "AmazonPay__c_12368",
"amazonToken": "3sample54cf04113e3f1595951874003",
"amazonTokenType": "Digital",
"shopperEmail": "sample@testmail.com",
"amazonAccount": "SampleAmazonAccount"

After your custom payment method is successfully created, you can use it to process payments and refunds in Zuora. When a custom payment method is created, by default the payment method status is Active. Active payment methods can be used to process electronic payments in an automated payment run, UI and API. You can set the status to Closed through the UI and API. Closed payment methods can also be used to process a payment in the UI and API. However, by default, closed payment methods will not be used to process electronic payments in an automated payment run.

Limitations for custom payment methods

  • You cannot use the SOAP APIs to create, update, or delete a custom payment method. You can use the SOAP API to retrieve the following fields of a custom payment method:
    • MethodReferenceId - The identification reference of the custom payment method.
    • UserReferenceId - The identification reference of the user or customer account.
    • SubType - The identification reference of the custom payment method type.
    • MethodSpecificData - The JSON string containing detailed information of the custom payment method.

    If you have created a custom payment method through the Zuora UI or the REST APIs, you can then use your custom payment method in other SOAP APIs by specifying the PaymentMethodId field if it is available in the SOAP API. For example, you can specify the ID of your custom payment method in the PaymentMethodId field of the CRUD: Create a payment SOAP API and create a payment.

  • The custom payment method is not supported by Hosted Payment Pages 2.0. 
  • Configuring payment retry rules for an individual custom payment method is not supported. The tenant-level payment retry rules are used for the custom payment method. To enable and configure tenant-level payment retry rules, navigate to Settings > Payments > Configure Payment Retry Rules.