API Documentation
The Coinsub API is designed to help merchants manage subscriptions and purchases seamlessly.
Last updated
The Coinsub API is designed to help merchants manage subscriptions and purchases seamlessly.
Last updated
Overview
This API allows merchants to manage subscriptions and purchases. All endpoints require authentication using Merchant-ID
and API-Key
headers.
All API requests must include the following headers for authentication:
Merchant-ID
: The unique identifier assigned to each merchant.
API-Key
: The API key generated through the merchant dashboard.
To generate and manage your API keys:
Log into with your wallet.
Navigate to Settings.
Click on Click here to manage API Keys.
Note: API keys can be disabled but not re-enabled. To disable an API key, go to the Your API Keys page, locate the key you wish to disable, and click Disable.
Endpoint: POST https://api.coinsub.io/v1/check_subscription_status_product
Description: This endpoint checks whether a subscriber has an active subscription for a specific product. If the subscription is active, it returns active: true
; otherwise, it returns active: false
.
Request Headers:
Merchant-ID
: Unique identifier for the merchant.
API-Key
: API key.
Request Body:
Success Response Example (Subscription is active):
Failure Response Example (Subscription is inactive or doesn't exist):
Error Responses:
400 Bad Request
: The request payload is invalid or the Merchant-ID
format is incorrect.
401 Unauthorized
: The provided API-Key
is invalid or missing.
404 Not Found
: The specified subscriber_id
or subscription_product_id
does not exist.
500 Internal Server Error
: An error occurred on the server while retrieving the subscription status.
Endpoint: POST https://api.coinsub.io/v1/check_subscription_by_metadata
Description: This endpoint checks the subscription status of a subscriber based on metadata. It returns one of three responses: active subscription, inactive subscription, or no matching subscription.
Request Headers:
Merchant-ID
: Unique identifier for the merchant.
API-Key
: API key.
Request Body:
Response Examples:
Active Subscription:
Inactive Subscription:
No Matching Subscription:
Endpoint: GET https://api.coinsub.io/v1/products
Description: Retrieves a list of products available from the merchant. Each product will be categorized as either a "subscription" or "One-Off" type.
Request Headers:
Merchant-ID
: Unique identifier for the merchant.
API-Key
: API key.
Response Example:
Endpoint: GET https://api.coinsub.io/v1/active_subscriptions_and_purchases/{subscriber_id}
Endpoint Example: GET https://api.coinsub.io/v1/active_subscriptions_and_purchases/123e4567-e89b-12d3-a456-426614174000
Description: Retrieves active subscriptions and one-off purchases for a given subscriber ID.
Request Headers:
Merchant-ID
: Unique identifier for the merchant.
API-Key
: API key.
Response Example:
Error Responses:
400 Bad Request
: The subscriber_id
or Merchant-ID
format is invalid.
401 Unauthorized
: The provided API-Key
is invalid or missing.
404 Not Found
: The specified subscriber_id
does not exist.
500 Internal Server Error
: An error occurred on the server while retrieving active subscriptions and purchases.
Endpoint: POST https://api.coinsub.io/v1/active_subscriptions_and_purchases_by_only_metadata
Description: This endpoint retrieves active subscriptions and purchases based on the provided customer metadata.
Request Headers:
Merchant-ID
: Unique identifier for the merchant.
API-Key
: API key.
Request Example:
Response Example:
No Metadata Match Response Example: