Prices

Retrieving all prices

get

Retrieves all prices assigned to the tenant. You can filter the results with query parameters.


Required scopes

No specific scopes are required.

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
siteCodestringOptional

Codes of sites for which prices should be retrieved.

Default: main
currencystringOptional

Codes of currencies in which prices should be retrieved.

effectiveDatestringOptional

Date on which retrieved prices should be valid, compliant with the ISO 8601 standard. Format:date-fullyear "-" date-month "-" date-mday "T" partial-time time-offset

Default: 2022-01-01T00:00:00Z
sortstringOptional

List of properties used to sort the results, separated by colons. The order of properties indicates their priority in sorting.

Possible values:

  • {fieldName}
  • {fieldName}:asc
  • {fieldName}:desc

Note: If you want to sort the results by localized properties, the possible values are:

  • {fieldName}.{language}
  • {fieldName}.{language}:asc
  • {fieldName}.{language}:desc

If the sorting direction is not specified, the fields are sorted in ascending order.

pageNumberinteger · min: 1Optional

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: 1
pageSizeinteger · min: 1Optional

Number of items to be retrieved per page.

Default: 60
principalIdstringOptional

IDs of customers for whom the retrieved prices should be valid.

Note: This parameter is only available in the v2 version of the Price Service.

priceModelIdstringOptional

ID of the price model to which the retrieved prices should be assigned.

Note: This parameter is only available in the v2 version of the Price Service.

itemIdstringOptional

IDs of products for which prices should be retrieved.

Note: This parameter is only available in the v2 version of the Price Service.

itemTypestringOptional

Item types for which prices should be retrieved. Possible values:

  • PRODUCT

  • SKU

    Note: The SKU value is a preview value - the system does not fully operate on the SKU concept yet.

Note: This parameter is only available in the v2 version of the Price Service.

countrystringOptional

Codes of countries for which prices should be retrieved.

Note: This parameter is only available in the v2 version of the Price Service.

itemNamestringOptional

A product or SKU name. This attribute is available only for Price v2

Header parameters
Accept-LanguagestringOptional

List of language codes acceptable for the response. You can specify factors that indicate which language should be retrieved if the one with a higher factor was not found in the localized fields.

  • If the header is set to a particular language or a list of languages, all localized fields are retrieved as strings.
  • If the header is set to *, all localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages.
  • If the header is empty, localized fields are retrieved in the default language defined in the Configuration Service.
Responses
200
The request was successful. A list of prices is returned.
application/json
get
GET /price/{tenant}/prices HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "id": "6245aa0a78a8576e338fa9c4",
    "itemId": {
      "itemType": "PRODUCT",
      "id": "5f5a3a365bac380024b93c45"
    },
    "currency": "EUR",
    "location": {
      "countryCode": "DE"
    },
    "priceModelId": "6245a8f578a8576e338fa9c3",
    "restrictions": {
      "siteCodes": [
        "1111"
      ]
    },
    "tierValues": [
      {
        "priceValue": 15.99
      },
      {
        "priceValue": 14.99
      },
      {
        "priceValue": 13.99
      }
    ],
    "metadata": {
      "version": 1,
      "createdAt": "2022-03-31T13:18:02.379Z",
      "modifiedAt": "2022-03-31T13:18:02.379Z",
      "mixins": {
        "customAttributes": "https://customAttributes.json"
      }
    }
  }
]

Creating a new price

post

Creates a new price for a specified product.


Required scopes

  • price.price_manage

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Header parameters
Content-LanguagestringOptional

List of languages in which localized fields in the request body are provided.

  • If the Content-Language header is set to *, the localized fields should be provided as maps of translations, where the keys are language codes and values are the fields in their respective languages.
  • If the Content-Language header is set to a specific language, the localized fields should be provided as strings.
  • If the Content-Language header is empty, the endpoint will asume that the localized fields are provided in the default language defined in the Configuration Service.

Note: You can provide the localized fields only in languages defined in the Configuration Service. In case the fields are provided in languages that are not defined in the Configuration Service, the request will be rejected.

Body
idstringOptional

Custom price identifier. If not provided, it is automatically generated.

itemYrnstringOptional

Product's uniform resource name.

currencyall ofRequired
stringOptional

Currency code, compliant with the ISO 4217 standard.

Pattern: [A-Z]{3}
locationall ofRequired
salePriceall ofOptional
restrictionsall ofOptional
priceModelIdstringOptional

ID of the price model to which the price should assigned. If the ID is not provided, the default price model is used.

Responses
201
The request was successful. The price has been created.
application/json
post
POST /price/{tenant}/prices HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 304

