Elryan Merchant API Reference (1.0.0)

Download OpenAPI specification:Download

Introduction

Welcome to Elryan API Documentation. Elryan is the first online store in Iraq to provide a range of consumer electronics from world renowned brands delivered to your home within 24 hours.

This documentation explains how to use Elryan API endpoints and how to fill request parameters. Elryan API allows you to create and update your products in our systems, get orders and synchronize operations between your and Elryan's systems.

How To Use the API?

Once you have your products synchronized with Elryan API, we take care of the rest.

Orders will be consolidated and shown in the orders panel of the Marketplace. Also you can use order API endpoints to manage orders directly from your own systems.

Environments

There are two environments:

  1. Staging: https://marketplacestaging.elryan.com/api where you may try your requests and see the results both in the API responses and in Staging Marketplace.

  2. Production: https://marketplace.elryan.com/api where your real data will be stored and published to the Marketplace. You may see the results both in the API responses and in Production Marketplace

Staging

All your requests should use the following domain:

https://merchantstaging.elryan.com/api

To use this environment, you still need to get your token; Please ensure you have created a vendor account at Elryan Staging Marketplace and then you can generate your Bearer Token via Users / Generate Token service.

You can create/update/delete as many records as you like on the sandbox environment, until you feel ready to move on to production.

Entity IDs will vary from the ones in Production environment.

Production

All your requests should use the following domain:

https://merchant.elryan.com/api

In this environment your records will be stored permanently. Before moving on to this environment, please make sure you are comfortable and successful with the Sandbox Environment. but this time you need to have a vendor account at Elryan Production Marketplace and then you can generate your Bearer Token via Users / Generate Token service.

General

health-check

The GET /health-check endpoint is used to perform a health check on the system.

Response

  • Status: 200

  • Content-Type: application/json

{
    "data": {
        "status": ""
    },
    "error_code": 0
}
Authorizations:
noauthAuth

Responses

Users

Generate Token

Generate User Token

This endpoint allows you to generate a Bearer token for a user to use all other services.

Request Body

  • email (text, required): The email of the user for whom the token is to be generated.

  • password (text, required): The password of the user for authentication.

Response

  • Status: 200

  • Content-Type: application/json

Example Response Body:

{
    "data": {
        "_id": "",
        "vacation": true,
        "syncStatus": true,
        "accountUsername": "",
        "mailAddress": "",
        "mobileNumber": "",
        "name": "",
        "password": "",
        "shopBrandName": "",
        "id": "",
        "role": "",
        "APIToken": ""
    },
    "error_code": 0
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "email": "{{email}}",
  • "password": "{{password}}"
}

Categories

Your categories with your own category tree structure. Later on you'll be matching saved categories with Elryan's category values.

Search Category

POST /categories/search

This endpoint is used to search for categories.

Request Body

  • raw (application/json)

    {
      "start": 0,
      "length": 0,
      "search": {
        "id": null,
        "company_id": null,
        "parent_id": null,
        "name": "",
        "remote_id": null,
        "is_active": null,
        "remote_parent_id": null
      }
    }
    

Response

The response of this request can be represented as a JSON schema:

{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "remote_id": { "type": "string" },
          "userId": { "type": "string" },
          "created_at": { "type": "string" },
          "exported": { "type": "boolean" },
          "is_active": { "type": "boolean" },
          "name": { "type": "string" },
          "parent_id": { "type": "string" },
          "remote_parent_id": { "type": "string" },
          "updated_at": { "type": "string" },
          "id": { "type": "string" }
        }
      }
    },
    "error_code": { "type": "number" }
  }
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "start": 0,
  • "length": 5,
  • "search": {
    }
}

Create / Update Category

POST /categories/upsert/

This endpoint is used to upsert (update or insert) a category.

Request Body

  • parent_id (string, optional): The ID of the parent category.
  • name (string, optional): The name of the category.
  • remote_id (string, optional): The remote ID of the category.
  • remote_parent_id (string, optional): The remote ID of the parent category.
  • is_active (boolean, required): Indicates if the category is active.

Response

The response is in the form of a JSON schema:

{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "remote_id": {"type": "string"},
                "userId": {"type": "string"},
                "created_at": {"type": "string"},
                "exported": {"type": "boolean"},
                "is_active": {"type": "boolean"},
                "name": {"type": "string"},
                "parent_id": {"type": "string"},
                "remote_parent_id": {"type": "string"},
                "updated_at": {"type": "string"},
                "id": {"type": "string"}
            }
        },
        "error_code": {"type": "number"}
    }
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "parent_id": "null",
  • "name": "Bags5",
  • "remote_id": "bags_555",
  • "remote_parent_id": "null",
  • "is_active": true
}

Category Info

The endpoint retrieves the details of a specific category with the remote_id "bags_555".

The response returned is a JSON object with the following schema:

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "remote_id": { "type": "string" },
        "userId": { "type": "string" },
        "created_at": { "type": "string" },
        "exported": { "type": "boolean" },
        "is_active": { "type": "boolean" },
        "name": { "type": "string" },
        "parent_id": { "type": "string" },
        "remote_parent_id": { "type": "string" },
        "updated_at": { "type": "string" },
        "id": { "type": "string" }
      }
    },
    "error_code": { "type": "number" }
  }
}
Authorizations:
bearerAuth

Responses

Brands

Brands of the products you are selling.

Search brand

POST /brands/search

This endpoint allows users to search for brands.

