Retrieve the upcoming invoice for the given subscription including any upcoming one time charges.
curl --request POST \
--url https://api.maplebilling.com/api/v1/companies/{company_id}/invoices/next \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "<string>",
"customer_id": "<string>",
"subscription_id": "<unknown>",
"cancel_config": {
"charge_remaining_balance": true,
"refund_type": "PRORATED",
"timing": "IMMEDIATE",
"cancel_pending_invoices": true,
"custom_end_date": "<unknown>",
"custom_refund_amount": {
"currency": "<string>",
"value_in_cents": 123
},
"customer_cancel_reason": "<unknown>",
"reason": "subscription.revoked",
"send_customer_receipt": "<unknown>"
},
"change_config": {
"config_items": [
{
"hide_at_checkout": "<unknown>",
"minimum_units": 1,
"num_licenses": 1,
"product_metric_pricing_id": "<unknown>",
"product_pricing_id": "<unknown>",
"quantity_config": {
"allow_custom_quantity": true,
"max_quantity": 123,
"min_quantity": 123
},
"sort_order": "<unknown>",
"upsell_product_metric_pricing_id": "<unknown>"
}
],
"product_pricing_ids": [
"<string>"
],
"proration_type": "NEXT",
"timing": "IMMEDIATE",
"auto_charges": "<unknown>",
"discounts": [
{
"name": "<string>",
"type": "DISCOUNT_AMOUNT",
"amount": {
"currency": "<string>",
"value_in_cents": 123
},
"cap": {
"currency": "<string>",
"value_in_cents": 123
},
"expiration_date": "<unknown>",
"percent": 0,
"product_pricing_id": "<unknown>"
}
],
"metadata": {},
"onetime_items": [
{
"aggregate": 123,
"custom_price": {
"amount": {
"currency": "<string>",
"value_in_cents": 123
},
"product_id": "<string>",
"description": "<string>"
},
"product_pricing_id": "<unknown>",
"quantity_config": {
"allow_custom_quantity": true,
"max_quantity": 123,
"min_quantity": 123
},
"sort_order": "<unknown>"
}
],
"payment_method_id": "<unknown>",
"reset_billing_anchor": "<unknown>",
"term": {
"count": 123,
"frequency": "HOUR"
},
"trial": "<unknown>",
"trial_term": {
"count": 123,
"frequency": "HOUR"
}
},
"include_taxes": true
}
'{
"auto_charges": true,
"billed_customer_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"customer": {
"address": {
"address_line_1": "<string>",
"address_line_2": "<string>",
"city": "<string>",
"country": "<string>",
"place_id": "<unknown>",
"state": "<string>",
"zip": "<string>"
},
"arr": {
"currency": "<string>",
"value_in_cents": 123
},
"billing_emails": [
"<string>"
],
"company_id": "<string>",
"computed_entitlements": [
{
"entitlement_id": "<string>",
"id": "<string>",
"inherited_from_id": "<unknown>",
"inherited_from_type": "<unknown>",
"key": "<string>",
"name": "<string>",
"original_value": "<unknown>",
"overridden": "<unknown>",
"type": "<string>",
"value": "<unknown>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"customer_integration_metadata": {},
"email": "<string>",
"exclude_from_metrics": true,
"id": "<string>",
"identifier": "<string>",
"integration_references": [
{
"integration_icon": "<string>",
"integration_id": "<string>",
"integration_key": "<string>",
"integration_name": "<string>",
"reference_type": "<string>",
"remote_id": "<string>",
"remote_type": "<string>"
}
],
"locale": "<string>",
"managed_externally": true,
"metadata": {},
"mrr": {
"currency": "<string>",
"value_in_cents": 123
},
"name": "<string>",
"org_name": "<string>",
"owner_id": "<unknown>",
"parent_customer_id": "<unknown>",
"phone": "<string>",
"status": "<string>",
"title": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"customer_id": "<string>",
"due": {
"currency": "<string>",
"value_in_cents": 123
},
"due_date": "2023-11-07T05:31:56Z",
"hosted_link": "<unknown>",
"invoice_date": "2023-11-07T05:31:56Z",
"name": "<string>",
"number": "<string>",
"paid": {
"currency": "<string>",
"value_in_cents": 123
},
"paid_date": "<unknown>",
"pdf_link": "<unknown>",
"prorated_amount": {
"currency": "<string>",
"value_in_cents": 123
},
"status": "<string>",
"sub_total": {
"currency": "<string>",
"value_in_cents": 123
},
"subscription_id": "<unknown>",
"total": {
"currency": "<string>",
"value_in_cents": 123
},
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The idempotency key that will be used to ensure the request is only performed once
The company ID with the prefix 'cmp_'.
The currency for the invoice
The customer for the invoice
The subscription ID for the invoice
The cancellation configuration for the subscription
Show child attributes
Whether to charge the remaining balance on the subscription. This option cannot be combined with other refund types
This is one of PRORATED, NONE, LAST_PAYMENT or CUSTOM based on whether the refund needs to be the prorated price of the subscription, no refund, the last payment from the customer for this subscription or any custom amount respectively
PRORATED, NONE, LAST_PAYMENT, CUSTOM This is one of IMMEDIATE, CUSTOM, PERIOD_END or RENEWAL based on whether the cancellation needs to happen immediately, at a custom date, at the end of the current period or at the renewal date respectively
IMMEDIATE, CUSTOM, PERIOD_END, RENEWAL Whether to cancel the pending invoices in the subscription
The date for the cancellation in RFC-3339 format when the timing is CUSTOM
An optional reason provided by the customer for the cancellation
The reason for the subscription cancellation
subscription.revoked, subscription.cancelled, subscription.expired Whether to email the cancellation receipt to the customer
The change configuration for subscription
Show child attributes
The mapping of the product metric pricings to their quantity
Show child attributes
Whether the pricing row will be hidden at checkout, defaults to false
The number of minimum units for this usage-based component
x >= 0The number of licenses for this license-based component
x >= 0The product metric pricing ID to which this config applies.
The product pricing ID to which this config applies. If the product pricing contains multiple components, the same config will apply to all of them
The sort index
The list of product pricings that form the subscription
This is one of NEXT, IMMEDIATE or NONE based on whether the proration is charged on the next invoice, immediately or no proration is applied respectively
NEXT, IMMEDIATE, NONE This is one of IMMEDIATE, PERIOD_END or RENEWAL based on whether the change timing needs to be immediate, at the end of the current period, on renewal respectively
IMMEDIATE, PERIOD_END, RENEWAL Whether the subscription is automatically charged to the payment method
The discounts attached to the change. If no discounts are sent, the original discounts on the subscription will remain
Show child attributes
The name for the discount
The type of discount that can be one of DISCOUNT_AMOUNT or DISCOUNT_PERCENT
DISCOUNT_AMOUNT, DISCOUNT_PERCENT The expiration date in RFC-3339 format for the discount, if needed
The percent rate of the discount in decimal, less than 1
x <= 1The specific product pricing in the subscription that the discount is associated with, if not, the discount is applied to the whole subscription
Any additional data as key-value pairs that needs to be attached to the changed subscription
Any one time charges to be attached to the change
Show child attributes
The quantity of the one-time charge
The custom pricing for the product. Either 'product_pricing_id' or 'custom_price' is required
Show child attributes
The product ID
The description of the one-time charge
The product pricing for the one-time charge. Either 'product_pricing_id' or 'custom_price' is required
The sort index
The payment method for the subscription on change
Whether to reset the billing anchor of the subscription
The term for the subscription, defaults to the largest product pricing frequency
The term which includes a frequency interval and a count for number of intervals
Whether to include taxes in the invoice
OK
Whether the invoice is automatically charged to the payment method on file for the customer
The billed customer ID for the invoice. This matches the customer_id by default, but can be set to another parent customer ID
The date the invoice was created
The currency of the invoice
The expanded customer details for the invoice
Show child attributes
The address of the customer
The additional emails to cc on customer's invoices
The company ID of the customer
The computed entitlements for the customer
Show child attributes
The date the customer was created
The email of the customer
Whether to exclude this customer and related fields from any metrics in Maple
The ID of the customer in Maple
The unique identifier for the customer that ties back to your system. You can query for a customer using this identifier
The integration references of this customer in third-party applications connected to Maple
Show child attributes
The locale of the customer
Whether this customer is managed outside of Maple
The metadata as key-value pairs attached to this customer
The name of the customer
The name of the company or the organization this customer is a part of
The company user ID of person in Maple assigned to manage this customer
The customer ID of the parent customer assigned in Maple
The phone number of the customer
The status of the customer such as ACTIVE or ARCHIVED
The title of the customer, such as CEO, VP
The date the customer was last updated
The customer ID for the invoice
The date the invoice total is due
The hosted link for the invoice
The date for the invoice
The name of the invoice
The invoice number for the invoice
The date the invoice was paid
The PDF link for the invoice
The status of the invoice such as PAID, DRAFT, VOID or PENDING
The subscription ID for the invoice, if is not a one-time invoice
The last date the invoice was updated
The unique identifier for the invoice
curl --request POST \
--url https://api.maplebilling.com/api/v1/companies/{company_id}/invoices/next \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "<string>",
"customer_id": "<string>",
"subscription_id": "<unknown>",
"cancel_config": {
"charge_remaining_balance": true,
"refund_type": "PRORATED",
"timing": "IMMEDIATE",
"cancel_pending_invoices": true,
"custom_end_date": "<unknown>",
"custom_refund_amount": {
"currency": "<string>",
"value_in_cents": 123
},
"customer_cancel_reason": "<unknown>",
"reason": "subscription.revoked",
"send_customer_receipt": "<unknown>"
},
"change_config": {
"config_items": [
{
"hide_at_checkout": "<unknown>",
"minimum_units": 1,
"num_licenses": 1,
"product_metric_pricing_id": "<unknown>",
"product_pricing_id": "<unknown>",
"quantity_config": {
"allow_custom_quantity": true,
"max_quantity": 123,
"min_quantity": 123
},
"sort_order": "<unknown>",
"upsell_product_metric_pricing_id": "<unknown>"
}
],
"product_pricing_ids": [
"<string>"
],
"proration_type": "NEXT",
"timing": "IMMEDIATE",
"auto_charges": "<unknown>",
"discounts": [
{
"name": "<string>",
"type": "DISCOUNT_AMOUNT",
"amount": {
"currency": "<string>",
"value_in_cents": 123
},
"cap": {
"currency": "<string>",
"value_in_cents": 123
},
"expiration_date": "<unknown>",
"percent": 0,
"product_pricing_id": "<unknown>"
}
],
"metadata": {},
"onetime_items": [
{
"aggregate": 123,
"custom_price": {
"amount": {
"currency": "<string>",
"value_in_cents": 123
},
"product_id": "<string>",
"description": "<string>"
},
"product_pricing_id": "<unknown>",
"quantity_config": {
"allow_custom_quantity": true,
"max_quantity": 123,
"min_quantity": 123
},
"sort_order": "<unknown>"
}
],
"payment_method_id": "<unknown>",
"reset_billing_anchor": "<unknown>",
"term": {
"count": 123,
"frequency": "HOUR"
},
"trial": "<unknown>",
"trial_term": {
"count": 123,
"frequency": "HOUR"
}
},
"include_taxes": true
}
'{
"auto_charges": true,
"billed_customer_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"customer": {
"address": {
"address_line_1": "<string>",
"address_line_2": "<string>",
"city": "<string>",
"country": "<string>",
"place_id": "<unknown>",
"state": "<string>",
"zip": "<string>"
},
"arr": {
"currency": "<string>",
"value_in_cents": 123
},
"billing_emails": [
"<string>"
],
"company_id": "<string>",
"computed_entitlements": [
{
"entitlement_id": "<string>",
"id": "<string>",
"inherited_from_id": "<unknown>",
"inherited_from_type": "<unknown>",
"key": "<string>",
"name": "<string>",
"original_value": "<unknown>",
"overridden": "<unknown>",
"type": "<string>",
"value": "<unknown>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"customer_integration_metadata": {},
"email": "<string>",
"exclude_from_metrics": true,
"id": "<string>",
"identifier": "<string>",
"integration_references": [
{
"integration_icon": "<string>",
"integration_id": "<string>",
"integration_key": "<string>",
"integration_name": "<string>",
"reference_type": "<string>",
"remote_id": "<string>",
"remote_type": "<string>"
}
],
"locale": "<string>",
"managed_externally": true,
"metadata": {},
"mrr": {
"currency": "<string>",
"value_in_cents": 123
},
"name": "<string>",
"org_name": "<string>",
"owner_id": "<unknown>",
"parent_customer_id": "<unknown>",
"phone": "<string>",
"status": "<string>",
"title": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"customer_id": "<string>",
"due": {
"currency": "<string>",
"value_in_cents": 123
},
"due_date": "2023-11-07T05:31:56Z",
"hosted_link": "<unknown>",
"invoice_date": "2023-11-07T05:31:56Z",
"name": "<string>",
"number": "<string>",
"paid": {
"currency": "<string>",
"value_in_cents": 123
},
"paid_date": "<unknown>",
"pdf_link": "<unknown>",
"prorated_amount": {
"currency": "<string>",
"value_in_cents": 123
},
"status": "<string>",
"sub_total": {
"currency": "<string>",
"value_in_cents": 123
},
"subscription_id": "<unknown>",
"total": {
"currency": "<string>",
"value_in_cents": 123
},
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "<string>"
}