{
  "id": "6245aa0a78a8576e338fa9c4",
  "itemId": {
    "itemType": "PRODUCT",
    "id": "5f5a3a365bac380024b93c45"
  },
  "currency": "EUR",
  "location": {
    "countryCode": "DE"
  },
  "priceModelId": "6245a8f578a8576e338fa9c3",
  "restrictions": {
    "siteCodes": [
      "1111"
    ]
  },
  "tierValues": [
    {
      "priceValue": 15.99
    },
    {
      "priceValue": 14.99
    },
    {
      "priceValue": 13.99
    }
  ]
}
{
  "id": "624c3e7c3406122baacc7e93"
}

Creating multiple prices

post

Creates multiple prices. The maximum batch size is 200.

Response for a particular price will be returned at the same position (index) at which that price is located in the request body.


Required scopes

  • price.price_manage

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Header parameters
Content-LanguagestringOptional

List of languages in which localized fields in the request body are provided.

  • If the Content-Language header is set to *, the localized fields should be provided as maps of translations, where the keys are language codes and values are the fields in their respective languages.
  • If the Content-Language header is set to a specific language, the localized fields should be provided as strings.
  • If the Content-Language header is empty, the endpoint will asume that the localized fields are provided in the default language defined in the Configuration Service.

Note: You can provide the localized fields only in languages defined in the Configuration Service. In case the fields are provided in languages that are not defined in the Configuration Service, the request will be rejected.

Bodyobject · Price(v2)[]
idstringOptional

Custom price identifier. If not provided, it is automatically generated.

itemYrnstringOptional

Product's uniform resource name.

currencyall ofRequired
stringOptional

Currency code, compliant with the ISO 4217 standard.

Pattern: [A-Z]{3}
locationall ofRequired
salePriceall ofOptional
restrictionsall ofOptional
priceModelIdstringOptional

ID of the price model to which the price should assigned. If the ID is not provided, the default price model is used.

Responses
207
Multi-Status
application/json
post
POST /price/{tenant}/prices/bulk HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 538

[
  {
    "itemId": {
      "itemType": "PRODUCT",
      "id": "5f5a3a365bac380024b93c45"
    },
    "currency": "EUR",
    "location": {
      "countryCode": "DE"
    },
    "priceModelId": "6245a8f578a8576e338fa9c3",
    "restrictions": {
      "siteCodes": [
        "1111"
      ]
    },
    "tierValues": [
      {
        "priceValue": 15.99
      },
      {
        "priceValue": 14.99
      },
      {
        "priceValue": 13.99
      }
    ]
  },
  {
    "itemId": {
      "itemType": "PRODUCT",
      "id": "5f5a3a365bac380024b93c46"
    },
    "currency": "EUR",
    "location": {
      "countryCode": "DE"
    },
    "priceModelId": "6245a8f578a8576e338fa9c3",
    "restrictions": {
      "siteCodes": [
        "1111"
      ]
    },
    "tierValues": [
      {
        "priceValue": 20
      },
      {
        "priceValue": 18
      },
      {
        "priceValue": 16
      }
    ]
  }
]
[
  {
    "index": 0,
    "id": "62d65a15088ed94ebf093d7d",
    "code": 201,
    "status": "CREATED"
  },
  {
    "index": 1,
    "id": "62d65a15088ed94ebf093d8d",
    "code": 201,
    "status": "CREATED"
  }
]

Upserting multiple prices

put

Updates or creates multiple prices. The maximum batch size is 200.

Response for a particular price will be returned at the same position (index) at which that price is located in the request body.


Required scopes

  • price.price_manage

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Header parameters
Content-LanguagestringOptional

List of languages in which localized fields in the request body are provided.

  • If the Content-Language header is set to *, the localized fields should be provided as maps of translations, where the keys are language codes and values are the fields in their respective languages.
  • If the Content-Language header is set to a specific language, the localized fields should be provided as strings.
  • If the Content-Language header is empty, the endpoint will asume that the localized fields are provided in the default language defined in the Configuration Service.

Note: You can provide the localized fields only in languages defined in the Configuration Service. In case the fields are provided in languages that are not defined in the Configuration Service, the request will be rejected.

Bodyall of[]
itemsall ofOptional
Responses
207
Multi-Status
application/json
put
PUT /price/{tenant}/prices/bulk HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 652

