Repository navigation
SubscriptionsController API Documentation
This document provides documentation for the Subscriptions API endpoints available in the Points.Api system.
All endpoints in the Subscriptions API require JWT Bearer authentication. Include the JWT token in the Authorization header of your requests:
Authorization: Bearer {your_jwt_token}
Creates a new subscription for the authenticated partner.
URL: /api/Subscriptions
Method: POST
Auth required: Yes (JWT Bearer token)
Request Body:
{
"name": "Premium Subscription",
"description": "Premium subscription with additional features",
"price": 19.99,
"currency": "USD",
"billingFrequency": "monthly",
"features": ["Feature 1", "Feature 2", "Feature 3"]
}Success Response:
- Code: 200 OK
- Content: Created subscription details
Error Response:
- Code: 404 Not Found
-
Content:
"Partner does not exist"
Example Request:
POST /api/Subscriptions HTTP/1.1
Host: your-api-domain.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/json
{
"name": "Premium Subscription",
"description": "Premium subscription with additional features",
"price": 19.99,
"currency": "USD",
"billingFrequency": "monthly",
"features": ["Feature 1", "Feature 2", "Feature 3"]
}Example Response:
{
"id": 123,
"name": "Premium Subscription",
"description": "Premium subscription with additional features",
"price": 19.99,
"currency": "USD",
"billingFrequency": "monthly",
"features": ["Feature 1", "Feature 2", "Feature 3"],
"partnerId": 456,
"createdDate": "2025-03-21T10:51:34Z"
}Notes:
- The partner ID is extracted from the JWT token claims.
- If the partner ID is not found in the claims, a 404 error is returned.
Deletes a subscription.
URL: /api/Subscriptions/{subscriptionId}
Method: DELETE
Auth required: Yes (JWT Bearer token)
URL Parameters:
-
subscriptionId(long) - ID of the subscription to delete
Success Response:
- Code: 200 OK
- Content: Result of the delete operation
Example Request:
DELETE /api/Subscriptions/123 HTTP/1.1
Host: your-api-domain.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Example Response:
{
"success": true,
"message": "Subscription deleted successfully"
}Retrieves all subscriptions for the authenticated partner.
URL: /api/Subscriptions
Method: GET
Auth required: Yes (JWT Bearer token)
Success Response:
- Code: 200 OK
- Content: List of subscriptions for the partner
Error Response:
- Code: 404 Not Found
-
Content:
"Partner does not exist"
Example Request:
GET /api/Subscriptions HTTP/1.1
Host: your-api-domain.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Example Response:
[
{
"id": 123,
"name": "Premium Subscription",
"description": "Premium subscription with additional features",
"price": 19.99,
"currency": "USD",
"billingFrequency": "monthly",
"features": ["Feature 1", "Feature 2", "Feature 3"],
"partnerId": 456,
"createdDate": "2025-03-21T10:51:34Z"
},
{
"id": 124,
"name": "Basic Subscription",
"description": "Basic subscription with core features",
"price": 9.99,
"currency": "USD",
"billingFrequency": "monthly",
"features": ["Feature 1"],
"partnerId": 456,
"createdDate": "2025-03-20T15:30:00Z"
}
]Notes:
- The partner ID is extracted from the JWT token claims.
- If the partner ID is not found in the claims, a 404 error is returned.
- Frequently Asked Questions
-
EZ Loyalty Points Api
- Authorization
- Summary
- End Points
- Branding End Points
- Buckets End Points
- Competition End Points
- Country End Points
- Leader Boards End Points
- Machine Learning End Points
- Partner Activities End Points
- Partner End Points
- Partner FAQs End Points
- Partner Level Points End Points
- Reward Points End Points
- Subscriptions End Points
- Users End Points
- User Points End Points
- EZ Loyalty Admin Api