Availabilities

Retrieving all availability information for a site

get

Retrieves all availability information for a specified site.

Note: When a product bundle is retrieved, availability is returned both for its particular products and for the bundle as a whole. The bundle's availability is equal to the lowest availability found in its products.


Required scopes No specific scopes are required.

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant's name.

Note: The tenant name should always be provided in lowercase.

Example: testtenant
sitestringRequired

Site code, defined when the site is created.

Example: shop1
Query parameters
pageSizenumberOptional

Number of items to be retrieved per page.

Default: 20000Example: 100
pageNumbernumberOptional

Page number to be retrieved. The number of the first page is 1.

Note: If the pageNumber parameter is passed, size of the pages must be specified in the pageSize parameter.

Default: 1Example: 5
Responses
200
The request was successful. A list of availabilities is returned.
application/json
get
GET /availability/{tenant}/availability/site/{site} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "id": "shop1:12345",
    "site": "shop1",
    "stockLevel": 10,
    "available": true,
    "productId": "5f7c996173fc281cdd412345",
    "popularity": 5,
    "distributionChannel": "ASSORTMENT",
    "metadata": {
      "mixins": {
        "productCustomAttributes": "https://res.cloudinary.com/saas-ag/raw/upload/schemata/productCustomAttributesMixIn.v29.json"
      },
      "createdAt": "2022-02-22T02:02:02.222Z",
      "modifiedAt": "2022-02-22T02:02:02.222Z"
    },
    "mixins": {
      "productCustomAttributes": {
        "minOrderQuantity": 2
      }
    }
  }
]

Retrieving product availabilities for a site

post

Retrieves availabilities for specified products on a specified site.


Required scopes No specific scopes are required.

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant's name.

Note: The tenant name should always be provided in lowercase.

Example: testtenant
Query parameters
sitestringOptional

Site code, defined when the site is created. If it's not provided, then availabilites for all sites are returned.

Example: shop1
pageSizenumberOptional

Number of items to be retrieved per page.

Default: 20000Example: 100
pageNumbernumberOptional

Page number to be retrieved. The number of the first page is 1.

Note: If the pageNumber parameter is passed, size of the pages must be specified in the pageSize parameter.

Default: 1Example: 5
Body
string[]Optional

IDs of products for which the locations should be retrieved.

Responses
200
The request was successful. A list of availabilities is returned.
application/json
post
POST /availability/{tenant}/availability/search HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 55

[
  "5f7c996173fc281cdd412345",
  "5f7c996173fc281cdd412346"
]
[
  {
    "id": "shop1:12345",
    "site": "shop1",
    "stockLevel": 10,
    "available": true,
    "productId": "5f7c996173fc281cdd412345",
    "popularity": 5,
    "distributionChannel": "ASSORTMENT",
    "metadata": {
      "mixins": {
        "productCustomAttributes": "https://res.cloudinary.com/saas-ag/raw/upload/schemata/productCustomAttributesMixIn.v29.json"
      },
      "createdAt": "2022-02-22T02:02:02.222Z",
      "modifiedAt": "2022-02-22T02:02:02.222Z"
    },
    "mixins": {
      "productCustomAttributes": {
        "minOrderQuantity": 2
      }
    },
    "bundleAvailabilities": [
      {
        "id": "shop1:678",
        "site": "shop1",
        "stockLevel": 10,
        "available": true,
        "productId": "5f7c996173fc281cdd412345",
        "popularity": 5,
        "distributionChannel": "ASSORTMENT",
        "metadata": {
          "createdAt": "2022-02-22T02:02:02.222Z",
          "modifiedAt": "2022-02-22T02:02:02.222Z"
        }
      }
    ]
  }
]

Retrieving a product's availability

get

Retrieves a specified product's availability details.


Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant's name.

Note: The tenant name should always be provided in lowercase.

Example: testtenant
productIdstringRequired

Product's unique identifier, generated when the product is created through the Product Service.

Example: 5f7c996173fc281cdd412345
sitestringRequired

Site code, defined when the site is created.

