Authentication
GET /auth/status
Check the current authentication status of the user.
Parameters
Name | Type | Required | Description |
---|---|---|---|
session_id |
String | Yes | The session identifier. |
{
"authenticated": true,
"user_id": "usr_abc123",
"expires_in": 3600
}
POST /auth/login
Authenticate a user with their credentials.
Parameters
Name | Type | Required | Description |
---|---|---|---|
username |
String | Yes | The user's username. |
password |
String | Yes | The user's password. |
{
"session_id": "sess_xyz789",
"message": "Login successful"
}
Users
GET /users/{user_id}
Retrieve details for a specific user.
Parameters
Name | Type | Required | Description |
---|---|---|---|
user_id |
String | Yes | The unique identifier for the user. (Path Parameter) |
{
"user_id": "usr_abc123",
"username": "dev_user",
"email": "dev@example.com",
"created_at": "2023-10-27T10:00:00Z"
}
GET /users
List all users. Supports pagination.
Parameters
Name | Type | Required | Description |
---|---|---|---|
page |
Integer | No | The page number for results. Defaults to 1. |
limit |
Integer | No | Number of results per page. Defaults to 20. |
{
"total": 50,
"page": 1,
"limit": 20,
"users": [
{"user_id": "usr_abc123", "username": "dev_user"},
{"user_id": "usr_def456", "username": "tester"}
// ... more users
]
}
Products
GET /products/{product_id}
Retrieve details for a specific product.
Parameters
Name | Type | Required | Description |
---|---|---|---|
product_id |
String | Yes | The unique identifier for the product. (Path Parameter) |
{
"product_id": "prod_xyz789",
"name": "SDK Pro License",
"description": "Full access to premium SDK features.",
"price": 99.99,
"currency": "USD",
"available": true
}
Orders
POST /orders
Create a new order.
Parameters
Name | Type | Required | Description |
---|---|---|---|
user_id |
String | Yes | The ID of the user placing the order. |
items |
Array | Yes | An array of product IDs and quantities. |
{
"order_id": "ord_1a2b3c",
"status": "pending",
"total_amount": 199.98,
"created_at": "2023-10-27T11:00:00Z"
}
Payments
POST /payments
Process a payment for an order.
Parameters
Name | Type | Required | Description |
---|---|---|---|
order_id |
String | Yes | The ID of the order to pay for. |
payment_method |
String | Yes | The payment method (e.g., 'credit_card', 'paypal'). |
card_details |
Object | Conditional | Required if payment_method is 'credit_card'. Contains card number, expiry, CVV. |
{
"payment_id": "pay_a1b2c3d4",
"order_id": "ord_1a2b3c",
"status": "processed",
"amount": 199.98,
"processed_at": "2023-10-27T11:05:00Z"
}