/plan/{plan_id}/suspension
Create a Suspension Period
(POST /plan/<plan_id>/suspension)
This endpoint allows the creation of a suspension period for an existing plan. It also allows scheduling suspension periods for the future.
If no end date is specified for the period, an indefinite suspension period will be created, which will take effect according to the specified start date and will end with a manual deactivation of the suspension period.
If the number of installments to be suspended is specified, a suspension period with installment limitation will be created, which will suspend the indicated number of installments and will reactivate the plan when the number of suspended installments has been exceeded. It is important to note that each plan may have a different periodicity; therefore, when a suspension period with installment limitation is created, the duration for which the plan will remain suspended will vary depending on the plan's periodicity. For example, if the plan has a monthly periodicity and is suspended for two installments, it will be suspended for a period of two months; on the other hand, if a plan has a quarterly periodicity and is suspended for two installments, its total suspension will be six months.
The creation of suspensions has no limitations except for creating suspension periods with a start date earlier than the current date.
Request Body
- suspended_at(string): The date on which the suspension period will take effect.
2016-01-01
- restrictions:
- format: yyyy-mm-dd
- default value: current day
- minimum value: greater than or equal to the current day
- restrictions:
- resumed_at(string): The date on which the suspension period will end.
2016-03-01
- restrictions:
- format: yyyy-mm-dd
- minimum value: greater than the
suspended_at
field
- restrictions:
- fees(integer): Number of installments to suspend.
- restrictions:
- default value: ""
- minimum value: 1
- restrictions:
- description(string): Brief description of the reason for the suspension.
Suspension requested by the client
- restrictions:
- default value: ""
- pattern: [\w-\s]
- minimum length: 6
- maximum length: 256
- restrictions:
Example of Indefinite Suspension Period
{
"key": "{{api-key}}",
"resource": "{{resource-key}}",
"nonce": "1234567890",
"mode": "sha256",
"payload": {
"suspended_at": "2016-01-01"
}
}
Example: Suspension Period with End Date
{
"key": "{{api-key}}",
"resource": "{{resource-key}}",
"nonce": "1234567890",
"mode": "sha256",
"payload": {
"suspended_at": "2016-01-01",
"resumed_at": "2016-03-01"
}
}
Example: Suspension Period with Quota Limitation
{
"key": "{{api-key}}",
"resource": "{{resource-key}}",
"nonce": "1234567890",
"mode": "sha256",
"payload": {
"suspended_at": "2016-01-01",
"fees": 3
}
}
Response - Success
- suspension_id (string): Identifier of the suspension needed to perform actions on it.
- active (bool): Indicates whether the suspension is active, meaning if the plan is suspended or not.
{
"uuid": "134b493f-b267-43c7-a674-a33b2f2b2cf3",
"payload": {
"suspension_id": "c0535e4be2b79ffd93291305436bf889314e4a3faec05ecffcbb7df31ad9e51a",
"description": "suspension by client",
"suspended_at": "2016-08-22",
"resumed_at": "2016-10-22",
"active": false
},
"description": "suspension added successfully",
"code": "0",
"type": "success",
"detail": "suspension_added",
"request_id": null
}