Skip to main content
POST
/
customers
/
{customer_id}
/
plans
/
add
Add a plan to a customer
curl --request POST \
  --url https://api.metronome.com/v1/customers/{customer_id}/plans/add \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "starting_on": "2023-11-07T05:31:56Z",
  "ending_before": "2023-11-07T05:31:56Z",
  "net_payment_terms_days": 123,
  "price_adjustments": [
    {
      "charge_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "adjustment_type": "percentage",
      "start_period": 123,
      "value": 123,
      "quantity": 123,
      "tier": 123
    }
  ],
  "trial_spec": {
    "length_in_days": 123,
    "spending_cap": {
      "credit_type_id": "<string>",
      "amount": 123
    }
  },
  "overage_rate_adjustments": [
    {
      "custom_credit_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "fiat_currency_credit_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "to_fiat_conversion_factor": 123
    }
  ]
}
'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

customer_id
string<uuid>
required

Body

application/json

The customer ID, plan ID, and date range for the plan to be applied

plan_id
string<uuid>
required
starting_on
string<date-time>
required

RFC 3339 timestamp for when the plan becomes active for this customer. Must be at 0:00 UTC (midnight).

ending_before
string<date-time>

RFC 3339 timestamp for when the plan ends (exclusive) for this customer. Must be at 0:00 UTC (midnight).

net_payment_terms_days
number

Number of days after issuance of invoice after which the invoice is due (e.g. Net 30).

price_adjustments
object[]

A list of price adjustments can be applied on top of the pricing in the plans. See the price adjustments documentation for details.

trial_spec
object

A custom trial can be set for the customer's plan. See the trial configuration documentation for details.

overage_rate_adjustments
object[]

An optional list of overage rates that override the rates of the original plan configuration. These new rates will apply to all pricing ramps.

Response

200 - application/json

Success

data
object
required