Skip to main content

EMERGE API: Product Info

Gigi Nguyen avatar
Written by Gigi Nguyen
Updated over 10 months ago

The Product API lets users access basic product information and inventory details, enabling quick retrieval of key data

A. Endpoints

GET: {APIhost}/product
PUT: {APIhost}/product/put/priceSelling
Headers: x-emerge-api-key: [Your API Key]

C# example

using (var client = new HttpClient())
{
client.BaseAddress = new Uri("https://yourapi.com/");
client.DefaultRequestHeaders.Add("x-emerge-api-key", "YOUR_API_KEY");
// Get or Post Request
var response = client.GetAsync("ProductInventory").Result;
}

Java example

import requests

headers = {
'x-emerge-api-key': 'YOUR_API_KEY'
}
response = requests.get('https://yourapi.com/ProductInventory', headers=headers)

Java example

HttpRequest.Builder requestBuilder = HttpRequest.newBuilder() 
.uri(URI.create("http://exampleURL.com/aFile"));
requestBuilder.header("xxxx","yyyyy");
HttpRequest request = requestBuilder.build();

Object data example

[
{
"id": 47021,
"parentId": null,
"name": "Product A",
"sku": "Product-A-Variant",
"purchasePrice": 19.99,
"sellingPrice": 59.99,
"defaultProductCategoryId": 2072,
"brand": {
"id": 46,
"name": "Top Fashion"
},
"categories": [
{
"id": 2072,
"name": "Shirt"
},
{
"id": 3217,
"name": "Luxury"
}
],
"isDeleted": false,
"productVariantViewModelList": [
{
"variantId": 47022,
"productVariantOptionAndValues": [
{
"productVariantOption": "Color",
"productVariantValue": "Red"
},
{
"productVariantOption": "Size",
"productVariantValue": "Big"
}
]
},
{
"variantId": 47023,
"productVariantOptionAndValues": [
{
"productVariantOption": "Color",
"productVariantValue": "Green"
},
{
"productVariantOption": "Size",
"productVariantValue": "Big"
}
]
}
]
}
]

B. Params

1. Limit

  • Data type: Int

  • Description: The maximum number of items returned per page, with a default value of 10. Maximum = 100

2. Page

  • Data type: Int

  • Description: The current page number to retrieve

3. from_date_created

  • Data type: Nullable Datetime (YYYY-MM-DD)

  • Description: An optional filter to return products created after this date.

4. to_date_created

  • Data type: Nullable Datetime (YYYY-MM-DD)

  • Description: An optional filter to return products created before this date.

C. Searching criterias

1. Query

  • Data type: String

  • Description: Searching product Product name and Product SKU

2. IDs

  • Data type: Int[]

  • Description: An array of integer IDs that represents a list of specific product IDs to be included in the search.

D. Standard Product Attributes

1. ID

  • Data type: int

  • Description: Unique identifier for the object. This property is always present

2. Name

  • Data type: string

  • Description: The product’s name, meant to be displayable to the customer

3. SKU

  • Data type: string

  • Description: The product's SKU

4. PurchasePrice

  • Data type: nullable decimal

  • Description: Purchase price of the product, can be null if user doesn't input purchase price into the product.

5. SellingPrice

  • Data type: nullable decimal

  • Description: Selling price of the product, can be null if user doesn't input selling price into the product.

6. Brand

  • Data type: nullable int

  • Description: Brand name. 1 product can only have 1 brand, can be null if user doesn't assign any brand to the product.

7. Categories

1 product can have multiple names. The categories field provides a list of categories related to the entity.

ID

  • Data type: int

  • Description: A unique identifier for the category.

Name

  • Data type: string

  • Description: The name of the category.

8. defaultProductCategoryId

  • Data type: int

  • Description: A unique identifier for the category. This is default category of the product.

9. isDeleted

  • Data type: boolean

  • Description: If = true then the product is deleted. If = false then product is not deleted

E. Variant Product Attributes

1. parentId

  • Data type: int

  • Description: A unique identifier for parent product of a variant.

2. productVariantViewModelList:

The productVariantViewModelList provides a list of product variants, each represented by its unique variantId and associated option-value pairs that describe specific variant attributes (such as color or size). Each variant contains:

VariantID

  • Data type: int

  • Description: A unique identifier for the product variant.

productVariantOptionAndValues

  • Data type: array

  • Description: A list of option-value pairs that define the variant's option and value

    • productVariantOption (string): The name of the product option, such as "Color" or "Size".

    • productVariantValue (string): The specific value of the option, such as "Red" or "Small".

Did this answer your question?