The following endpoint can be used to add or update a Suscripción within the Hyfin application. When a Suscripción is added to Hyfin, a request will be automatically generated and the customer will be notified via text message, email or both based on the notification options set on the customer record. After submitting their payment method, the customer will automatically be charged based on the frequency of the recurring payment.
If the customer is viewing the Suscripción on their device and it gets updated, a message will display letting the customer know the Suscripción has been updated and the new version of the Suscripción will automatically be displayed on the customers device.
The following endpoint can be used to add or update a Suscripción. You must replace the {base_url} and {site_id} variable with the site id that was provided when the site was created.
{
"_id": "61f32dc2f62bdc6a48945067",
"description": "Gold+ Plan",
"amount": 34.99,
"frequency": "Monthly",
"frequency_units": 1,
"customer": {
"_id": "61f32dc2f62bdc6a48951255",
"first_name": "John",
"last_name": "Doe",
"mobile_phone": "111-222-3333",
"email": "johndoe@abc.com"
},
"webhook_url": "https://yourcompany.com/webhook"
}
{
"success": true,
"action": "added",
"_id": "60f720d248f143332af022e0"
}
{
"success": false,
"errors": [
"invalid field2",
"missing field_name"
]
}