AlShamel API Documentation
    • AlShamel API
    • Account
      • Get Account balances
        GET
      • List Account
        GET
      • Get Account by ID
        GET
    • Accounts Group
      • List Accounts Group
        GET
      • Get Accounts Group by ID
        GET
    • Bank
      • List Bank
        GET
      • Get Bank by ID
        GET
    • Branch
      • List Branch
        GET
      • Get Branch by ID
        GET
    • Casher
      • List Casher
        GET
      • Get Casher by ID
        GET
    • Center
      • List Center
        GET
      • Get Center by ID
        GET
    • Class
      • Get Class quantities
        GET
      • Create Class
        POST
      • Update Class
        PUT
      • Delete Class
        DELETE
      • List Class
        GET
      • Get Class by ID
        GET
    • Classes Group
      • Create Classes Group
        POST
      • Update Classes Group
        PUT
      • Delete Classes Group
        DELETE
      • List Classes Group
        GET
      • Get Classes Group by ID
        GET
    • Coin
      • List Coin
      • Get Coin by ID
    • Credit Card
      • List Credit Card
      • Get Credit Card by ID
    • Customer
      • Create Customer
      • Update Customer
      • Delete Customer
      • List Customer
      • Get Customer by ID
    • Customer City
      • List Customer City
      • Get Customer City by ID
    • Customer Country
      • List Customer Country
      • Get Customer Country by ID
    • Customer Discount
      • List Customer Discount
      • Get Customer Discount by ID
    • Customer Order
      • Create Customer Order
      • Update Customer Order
      • Delete Customer Order
      • List Customer Order
      • Get Customer Order by ID
    • Customers Group
      • List Customers Group
      • Get Customers Group by ID
    • Payment Voucher
      • Create Payment Voucher
      • Update Payment Voucher
      • Delete Payment Voucher
      • List Payment Voucher
      • Get Payment Voucher by ID
    • Price Offer
      • Create Price Offer
      • Update Price Offer
      • Delete Price Offer
      • List Price Offer
      • Get Price Offer by ID
    • Purchase Order
      • Create Purchase Order
      • Update Purchase Order
      • Delete Purchase Order
      • List Purchase Order
      • Get Purchase Order by ID
    • Receipt Voucher
      • Create Receipt Voucher
      • Update Receipt Voucher
      • Delete Receipt Voucher
      • List Receipt Voucher
      • Get Receipt Voucher by ID
    • Repurchase
      • Create Repurchase
      • Update Repurchase
      • Delete Repurchase
      • List Repurchase
      • Get Repurchase by ID
    • Resale
      • Create Resale
      • Update Resale
      • Delete Resale
      • List Resale
      • Get Resale by ID
    • Sale
      • Create Sale
      • Update Sale
      • Delete Sale
      • List Sale
      • Get Sale by ID
    • Salesman
      • List Salesman
      • Get Salesman by ID
    • Store
      • List Store
      • Get Store by ID
    • Sub Classes Group
      • Create Sub Classes Group
      • Update Sub Classes Group
      • Delete Sub Classes Group
      • List Sub Classes Group
      • Get Sub Classes Group by ID
    • Schemas
      • Account
      • AccountBalance
      • AccountsGroup
      • Bank
      • Branch
      • Casher
      • Class
      • ClassesBarcode
      • ClassesGroup
      • ClassesPrice
      • ClassesQty
      • ClassesQuantitiesRequest
      • Coin
      • CostCenter
      • CreditCard
      • Customer
      • CustomerAccount
      • CustomerCity
      • CustomerCountry
      • CustomerDiscount
      • CustomerOrder
      • CustomerOrderDetail
      • CustomersGroup
      • Payment
      • PaymentDetail
      • PriceOffer
      • PriceOfferDetail
      • PurchaseOrder
      • PurchaseOrderDetail
      • Receipt
      • ReceiptDetail
      • Repurchase
      • RepurchaseDetail
      • Resale
      • ResaleDetail
      • Salesman
      • Store
      • SubClassesGroup
      • ApiError

    AlShamel API

    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:
    Accounts
    Customers
    Customer Orders
    Products and Classes
    Purchase Orders
    Sales and Resales
    Payment Vouchers
    Receipt Vouchers
    Price Offers
    Branches
    Stores
    Salesmen
    Currencies
    Credit Cards
    Customer Groups
    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.net
    For example:
    https://api.alshamelservice.net/api/Account/balances

    API Version#

    Current API version:
    1.0.0
    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
    Browser JavaScript
    Mobile application source code
    Public documentation
    Client-side HTML
    Logs or error messages

    2. Send the API Key#

    The API Key must be included in the HTTP request header using the following header:
    ApiKey: YOUR_API_KEY
    Example:

    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.

    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.
    You should:
    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.
    MethodPurpose
    GETRetrieve data
    POSTCreate a new record
    PUTUpdate an existing record
    DELETEDelete a record, when supported
    The exact method and request parameters are defined on each endpoint.

    Content Type#

    Requests containing JSON data should use:
    Example:

    Response Format#

    API responses are generally returned as JSON.
    Example:
    {
      "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 CodeMeaning
    200Request completed successfully
    201Resource created successfully
    204Request completed successfully with no response body
    400Invalid request
    401Authentication failed or API Key is missing/invalid
    403Access to the requested resource is not permitted
    404Requested resource was not found
    409Request conflicts with the current resource state
    422Request contains valid JSON but invalid business data
    500Internal 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.
    Example:
    {
      "status": 400,
      "message": "Invalid request."
    }
    For authentication errors, verify that:
    1.
    The ApiKey header is included.
    2.
    The API Key is correct.
    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 endpoint URL.
    The resource ID.
    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
    List accounts
    Get an account by ID

    Get Account Balances#

    Returns balance information for accounts.
    Example:
    Example response:
    [
      {
        "accountId": 0,
        "balance": 0
      }
    ]

    Customer#

    The Customer module provides operations for customer records.
    Typical operations include:
    Create Customer
    List Customers
    Get Customer by ID
    Update Customer
    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:
    Accounts Group
    Coin
    Credit Card
    Customer City
    Customer Country
    Customer Discount
    Customers Group
    Salesman
    Store
    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.
    Usage:

    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
    Avoid:
    in production source code.

    Validate HTTP Responses#

    Always check whether the request succeeded.
    Example:
    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.
    When retrying requests:
    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:
    HTTP status code
    Endpoint
    Request timestamp
    Response status
    Correlation/reference information, if available
    Do not log:
    API Keys
    Passwords
    Sensitive credentials

    Data Synchronization#

    When integrating AlShamel with another system, the integration should maintain a reliable mapping between records.
    For example:
    External Product ID
            |
            v
    AlShamel Product ID
    Similarly:
    External Customer ID
            |
            v
    AlShamel Customer ID
    And:
    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:
    API Key is securely stored.
    HTTPS is used for all requests.
    Correct API Base URL is configured.
    Authentication is working.
    HTTP status codes are handled.
    API errors are handled.
    Network timeouts are configured.
    Retry logic is controlled.
    Duplicate transaction handling is implemented.
    API requests are logged without exposing credentials.
    Integration has been tested with representative data.
    Production API credentials are separated from development credentials.

    Support#

    For API integration questions or technical support, please contact the AlShamel API support team.
    When contacting support, include:
    Your integration/application name
    API endpoint
    HTTP method
    Approximate request time
    HTTP status code
    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:
    HTTP method
    Endpoint URL
    Request parameters
    Request body
    Response schema
    Response examples
    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
    Next
    Get Account balances
    Built with