Problem:
We are trying to use this call https://www.zuora.com/developer/api-reference/#operation/POST_Subscription to create a Zuora account and subscription without creating payment method but we are running into an error ""To collect payment, the customer account must have a default payment method."
This is our payload:
array (
'autoRenew' => true,
'termType' => 'TERMED',
'initialTerm' => '12',
'renewalTerm' => '12',
'contractEffectiveDate' => '2019-03-01',
'serviceActivationDate' => '2019-03-01',
'customerAcceptanceDate' => '2019-03-01',
'termStartDate' => '2019-03-01',
'subscribeToRatePlans' =>
array (
0 =>
array (
'chargeOverrides' =>
array (
0 =>
array (
'productRatePlanChargeId' => '2c92c03b67caedb40s67dcc8a30c1c38',
'price' => '1080',
'listPriceBase' => 'Per_Billing_Period',
'billingPeriod' => 'Annual',
'quantity' => 1,
),
),
'productRatePlanId' => '2c92c0fb6scaedb00127dcc8d2e71f36',
),
),
'accountKey' => '83576629',
'runBilling' => true,
'invoiceOwnerAccountKey' => NULL,
'targetDate' => '2019-03-01',
)
Solution:
We have another type of call called subsribe() that is solely for this purpose. With this call you can:
This is a combined call that you can use to perform all of the following tasks in a single call:
Create accounts
Create contacts
Create payment methods, including external payment options
Create an invoice for the subscription
Apply the first payment to a subscription
https://www.zuora.com/developer/api-reference/#operation/Action_POSTsubscribe
In the below example is a subscribe call that creates the account, subscription, and invoice without the payment method.
{
"subscribes": [
{
"Account": {
"AccountNumber": "A00000013",
"AutoPay": false,
"Batch": "Batch1",
"BillCycleDay": 1,
"Currency": "USD",
"Name": "Hung Do Test2",
"PaymentTerm": "Due Upon Receipt"
},
"BillToContact": {
"Address1": "312 2nd Ave W",
"City": "Seattle",
"Country": "United States",
"FirstName": "Sarah",
"LastName": "Smith",
"PostalCode": "98119",
"State": "Washington",
"WorkEmail": "sarah@example.com"
},
"SubscribeOptions": {
"GenerateInvoice": true,
"ProcessPayments": false
},
"SubscriptionData": {
"RatePlanData": [
{
"RatePlan": {
"ProductRatePlanId": "2c92c0f863f7f040016419ecff807f63"
},
"RatePlanChargeData": [
{
"RatePlanCharge": {
"ChargeModel": "Discount-Percentage",
"DiscountPercentage": "6.75",
"ProductRatePlanChargeId": "2c92c0f863f7f048016419edfd04342f"
}
}
]
}
],
"Subscription": {
"AutoRenew": true,
"ContractAcceptanceDate": "2019-02-15",
"ContractEffectiveDate": "2019-02-15",
"InitialTerm": 12,
"RenewalTerm": 6,
"ServiceActivationDate": "2019-02-15",
"TermType": "TERMED"
}
}
}
]
}
... View more