SofizPay Logo

SofizPay

SofizPay Logo
SofizPay
Technical Documentation
Products API

Get Products

Retrieve a list of available digital products from the SofizPay catalog, with optional filtering by name

API Endpoint

GEThttps://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

ParameterTypeRequiredDescription
encrypted_skstringYesEncrypted or plain Stellar secret key. Can be a plain key starting with "S" (56 characters) or an RSA-encrypted base64-encoded key
searchstringNoOptional 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

FieldTypeDescription
statusstringResponse status: "success" or "error"
countintegerTotal number of available products returned
productsarrayArray of product objects
products[].namestringProduct name
products[].pricestringProduct 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