[
  {
    "id": "6245aa0a78a8576e338fa9c4",
    "itemId": {
      "itemType": "PRODUCT",
      "id": "5f5a3a365bac380024b93c45"
    },
    "currency": "EUR",
    "location": {
      "countryCode": "DE"
    },
    "priceModelId": "6245a8f578a8576e338fa9c3",
    "restrictions": {
      "siteCodes": [
        "1111"
      ]
    },
    "tierValues": [
      {
        "priceValue": 15.99
      },
      {
        "priceValue": 14.99
      },
      {
        "priceValue": 13.99
      }
    ],
    "metadata": {
      "version": 1
    }
  },
  {
    "id": "6245aa0a78a8576e338fa9c5",
    "itemId": {
      "itemType": "PRODUCT",
      "id": "5f5a3a365bac380024b93c46"
    },
    "currency": "EUR",
    "location": {
      "countryCode": "DE"
    },
    "priceModelId": "6245a8f578a8576e338fa9c3",
    "restrictions": {
      "siteCodes": [
        "1111"
      ]
    },
    "tierValues": [
      {
        "priceValue": 20
      },
      {
        "priceValue": 18
      },
      {
        "priceValue": 16
      }
    ],
    "metadata": {
      "version": 1
    }
  }
]
[
  {
    "index": 0,
    "id": "62d65a15088ed94ebf093d7d",
    "code": 204,
    "status": "NO_CONTENT"
  },
  {
    "index": 1,
    "id": "62d65a15088ed94ebf093d8d",
    "code": 400,
    "status": "BAD_REQUEST",
    "message": "The site(s) with code(s):[abcd] do(es) not exist on tenant:tenantname. Please provide valid site codes"
  }
]

Retrieving a price

get

Retrieves a specified price's details by priceId.


Required scopes

No specific scopes are required.

Authorizations
Path parameters
priceIdstringRequired

Price's unique identifier, generated when the price is created.

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
extendWithPriceModelbooleanOptional

If set to true, the response will also include the price model's details.

Default: false
Header parameters
Accept-LanguagestringOptional

List of language codes acceptable for the response. You can specify factors that indicate which language should be retrieved if the one with a higher factor was not found in the localized fields.

  • If the header is set to a particular language or a list of languages, all localized fields are retrieved as strings.
  • If the header is set to *, all localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages.
  • If the header is empty, localized fields are retrieved in the default language defined in the Configuration Service.
Responses
200
The request was successful. Price details are returned.
application/json
Responseall of
get
GET /price/{tenant}/prices/{priceId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "id": "62468170bddc000efeb10781",
  "itemId": {
    "itemType": "PRODUCT",
    "id": "5f5a3a365bac380024b93c45"
  },
  "currency": "EUR",
  "location": {
    "countryCode": "DE"
  },
  "priceModelId": "6245a8f578a8576e338fa9c3",
  "restrictions": {
    "siteCodes": [
      "1111"
    ]
  },
  "tierValues": [
    {
      "priceValue": 15.99
    },
    {
      "priceValue": 14.99
    },
    {
      "priceValue": 13.99
    }
  ],
  "metadata": {
    "version": 1,
    "createdAt": "2022-04-01T04:37:04.301Z",
    "modifiedAt": "2022-04-01T04:37:04.301Z"
  }
}

Upserting a price

put

Updates a specified price's details by priceId, or creates a new one with if a price with the given id doesn't exist yet.


Required scopes

  • price.price_manage

Authorizations
Path parameters
priceIdstringRequired

Price's unique identifier, generated when the price is created.

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
partialbooleanRequired
Value Description
true A partial update will be performed.
false A full product replacement will be performed.
Header parameters
Content-LanguagestringOptional

List of languages in which localized fields in the request body are provided.

  • If the Content-Language header is set to *, the localized fields should be provided as maps of translations, where the keys are language codes and values are the fields in their respective languages.
  • If the Content-Language header is set to a specific language, the localized fields should be provided as strings.
  • If the Content-Language header is empty, the endpoint will asume that the localized fields are provided in the default language defined in the Configuration Service.

Note: You can provide the localized fields only in languages defined in the Configuration Service. In case the fields are provided in languages that are not defined in the Configuration Service, the request will be rejected.

Body
all ofOptional
Responses
201
The resource has been created.
application/json
put
PUT /price/{tenant}/prices/{priceId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 329

{
  "id": "62468170bddc000efeb10781",
  "itemId": {
    "itemType": "PRODUCT",
    "id": "5f5a3a365bac380024b93c45"
  },
  "currency": "EUR",
  "location": {
    "countryCode": "DE"
  },
  "priceModelId": "6245a8f578a8576e338fa9c3",
  "restrictions": {
    "siteCodes": [
      "1111"
    ]
  },
  "tierValues": [
    {
      "priceValue": 15.99
    },
    {
      "priceValue": 14.99
    },
    {
      "priceValue": 13.99
    }
  ],
  "metadata": {
    "version": 1
  }
}
{
  "id": "12345678-1234-1234-1234-123456789012"
}

Deleting a price

delete

Deletes a specified price by priceId.


Required scopes

  • price.price_manage

Authorizations
Path parameters
priceIdstringRequired

Price's unique identifier, generated when the price is created.

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Responses
204
The request was successful. The price has been updated.
delete
DELETE /price/{tenant}/prices/{priceId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Searching for prices

post

Retrieves prices (or a single price) for a list of products.

Required scopes

  • price.price_read

  • price.price_manage

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
expandstringOptional

Fields that should be expanded with additional information in the response body. Expressed as strings separated by commas.

Possible values:

  • priceModel
Body
itemIdsstring[] · min: 1 · max: 100Required

List of item IDs for which the prices should be retrieved.

currencystringOptional

Currency in which the prices should be retrieved, as defined in the Currency Service.

Pattern: [A-Z]{3}
siteCodestringOptional

Code of the site for which the prices should be retrieved.

principalIdstringOptional

IDs of customers for whom the retrieved prices should be valid.

effectiveDatestringOptional

Date on which retrieved prices should be valid, compliant with the ISO 8601 standard.

Format: date-fullyear "-" date-month "-" date-mday "T" partial-time time-offset

includesTaxbooleanOptional

Flag indicating whether the prices should be retrieved as net or a gross values.

useFallbackbooleanOptional

If no price that matches the criteria is found for the specified site, the price searching functionality will try to find the best price for the main site. To enable this option, this field needs to be set to true.

Note: Using the fallback mechanism may impact the performance as the price searching has to run a second time. If the fallback mechanism is used, the response's siteCode field will be set to main.

Default: false
searchModestring · enumOptional

Search mode indicating which prices should be taken into account regarding their principal-related restrictions.

Possible values:

  • ALL_PRICES - all prices should be taken into account regardless of their principal restrictions.
  • COMMON_PRICES - only the prices with no principal restrictions should be taken into account.
  • USER_SPECIFIC_PRICES - only the prices applicable for a given principalId should be taken into account.
Default: ALL_PRICESPossible values:
Responses
200
Prices have been successfully retrieved.
application/json
post
POST /price/{tenant}/prices/search HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 236

{
  "itemIds": [
    "62d7d67da07705795f72f313",
    "62d7d67da07705795f72f314"
  ],
  "currency": "EUR",
  "siteCode": "Berlin",
  "principalId": "principalId",
  "effectiveDate": "2022-01-01T00:00:00Z",
  "includesTax": true,
  "useFallback": false,
  "searchMode": "ALL_PRICES"
}
[
  {
    "itemId": "62d7d680a07705795f72f314",
    "prices": []
  },
  {
    "itemId": "62d7d67da07705795f72f313",
    "prices": [
      {
        "id": "62d7d67d92eb0f38a72a2a16",
        "itemId": {
          "itemType": "PRODUCT",
          "id": "62d7d67da07705795f72f313"
        },
        "itemYrn": "urn:yaas:saasag:caasproduct:product:testtenant;62d7d67da07705795f72f313",
        "currency": "EUR",
        "location": {
          "countryCode": "DE"
        },
        "salePrice": {
          "discountRate": 0
        },
        "priceModelId": "62d7d67d92eb0f38a72a2a13",
        "restrictions": {
          "principals": [
            {
              "type": "CUSTOMER",
              "id": "18637136"
            }
          ],
          "validity": {
            "from": "2021-08-31T00:07:42.518Z",
            "to": "2026-08-31T00:07:42.518Z"
          },
          "siteCodes": [
            "Berlin"
          ]
        },
        "tierValues": [
          {
            "priceValue": 10
          }
        ],
        "priceModel": {
          "id": "62d7d67d92eb0f38a72a2a13",
          "name": {
            "de": "Basic"
          },
          "description": {
            "de": "Basic price model"
          },
          "includesTax": false,
          "includesMarkup": true,
          "measurementUnit": {
            "quantity": 1,
            "unitCode": "pc"
          },
          "tierDefinition": {
            "tierType": "BASIC",
            "tiers": [
              {
                "minQuantity": {
                  "quantity": 0,
                  "unitCode": "pc"
                }
              }
            ]
          },
          "metadata": {
            "version": 1,
            "createdAt": "2022-07-20T10:18:37.265Z",
            "modifiedAt": "2022-07-20T10:18:37.265Z"
          },
          "default": false
        },
        "mixins": {
          "test2": {
            "atr1": "test",
            "atr2": "test2"
          },
          "test1": {
            "atr1": "test",
            "atr2": "test2"
          }
        },
        "metadata": {
          "version": 1,
          "createdAt": "2022-07-20T10:18:37.984Z",
          "modifiedAt": "2022-07-20T10:18:37.984Z",
          "mixins": {
            "test2": "url2",
            "test1": "url1"
          }
        }
      }
    ]
  }
]

Was this helpful?