Request Body

  • start (number) - The starting index for the search.
  • length (number) - The number of items to retrieve.
  • search (object) - An object containing search parameters.
    • remote_id (string) - The remote ID of the brand.
    • name (string) - The name of the brand.
    • is_active (string) - The active status of the brand.
    • id (string) - The ID of the brand.

Response

The response is a JSON array containing brand objects with the following properties:

  • remote_id (string) - The remote ID of the brand.
  • userId (string) - The user ID associated with the brand.
  • created_at (string) - The date and time of creation.
  • exported (boolean) - The export status of the brand.
  • is_active (boolean) - The active status of the brand.
  • name (string) - The name of the brand.
  • remote_image_url (string) - The remote image URL of the brand.
  • updated_at (string) - The date and time of last update.
  • id (string) - The ID of the brand.

Response JSON Schema

{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "remote_id": { "type": "string" },
          "userId": { "type": "string" },
          "created_at": { "type": "string" },
          "exported": { "type": "boolean" },
          "is_active": { "type": "boolean" },
          "name": { "type": "string" },
          "remote_image_url": { "type": "string" },
          "updated_at": { "type": "string" },
          "id": { "type": "string" }
        }
      }
    },
    "error_code": { "type": "number" }
  }
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "start": 0,
  • "length": 1,
  • "search": {
    }
}

Create / Update brand

The POST /brands/upsert endpoint is used to create or update a brand. The request should include a JSON payload with the brand details such as name, remote ID, remote image URL, and whether the brand is active.

Request Body

  • name (string, required): The name of the brand.
  • remote_id (string, required): The remote ID of the brand.
  • remote_image_url (string, optional): The URL of the remote image associated with the brand.
  • is_active (boolean, required): Indicates whether the brand is active.

Response

The response of this request is a JSON schema representing the structure of the brand object.

Example response:

{
    "data": {
        "remote_id": "apple_9",
        "userId": "6630c317826ae800363d051e",
        "created_at": "2024-04-30T21:32:42.453Z",
        "exported": false,
        "is_active": true,
        "name": "Apple_9",
        "remote_image_url": "updatdsfdsafe_9.jpg",
        "updated_at": "2024-04-30T21:32:42.453Z",
        "id": "6631637a5fa475f8a54403f6"
    },
    "error_code": 0
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "name": "Apple_9",
  • "remote_id": "apple_9",
  • "remote_image_url": "updatdsfdsafe_9.jpg",
  • "is_active": true
}

Brand Info

This endpoint makes an HTTP GET request to retrieve information about the brand with the remote_id "apple_9".

Response Body

The response will be in JSON format and will include the following fields:

  • data (object)
    • remote_id
    • userId
    • created_at
    • exported
    • is_active
    • name
    • remote_image_url
    • updated_at
    • id
  • error_code
Authorizations:
bearerAuth

Responses

Attributes

Search attribute

POST /attributes/search

This endpoint allows users to search for attributes.

Request Body

  • Type: JSON
    • start (number): The starting index for the search.
    • length (number): The length of the search.
    • search (object):
      • company_id (string): The company ID to search for.
      • remote_id (string): The remote ID to search for.
      • name (string): The name to search for.
      • is_active (boolean): The status of the attribute.
      • id (string): The ID of the attribute.

Response

The response is in JSON format and follows the schema below:

{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "remote_id": { "type": "string" },
          "userId": { "type": "string" },
          "created_at": { "type": "string" },
          "exported": { "type": "boolean" },
          "is_active": { "type": "boolean" },
          "name": { "type": "string" },
          "updated_at": { "type": "string" },
          "id": { "type": "string" }
        }
      }
    },
    "error_code": { "type": "number" }
  }
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "start": 0,
  • "length": 10,
  • "search": {
    }
}

Create / Update attribute

Upsert Attributes

The POST request is used to upsert attributes at the specified endpoint {{baseUrl}}/attributes/upsert. The request should contain a JSON payload with parameters name, remote_id, and is_active.

Request Body

  • name (string, required): The name of the attribute.
  • remote_id (string, required): The remote ID of the attribute.
  • is_active (boolean, required): Indicates whether the attribute is active.

Response

The response is in the form of a JSON schema:

{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "remote_id": {"type": "string"},
                "userId": {"type": "string"},
                "created_at": {"type": "string"},
                "exported": {"type": "boolean"},
                "is_active": {"type": "boolean"},
                "name": {"type": "string"},
                "updated_at": {"type": "string"},
                "id": {"type": "string"}
            }
        },
        "error_code": {"type": "integer"}
    }
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "name": "Size1",
  • "remote_id": "size_123456789",
  • "is_active": true
}

Attribute Info

The GET /attributes/get/size_123456789 endpoint retrieves attribute data for a specific size with the ID 123456789. The response is in JSON format and has the following schema:

{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "remote_id": {"type": "string"},
                "userId": {"type": "string"},
                "created_at": {"type": "string"},
                "exported": {"type": "boolean"},
                "is_active": {"type": "boolean"},
                "name": {"type": "string"},
                "updated_at": {"type": "string"},
                "id": {"type": "string"}
            }
        },
        "error_code": {"type": "integer"}
    }
}
Authorizations:
bearerAuth

Responses

Attribute Values

Search attribute values

This endpoint allows you to search for attribute values.

Request Body

  • start (number) - The starting index for the search.
  • length (number) - The number of items to retrieve.
  • search (object) - An object containing search parameters.
    • value (string) - The value to search for.
    • is_active (boolean) - The status of the attribute value.
    • id (string) - The ID of the attribute value.
    • remote_id (string) - The remote ID of the attribute value.
    • attribute_id (string) - The ID of the attribute.
    • remote_attribute_id (string) - The remote ID of the attribute.