Example: shop1
Responses
200
The request was successful. The product's availability details are returned.
application/json
get
GET /availability/{tenant}/availability/{productId}/{site} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "id": "shop1:12345",
  "site": "shop1",
  "stockLevel": 10,
  "available": true,
  "productId": "5f7c996173fc281cdd412345",
  "popularity": 5,
  "distributionChannel": "ASSORTMENT",
  "metadata": {
    "mixins": {
      "productCustomAttributes": "https://res.cloudinary.com/saas-ag/raw/upload/schemata/productCustomAttributesMixIn.v29.json"
    },
    "createdAt": "2022-02-22T02:02:02.222Z",
    "modifiedAt": "2022-02-22T02:02:02.222Z"
  },
  "mixins": {
    "productCustomAttributes": {
      "minOrderQuantity": 2
    }
  },
  "bundleAvailabilities": [
    {
      "id": "shop1:678",
      "site": "shop1",
      "stockLevel": 10,
      "available": true,
      "productId": "5f7c996173fc281cdd412345",
      "popularity": 5,
      "distributionChannel": "ASSORTMENT",
      "metadata": {
        "mixins": {
          "productCustomAttributes": "https://res.cloudinary.com/saas-ag/raw/upload/schemata/productCustomAttributesMixIn.v29.json"
        },
        "createdAt": "2022-02-22T02:02:02.222Z",
        "modifiedAt": "2022-02-22T02:02:02.222Z"
      },
      "mixins": {
        "productCustomAttributes": {
          "minOrderQuantity": 2
        }
      }
    }
  ]
}

Creating a new availability for a product

post

Creates a new availability for a specified product.

Note: We recommend not to create a new product availability for a site named main. A site named main works as an aggregator of availability data from other sites. It's not possible to later retrieve availability for a single site when it's called main.


Required scopes

  • availability.availability_manage

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant's name.

Note: The tenant name should always be provided in lowercase.

Example: testtenant
productIdstringRequired

Product's unique identifier, generated when the product is created through the Product Service.

Example: 5f7c996173fc281cdd412345
sitestringRequired

Site code, defined when the site is created.

Example: shop1
Body
stockLevelnumberOptional

Stock level of the product, expressed as a number.

Example: 10
availablebooleanOptional

Flag indicating whether the product is available.

Example: true
popularityintegerOptional

Popularity of the product, expressed as a number.

Example: 5
distributionChannelstring · enumOptional

Name of the product's distribution channel.

Example: ASSORTMENTPossible values:
Responses
201
The request was successful. The availability has been created.
application/json
post
POST /availability/{tenant}/availability/{productId}/{site} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 289

{
  "stockLevel": 10,
  "available": true,
  "popularity": 5,
  "distributionChannel": "ASSORTMENT",
  "metadata": {
    "mixins": {
      "productCustomAttributes": "https://res.cloudinary.com/saas-ag/raw/upload/schemata/productCustomAttributesMixIn.v29.json"
    }
  },
  "mixins": {
    "productCustomAttributes": {
      "minOrderQuantity": 2
    }
  }
}
{
  "id": "5f7c996173fc281cdd412345."
}

Upserting availability information of a product

put

Updates a specified product's availability details, or crates a new availability if it doesn't exist yet.

Note: There is no possibility to update a product bundle's availability - it is always equal to the lowest availability found in the bundled products.


Required scopes

  • availability.availability_manage

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant's name.

Note: The tenant name should always be provided in lowercase.

Example: testtenant
productIdstringRequired

Product's unique identifier, generated when the product is created through the Product Service.

Example: 5f7c996173fc281cdd412345
sitestringRequired

Site code, defined when the site is created.

Example: shop1
Body
stockLevelnumberOptional

Stock level of the product, expressed as a number.

Example: 10
availablebooleanOptional

Flag indicating whether the product is available.

Example: true
popularityintegerOptional

Popularity of the product, expressed as a number.

Example: 5
distributionChannelstring · enumOptional

Name of the product's distribution channel.

Example: ASSORTMENTPossible values:
Responses
201
The request was successful. The availability has been created.
application/json
put
PUT /availability/{tenant}/availability/{productId}/{site} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 289

{
  "stockLevel": 10,
  "available": true,
  "popularity": 5,
  "distributionChannel": "ASSORTMENT",
  "metadata": {
    "mixins": {
      "productCustomAttributes": "https://res.cloudinary.com/saas-ag/raw/upload/schemata/productCustomAttributesMixIn.v29.json"
    }
  },
  "mixins": {
    "productCustomAttributes": {
      "minOrderQuantity": 2
    }
  }
}
{
  "id": "5f7c996173fc281cdd412345."
}

Deleting availability information of a product

delete

Deletes a specified product's availability.

Note: There is no possibility to delete a product bundle's availability - it is always equal to the lowest availability found in the bundled products.


Required scopes

  • availability.availability_manage

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant's name.

Note: The tenant name should always be provided in lowercase.

Example: testtenant
productIdstringRequired

Product's unique identifier, generated when the product is created through the Product Service.

Example: 5f7c996173fc281cdd412345
sitestringRequired

Site code, defined when the site is created.

Example: shop1
Responses
204
The request was successful. The availability has been deleted.
delete
DELETE /availability/{tenant}/availability/{productId}/{site} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Was this helpful?