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 '{
"cancel_config": {
"cancel_pending_invoices": true,
"charge_remaining_balance": null,
"custom_end_date": null,
"custom_refund_amount": {
"currency": "<string>",
"value_in_cents": 123
},
"customer_cancel_reason": null,
"reason": null,
"refund_type": "PRORATED",
"send_customer_receipt": null,
"timing": "IMMEDIATE"
},
"change_config": {
"auto_charges": null,
"config_items": [
{
"minimum_units": 1,
"num_licenses": 1,
"product_metric_pricing_id": null,
"product_pricing_id": null,
"quantity_config": {
"allow_custom_quantity": true,
"max_quantity": 123,
"min_quantity": 123
},
"upsell_product_metric_pricing_id": null
}
],
"currency": "<string>",
"discounts": [
{
"amount": {
"currency": "<string>",
"value_in_cents": 123
},
"cap": {
"currency": "<string>",
"value_in_cents": 123
},
"expiration_date": null,
"name": "<string>",
"percent": 123,
"product_pricing_id": null,
"type": "DISCOUNT_AMOUNT"
}
],
"metadata": {},
"onetime_items": [
{
"aggregate": 2,
"custom_price": {
"amount": {
"currency": "<string>",
"value_in_cents": 123
},
"description": null,
"product_id": "<string>"
},
"product_pricing_id": null,
"quantity_config": {
"allow_custom_quantity": true,
"max_quantity": 123,
"min_quantity": 123
}
}
],
"payment_method_id": null,
"product_pricing_ids": [
"<string>"
],
"proration_type": "NEXT",
"reset_billing_anchor": null,
"term": {
"count": 2,
"frequency": "HOUR"
},
"timing": "IMMEDIATE",
"trial": null,
"trial_term": {
"count": 2,
"frequency": "HOUR"
}
},
"currency": "<string>",
"customer_id": "<string>",
"include_taxes": true,
"subscription_id": null
}'
{
"auto_charges": true,
"billed_customer_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"customer_id": "<string>",
"due": {
"currency": "<string>",
"value_in_cents": 123
},
"due_date": "2023-11-07T05:31:56Z",
"hosted_link": null,
"invoice_date": "2023-11-07T05:31:56Z",
"name": "<string>",
"number": "<string>",
"paid": {
"currency": "<string>",
"value_in_cents": 123
},
"paid_date": null,
"pdf_link": null,
"prorated_amount": {
"currency": "<string>",
"value_in_cents": 123
},
"status": "<string>",
"sub_total": {
"currency": "<string>",
"value_in_cents": 123
},
"subscription_id": null,
"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_'.
OK
The response is of type object
.
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 '{
"cancel_config": {
"cancel_pending_invoices": true,
"charge_remaining_balance": null,
"custom_end_date": null,
"custom_refund_amount": {
"currency": "<string>",
"value_in_cents": 123
},
"customer_cancel_reason": null,
"reason": null,
"refund_type": "PRORATED",
"send_customer_receipt": null,
"timing": "IMMEDIATE"
},
"change_config": {
"auto_charges": null,
"config_items": [
{
"minimum_units": 1,
"num_licenses": 1,
"product_metric_pricing_id": null,
"product_pricing_id": null,
"quantity_config": {
"allow_custom_quantity": true,
"max_quantity": 123,
"min_quantity": 123
},
"upsell_product_metric_pricing_id": null
}
],
"currency": "<string>",
"discounts": [
{
"amount": {
"currency": "<string>",
"value_in_cents": 123
},
"cap": {
"currency": "<string>",
"value_in_cents": 123
},
"expiration_date": null,
"name": "<string>",
"percent": 123,
"product_pricing_id": null,
"type": "DISCOUNT_AMOUNT"
}
],
"metadata": {},
"onetime_items": [
{
"aggregate": 2,
"custom_price": {
"amount": {
"currency": "<string>",
"value_in_cents": 123
},
"description": null,
"product_id": "<string>"
},
"product_pricing_id": null,
"quantity_config": {
"allow_custom_quantity": true,
"max_quantity": 123,
"min_quantity": 123
}
}
],
"payment_method_id": null,
"product_pricing_ids": [
"<string>"
],
"proration_type": "NEXT",
"reset_billing_anchor": null,
"term": {
"count": 2,
"frequency": "HOUR"
},
"timing": "IMMEDIATE",
"trial": null,
"trial_term": {
"count": 2,
"frequency": "HOUR"
}
},
"currency": "<string>",
"customer_id": "<string>",
"include_taxes": true,
"subscription_id": null
}'
{
"auto_charges": true,
"billed_customer_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"customer_id": "<string>",
"due": {
"currency": "<string>",
"value_in_cents": 123
},
"due_date": "2023-11-07T05:31:56Z",
"hosted_link": null,
"invoice_date": "2023-11-07T05:31:56Z",
"name": "<string>",
"number": "<string>",
"paid": {
"currency": "<string>",
"value_in_cents": 123
},
"paid_date": null,
"pdf_link": null,
"prorated_amount": {
"currency": "<string>",
"value_in_cents": 123
},
"status": "<string>",
"sub_total": {
"currency": "<string>",
"value_in_cents": 123
},
"subscription_id": null,
"total": {
"currency": "<string>",
"value_in_cents": 123
},
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "<string>"
}