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.

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.

You cannot use the SOAP APIs to create, update, or delete a custom payment method. You can use the SOAP API to retrieve a custom payment method, but only the following fields that you specified in your metadata definition file can be retrieved.

  • 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 array 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.