This API endpoint allows authenticated users to retrieve detailed information about their active subscription plans and the remaining query or credit balance associated with each plan. By providing a valid API key, the system identifies the user and returns a list of processed transactions along with plan details, purchase and expiry dates, renewal type, total allocated queries, and the number of queries already used. This enables users to easily monitor their available credits across multiple active plans and manage their usage accordingly.
API Usage check for available credits or authentication:
This method is used to check the available credits or authentication status of the user.
curl --locationhttps://staging.editpad.org/api/user/usage
\ --requestPOST
\ --header'Accept: application/json'
\ --header'Content-Type: application/json'
\ --header'Authorization: Bearer
API_KEY
'
Successful Response:
This API returns a structured JSON response containing details about all active and processed subscription plans associated with the authenticated user. For each plan, the response includes the plan name, purchase date, expiry date, along with the total number of queries (credits) allocated and the number of queries already used. This allows the user to easily track their current usage and remaining credits across multiple subscriptions. The response ensures transparency in plan usage and helps users manage their credits effectively.
{;"error"
: false,"user"
: {"name"
: "User Name","email"
: "[email protected]","api_key"
: "API_KEY
" }"memberships"
: {"plan_name"
: "API Plan Name","purchase_date"
: "2025-10-16","expiry_date"
: "2025-11-16","total_credits"
: 10000// total credits available for this plan
"used_credits"
: 100// credits used for this plan
} }
Incorrect API key:
;// Response Status: 401 Unauthorized
{"type"
: "invalid_request","message"
: "incorrect API key provided", }
User does not have an API plan:
;// Response Status: 401 Unauthorized
{"type"
: "invalid_request","message"
: "you are not API premium user", }