Register Plan
Allows you to register a billing plan with the subscription frequency and a timely payment reminder for the user.
Method
POST
URL
https://b61cr11gvd.execute-api.us-east-1.amazonaws.com/v1/api/payment/suscription/plans
Request Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Bearer Token |
Request Body
Name | Type | Description |
---|---|---|
hash* | string | Hash generated in /payment/create |
interval* | string | The frequency with which a plan is paid. Allowed values: month , week , day |
interval_count* | string | The number of intervals (specified in the interval attribute) between plan payments. For example, if interval=month and interval_count=1, payment will be made monthly. If interval=month and interval_count=3, payment will be made every 3 months. If interval=week and interval_count=1, payment will be made weekly. |
amount* | string | Plan value. Can have a maximum of 2 decimal places. |
description* | string | Short plan description. Do not include special characters. |
Request (example)
{
"hash": "U2FsdGVkX19oU6%....",
"interval": "month",
"timestamp": 1686943428,
"interval_count": "1",
"amount": "10",
"description": "Test Suscripcion 2"
}
Response Codes
- 202: Accepted Payment
- 406: Payment declined
- 422: Unprocessable Entity - The body sent is incorrect
- 401: Unauthorized - Header Authorization not sent
- 401: Unauthorized - Token malformation
Response (example)
{
"status": {
"code": 202,
"message": "success",
"kind": "unknown"
},
"data": {
"CODE": "0000",
"DESC": "OK",
"DATA": {
"id": "1172a142-f29c-4ddb-b822-b518e9bb79cb",
"description": "",
"interval": "month",
"interval_count": "1",
"amount": "12000"
}
}
}