Path Parameters
The unique identifier of the service you want to attach this plan to. The service must exist; passing an invalid ID returns a
404.Request Body
The display name for the plan. This name appears on invoices and in the checkout flow presented to the payer.
The pricing model for the plan. Accepted values are:
FIXED_RECURRING— charges the subscriber the sameamounton every billing cycle (e.g. monthly SaaS).USAGE_BASED— charges based on reported usage events. Theamountfield represents the per-unit price.ONE_TIME— charges the subscriber once at checkout with no renewal.
The charge amount in USDC. You can pass this as a decimal string (e.g.
"49.00") or a number (e.g. 49). The value is stored with six decimal places of precision (e.g. "49.000000"). Must be a non-negative value.A human-readable description of what the plan includes. This appears in checkout sessions and on invoices.
How often the subscriber is billed. Accepted values are
MONTH, WEEK, DAY, and NONE. Defaults to NONE if omitted.MONTH— billed once per calendar month.WEEK— billed once per week.DAY— billed daily.NONE— no automatic recurring billing (use withONE_TIMEorUSAGE_BASEDplans).
The settlement currency for the plan. Defaults to
USDC if omitted. Currently only USDC is supported.For
FIXED_RECURRING plans, set billingInterval to MONTH, WEEK, or DAY to enable automatic recurring settlement. Leaving it as NONE on a recurring plan will prevent automatic renewals.Response
A successful request returns HTTP201 Created with the new plan object.
The newly created payment plan object.
Error Responses
| Status | Message | Condition |
|---|---|---|
400 Bad Request | name is required. | name was omitted. |
400 Bad Request | amount is required. | amount was omitted. |
400 Bad Request | pricingType must be one of: FIXED_RECURRING, USAGE_BASED, ONE_TIME. | An invalid pricingType value was provided. |
400 Bad Request | billingInterval must be one of: MONTH, WEEK, DAY, NONE. | An invalid billingInterval value was provided. |
404 Not Found | Referenced database record was not found. | No service exists for the provided serviceId. |