get https://api.fastspring.com/subscriptions/proformaInvoice/
Use this endpoint to retrieve a proforma invoice for a specific subscription.
The invoice FastSpring returns provides an estimate of charges for the upcoming billing period, without taking into account any proposed changes to the plan.
Sample Request
This request retrieves a proforma invoice, specifying Italian as the language:
GET https://api.fastspring.com/subscriptions/proformaInvoice/lx58srwKSQePWxSsjx_slw?lang=it
{
"proFormaInvoiceHeader": {
"currency": "USD",
"timezone": "UTC",
"language": "it",
"message": "Questa fattura e l'importo del rinnovo previsto per la prossima data di addebito sono validi a condizione che non vengano apportate modifiche al piano di abbonamento o ai dettagli di fatturazione dalla data odierna fino alla prossima data di addebito.",
"proFormaInvoiceCreationDate": 1716984212312,
"proFormaInvoiceCreationDateDisplay": "05/29/2024",
"proFormaInvoiceCreationDateDisplayISO8601": "2024-05-29",
"proFormaInvoiceExpirationDate": 1718928000000,
"proFormaInvoiceExpirationDateDisplay": "06/21/2024",
"proFormaInvoiceExpirationDateDisplayISO8601": "2024-06-21"
},
"supportContact": {
"name": "John Doe",
"email": "[email protected]",
"url": "https://www.fastspring.com"
},
"merchantContact": {
"MerchantName": "FastSpring",
"MerchantAddress": "11 W Victoria St Suite 207A Santa Barbara, CA 93101 US"
},
"contact": {
"type": "BILL-TO",
"email": "[email protected]",
"firstName": "John",
"phone": "5555555555",
"organization": {
"companyId": "550e8400-e29b-41d4-a716-446655440002",
"companyName": "Financial Solutions",
"department": {
"departmentId": "550e8400-e29b-41d4-a716-446655440003",
"departmentName": "Finance",
"departmentDescription": "Handles billing, invoicing, and payment processing."
}
},
"address": {
"accountId": "mTxSarJyQcCS7tz0TczjMw",
"addressLine1": null,
"city": "Los Angeles",
"region": "US-CA",
"postalCode": "90001",
"country": "US"
}
},
"subscription": {
"subscription": "lx58srwKSQePWxSsjx_slw",
"currency": "COP",
"timezone": "UTC",
"periodStartDate": 1714089600000,
"periodStartDateDisplay": "4/26/24",
"periodStartDateDisplayISO8601": "2024-04-26",
"periodEndDate": 1716595200000,
"periodEndDateDisplay": "5/25/24",
"periodEndDateDisplayISO8601": "2024-05-25",
"endDate": null,
"endDateDisplay": null,
"endDateDisplayISO8601": null,
"remainingPeriods": -1,
"nextChargeDate": 1716681600000,
"nextChargeDateDisplay": "5/26/24",
"nextChargeDateDisplayISO8601": "2024-05-26",
"isProratable": true,
"prorationStatus": "Available",
"currentPlan": {
"display": "imported-cat",
"product": "imported-subscription",
"billingFrequency": "1 month",
"price": 250440.00,
"priceDisplay": "COP 250,440.00",
"discount": 0.00,
"discountDisplay": "COP 0.00",
"quantity": 2,
"subtotal": 500880.00,
"subtotalDisplay": "COP 500,880.00",
"tax": 0.00,
"taxDisplay": "COP 0.00",
"total": 500880.00,
"totalDisplay": "COP 500,880.00",
"taxPercent": 0.00,
"taxPercentDisplay": "0%",
"periodStartDate": 1714089600000,
"periodStartDateDisplay": "4/26/24",
"periodStartDateDisplayISO8601": "2024-04-26",
"periodEndDate": 1714089600000,
"periodEndDateDisplay": "4/26/24",
"periodEndDateDisplayISO8601": "2024-04-26",
"prorationUtilizedDays": 0,
"prorationRemainingDays": 30,
"prorationTotalDays": 30,
"proratedItemCharge": 751320.00,
"proratedItemChargeDisplay": "COP 751,320.00",
"proratedItemCredit": 500880.00,
"proratedItemCreditDisplay": "COP 500,880.00",
"proratedItemSubtotal": 250440.00,
"proratedItemSubtotalDisplay": "COP 250,440.00",
"proratedItemTax": 0.00,
"proratedItemTaxDisplay": "COP 0.00",
"proratedItemTotal": 250440.00,
"proratedItemTotalDisplay": "COP 250,440.00",
"addons": [
{
"display": "Add-onCD",
"product": "add-oncd",
"price": 49671.00,
"priceDisplay": "COP 49,671.00",
"discount": 0.00,
"discountDisplay": "COP 0.00",
"quantity": 2,
"subtotal": 99342.00,
"subtotalDisplay": "COP 99,342.00",
"tax": 15861.33,
"taxDisplay": "COP 15,861.33",
"total": 99342.00,
"totalDisplay": "COP 99,342.00",
"taxPercent": 19.00,
"taxPercentDisplay": "19%",
"proratedItemCharge": 198684.00,
"proratedItemChargeDisplay": "COP 198,684.00",
"proratedItemCredit": 99342.00,
"proratedItemCreditDisplay": "COP 99,342.00",
"proratedItemSubtotal": 99342.00,
"proratedItemSubtotalDisplay": "COP 99,342.00",
"proratedItemTax": 15861.33,
"proratedItemTaxDisplay": "COP 15,861.33",
"proratedItemTotal": 99342.00,
"proratedItemTotalDisplay": "COP 99,342.00"
}
],
"subscriptionSubtotal": 600222.00,
"subscriptionSubtotalDisplay": "COP 600,222.00",
"subscriptionTax": 15861.33,
"subscriptionTaxDisplay": "COP 15,861.33",
"subscriptionTotal": 600222.00,
"subscriptionTotalDisplay": "COP 600,222.00",
"subscriptionProratedCredit": 600222.00,
"subscriptionProratedCreditDisplay": "COP 600,222.00"
},
"proposedPlan": {
"display": "imported-cat",
"product": "imported-subscription",
"billingFrequency": "1 month",
"price": 250440.00,
"priceDisplay": "COP 250,440.00",
"discount": 0.00,
"discountDisplay": "COP 0.00",
"quantity": 3,
"subtotal": 751320.00,
"subtotalDisplay": "COP 751,320.00",
"tax": 0.00,
"taxDisplay": "COP 0.00",
"total": 751320.00,
"totalDisplay": "COP 751,320.00",
"taxPercent": 0.00,
"taxPercentDisplay": "0%",
"periodStartDate": 1714089600000,
"periodStartDateDisplay": "4/26/24",
"periodStartDateDisplayISO8601": "2024-04-26",
"periodEndDate": 1716595200000,
"periodEndDateDisplay": "5/25/24",
"periodEndDateDisplayISO8601": "2024-05-25",
"prorationUtilizedDays": 0,
"prorationRemainingDays": 30,
"prorationTotalDays": 30,
"proratedItemCharge": 751320.00,
"proratedItemChargeDisplay": "COP 751,320.00",
"proratedItemCredit": 500880.00,
"proratedItemCreditDisplay": "COP 500,880.00",
"proratedItemSubtotal": 250440.00,
"proratedItemSubtotalDisplay": "COP 250,440.00",
"proratedItemTax": 0.00,
"proratedItemTaxDisplay": "COP 0.00",
"proratedItemTotal": 250440.00,
"proratedItemTotalDisplay": "COP 250,440.00",
"addons": [
{
"display": "Add-onCD",
"product": "add-oncd",
"price": 49671.00,
"priceDisplay": "COP 49,671.00",
"discount": 0.00,
"discountDisplay": "COP 0.00",
"quantity": 4,
"subtotal": 198684.00,
"subtotalDisplay": "COP 198,684.00",
"tax": 31722.66,
"taxDisplay": "COP 31,722.66",
"total": 198684.00,
"totalDisplay": "COP 198,684.00",
"taxPercent": 19.00,
"taxPercentDisplay": "19%",
"proratedItemCharge": 198684.00,
"proratedItemChargeDisplay": "COP 198,684.00",
"proratedItemCredit": 99342.00,
"proratedItemCreditDisplay": "COP 99,342.00",
"proratedItemSubtotal": 99342.00,
"proratedItemSubtotalDisplay": "COP 99,342.00",
"proratedItemTax": 15861.33,
"proratedItemTaxDisplay": "COP 15,861.33",
"proratedItemTotal": 99342.00,
"proratedItemTotalDisplay": "COP 99,342.00"
}
],
"subscriptionSubtotal": 950004.00,
"subscriptionSubtotalDisplay": "COP 950,004.00",
"subscriptionTax": 31722.66,
"subscriptionTaxDisplay": "COP 31,722.66",
"subscriptionTotal": 950004.00,
"subscriptionTotalDisplay": "COP 950,004.00",
"subscriptionProratedCharge": 950004.00,
"subscriptionProratedChargeDisplay": "COP 950,004.00"
},
"amountDue": {
"prorationSubtotal": 349782.00,
"prorationSubtotalDisplay": "COP 349,782.00",
"prorationTax": 15861.33,
"prorationTaxDisplay": "COP 15,861.33",
"totalAmountDue": 349782.00,
"totalAmountDueDisplay": "COP 349,782.00",
"nextChargeDate": 1716681600000,
"nextChargeDateDisplay": "5/26/24",
"nextChargeDateDisplayISO8601": "2024-05-26",
"nextChargeAmount": 950004.00,
"nextChargeAmountDisplay": "COP 950,004.00"
}
}
}
Error Handling
Status Code | Error Message | Solution |
---|---|---|
400 | Invalid request parameters | Verify that you've provided a valid subscription ID in the URL path. If you're using the language parameter, make sure it's a supported language code. |
404 | Subscription ID does not exist: [subscription_id] | Verify that the subscription ID you're using is correct and exists in the system. Double-check for any typos in the ID. |
405 | Subscription is in trial period: [subscription_id] | Wait until the trial period for the subscription has ended before requesting a proforma invoice. |
500 | Exception getting subscription change estimate for sub_id:[subscription_id] | Server-side error. Retry the request or contact FastSpring support if the issue persists. |