POST
/
companies
/
{company_id}
/
checkout
Create Checkout Session
curl --request POST \
  --url https://api.maplebilling.com/api/v1/companies/{company_id}/checkout \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "auto_charges": null,
  "auto_renews": null,
  "change_proration_type": null,
  "change_reset_billing_anchor": null,
  "change_timing": 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
    }
  ],
  "customer_id": null,
  "discounts": [
    {
      "amount": {
        "currency": "<string>",
        "value_in_cents": 123
      },
      "cap": {
        "currency": "<string>",
        "value_in_cents": 123
      },
      "coupon_id": null,
      "customer_id": null,
      "expiration_date": null,
      "import_created_at_ref": null,
      "import_ref": null,
      "imported_from": null,
      "item_pricing_id": null,
      "name": "<string>",
      "onetime_billable_id": null,
      "percent": 1,
      "product_id": null,
      "product_pricing_id": null,
      "proposal_id": null,
      "state": null,
      "subscription_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
      }
    }
  ],
  "options": {
    "allow_promo_code": null,
    "completion_action": null,
    "confirmation_message": null,
    "redirect_url": null,
    "requires_customer_address": null
  },
  "previous_subscription_id": null,
  "product_pricing_ids": [
    "<string>"
  ],
  "term": {
    "count": 2,
    "frequency": "HOUR"
  },
  "trial": null,
  "trial_term": {
    "count": 2,
    "frequency": "HOUR"
  },
  "type": "CHECKOUT_SESSION"
}'
{
  "id": "<string>",
  "url": null
}

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

Response

200 - application/json

OK

The response is of type object.