Happy Business Starts Here

how to associate a payment method created from HPM to an existing customer account through REST?

Support SME

how to associate a payment method created from HPM to an existing customer account through REST?

I'm aware of below 2 document, but there is no sample request of how to do it through REST.

https://knowledgecenter.zuora.com/CB_Billing/LA_Hosted_Payment_Pages/B_Payment_Pages_2.0/Link_Paymen...

https://knowledgecenter.zuora.com/DC_Developers/C_REST_API/B_REST_API_reference/Subscriptions/02_Cre...






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

1 REPLY 1
Support SME

Re: how to associate a payment method created from HPM to an existing customer account through REST?

Here is a sample REST request to link a HPM created payment method to an existing customer account.

Please note that this has to be doen together with creating a new subscirption.

 

POST https://rest.apisandbox.zuora.com/v1/action/subscribe

{
  "subscribes": [
    {
      "Account": {
        "Id": "2c92c0f863b81b8d0163cf14c5445f51"
      },
      "BillToContact": {
      },
      "PaymentMethod": {
        "Id": "2c92c0f863b81b970163d84d7e9f323d"
      },
      "PreviewOptions": {
        "EnablePreviewMode": false,
        "NumberOfPeriods": 3
      },
      "SubscribeOptions": {
      },
      "SubscriptionData": {
        "RatePlanData": [
          {
            "RatePlan": {
              "ProductRatePlanId": "2c92c0f860017cd901600dbee8862799"
            }
          }
        ],
        "Subscription": {
          "AutoRenew": false,
          "ContractAcceptanceDate": "2018-03-20",
          "ContractEffectiveDate": "2018-03-20",
          "InitialTerm": 12,
          "Name": "S_1b6111333666",
          "Notes": "this is notes",
          "RenewalTerm": 12,
          "ServiceActivationDate": "2018-03-20",
          "TermStartDate": "2018-03-20",
          "TermType": "TERMED"
        }
      }
    }
  ]
}

API Reference for the subscribe request:

https://www.zuora.com/developer/api-reference/#operation/Action_POSTsubscribe 






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √