POST
/
companies
/
{company_id}
/
checkout
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": true,
  "auto_renews": true,
  "change_proration_type": "NEXT",
  "change_reset_billing_anchor": true,
  "change_timing": "IMMEDIATE",
  "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>"
    }
  ],
  "customer_id": "<string>",
  "discounts": [
    {
      "amount": {
        "currency": "<string>",
        "value_in_cents": 123
      },
      "cap": {
        "currency": "<string>",
        "value_in_cents": 123
      },
      "coupon_id": "<string>",
      "customer_id": "<string>",
      "expiration_date": "2023-11-07T05:31:56Z",
      "import_created_at_ref": "2023-11-07T05:31:56Z",
      "import_ref": "<string>",
      "imported_from": "<string>",
      "item_pricing_id": "<string>",
      "name": "<string>",
      "onetime_billable_id": "<string>",
      "percent": 1,
      "product_id": "<string>",
      "product_pricing_id": "<string>",
      "proposal_id": "<string>",
      "state": "ACTIVE",
      "subscription_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
      }
    }
  ],
  "options": {
    "allow_promo_code": true,
    "completion_action": "REDIRECT",
    "confirmation_message": "<string>",
    "redirect_url": "<string>",
    "requires_customer_address": true
  },
  "previous_subscription_id": "<string>",
  "product_pricing_ids": [
    "<string>"
  ],
  "term": {
    "count": 2,
    "frequency": "HOUR"
  },
  "trial": true,
  "trial_term": {
    "count": 2,
    "frequency": "HOUR"
  },
  "type": "CHECKOUT_SESSION"
}'
{
  "id": "<string>",
  "url": "<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.