Get Customer Subscriptions
Request:
GET /api/v1/customer/#{customer_id}/subscriptions
JSON Response Example:
{
"data": [
{
"id": "7",
"type": "subscription",
"attributes": {
"customer_id": 7,
"tea_id": 10,
"price": 5.99,
"frequency_monthly": 5,
"cancelled": true
}
},
{
"id": "8",
"type": "subscription",
"attributes": {
"customer_id": 7,
"tea_id": 11,
"price": 2.5,
"frequency_monthly": 10,
"cancelled": false
}
},
{...},
{...},
]
}
Cancel Subscription
Request:
DELETE /api/v1/customer/#{customer_id}/subscriptions/#{subscription_id}
JSON Response Example:
{
"message": "The subscription was successfully cancelled"
}
Create Subscription
Request:
POST /api/v1/customer/#{customer_id}/subscriptions
Request Body Example:
{
"tea_id": 2,
"price": 5.99,
"frequency_monthly": 2
}
JSON Response Example:
{
"data":
{
"id": "7",
"type": "subscription",
"attributes": {
"customer_id": 7,
"tea_id": 2,
"price": 5.99,
"frequency_monthly": 2,
"cancelled": false
}
}
}