Documentation for the Billing Client API
The Paymenter Client API allows end-users to interact programmatically with the Paymenter platform to manage their orders, invoices, services, and account information. This documentation provides a detailed guide for interacting with the API, designed for customers using the Paymenter-powered shop at cptcr.shop.
Written By Cptcr
Last updated About 1 year ago
1. Introduction
The Paymenter Client API allows customers to access and manage their account and services programmatically. You can automate tasks such as retrieving service information, viewing invoices, or creating support tickets.
Base URL
The base URL for the Paymenter Client API is:
https://cptcr.shop/api/client This is the entry point for all API requests. All endpoints mentioned in this guide are relative to the base URL.
2. Authentication
The Paymenter Client API uses API keys for authentication. These keys are user-specific and must be included in all requests.
Generating an API Key
Visit cptcr.shop and log in to your account.
Go to your Profile Settings.
Navigate to the API Keys section.
Click Generate API Key, provide a name, and optionally set an expiry date.
Save the generated key securely, as it will only be shown once.
Using an API Key
Include the API key in the Authorization header of your HTTP requests, using the following format:
Authorization: Bearer <API_KEY> Example Request (cURL):
curl -X GET "https://cptcr.shop/api/client/account" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" 3. API Endpoints Overview
Here is a quick overview of the key endpoints available in the Paymenter Client API:
4. Detailed Endpoint Reference
1. Retrieve Account Details
Retrieve basic information about the authenticated user.
Endpoint:
GET /account Example Request:
curl -X GET "https://cptcr.shop/api/client/account" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" Example Response:
{ "data": { "id": 1, "name": "John Doe", "email": "john.doe@example.com", "balance": 10.00, "currency": "USD" } } 2. List Services
Retrieve a list of services associated with your account.
Endpoint:
GET /services Example Request:
curl -X GET "https://cptcr.shop/api/client/services" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" Example Response:
{ "data": [ { "id": 123, "name": "Minecraft Server Hosting", "status": "Active", "next_due_date": "2025-02-01", "price": 5.00 }, { "id": 124, "name": "CS:GO Server Hosting", "status": "Pending", "next_due_date": "2025-02-15", "price": 7.50 } ] } 3. Get Invoice Details
Retrieve detailed information about a specific invoice.
Endpoint:
GET /invoices/{invoice_id} Example Request:
curl -X GET "https://cptcr.shop/api/client/invoices/456" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" Example Response:
{ "data": { "id": 456, "status": "Unpaid", "total": 12.50, "currency": "USD", "due_date": "2025-01-31", "items": [ { "description": "Minecraft Server Hosting", "amount": 5.00 }, { "description": "Backup Addon", "amount": 7.50 } ] } } 4. Create a Support Ticket
Open a new support ticket for your account.
Endpoint:
POST /tickets Request Body:
{ "title": "Issue with my Minecraft Server", "message": "The server is not starting properly after the update.", "priority": "High" } Example Request:
curl -X POST "https://cptcr.shop/api/client/tickets" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "Issue with my Minecraft Server", "message": "The server is not starting properly after the update.", "priority": "High" }' Example Response:
{ "data": { "id": 789, "title": "Issue with my Minecraft Server", "status": "Open", "priority": "High", "created_at": "2025-01-24T12:00:00Z" } } 5. Error Handling
The API returns standard HTTP status codes to indicate success or failure:
Example Error Response:
{ "error": { "message": "Invalid API key", "status": 401 } } 6. Best Practices
Secure Your API Key: Treat your API key like a password. Never expose it in public repositories.
Rate Limiting: Avoid sending excessive requests in a short period to prevent potential rate limiting by the server.
Validate Responses: Always check the status codes and handle errors gracefully in your application.
Keep API Keys Unique: Use different API keys for different applications or projects to monitor usage more effectively.
7. FAQ
Q: How do I regenerate my API key?
A: Go to the API Keys section in your profile settings on cptcr.shop. Delete the old key and generate a new one.
Q: Can I use this API to access services I don’t own?
A: No, the Paymenter Client API only provides access to services and information tied to your account.
Q: Are there any request limits?
A: Some hosts may impose rate limits. Contact support at cptcr.shop for details.
For further assistance, visit cptcr.shop or contact support.