Introduction#
Welcome to the AlShamel API documentation.AlShamel API provides a programmatic interface for integrating external applications, e-commerce platforms, business systems, and other services with AlShamel accounting and business management services.The API is designed to make it easier for developers and integration partners to exchange business data with AlShamel through standard REST API endpoints and JSON responses.Using the AlShamel API, applications can interact with business entities such as:Other supported accounting and business entities
The API uses HTTP requests and JSON-formatted responses.
Base URL#
All API requests should be sent to:https://api.alshamelservice.nethttps://api.alshamelservice.net/api/Account/balances
API Version#
The API version may be updated as new functionality is introduced.When changes are made, compatibility will be considered to minimize disruption to existing integrations.
Getting Started#
1. Obtain an API Key#
Access to the AlShamel API requires an API Key.Your API Key should be provided by AlShamel or by the system administrator responsible for your integration.Keep your API Key secure.Do not expose your API Key in:Public source code repositories
Mobile application source code
2. Send the API Key#
The API Key must be included in the HTTP request header using the following header:
3. Your First Request#
The following example retrieves account balance information.cURL#
Example Response#
[
{
"accountId": 0,
"balance": 0
}
]
Replace YOUR_API_KEY with the API Key provided to your application.
Authentication#
API Key Authentication#
AlShamel API uses API Key authentication.The API Key must be sent in the ApiKey HTTP request header.Example#
Authentication is required for API requests unless an endpoint is explicitly documented otherwise.
Authentication Security#
Your API Key is equivalent to a credential that grants access to the API.Store the API Key securely.
Use environment variables or a secure secret store.
Never hard-code production API Keys in publicly distributed applications.
Never commit API Keys to Git repositories.
Never expose API Keys in browser-side JavaScript.
Rotate the API Key if it is suspected to have been compromised.
For server-to-server integrations, the API Key should normally be stored on the server and added to outgoing API requests by the server.
API Conventions#
HTTP Methods#
The API follows standard HTTP methods.| Method | Purpose |
|---|
| GET | Retrieve data |
| POST | Create a new record |
| PUT | Update an existing record |
| DELETE | Delete a record, when supported |
The exact method and request parameters are defined on each endpoint.
Content Type#
Requests containing JSON data should use:
API responses are generally returned as JSON.{
"id": 123,
"name": "Example"
}
Collection endpoints may return an array:[
{
"id": 1,
"name": "Example 1"
},
{
"id": 2,
"name": "Example 2"
}
]
The exact response structure is documented for each endpoint.
HTTP Status Codes#
The following HTTP status codes may be used by the API.| Status Code | Meaning |
|---|
| 200 | Request completed successfully |
| 201 | Resource created successfully |
| 204 | Request completed successfully with no response body |
| 400 | Invalid request |
| 401 | Authentication failed or API Key is missing/invalid |
| 403 | Access to the requested resource is not permitted |
| 404 | Requested resource was not found |
| 409 | Request conflicts with the current resource state |
| 422 | Request contains valid JSON but invalid business data |
| 500 | Internal server error |
Developers should always check the HTTP status code before processing the response body.
Error Handling#
Applications integrating with AlShamel API should handle unsuccessful HTTP responses gracefully.A typical API error may contain information describing the problem.{
"status": 400,
"message": "Invalid request."
}
For authentication errors, verify that:1.
The ApiKey header is included.
3.
The API Key has not expired or been revoked.
4.
The request is being sent to the correct API environment.
For a 404 Not Found response, verify:The requested resource exists.
The API version and route are correct.
For 500 Internal Server Error, applications should avoid continuously retrying without a controlled retry strategy.
API Modules#
The AlShamel API is organized into functional modules.Account#
The Account module provides access to accounting account information.Available operations include:Get Account Balances#
Returns balance information for accounts.[
{
"accountId": 0,
"balance": 0
}
]
Customer#
The Customer module provides operations for customer records.Typical operations include:Delete Customer, where supported
Refer to the individual Customer endpoints for the exact request and response schemas.
Customer Order#
The Customer Order module provides operations related to customer orders.Customer Order endpoints can be used by integrations that need to exchange order information with AlShamel.The exact fields and supported operations are documented on each endpoint.
Payment Voucher#
The Payment Voucher module provides access to payment voucher operations.This module can be used by integrations that need to exchange payment-related accounting information with AlShamel.
Receipt Voucher#
The Receipt Voucher module provides access to receipt voucher operations.This module can be used for integrations involving receipt transactions.
Purchase Order#
The Purchase Order module provides operations for purchase orders.Applications can use the documented endpoints to create and retrieve purchase order information.
Repurchase#
The Repurchase module provides operations related to repurchase transactions.Refer to the individual endpoints for the supported request and response structures.
Resale#
The Resale module provides operations related to resale transactions.Refer to the individual endpoints for the supported request and response structures.
Price Offer#
The Price Offer module provides operations related to price offers.The exact available operations and data models are documented within the Price Offer section.
Branch#
The Branch module provides operations related to business branches.
Cashier#
The Cashier module provides operations related to cashiers.
Center#
The Center module provides operations related to centers.
Class#
The Class module provides operations related to products/classes.
Classes Group#
The Classes Group module provides operations related to product/class groups.
Sub Classes Group#
The Sub Classes Group module provides operations related to sub-groups.
Other Modules#
Additional API modules are available in the API documentation, including supported operations for:The availability of individual operations depends on the endpoint definitions published in the current API version.
Integration Example — C##
The following example demonstrates how to send an authenticated GET request to the AlShamel API.
Integration Example — JavaScript#
For server-side JavaScript applications such as Node.js:Do not expose a production API Key in browser-side JavaScript.
Integration Example — PHP#
Integration Example — cURL#
Recommended Integration Architecture#
For production integrations, we recommend using a server-to-server architecture.A typical integration can follow this pattern:Your Application
|
| HTTPS Request
| ApiKey Header
v
AlShamel API
|
v
AlShamel Accounting System
For e-commerce integrations:E-Commerce Platform
|
| Orders / Products / Customers
v
Integration Service
|
| HTTPS + API Key
v
AlShamel API
|
v
AlShamel Accounting
This architecture keeps the API Key on the server and prevents exposing credentials to end users.
Best Practices#
Use HTTPS#
Always communicate with the API over HTTPS.Do not send API credentials over unencrypted HTTP connections.
Protect API Keys#
Store API Keys in secure configuration.For example, use environment variables:ALSHAMEL_API_KEY=YOUR_API_KEY
in production source code.
Validate HTTP Responses#
Always check whether the request succeeded.Do not assume that every HTTP request returns a successful response.
Implement Timeouts#
External API requests should always have reasonable timeouts.An integration should not remain blocked indefinitely while waiting for an external service.
Implement Controlled Retries#
Temporary network failures may occur.Use a limited number of retries.
Use increasing delays between retries.
Avoid immediately retrying every error.
Do not blindly retry requests that may create duplicate transactions.
For create operations, integrations should be especially careful about duplicate submissions.
Log API Errors#
For production integrations, log useful diagnostic information such as:Correlation/reference information, if available
Data Synchronization#
When integrating AlShamel with another system, the integration should maintain a reliable mapping between records.External Product ID
|
v
AlShamel Product ID
External Customer ID
|
v
AlShamel Customer ID
External Order ID
|
v
AlShamel Order ID
Maintaining these mappings helps prevent duplicate records and makes synchronization more reliable.
Production Integration Checklist#
Before moving an integration to production, verify the following:
Support#
For API integration questions or technical support, please contact the AlShamel API support team.When contacting support, include:Your integration/application name
Error message or response
A description of the expected behavior
Never send your API Key in a support request.
API Documentation#
The endpoint documentation contains the exact:Authentication requirements
Always use the endpoint-specific documentation as the authoritative reference for the exact request and response structure.
Changelog#
Version 1.0.0#
Initial public API documentation.The current API provides REST endpoints for supported AlShamel accounting and business entities.Future versions may introduce additional endpoints, fields, integrations, and capabilities.Modified at 2026-09-20 19:25:41