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

ElementValue
URL[Base URL]/[resource]
MethodGET / POST / PUT / DELETE
AuthenticationYes /  No
Specify environment variants if relevant: dev, staging, production.


Request details

DescriptionKeyValue
Format of request bodyContent-Typeapplication/json
Authentication tokenAuthorizationBearer {token}


Parameters

NameTypeLocationRequiredDescription
user_idstringbodyUnique ID of the user
emailstringbodyOptional email address
Ensure parameter location is explicit (query/path/body).


 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


Need help integrating this API? Email us at help@snapplify.com or reach out via WhatsAapp +27 60 011 8065.