Variant of the plan. This field is optional in create and update requests. The variant is subscription when recurringInterval is present. If included, this field must match the applicable variant. A mismatch results in an HTTP 422 response. Responses always include this field.
Creates or updates (upserts) a plan with a specified ID.
{ "color": "red", "size": "xxl" }
One-time setup fee charged when the plan starts. Set to 0 or null if no setup fee applies.
Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.
{ "foo": "bar" }
- Mock serverhttps://www.rebilly.com/_mock/catalog/all/plans/{id}
- Sandbox serverhttps://api-sandbox.rebilly.com/organizations/{organizationId}/plans/{id}
- Live serverhttps://api.rebilly.com/organizations/{organizationId}/plans/{id}
curl -i -X PUT \
'https://www.rebilly.com/_mock/catalog/all/plans/{id}' \
-H 'Content-Type: application/json' \
-H 'REB-APIKEY: YOUR_API_KEY_HERE' \
-d '{
"type": "subscription",
"name": "string",
"description": "string",
"richDescription": "string",
"productId": "prod_0YV7DES3WPC5J8JD8QTVNZBZNZ",
"productOptions": {
"color": "red",
"size": "xxl"
},
"currency": "USD",
"pricing": {
"formula": "fixed-fee",
"price": 99.95
},
"setup": {
"price": 0.1
},
"setupFee": 0,
"customFields": {
"foo": "bar"
},
"isActive": true,
"recurringInterval": {
"periodAnchorInstruction": {
"method": "day-of-month",
"day": 1,
"time": "14:15:22Z"
},
"unit": "day",
"length": 1,
"limit": 1,
"billingTiming": "prepaid"
},
"trial": {
"price": 0.1,
"period": {
"unit": "day",
"length": 1
}
},
"meteredBilling": {
"strategy": "sum",
"min": 0.01,
"max": 0.01,
"sticky": false
},
"invoiceTimeShift": {
"issueTimeShift": {
"chronology": "before",
"duration": 1,
"unit": "second"
},
"dueTimeShift": {
"duration": 1,
"unit": "hour"
}
}
}'Maximum number of requests available at one time for this rate limit. For more information, see Rate limits.
Number of requests still available for this rate limit. For more information, see Rate limits.
Variant of the plan. This field is optional in create and update requests. The variant is subscription when recurringInterval is present. If included, this field must match the applicable variant. A mismatch results in an HTTP 422 response. Responses always include this field.
{ "color": "red", "size": "xxl" }
One-time setup fee charged when the plan starts. Set to 0 or null if no setup fee applies.
Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.
{ "foo": "bar" }
Use invoice time shift to control the billing time.
Invoice time shift adjusts the invoice issue and due date when billing must occur before the service period changes.
Use invoice time shift in conjunction with billingTiming to:
- Bill immediately when the service period starts.
- Bill immediately after the service period ends.
- Bill at an interval of time before the service period starts.
- Bill at an interval of time after the service period starts.
- Bill at an interval of time before the service period ends.
- Bill at an interval of time after the service period ends.
{ "id": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X", "type": "subscription", "name": "string", "description": "string", "richDescription": "string", "productId": "prod_0YV7DES3WPC5J8JD8QTVNZBZNZ", "productOptions": { "color": "red", "size": "xxl" }, "currency": "USD", "currencySign": "string", "pricing": { "formula": "fixed-fee", "price": 99.95 }, "setup": { "price": 0.1 }, "setupFee": 0, "customFields": { "foo": "bar" }, "isActive": true, "revision": 0, "isTrialOnly": false, "recurringInterval": { "periodAnchorInstruction": { … }, "unit": "day", "length": 1, "limit": 1, "billingTiming": "prepaid" }, "trial": { "price": 0.1, "period": { … } }, "meteredBilling": { "strategy": "sum", "min": 0.01, "max": 0.01, "sticky": false }, "invoiceTimeShift": { "issueTimeShift": { … }, "dueTimeShift": { … } }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ { … } ] }