REST: "GenerateInvoice": true yet no invoice is being generated, why?

Reply
Highlighted
Viktor Zuora Moderator

Zuora Moderator

Zuora Moderator
Posts: 239
Registered: ‎01-11-2016
Accepted Solution

REST: "GenerateInvoice": true yet no invoice is being generated, why?

[ Edited ]

Question:

 

We're trying to trigger the POST /action/subscribe REST call as presented on the Developer Center. Even though we have specifically defined "GenerateInvoice": true, no invoice is being generated. Why?

 

(please note irrevelant parts have been removed from the call example)

 

{
"subscribes": [
{
"Account": {},
"BillToContact": {},
"PaymentMethod": {},
"PreviewOptions": {},
"SubscribeOptions": {
"GenerateInvoice": true,
"ProcessPayments": false,
"SubscribeInvoiceProcessingOptions": { }
},
"SubscriptionData": {
"RatePlanData": [],
"Subscription": {
"AutoRenew": false,
"ContractAcceptanceDate": "2017-10-20",
"ContractEffectiveDate": "2017-10-20",
"InitialTerm": 12,
"Name": "S_1476935174239",
"Notes": "this is notes",
"RenewalTerm": 12,
"ServiceActivationDate": "2017-10-20",
"TermStartDate": "20-10-20",
"TermType": "TERMED"
}
}
}
]
}


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

Viktor Zuora Moderator

Zuora Moderator

Zuora Moderator
Posts: 239
Registered: ‎01-11-2016

Re: REST: "GenerateInvoice": true yet no invoice is being generated, why?

Answer:

 

The call above would indeed work, if today's date is at least "2017-10-20", as that's when the subscription actually starts, and that's the date from where it can be picked up by the Billing engine.

 

However if we're before "2017-10-20", and we did not specify a custom Target Date for the invoice generation, it will use today's date by default. Today, at the time of posting is "2017-05-26", and since there's nothing to bill for this subscription on this specific date, no invoice will be generated.

 

So in case we'd like to specify the Target Date and generate the invoice for the subscription that has a Start Date in the future, we'll need to use the following format (note the SubscribeInvoiceProcessingOptions tag):

 

{
"subscribes": [
{
"Account": {},
"BillToContact": {},
"PaymentMethod": {},
"PreviewOptions": {},
"SubscribeOptions": {
"GenerateInvoice": true,
"ProcessPayments": false,
"SubscribeInvoiceProcessingOptions": {
"InvoiceTargetDate": "2017-10-20"
} }, "SubscriptionData": { "RatePlanData": [], "Subscription": { "AutoRenew": false, "ContractAcceptanceDate": "2017-10-20", "ContractEffectiveDate": "2017-10-20", "InitialTerm": 12, "Name": "S_1476935174239", "Notes": "this is notes", "RenewalTerm": 12, "ServiceActivationDate": "2017-10-20", "TermStartDate": "2017-10-20", "TermType": "TERMED" } } } ] }

 

Supporting references:

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

https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/F_SOAP_API_Complex_Types/SubscribeOptions...



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