Skip to content

Create a plan

POST
/v1/plans
curl -X POST "https://api.summerbase.com/v1/plans" \
-H "Authorization: Bearer sb_..." \
-H "Content-Type: application/json" \
-d '{
"properties": {
"name": "Growth"
}
}'

Creates a plan, for prices to be put on, named by properties.name, and archived by properties.archived. A billing system that makes a plan should say archived, true or false; a plan no source says is archived is not.

Create a plan before the prices on it, under your own id with PATCH /v1/plans/{id}, so that each price can name it.

expand[]
Array<string>
<= 10 items
Allowed values: prices

Relationships to include in the response instead of fetching separately. A dotted path expands what an expanded record can expand in turn — at most 4 deep, 10 paths a request, and never back to a record already on the path.

Media typeapplication/json
object
on_warning

What to do about the parts of this write that cannot be applied as sent, or that would merge two records together.

warn applies everything it can and reports the rest in warnings, so one unusable property never costs you a subscription’s amounts. error applies none of it unless all of it applies: the write is rolled back and every warning comes back as an error instead.

Send error from a form, where somebody is waiting to be told what to fix, and where folding two customers together is a thing to confirm rather than to discover afterwards. Leave it alone in an ingest client, which wants the revenue to land either way.

string
Allowed values: warn error
properties

Properties to record in your source.

Property keys and the values to set. Only the keys named here change; null clears one.

object
key
additional properties
Any of:
string

Example

{
"properties": {
"name": "Growth"
}
}

Returns the plan object, with response_metadata about this request.

Media typeapplication/json
object
response_metadata

About this request rather than about the record. Absent when there is nothing to say.

object
warnings

Parts of this write that were skipped — a property whose value did not fit its type — and things it did that were worth saying, like merging two customers. The rest of the write landed. Absent when there is nothing to report.

Send on_warning: "error" to have these refuse the write instead, and come back as error.errors with the same codes.

Array<object>
object
code
required

What kind of thing was skipped, for a client to branch on.

string
field

The input it came from, like properties.seats.

string
message
required

What was skipped and why, in a sentence.

string

Example

{
"archived": false,
"created_at": "2025-09-08T14:12:30Z",
"id": "0198f1a4-1d2e-7a40-9b31-5c6d7e8f9a0b",
"identities": [
"stripe:prod_QhR2sT4uV6wX8y"
],
"name": "Growth",
"object": "plan",
"price_count": 2,
"properties": {
"tier": "mid"
},
"properties_by_source": {
"backend": {
"tier": "mid"
}
}
}