POST
/
companies
/
{company_id}
/
invoices
/
next
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": {
    "charge_remaining_balance": true,
    "custom_end_date": "2023-11-07T05:31:56Z",
    "custom_refund_amount": {
      "currency": "<string>",
      "value_in_cents": 123
    },
    "customer_cancel_reason": "<string>",
    "reason": "subscription.revoked",
    "refund_type": "PRORATED",
    "send_customer_receipt": true,
    "timing": "IMMEDIATE"
  },
  "change_config": {
    "auto_charges": true,
    "config_items": [
      {
        "minimum_units": 1,
        "num_licenses": 1,
        "product_metric_pricing_id": "<string>",
        "product_pricing_id": "<string>",
        "quantity_config": {
          "allow_custom_quantity": true,
          "max_quantity": 123,
          "min_quantity": 123
        },
        "upsell_product_metric_pricing_id": "<string>"
      }
    ],
    "currency": "<string>",
    "discounts": [
      {
        "amount": {
          "currency": "<string>",
          "value_in_cents": 123
        },
        "cap": {
          "currency": "<string>",
          "value_in_cents": 123
        },
        "expiration_date": "2023-11-07T05:31:56Z",
        "name": "<string>",
        "percent": 123,
        "product_pricing_id": "<string>",
        "type": "DISCOUNT_AMOUNT"
      }
    ],
    "metadata": {},
    "onetime_items": [
      {
        "aggregate": 2,
        "custom_price": {
          "amount": {
            "currency": "<string>",
            "value_in_cents": 123
          },
          "description": "<string>",
          "product_id": "<string>"
        },
        "product_pricing_id": "<string>",
        "quantity_config": {
          "allow_custom_quantity": true,
          "max_quantity": 123,
          "min_quantity": 123
        }
      }
    ],
    "payment_method_id": "<string>",
    "product_pricing_ids": [
      "<string>"
    ],
    "proration_type": "NEXT",
    "reset_billing_anchor": true,
    "term": {
      "count": 2,
      "frequency": "HOUR"
    },
    "timing": "IMMEDIATE",
    "trial": true,
    "trial_term": {
      "count": 2,
      "frequency": "HOUR"
    }
  },
  "currency": "<string>",
  "customer_id": "<string>",
  "include_taxes": true,
  "subscription_id": "<string>"
}'
{
  "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": "<string>",
  "invoice_date": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "number": "<string>",
  "paid": {
    "currency": "<string>",
    "value_in_cents": 123
  },
  "paid_date": "2023-11-07T05:31:56Z",
  "pdf_link": "<string>",
  "prorated_amount": {
    "currency": "<string>",
    "value_in_cents": 123
  },
  "status": "<string>",
  "sub_total": {
    "currency": "<string>",
    "value_in_cents": 123
  },
  "subscription_id": "<string>",
  "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

Company ID. It should have a prefix 'cmp_'.

Body

application/json

Response

200 - application/json

OK

The response is of type object.