mutation · Module: Billing · Requires billing:write
Arguments
| Argument | Type | Description |
|---|---|---|
input | PricePlanInput | The fields for this operation. |
PricePlanInput fields
| Field | Type |
|---|---|
name | String |
currency | String |
base_fee | PricePlanInputBaseFeeInput |
prices | [PricePlanInputPricesItemInput!] |
minimum | PricePlanInputMinimumInput |
status | PricePlanInputStatus |
user_metadata | UserMetadataInput |
Returns
PricePlan!
| Field | Type |
|---|---|
id | String! |
object | PricePlanObject! |
livemode | Boolean! |
created | Int! |
updated | Int |
name | String! |
currency | String! |
base_fee | PricePlanBaseFee |
prices | [PricePlanPricesItem!]! |
minimum | PricePlanMinimum |
status | PricePlanStatus |
user_metadata | UserMetadata |
carrier_metadata | CarrierMetadata |
system_metadata | SystemMetadata |
Errors
Errors are returned inerrors[], with the REST error object in extensions (type, code, param, request_id), using the codes in Conventions §9.
mutation CreatePricePlan($input: PricePlanInput!) {
createPricePlan(input: $input) {
id
object
name
status
livemode
created
updated
currency
base_fee {
amount
currency
interval
}
prices {
meter
model
unit_amount
included
rate
tiers {
up_to
unit_amount
}
}
minimum {
amount
currency
interval
}
}
}
{
"input": {
"name": "Example",
"currency": "usd",
"base_fee": {
"amount": 1299,
"currency": "usd",
"interval": "example"
},
"prices": [
{
"meter": "example",
"model": "per_unit",
"unit_amount": 1.5,
"included": 2
}
],
"minimum": {
"amount": 1299,
"currency": "usd",
"interval": "example"
},
"status": "active"
}
}
{
"data": {
"createPricePlan": {
"id": "plan_1a2B3c",
"object": "price_plan",
"name": "Example",
"status": "active",
"livemode": true,
"created": 1791302400,
"updated": 1791302400,
"currency": "usd",
"base_fee": {
"amount": 1299,
"currency": "usd",
"interval": "example"
},
"prices": [
{
"meter": "example",
"model": "per_unit",
"unit_amount": 1.5,
"included": 2,
"rate": 0.145,
"tiers": [
{
"up_to": 2,
"unit_amount": 1.5
}
]
}
],
"minimum": {
"amount": 1299,
"currency": "usd",
"interval": "example"
}
}
}
}