Example

{
  "start": 0,
  "length": 0,
  "search": {
    "value": null,
    "is_active": null,
    "id": null,
    "remote_id": null,
    "attribute_id": null,
    "remote_attribute_id": null
  }
}

Response

The response is a JSON object with the following schema:

{
  "data": [
    {
      "remote_id": "",
      "userId": "",
      "attribute": {
        "name": "",
        "remote_id": "",
        "is_active": true
      },
      "created_at": "",
      "exported": true,
      "is_active": true,
      "updated_at": "",
      "value": "",
      "id": ""
    }
  ],
  "error_code": 0
}

The response contains an array of data objects, each representing an attribute value, along with an error code.

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "start": 0,
  • "length": 10,
  • "search": {
    }
}

Create / Update attribute values

Upsert Attribute Values

This endpoint allows the client to upsert attribute values.

Request Body

  • value (string, required): The value to be upserted.
  • is_active (boolean, required): Indicates if the attribute value is active.
  • remote_id (string, required): The remote identifier for the attribute value.
  • attribute (object, required): Details of the attribute.
    • name (string, required): The name of the attribute.
    • remote_id (string, required): The remote identifier for the attribute.
    • is_active (boolean, required): Indicates if the attribute is active.

Response

The response will be in the form of a JSON schema with the following structure:

{
  "data": {
    "remote_id": "",
    "userId": "",
    "attribute": {
      "name": "",
      "remote_id": "",
      "is_active": true
    },
    "created_at": "",
    "exported": true,
    "is_active": true,
    "updated_at": "",
    "value": "",
    "id": ""
  },
  "error_code": 0
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "value": "44",
  • "is_active": true,
  • "remote_id": "remote_44",
  • "attribute": {
    }
}

Attribute values Info

This endpoint retrieves attribute values for a specific remote device with the remote_id "remote_44".

Request

The request does not require any specific parameters in the request body or headers.

Response

Upon a successful request (Status: 200), the response will be in JSON format and will include the following fields:

  • data: An object containing information about the attribute values, including the remote ID, user ID, attribute details, creation and update timestamps, exported status, and value ID.
  • error_code: An integer representing the error code (0 indicates no error).

Example response body:

{
    "data": {
        "remote_id": "",
        "userId": "",
        "attribute": {
            "name": "",
            "remote_id": "",
            "is_active": true
        },
        "created_at": "",
        "exported": true,
        "is_active": true,
        "updated_at": "",
        "value": "",
        "id": ""
    },
    "error_code": 0
}
Authorizations:
bearerAuth

Responses

Products

Create / Update Product

This endpoint is used to create or update a product.

Request Body

  • name (string, required): The name of the product.

  • spu (string, required): The Stock Keeping Unit (SKU) of the product.

  • category (object, required): The category information of the product.

    • parent_remote_id (string, required): The parent category's remote ID.

    • remote_id (string, required): The category's remote ID.

    • name (string, required): The name of the category.

  • brand (object, required): The brand information of the product.

    • name (string, required): The name of the brand.

    • remote_id (string, required): The brand's remote ID.

  • default_image_url (string, required): The URL of the default image of the product.

  • tax (number, required): The tax amount for the product.

  • is_active (boolean, required): Indicates if the product is active.

  • translations (array, required): Translations for the product name in different languages.

    • language (string, required): The language code.

    • name (string, required): The translated name of the product.

  • variants (array, required): The variants of the product.

    • retail_price (number, required): The retail price of the variant.

    • price (number, required): The price of the variant.

    • currency (string, required): The currency of the price.

    • stock (number, required): The stock quantity of the variant.

    • name (string, required): The name of the variant.

    • sku (string, required): The Stock Keeping Unit (SKU) of the variant.

    • barcode (string, required): The barcode of the variant.

    • hs_code (string, required): The Harmonized System (HS) code of the variant.

    • gtin (string, required): The Global Trade Item Number (GTIN) of the variant.

    • default_image_url (string, required): The URL of the default image of the variant.

    • extra_images (array, required): Additional images of the variant.

    • description (string, required): The description of the variant.

    • weight (number, required): The weight of the variant.

    • height (number, required): The height of the variant.

    • width (number, required): The width of the variant.

    • length (number, required): The length of the variant.

    • freight (number, required): The freight cost of the variant.

    • is_active (boolean, required): Indicates if the variant is active.

    • supplier (object, required): The supplier information of the variant.

      • name (string, required): The name of the supplier.

      • remote_id (string, required): The supplier's remote ID.

    • translations (array, required): Translations for the variant name and description in different languages.

      • language (string, required): The language code.

      • name (string, required): The translated name of the variant.

      • description (string, required): The translated description of the variant.

    • attributes (array, required): The attributes of the variant.

      • name (string, required): The name of the attribute.

      • value (string, required): The value of the attribute.

      • remote_attribute_id (string, required): The remote ID of the attribute.

      • remote_attribute_value_id (string, required): The remote ID of the attribute value.

  • guarantee (number, required): The guarantee period of the product.

  • fulfillment_day (number, required): The fulfillment day for the product.

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "name": "Black Pencil",
  • "spu": "black_pencil_12345677",
  • "category": {
    },
  • "brand": {
    },
  • "tax": 0,
  • "is_active": true,
  • "translations": [
    ],
  • "variants": [
    ],
  • "guarantee": 6,
  • "fulfillment_day": 3
}

