Skip to main content
POST
/
companies
/
{company_id}
/
invoices
/
next
Next 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 '{
  "cancel_config": {
    "cancel_pending_invoices": true,
    "charge_remaining_balance": true,
    "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": [
      {
        "hide_at_checkout": null,
        "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
        },
        "sort_order": null,
        "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": 0,
        "product_pricing_id": null,
        "type": "DISCOUNT_AMOUNT"
      }
    ],
    "metadata": {},
    "onetime_items": [
      {
        "aggregate": 123,
        "custom_price": {
          "amount": {
            "currency": "<string>",
            "value_in_cents": 123
          },
          "description": "<string>",
          "product_id": "<string>"
        },
        "product_pricing_id": null,
        "quantity_config": {
          "allow_custom_quantity": true,
          "max_quantity": 123,
          "min_quantity": 123
        },
        "sort_order": null
      }
    ],
    "payment_method_id": null,
    "product_pricing_ids": [
      "<string>"
    ],
    "proration_type": "NEXT",
    "reset_billing_anchor": null,
    "term": {
      "count": 1,
      "frequency": "HOUR"
    },
    "timing": "IMMEDIATE",
    "trial": null,
    "trial_term": {
      "count": 1,
      "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>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string

The idempotency key that will be used to ensure the request is only performed once

Path Parameters

company_id
string
required

The company ID with the prefix 'cmp_'.

Body

application/json
currency
string
required

The currency for the invoice

customer_id
string
required

The customer for the invoice

subscription_id
string | null
required

The subscription ID for the invoice

cancel_config
object

The cancellation configuration for the subscription

change_config
object

The change configuration for subscription

include_taxes
boolean

Whether to include taxes in the invoice

Response

200 - application/json

OK

auto_charges
boolean

Whether the invoice is automatically charged to the payment method on file for the customer

billed_customer_id
string

The billed customer ID for the invoice. This matches the customer_id by default, but can be set to another parent customer ID

created_at
string<date-time>

The date the invoice was created

currency
string

The currency of the invoice

customer_id
string

The customer ID for the invoice

due
object

The total amount due on the invoice after any payments

due_date
string<date-time>

The date the invoice total is due

The hosted link for the invoice

invoice_date
string<date-time>

The date for the invoice

name
string

The name of the invoice

number
string

The invoice number for the invoice

paid
object

The total amount paid against the invoice

paid_date
string<date-time> | null

The date the invoice was paid

The PDF link for the invoice

prorated_amount
object

Any prorated amounts for the invoice

status
string

The status of the invoice such as PAID, DRAFT, VOID or PENDING

sub_total
object

The subtotal of the invoice which is prior to applying credits

subscription_id
string | null

The subscription ID for the invoice, if is not a one-time invoice

total
object

The final total of the invoice after applying all credits, discounts and taxes

updated_at
string<date-time>

The last date the invoice was updated

uuid
string

The unique identifier for the invoice

I