Update proration policy
PUT/subscriptions/proration-policies/:proration_policy_uuid
You can update a proration policy at any time. For any subscriptions that are using the updated proration policy, the changes are also applied. Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the proration policy is not updated.
When updating proration policies:
- You can change the name of an existing policy.
- You can update
rounding
. - You can update
external_ref
as long asexternal_ref
is still unique in your store. - You can remove
external_ref
as this attribute is optional. - You cannot remove any required attributes, such as
name
orrounding
.
Request
Path Parameters
The unique identifier of a proration policy.
- application/json
Body
data ProrationPolicyUpdaterequired
The unique identifier.
Possible values: [subscription_proration_policy
]
attributes ProrationPolicyUpdateAttributesrequired
Possible values: <= 2048 characters
A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.
Possible values: >= 3 characters
and <= 1024 characters
The name of the proration policy.
Possible values: [up
, down
, nearest
]
Whether to round up or down
Responses
- 200
- 400
- 403
- 404
- 409
Success. The proration policy details are updated.
- application/json
- Schema
- Example (from schema)
Schema
- round up to the next unit, ensuring subscribers are charged slightly more to cover any partial use.
- round down to the previous whole unit, providing subscribers with a slight benefit by not charging for partial use.
- round to the nearest whole unit, whether up or down, based on standard rounding rules. For example, rounding 0.5 up and rounding 0.5 down.
data ProrationPolicy
The unique identifier.
Possible values: [subscription_proration_policy
]
attributes ProrationPolicyAttributesrequired
Possible values: >= 3 characters
and <= 1024 characters
A name for the proration policy.
Possible values: [up
, down
, nearest
]
When rounding in proration, you must decide how to round the units of time used to calculate the charges.
Possible values: <= 2048 characters
A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.
meta ProrationPolicyMetarequired
The owner of a resource, either store
or organization
.
timestamps Timestampsrequired
The date and time a resource was updated.
The date and time a resource was created.
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "subscription_proration_policy",
"attributes": {
"name": "Main Policy",
"rounding": "up",
"external_ref": "abc123"
},
"meta": {
"owner": "store",
"timestamps": {
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z"
}
}
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (from schema)
- missing-name
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Validation Error",
"status": "400",
"detail": "data.attributes.name: \"name\" is required"
}
]
}
Forbidden. The operation is forbidden on this entity.
- application/json
- Schema
- Example (from schema)
- not-found
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Permission denied",
"status": "404",
"detail": "Permission denied: plan tenancy mismatch"
}
]
}
Not found. The requested entity does not exist.
- application/json
- Schema
- Example (from schema)
- not-found
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Not Found",
"status": "404",
"detail": "No plan found"
}
]
}
Write conflict. Unable to perform the operation at this time.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Write Conflict",
"status": "409"
}
]
}