Search Product

POST /products/search

This endpoint is used to search for products.

Request Body

  • start (number) - The starting index for the search results.

  • length (number) - The number of items to retrieve.

  • search (object) - An object containing search parameters.

    • category_id (string) - The ID of the category to search within.

    • brand_id (string) - The ID of the brand to search within.

    • spu (string) - The SPU (Supplier Product Number) for the product.

    • name (string) - The name of the product.

    • is_active (boolean) - Indicates whether the product is active.

    • id (string) - The ID of the product.

    • remote_brand_id (string) - The remote ID of the brand.

    • remote_category_id (string) - The remote ID of the category.

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "start": 0,
  • "length": 1,
  • "search": {
    }
}

Product Info

This endpoint gets your product information with spu.

Authorizations:
bearerAuth

Responses

Enable Product

This endpoint enable product with spu.

Authorizations:
bearerAuth

Responses

Disable Product

This endpoint disable product with spu.

Authorizations:
bearerAuth

Responses

Variants

Create / Update Variant

This endpoint creates your variants connected to your product.

Request Body

  • spu (string): The Stock Keeping Unit (SKU) for the product variant.

  • retail_price (number): The retail price of the product variant.

  • price (number): The price of the product variant.

  • currency (string): The currency in which the prices are specified.

  • stock (number): The stock quantity of the product variant.

  • name (string): The name of the product variant.

  • sku (string): The Stock Keeping Unit (SKU) for the product variant.

  • barcode (string): The barcode of the product variant.

  • hs_code (string): The Harmonized System (HS) code for the product variant.

  • gtin (string): The Global Trade Item Number (GTIN) of the product variant.

  • default_image_url (string): The URL of the default image for the product variant.

  • extra_images (array): Array of URLs for additional images of the product variant.

  • description (string): The description of the product variant.

  • weight (number): The weight of the product variant.

  • height (number): The height of the product variant.

  • width (number): The width of the product variant.

  • length (number): The length of the product variant.

  • freight (number): The freight cost of the product variant.

  • supplier (object): Details of the supplier for the product variant.

    • name (string): The name of the supplier.

    • remote_id (string): The remote identifier of the supplier.

  • is_active (boolean): Indicates whether the product variant is active.

  • translations (array): Array of translations for the product variant.

    • language (string): The language of the translation.

    • name (string): The translated name of the product variant.

    • description (string): The translated description of the product variant.

  • attributes (array): Array of attributes for the product variant.

    • name (string): The name of the attribute.

    • value (string): The value of the attribute.

    • remote_attribute_id (string): The remote identifier of the attribute.

    • remote_attribute_value_id (string): The remote identifier of the attribute value.

Response Body

The response body will contain the details of the created or updated product variant.

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "spu": "white_pencil_123",
  • "retail_price": 26,
  • "price": 100,
  • "currency": "EUR",
  • "stock": 100,
  • "name": "White Pencil",
  • "sku": "white_pencil_test",
  • "barcode": "12321412",
  • "hs_code": "asdhas123",
  • "gtin": "123214",
  • "description": "iphone 8 description",
  • "weight": 10,
  • "height": 10,
  • "width": 10,
  • "length": 10,
  • "freight": 1,
  • "supplier": {
    },
  • "is_active": true,
  • "translations": [
    ],
  • "attributes": [
    ]
}

Search Variant

This endpoint allows you to search for variants based on specific criteria.

Request Body

  • start (number): The starting index for the search results.

  • length (number): The number of results to return.

  • search (object):

    • sku (string): The Stock Keeping Unit of the variant.

    • name (string): The name of the variant.

    • is_active (boolean): Indicates if the variant is active.

    • id (string): The ID of the variant.

    • supplier_id (string): The ID of the supplier.

    • remote_supplier_id (string): The remote ID of the supplier.

Response

The response will be a JSON object with the following structure:

{
  "data": [
    {
      "_id": "",
      "sku": "",
      "userId": "",
      "__v": 0,
      "attributes": [
        {
          "name": "",
          "value": "",
          "remote_attribute_id": "",
          "remote_attribute_value_id": "",
          "_id": ""
        }
      ],
      "barcode": "",
      "currency": "",
      "default_image_url": "",
      "description": "",
      "exported": true,
      "extra_images": [""],
      "freight": 0,
      "gtin": "",
      "height": 0,
      "hs_code": "",
      "is_active": true,
      "length": 0,
      "name": "",
      "price": 0,
      "retail_price": 0,
      "stock": 0,
      "supplier": {
        "name": "",
        "remote_id": ""
      },
      "translations": [
        {
          "language": "",
          "name": "",
          "description": "",
          "_id": ""
        }
      ],
      "weight": 0,
      "width": 0,
      "spu": ""
    }
  ],
  "error_code": 0
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "start": 0,
  • "length": 10,
  • "search": {
    }
}

Price & Stock Update

This endpoint is used to update the stock and price of variants.

Request Body

  • items (array) - An array of objects containing the following parameters:
    • sku (string) - The SKU of the variant.

    • stock (number) - The updated stock quantity of the variant.

    • price (number) - The updated price of the variant.

    • retail_price (number) - The updated retail price of the variant.

Example:

