Happy Business Starts Here

REST API /subscription/preview is not returning invoice data when previewType set to invoiceItem

Highlighted
Advanced Tutor

REST API /subscription/preview is not returning invoice data when previewType set to invoiceItem

I believe this started happening today on the REST API sandox endpoint /rest/v1/subscriptions/preview

 

I'm only getting back charge metric data. This happens when I do not provide a previewType (so invoiceItem should default) or I explicity set the previewType to invoiceItem or InvoiceItemChargeMetrics

 

here's an example (assume the variables equate to something that works)

 

'previewAccountInfo'               => [
'currency' => 'USD',
'billCycleDay' => '0',
'billToContact' => [
'country' => $creditCardCountry,
'city' => $creditCardCity,
'state' => $creditCardState,
'zipCode' => $creditCardPostalCode
]
],
'termType' => 'TERMED',
'contractEffectiveDate' => date('Y-m-d'),
'initialTerm' => 12,
'subscribeToRatePlans' => $productRatePlans,
'previewType' => 'InvoiceItem'

 

and this is what I get back:

 {"success":true,"contractedMrr":12.25,"totalContractedValue":147}

 

notice invoice item data isn't there. just charge metrics

Tags (2)
2 REPLIES 2
Highlighted
Advanced Tutor

Re: REST API /subscription/preview is not returning invoice data when previewType set to invoiceItem

Welp, woke up this morning at the endpoint is now returning invoice data. Was a bug introduced then fixed?

Highlighted
Community Manager

Re: REST API /subscription/preview is not returning invoice data when previewType set to invoiceItem

Glad to hear that it's resolved itself! I know that we had some maintenance yesterday (see Release Notifications and this resolved issue), but I'll look into it for you for peace of mind (and sanity, lol!).

 

Thanks for updating us,

Lana


Lana Lee | Senior Community Manager and Strategist
"A little consideration, a little thought for others, makes all the difference." —A. A. Milne