DaleelBusiness API v1 - Marketplace ## Sections β€’ [Welcome](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/welcome.md): Welcome πŸ‘‹πŸ» to DaleelBusiness's API - Marketplace DaleelBusiness's API is an aggregator service that offers a wide range of gift cards as part of your system's workflow. This document will help you to: Learn about all the APIs offered by DaleelBusiness's API. Connect to DaleelBusiness's API. Authorize your requests. Make a purchase. Understand response status codes. β€’ [Authentication](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/authentication.md): DaleelBusiness's API uses CLIENT_ID And CLIENT_SECRET authenticate client accounts. These credentials cannot be used directly with the APIs. Instead, clients must generate an Authorization Token , which can then be used to authorize other API requests. Authorization tokens expire after a certain amount of time, which is specified in the expires_in parameter of the token. Clients are advised to generate and reuse an authorization token every time it expires. This will help to reduce the number of round trips to the server, as clients will not need to generate a new token for every request. Note There are two ways to get an access token: using the "password" or "client_credentials" grant type. The result is the same for both approaches. You can use the "password" grant type if you want to get a refresh token along with your access token. This will allow you to use the refresh token API to get a new access token in the future, without having to go through the authorization process again. You will need to share with us your server IP from which the requests are made to the API. During the process, an IP address (Static/ Dynamic) should be provided for whitelisting for secured traffic. β€’ [Get Started](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/get-started.md): The most important thing is to generate an Authorization Token. You can do this by using the Get Token service with the password , client_credentials , or refresh_token grant type. Once you have your Authorization Token, you need to add it to the header of all requests to the API. The header should be named Authorization and the value should be the token in the format Bearer <token> . To use the API, you will need to follow these steps Generate an Authorization Token. Add the token to the header of all requests. Fetch all Get Merchants List by using the Get Merchants list service. Fetch e-Vouchers By Merchant ID and Store ID by Using Get eVouchers By Merchants ID service. Check the availability of e-vouchers by using the Check eVouchers service. Make a purchase if the item is available. check purchase Status By reference. Get purchase Details by using the Get Purchase Details service... Check your balance, Get Purchase details , or all purchases by using the API services. Below is a test account for you to get started. Once the integration is completed, you can contact our support team to request a live account environment. Test Account Title Description Email merchants.api@daleelstore.com password ABC12345 client_id 2 client_secret D1uvg3aUd79fDIvqduYlaV3q1b59XztrPPooADyDrIo= Live Account To request a live account, please get in touch with our support team at business@daleelstore.com β€’ [Get Token (password)](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/get-token-password.md): Get Token Service This service is used to start making connections with DaleelBusiness APIs. Usage To get your token in DaleelBusiness you need to send a request for this service with parameters in the body looking like: cURL grant_type => "password", "scope" => "*", "client_id" => "CLIENT_ID", "client_secret" => "CLIENT_SECRET", "username" => "DALEEL_EMAIL", "password" => "DALEEL_PASSWORD" Note β€œ grant_type ” AND " scope " Keep it with the same value as below. β€œ client_id ” AND " client_secret " Will take it from the manual team. β€œ username ” AND " password " Your Email and Password at DaleelBusiness β€’ [Get Token (client_credentials)](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/get-token-client_credentials.md) β€’ [Refresh Token](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/refresh-token.md): Refresh Token Service Here you can find an easy way to refresh your token. Usage To generate new token you just need to send a request for this service with parameters in the body looking like: body Plain text "grant_type" => "refresh_token" "scope" => "*" "refresh_token" => "REFRESH_TOKEN" "client_id" => "5" "client_secret" => "CLIENT_SECRET" "grant_type" => "refresh_token" "scope" => "*" "refresh_token" => "REFRESH_TOKEN" "client_id" => "5" "client_secret" => "CLIENT_SECRET" Note β€œ grant_type ” AND " scope " Keep it with the same value as below. β€œ client_id ” AND " client_secret " Will shared from support team " refresh_token " get it from Get Token Service . β€’ [Get Categories List](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/get-merchants-list-copy-1.md): Get Categories List Service This service allows you to fetch all Categories that are supported in our catalog by the API. Usage To get the items, you need to send a request to the service with the following header parameters: Plain text "Authorization" => "Bearer TOKEN" Note This service does not accept any parameters in the body of the request. The only parameter that is required is the Authorization header, which must contain your Authorization Token. The Content-Type header must also be set to application/json . This ensures that the response from the service is in JSON format β€’ [Get Merchants List](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/get-merchants-list.md): Get Merchants List Service This service allows you to fetch all Merchants that are supported in our catalog by the API. You can use these items to make orders. Usage To get the items, you need to send a request to the service with the following header parameters: Plain text "Authorization" => "Bearer TOKEN" Note This service does not accept any parameters in the body of the request. The only parameter that is required is the Authorization header, which must contain your Authorization Token. The Content-Type header must also be set to application/json . This ensures that the response from the service is in JSON format β€’ [Get e-Vouchers By Merchants ID](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/get-e-vouchers-by-merchants-id.md): Get e-Vouchers By Merchants ID Service This service allows you to fetch all e-Vouchers that are supported in our catalog by Merchants ID and Store ID. You can use these e-Vouchers to make orders. Usage To get the e-Vouchers , you need to send a request to the service with the following header parameters: Plain text "Authorization" => "Bearer TOKEN" Note This service does not accept any parameters in the body of the request. The only parameter that is required is the Authorization header, which must contain your Authorization Token. The Content-Type header must also be set to application/json . This ensures that the response from the service is in JSON format β€’ [Check e-Vouchers](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/check-e-vouchers.md): Check e-Vouchers Service This service allows you to check if an item is available to make a purchase or not. Usage To use this service, you need to send a request to the service with the following header and body parameters: HEADER Plain text Authorization: Bearer TOKEN Body Plain text item_id: The id of the item qty: The quantity number want to purchase Note Item_id get it from "get items service" . item_id & qty Should be integer number Make sure you send the header content type with application/json. β€’ [Make Purchase](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/make-purchase.md): Make Purchase Service This service allows you to make a purchase. Usage To make a purchase, you need to send header AND body a request to the service with the following parameters: HEADER Plain text Authorization: Bearer TOKEN Body Plain text item_id : The id of the item qty : The quantity number want to purchase reference : Unique Code assigned by the client system marketplace_customer_id: The Id of client customer system Note Item_id get it from " get items service ". item_id & qty Should be integer number reference Should be an unique string can customize the purchase process for the store customer by adding the " marketplace_customer_id ". Make sure you send the header content type with application/json. β€’ [Check Status By Reference](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/check-status-by-reference.md): Check Status By Referance Service This service allows you to check purchase status by Referance code. Usage To make a purchase, you need to send header AND body a request to the service with the following parameters: HEADER Plain text Authorization: Bearer TOKEN Note purchase_status: [complete - in_progress- failed ] β€’ [Get Purchase Details](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/get-purchase-details.md): Get Purchase Details This service allows you to get the complete details of a purchase. To do this, you need to send a request to the service with the order_id Usage To use this service you want to send header AND body with parameters looking like: HEADER Plain text Authorization: Bearer TOKEN Body Plain text order_id: The id of the purchase β€’ [Get All Purchase](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/get-all-purchase.md): Get All Purchase This service allows you to get a list of all purchases that have been completed for an account Usage To use this service you want to send header AND body with parameters looking like: HEADER Plain text Authorization: Bearer TOKEN note: This service fetches the last fifty newly added orders if the from_date and to_date not specified. β€’ [Get Balance](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/apis/get-balance.md): Get Balance Service This service allows you to query your balance before making a purchase order. Usage To get your balance, you need to send a request to the service with the following header parameters: Plain text "Authorization" => "Bearer TOKEN" Note This service does not accept any parameters in the body of the request. The only parameter that is required is the Authorization header, which must contain your Authorization Token. The Content-Type header must also be set to application/json . This ensures that the response from the service is in JSON forma β€’ [Status Codes](https://app.theneo.io/daleelstore/daleelbusiness-marketplace/status-codes.md): DaleelBusiness API has applied all the technical standards that have been placed by the REST principles. Some Errors include an error codeβ€”a short string with a brief explanation. These codes play a role in our recommended error handling techniques. Below is a list of possible error codes, along with additional information about how to resolve them.