{
  "items": [
    {
      "sku": "",
      "stock": 0,
      "price": 0,
      "retail_price": 0
    }
  ]
}
#### Response
- `data` (object) - Object containing the following parameters:
  - `message` (string) - A message related to the operation.
  - `updatedCount` (number) - The count of variants updated.
  - `foundVariantsInDb` (array) - Array of SKUs found in the database.
  - `notFoundVariantsInDb` (array) - Array of SKUs not found in the database.
- `error_code` (number) - The error code, if any.
- `message` (string) - A message related to the response.
Example:
```json
{
  "data": {
    "message": "",
    "updatedCount": 0,
    "foundVariantsInDb": [""],
    "notFoundVariantsInDb": [""]
  },
  "error_code": 0,
  "message": ""
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "items": [
    ]
}

Variant Info

This endpoint retrieves the details of a specific variant identified by its SKU.

Request

  • Method: GET

  • URL: {{baseUrl}}/variants/get/black_pencil123

Response

  • Status: 200

  • Content-Type: application/json

{
    "data": {
        "_id": "",
        "sku": "",
        "userId": "",
        "__v": 0,
        "attributes": [
            {
                "name": "",
                "value": "",
                "remote_attribute_id": "",
                "remote_attribute_value_id": "",
                "_id": ""
            }
        ],
        "barcode": "",
        "currency": "",
        "default_image_url": "",
        "description": "",
        "exported": true,
        "extra_images": [""],
        "freight": 0,
        "gtin": "",
        "height": 0,
        "hs_code": "",
        "is_active": true,
        "length": 0,
        "name": "",
        "price": 0,
        "retail_price": 0,
        "stock": 0,
        "supplier": {
            "name": "",
            "remote_id": ""
        },
        "translations": [
            {
                "language": "",
                "name": "",
                "description": "",
                "_id": ""
            }
        ],
        "weight": 0,
        "width": 0,
        "spu": ""
    },
    "error_code": 0
}
Authorizations:
bearerAuth

Responses

Enable Variant

This endpoint enable variant with sku.

Response

The response will be in JSON format and will have the following schema:

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    },
    "error_code": {
      "type": "integer"
    },
    "message": {
      "type": "string"
    }
  }
}

The response will contain the following fields:

  • data (object): An object containing the message related to the enablement status.

    • message (string): A message related to the enablement status.
  • error_code (integer): An error code, if any.

  • message (string): A general message related to the response.

Authorizations:
bearerAuth

Responses

Disable Variant

This endpoint disable variant with sku.

Response

The response is in JSON format and follows the schema below:

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    },
    "error_code": {
      "type": "integer"
    },
    "message": {
      "type": "string"
    }
  }
}

The response contains the following properties:

  • data: An object containing a message property of type string.

  • error_code: An integer indicating any error code.

  • message: A string providing additional information about the response.

Authorizations:
bearerAuth

Responses

Orders

Search Orders

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "start": 0,
  • "length": 20,
  • "search": {
    }
}

Get Order Details

This endpoint retrieves details of a specific order by providing the POlineID in the URL. The response will include various order-related information in JSON format, such as purchase order details, item description, quantity, status, and financial details. The response will also include an error code if applicable.

The last execution of this request returned a 200 status code with a JSON response containing order data and an error code.

Response example:

{
    "data": {
        "POlineID": "77231331",
        "Date": "11/09/2022",
        "Description": "Night Bloom by Jacomo for Women - Eau de Parfum, 100ml",
        "Description (AR)": "نايت بلوم من جاكومو للنساء - او دي بارفان, 100 مل",
        "Elryan Commission": "10.0%",
        "Item": "3392865241177-62e67b59a77546efcb592795",
        "Net Amount": "22.50",
        "Order Number": "PO110038645",
        "POLastModified": "12/09/2022 11:38 PM",
        "Purchase Order ID": "7723133",
        "Quantity": "1",
        "Selling Price": "25",
        "Status": "Delivered",
        "Status (AR)": "تم التوصيل",
        "Total Amount": "25.00",
        "dateISO": "2022-09-11T00:00:00",
        "id": "631e4485e081fc4a978a8598",
        "recordType": "salesorder",
        "userId": "62e67b59a77546efcb592795",
        "exported": true,
        "updatedLocalTime": "2022-09-12T01:38:58.000Z",
        "updatedTime": "2022-09-11T22:38:58.184Z",
        "Magento IQD Exchange Rate": "1485"
    },
    "error_code": 0
}
Authorizations:
bearerAuth

Responses

Unfulfilled Order List

Endpoint Description

This endpoint is used to retrieve a list of unfulfilled orders.

Request Body

  • start (integer) - The starting index for the list of unfulfilled orders.
  • length (integer) - The length of the list to be retrieved.

Response

Upon a successful execution, the response will contain a status code of 200 and a JSON object with the list of unfulfilled orders under the "data" key. Each order object includes various details such as POlineID, Date, Description, Elryan Commission, Item, Net Amount, Order Number, and more. The "error_code" field will be set to 0 in case of success.

Response example:

{
    "data": [
        {
            "POlineID": "77231332",
            "Date": "11/09/2022",
            "Description": "Jacomo For Her by Jacomo for Women - Eau de Parfum, 100ml",
            "Description (AR)": "جاكومو فور هير من جاكومو للنساء - او دي بارفان, 100 مل",
            "Elryan Commission": "10.0%",
            "Item": "3392865191175-62e67b59a77546efcb592795",
            "Net Amount": "45.00",
            "Order Number": "PO110038645",
            "POLastModified": "12/09/2022 11:38 PM",
            "Purchase Order ID": "7723133",
            "Quantity": "2",
            "Selling Price": "25",
            "Status": "Pending Confirmation",
            "Status (AR)": "تم التوصيل",
            "Total Amount": "50.00",
            "dateISO": "2022-09-11T00:00:00",
            "id": "631e4485e081fc4a978a859a",
            "recordType": "salesorder",
            "userId": "62e67b59a77546efcb592795",
            "exported": true,
            "updatedLocalTime": "2022-09-12T01:38:58.000Z",
            "updatedTime": "2022-09-11T22:38:58.184Z",
            "Magento IQD Exchange Rate": "1485"
        }
    ],
    "error_code": 0
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "start": 0,
  • "length": 10
}

Order Cancel

This HTTP PUT request is used to reject a specific order identified by the order POlineID. The request should be sent to {{baseUrl}}/orders/cancel/:POlineID with a payload in raw JSON format. The payload should include the "reason" key with the reason for cancellation as its value.

Request Body

  • reason (string, required): The reason for canceling the order.

Response

Upon successful execution, the response will have a status code of 200 and a JSON content type. The response body will contain the updated data for the canceled order, including various order details such as POlineID, Date, Description, Elryan Commission, Item, Net Amount, Order Number, Quantity, Selling Price, Status, Total Amount, and more. Additionally, the response will include an error_code indicating the success of the operation.

Example:

{
    "data": {
        "POlineID": "",
        "Date": "",
        "Description": "",
        "Description (AR)": "",
        "Elryan Commission": "",
        "Item": "",
        "Net Amount": "",
        "Order Number": "",
        "POLastModified": "",
        "Purchase Order ID": "",
        "Quantity": "",
        "Selling Price": "",
        "Status": "",
        "Status (AR)": "",
        "Total Amount": "",
        "dateISO": "",
        "id": "",
        "recordType": "",
        "userId": "",
        "exported": true,
        "updatedLocalTime": "",
        "updatedTime": "",
        "Magento IQD Exchange Rate": "",
        "cancelReason": ""
    },
    "error_code": 0
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "reason": "out_of_stock"
}

Order Items Prepare

Authorizations:
bearerAuth

Responses

Order Cancellation Reason List

This endpoint makes an HTTP GET request to retrieve a list of order reasons cancellation reasons from the server. The response will be in JSON format and will include an array of order reasons under the "data" key.

Response:

{
    "data": [
        "out_of_stock",
        "incorrect_pricing",
        "sourcing_delay"
    ],
    "error_code": 0
}
Authorizations:
bearerAuth

Responses

Transactions

Search Transactions

POST /transactions/search

This endpoint is used to search for transactions based on certain criteria.

Request Body

  • start (integer) - The starting index for the search results.
  • length (integer) - The number of results to return.
  • search (object)
    • recordType (string) - The type of record to search for. Possible values are 'vendorcredit', 'vendorbill', 'vendorpayment'.

Example:

{
  "start": 0,
  "length": 10,
  "search": {
    "recordType": "vendorcredit"
  }
}

Response

  • Status: 200
  • Content-Type: application/json
  • data (array) - An array of transaction objects containing details such as amount, date, transaction number, type, record type, user ID, and Magento IQD exchange rate.
    • _id (string) - The ID of the transaction.
    • id (string) - The transaction ID.
    • Amount (string) - The amount of the transaction.
    • Date (string) - The date of the transaction.
    • Transaction Number (string) - The transaction number.
    • Type (string) - The type of the transaction.
    • Type (AR) (string) - Another type related to the transaction.
    • recordType (string) - The record type of the transaction.
    • userId (string) - The ID of the user associated with the transaction.
    • Magento IQD Exchange Rate (string) - The exchange rate in Magento IQD.
  • error_code (integer) - An error code, if any.

Example Response:

{
  "data": [
    {
      "_id": "",
      "id": "",
      "Amount": "",
      "Date": "",
      "Transaction Number": "",
      "Type": "",
      "Type (AR)": "",
      "recordType": "",
      "userId": "",
      "Magento IQD Exchange Rate": ""
    }
  ],
  "error_code": 0
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "start": 0,
  • "length": 10,
  • "search": {
    }
}

Transactions Info

This endpoint retrieves the details of a specific transaction with the ID 3364306. The response will be in JSON format and will include the transaction data such as amount, date, transaction number, type, record type, user ID, and Magento IQD exchange rate. The response will also contain an error code if applicable.

Example:

{
    "data": {
        "_id": "61abdb0ce081fc4a975c296c",
        "id": "3364306",
        "Amount": "46.00",
        "Date": "04/12/2021",
        "Transaction Number": "PO110012710",
        "Type": "Sales",
        "Type (AR)": "مبيعات",
        "recordType": "vendorbill",
        "userId": "62e67b59a77546efcb592795",
        "Magento IQD Exchange Rate": "1480"
    },
    "error_code": 0
}
Authorizations:
bearerAuth

Responses

Packages

Search Package

The endpoint {{baseUrl}}/packages/search is a POST request used to search for packages. The request should include a payload with the following structure in raw request body type:

{
    "start": 0,
    "length": 0,
    "search": {
        "supplier_id": null,
        "order_id": 0,
        "id": null,
        "marketplace_package_id": null,
        "remote_id": null,
        "status": null,
        "package_status": null
    }
}

Response

The response to this request is a JSON object with the following schema:

{
    "data": [
        {
            "order_id": 0,
            "company_id": 0,
            "created_at": "",
            "invoice": {
                "invoice_pdf": "",
                "invoice_link": "",
                "invoice_date": "",
                "invoice_number": ""
            },
            "items": [
                {
                    "order_item_id": 0,
                    "quantity": 0,
                    "total_deci": 0
                }
            ],
            "marketplace_package_id": 0,
            "remote_id": "",
            "remote_supplier_id": 0,
            "status": "",
            "supplier_id": 0,
            "total_deci": 0,
            "tracking": {
                "tracking_provider": "",
                "provider": ""
            },
            "updated_at": "",
            "id": ""
        }
    ],
    "error_code": 0
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "start": 0,
  • "length": 10,
  • "search": {
    }
}

Create Package

Create a New Package

Once you are ready to send your products, you need to start with creating package information with the related items by this service.

This endpoint allows you to create a new package by making an HTTP POST request to the specified URL.

Request Body

  • remote_supplier_id (integer): The ID of the remote supplier.
  • supplier_id (integer): The ID of the supplier.
  • order_id (integer): The ID of the order.
  • company_id (integer): The ID of the company.
  • remote_id (string): The remote package ID.
  • marketplace_package_id (integer): The ID of the marketplace package.
  • total_deci (integer): The total decimal value.
  • status (string): The status of the package.
  • items (array): An array of items included in the package, each containing:
    • order_item_id (integer): The ID of the order item.
    • quantity (integer): The quantity of the item.
    • total_deci (integer): The total decimal value of the item.
  • tracking (object): Object containing tracking information with the following fields:
    • tracking_pdf (string): The tracking PDF file.
    • tracking_barcode (string): The tracking barcode.
    • base64_file (string): The base64 encoded file.
    • tracking_link (string): The tracking link.
    • tracking_provider (string): The tracking provider (deprecated).
    • provider (string): The provider.
  • invoice (object): Object containing invoice information with the following fields:
    • invoice_pdf (string): The invoice PDF file.
    • invoice_link (string): The invoice link.
    • invoice_date (string): The date of the invoice.
    • invoice_number (string): The invoice number.

Response

The response will contain the created package data, including the package ID, order ID, company ID, creation and update timestamps, invoice information, item details, marketplace package ID, remote ID, supplier ID, total decimal value, and tracking information. Additionally, an error code will be included in the response.

Example:

{
  "data": {
    "order_id": 0,
    "company_id": 0,
    "created_at": "",
    "invoice": {
      "invoice_pdf": "",
      "invoice_link": "",
      "invoice_date": "",
      "invoice_number": ""
    },
    "items": [
      {
        "order_item_id": 0,
        "quantity": 0,
        "total_deci": 0
      }
    ],
    "marketplace_package_id": 0,
    "remote_id": "",
    "remote_supplier_id": 0,
    "status": "",
    "supplier_id": 0,
    "total_deci": 0,
    "tracking": {
      "tracking_pdf": "",
      "tracking_barcode": "",
      "base64_file": "",
      "tracking_link": "",
      "tracking_provider": "",
      "provider": ""
    },
    "updated_at": "",
    "id": ""
  },
  "error_code": 0
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "remote_supplier_id": 13,
  • "supplier_id": 13,
  • "order_id": 13,
  • "company_id": 3,
  • "remote_id": "remote_package_3",
  • "marketplace_package_id": 3,
  • "total_deci": 3,
  • "status": "null",
  • "items": [
    ],
  • "tracking": {
    },
  • "invoice": {}
}

Package Info

GET /packages/13

Description

This endpoint retrieves package details based on the provided package ID.

Request

No request body is required for this endpoint.

Response

The response will be a JSON object with the following schema:

{
  "data": {
    "order_id": 0,
    "company_id": 0,
    "created_at": "",
    "invoice": {
      "invoice_pdf": "",
      "invoice_link": "",
      "invoice_date": "",
      "invoice_number": ""
    },
    "items": [
      {
        "order_item_id": 0,
        "quantity": 0,
        "total_deci": 0
      }
    ],
    "marketplace_package_id": 0,
    "remote_id": "",
    "remote_supplier_id": 0,
    "status": "",
    "supplier_id": 0,
    "total_deci": 0,
    "tracking": {
      "tracking_pdf": "",
      "tracking_barcode": "",
      "base64_file": "",
      "tracking_link": "",
      "tracking_provider": "",
      "provider": ""
    },
    "updated_at": "",
    "id": ""
  },
  "error_code": 0
}
Authorizations:
bearerAuth

Responses

Cancel Package

The endpoint makes an HTTP GET request to cancel a package by ID

The response of the request can be documented as a JSON schema as follows:

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "order_id": { "type": "integer" },
        "company_id": { "type": "integer" },
        "created_at": { "type": "string" },
        "invoice": {
          "type": "object",
          "properties": {
            "invoice_pdf": { "type": "string" },
            "invoice_link": { "type": "string" },
            "invoice_date": { "type": "string" },
            "invoice_number": { "type": "string" }
          }
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "order_item_id": { "type": "integer" },
              "quantity": { "type": "integer" },
              "total_deci": { "type": "integer" }
            }
          }
        },
        "marketplace_package_id": { "type": "integer" },
        "remote_id": { "type": "string" },
        "remote_supplier_id": { "type": "integer" },
        "status": { "type": "string" },
        "supplier_id": { "type": "integer" },
        "total_deci": { "type": "integer" },
        "tracking": {
          "type": "object",
          "properties": {
            "tracking_pdf": { "type": "string" },
            "tracking_barcode": { "type": "string" },
            "base64_file": { "type": "string" },
            "tracking_link": { "type": "string" },
            "tracking_provider": { "type": "string" },
            "provider": { "type": "string" }
          }
        },
        "updated_at": { "type": "string" },
        "id": { "type": "string" }
      }
    },
    "error_code": { "type": "integer" }
  }
}
Authorizations:
bearerAuth

Responses

Fulfill Package

POST /packages/fulfill/13

You can include tracking information to you packages with this service, if you didn't do in creation phase.

Request Body

  • tracking_pdf (string): The URL for the tracking PDF.
  • tracking_barcode (string): The tracking barcode.
  • base64_file (string, optional): Base64 encoded file.
  • tracking_link (string): The URL for tracking.
  • tracking_provider (string, deprecated): The tracking provider (deprecated).
  • provider (string): The provider.

Response

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "order_id": {
          "type": "integer"
        },
        "company_id": {
          "type": "integer"
        },
        "created_at": {
          "type": "string"
        },
        "invoice": {
          "type": "object",
          "properties": {
            "invoice_pdf": {
              "type": "string"
            },
            "invoice_link": {
              "type": "string"
            },
            "invoice_date": {
              "type": "string"
            },
            "invoice_number": {
              "type": "string"
            }
          }
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "order_item_id": {
                "type": "integer"
              },
              "quantity": {
                "type": "integer"
              },
              "total_deci": {
                "type": "integer"
              }
            }
          }
        },
        "marketplace_package_id": {
          "type": "integer"
        },
        "remote_id": {
          "type": "string"
        },
        "remote_supplier_id": {
          "type": "integer"
        },
        "status": {
          "type": "string"
        },
        "supplier_id": {
          "type": "integer"
        },
        "total_deci": {
          "type": "integer"
        },
        "tracking": {
          "type": "object",
          "properties": {
            "tracking_pdf": {
              "type": "string"
            },
            "tracking_barcode": {
              "type": "string"
            },
            "base64_file": {
              "type": "string"
            },
            "tracking_link": {
              "type": "string"
            },
            "tracking_provider": {
              "type": "string"
            },
            "provider": {
              "type": "string"
            }
          }
        },
        "updated_at": {
          "type": "string"
        },
        "id": {
          "type": "string"
        }
      }
    },
    "error_code": {
      "type": "integer"
    }
  }
}
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{}

Fulfill Online Package

Fulfill Online Package

Fulfills an order via one of our accepted shipping providers that offer online shipping.

Request Body

  • tracking_provider (deprecated): The tracking provider for the package. (Will be deprecated)
  • provider: The provider for the package.

Response

Upon successful execution, the endpoint returns a JSON response with the following structure:

{
    "data": {
        "order_id": 0,
        "company_id": 0,
        "created_at": "",
        "invoice": {
            "invoice_pdf": "",
            "invoice_link": "",
            "invoice_date": "",
            "invoice_number": ""
        },
        "items": [
            {
                "order_item_id": 0,
                "quantity": 0,
                "total_deci": 0
            }
        ],
        "marketplace_package_id": 0,
        "remote_id": "",
        "remote_supplier_id": 0,
        "status": "",
        "supplier_id": 0,
        "total_deci": 0,
        "tracking": {
            "tracking_provider": "",
            "provider": ""
        },
        "updated_at": "",
        "id": ""
    },
    "error_code": 0
}
  • order_id: The ID of the order associated with the package.
  • company_id: The ID of the company associated with the package.
  • created_at: The timestamp of creation.
  • invoice: Details of the invoice including PDF, link, date, and number.
  • items: List of items in the package with order item ID, quantity, and total.
  • marketplace_package_id: The ID of the package in the marketplace.
  • remote_id: The remote ID of the package.
  • remote_supplier_id: The ID of the remote supplier.
  • status: The status of the package.
  • supplier_id: The ID of the supplier.
  • total_deci: The total decimal value.
  • tracking: Details of the tracking provider and provider.
  • updated_at: The timestamp of the last update.
  • id: The ID of the package.
Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "tracking_provider": "pts",
  • "provider": "pts"
}

Package Tracking

Search Tracking

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "start": 0,
  • "length": 10,
  • "search": {
    }
}

Create / Update Tracking

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{}

Tracking Info

Authorizations:
bearerAuth

Responses

Deliveries

Get Delivery Info

Get Delivery Details

This endpoint retrieves the details of a specific delivery by providing the delivery ID in the URL.

Request

  • Method: GET
  • URL: {{baseUrl}}/deliveries/1/
Request Body
  • Type: Raw
  • { "start": 0, "length": 0, "search": { "id": null, "company_id": null, "parent_id": null, "name": "", "remote_id": null, "is_active": null, "remote_parent_id": null }}
Authorizations:
bearerAuth

Responses

Update Event Info

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "delivery_info": {
    }
}

Update Status

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "status": "in_transit"
}

Cron

start

GET /cron/start

This endpoint is used to initiate a cron job.

Request

No request body is required for this request.

Response

The response for this request is a JSON object with the following schema:

{
    "data": {
        "message": "string"
    },
    "error_code": "number",
    "message": "string"
}
  • data (object)

    • message (string): A message related to the response.
  • error_code (number): An error code, if any.

  • message (string): A message related to the response.

The response received upon the last execution had a status code of 200 and a content type of application/json. The response body included a JSON object with a "data" field containing the "message" key, an "error_code" field, and a "message" field.

Authorizations:
noauthAuth

Responses