Products API
Get Products
Retrieve a list of available digital products from the SofizPay catalog, with optional filtering by name
API Endpoint
GET
https://sofizpay.com/services/get_products/This endpoint returns available products filtered by availability, returning only simplified information (name and price)
This endpoint requires a valid Stellar secret key for authentication via the encrypted_sk field
Request Parameters
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
encrypted_sk | string | Yes | Encrypted or plain Stellar secret key. Can be a plain key starting with "S" (56 characters) or an RSA-encrypted base64-encoded key |
search | string | No | Optional search term to filter products by name |
Request Example
Example with search term
bash
curl -X GET "https://sofizpay.com/services/get_products/" \
-H "Content-Type: application/json" \
-d '{
"encrypted_sk": "SBXJ...",
"search": "PUBG"
}'Example without search term (all products)
bash
curl -X GET "https://sofizpay.com/services/get_products/" \
-H "Content-Type: application/json" \
-d '{
"encrypted_sk": "SBXJ..."
}'Success Response (200)
Returns a list of available products with their names and prices in DZT
json
1{
2 "status": "success",
3 "count": 8,
4 "products": [
5 {
6 "name": "PUBG 1320 UC",
7 "price": "4743.24"
8 },
9 {
10 "name": "PUBG 1800 UC",
11 "price": "5929.05"
12 },
13 {
14 "name": "PUBG 325 UC",
15 "price": "1185.81"
16 }
17 ]
18}Error Responses
400 - Invalid JSON
json
{
"status": "error",
"message": "Invalid JSON"
}400 - encrypted_sk is required
json
{
"status": "error",
"message": "encrypted_sk is required"
}400 - Invalid Secret Key
json
{
"status": "error",
"message": "Invalid secret key"
}400 - Invalid Secret Key Format
json
{
"status": "error",
"message": "Invalid secret key format"
}500 - External API Error
json
{
"status": "error",
"message": "Error fetching products: [error details]"
}Response Fields
| Field | Type | Description |
|---|---|---|
status | string | Response status: "success" or "error" |
count | integer | Total number of available products returned |
products | array | Array of product objects |
products[].name | string | Product name |
products[].price | string | Product price in DZT |
Features
Authentication: Validates Stellar secret keys
Encryption Support: Handles both plain and RSA-encrypted secret keys
Search Filtering: Optional search parameter to filter products
Availability Filter: Only returns products marked as available
Simplified Response: Returns only essential product information (name & price)
External API Integration: Fetches data from sofizpay.dz
- All available products are returned if no search term is provided
- Prices are returned as strings to prevent floating-point precision issues
- Only products with is_available: true are included in the response
- The endpoint uses CSRF exemption for easier client integration