انتقل إلى المحتوى الرئيسي

Introduction

Welcome to the API documentation. This documentation is intended for developers who want to write applications that can interact with the API.

ملاحظة

When making API requests to any API endpoint, developers should ensure to include the necessary request headers as per the API's requirements and specifications. there are some common headers that developers should consider including:

Request Header

KeyDescription
AuthorizationThe API requires a bearer token for user authentication, and the initialize API generates a new token and returns a guest user profile if none is sent; otherwise, it provides the profile of the authenticated user.
langthe language of the response that the client expects. In the provided description, the values are used to represent 1 to English and 2 to Arabic.
Content-Typethe format or type of the request payload being sent to the server. In the provided description, the Content-Type is set to json, indicating that the request payload is in JSON format.
api-keyThe api-key is a unique token assigned by the website, critical for multi-tenant projects. In the web version, the Referer key indicates the request's source URL from various websites, sent by default with the browser.
deviceThe device type of the client. In the provided description, the values are used to represent 1 to Android and 2 to iOS.

Api Key

حذر

The api-key request header, which represents the API key of a website, can typically be obtained from the admin panel in the Configuration > API Integration section.

Success Response

KeyTypeDescription
codeIntegerThe HTTP status code indicating the success or failure of the API request.
messageStringA field provides a human-readable description or summary of the response status. It gives additional information to developers or clients about the outcome of the API request. In this case, the message is "Success" indicating that the request was successful.
dataObjectThe actual payload of the API response. It includes the relevant information requested by the client or any data that the API is returning as a result of the request. The structure and content of the "data" field can vary depending on the specific API endpoint.
200 OK - If the request is successful
{
"code": 200,
"message": "Success",
"data": {
//...
}
}

Status Codes

HTTP Status Codes

CodeDescription
200Successful request. check response for custom code and message details to understand the specific result received.
500The server encountered an unexpected condition that prevented it from fulfilling the request.

General Status Codes

CodeDescription
200The request was successful.
401The request requires an authentication token.
404The requested API was not found, or the user associated with the request could not be registered.

Specific For APIs Status Codes

CodeDescription
201The request was successful and a new order was created. Used Api
202The request for pay order online was successful, and you should open the returned link in an iframe within a modal popup. Used Api
203The request for pay order online was successful, and you should redirect the user to the returned link in a new window. Used Api
409The request cannot be processed because the customer's phone is not verified. Used Api
422The request cannot be processed because the customer's phone is not found. Used Api
  • Create and Update Address
  • Create Affiliate Request
  • Register
  • Social Register and Auth
  • Forget and Reset Password
  • Cancel and Rate Order
  • Update Profile
  • Resend Verification
  • Update Phone and Email
  • Change Password
  • Verify Email
  • Set and Check Current Area
  • Redeem Reward
423The checkout order request failed due to order validation issues, refer to the error message for specific details. Used Api