The Snapplify subscription service allows a partner to define a Subscription and then allocate that Subscription to a valid Snapplify User and once subscription is allocated to a Snapplify User an order must be created. This Order should indicate the Subscription, User, Price.
Why Use the API:
The User Authentication API enables client applications to authenticate users and retrieve access tokens for secure and authorized access to protected endpoints.
Creating an API Subscription
Use the Subscription API to define the subscription type and the associated content.
Step 1: Set Up Authentication
Before making API calls, ensure you have a valid API token. To request one, email help@snapplify.com with the following information:
Your domain name
Redirect URL (for voucher API)
IP address and endpoint (for product API)
For more details, refer to the article: How to Request an API Key from Snapplify.
Step 2: Create a Subscription
Make a POST
request to the Subscription API endpoint to define a new subscription, specifying the type and associated content.
Confirm subscription is created - A successful response will return a subscription_id, You will use this in the next step to allocate users
Step 3: Allocating the Subscription
Use a Subscription API to allocate a subscription to a Snapplify user. You’ll need to pass the following information:
- The Snapplify User
- Subscription ID
Endpoint
Element | Value |
---|---|
URL | [Base URL]/[resource] |
Method | GET / POST / PUT / DELETE |
Authentication | Yes / No |
Request details
Description | Key | Value |
---|---|---|
Format of request body | Content-Type | application/json |
Authentication token | Authorization | Bearer {token} |
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
user_id | string | body | ✅ | Unique ID of the user |
string | body | ❌ | Optional email address |
Sample Request
http
CopyEdit
POST https://api.example.com/v1/login Content-Type: application/json Authorization: Bearer {your_token} { "username": "janedoe", "password": "securePass123" }
Response
Success (200 OK)
json
CopyEdit
{ "access_token": "abc123", "expires_in": 3600 }
Error (401 Unauthorized)
json
CopyEdit
{ "error": "Invalid credentials", "code": 401 }
Use Case:
An institution offering a "Grade 10 Business Studies" subscription for one year. Using the Subscription API:
- The institution creates the subscription (with content & pricing).
- They then allocate it to the students' accounts.
- When the subscription period ends, access to the content automatically expires.
Tips & Best Practices
- Always use HTTPS to protect sensitive data
- Refresh tokens before they expire (typically 1 hour)
- Log all response codes and errors for better diagnostics
Common Questions
- Which APIs will the subscription access? - Identify the specific endpoints or services needed.
- Who is the subscriber (individual or organization)? - Collect identity and verification info.
- What is the billing model? - Per-call, monthly subscription, pay-as-you-go?
- Is there documentation or developer support? - Access to API docs, SDKs, or community forums.
Additional Resources
- Developer Portal: Snapplify Developer Portal
- API Documentation: Subscription API Documentation
Need help integrating this API? Email us at help@snapplify.com or reach out via WhatsAapp +27 60 011 8065.