Create & update prices data

Create and update prices and assign them to a SKU

Before we learn how to create upload prices to JOOR, let's learn how JOOR pricing works.

Prices are assigned on the SKU level, which means that a product could have different prices for different SKUs.

On JOOR, a brand can sell in one or many currencies, and a brand can sell the same product in the same currency at different price points to different customers. Brands control this via price types. So before we can upload prices to JOOR to display them to customers, we will have to retrieve from JOOR all available price types.

Let's create wholesale ($100) and retail ($200) prices for an SKU on JOOR.

Creating Prices

  1. A price on JOOR has five distinct properties
  • sku_id - JOOR SKU ID
  • price_type_id - JOOR price type ID
  • wholesale_value - wholesale price
  • retail_value - retail price
  1. We need a JOOR SKU id to add a price to an SKU. If you have stored the JOOR SKU id after creating an SKU then you can retrieve it now and use it in the CREATE /prices request. If not, then use the GET /skus endpoint to see a list of available SKU ids for products.
    a. You can use the product_id to filter only SKUs that belong to the product that you wish to add prices.
  • For example: https://apisandbox.jooraccess.com/v4/skus?product_ids=3295521&account=[your_account_id]

Here is a sample GET /skus response, capture the id we will need for the CREATE /prices request:

{
    "data": [
        {
            "id": "MHw1NTE3MDk1fDE4MjMwODYy",
            "product_id": "3295521",
            "external_id": "nyhat0001",
            "sku_identifier": "nyhatblue001s1",
            "trait_values": [
                {
                    "trait": {
                        "id": "U0tVVHJhaXQ6U3R5bGVDb2xvcg==",
                        "name": "Color"
                    },
                    "value": "Blue",
                    "external_id": "blue001",
                    "order_minimum": 0,
                    "order_nbr": 1,
                    "status": "ACTIVE",
                    "hexColor": null,
                    "swatch": null,
                    "images": null
                },
                {
                    "trait": {
                        "id": "U0tVVHJhaXQ6U2l6ZQ==",
                        "name": "Size"
                    },
                    "value": "Small",
                    "external_id": "S1",
                    "order_minimum": null,
                    "order_nbr": 1,
                    "status": "ACTIVE",
                    "hexColor": null,
                    "swatch": null,
                    "images": null
                }
            ],
            "identifiers": [
                {
                    "type": "upc",
                    "value": "03338300740"
                }
            ]
        }
    ],
    "errors": []
}
  1. Every price must belong to a price type, which does two things: sets currency for the retail and wholesale prices and controls which prices retailers see (price types are assigned to customers during customer creation, which is explained in a different section).
  • You might have price type IDs stored on your end, if you do then just use those. If you don't have them, then use the GET /price_types endpoint to see available price types.

  • For example: GET https://apisandbox.jooraccess.com/v4/price_types?account=[your_account_id]

{
    "data": [
        {
            "id": "464603",
            "name": "EU1",
            "currency_code": "USD",
            "retail_currency_code": "EUR"
        },
        {
            "id": "464601",
            "name": "US1",
            "currency_code": "USD",
            "retail_currency_code": "USD"
        },
        {
            "id": "476673",
            "name": "EXPORT-CN",
            "currency_code": "EUR",
            "retail_currency_code": "EUR"
        }
    ],
    "errors": []
}

*Most likely you will see many price types in the response, filter for the price type that you want to use and store its id.

  1. Now we are ready to create a product price on JOOR. Insert the sku_id and price_type_id into the CREATE /prices request to create prices for that SKU.
[
  {
    "sku_id": "MHw1NTE3MDk1fDE4MjMwODYy",
    "price_type_id": "464601",
    "wholesale_value": "100",
    "retail_value": "200"
  }
]
  1. The CREATE /prices response will provide JOOR price id, which is used in the UPDATE /prices request. You can choose to store the JOOR price id or ask JOOR to provide it whenever you need it using the GET /prices request.
{
    "data": [
        {
            "id": "168378",
            "sku_id": "MHw1NTE3MDk1fDE4MjMwODYy",
            "price_type": {
                "id": "464601",
                "name": "US1",
                "currency_code": "USD",
                "retail_currency_code": "USD"
            },
            "wholesale_value": "100.0",
            "retail_value": "200.0"
        }
    ],
    "errors": []
}

Update Prices

The UPDATE /prices request is essentially the same as CREATE /prices with one exception, it requires a JOOR price ID so the system knows which product to update. If you saved the JOOR price ID when the price was created then you can use it in the UPDATE /prices request; however, if you don't have it then you will have to use the GET /prices endpoint.

Let's walk through retrieving an SKU and prices id from JOOR and updating a SKU price:

1.Use the GET /skus endpoint to see available SKU ids for products.
a. If you know the product_id you can use it to filter only SKUs that belong to the product that you wish to update.

  • For example: https://apisandbox.jooraccess.com/v4/skus?product_ids=3295521&account=[your_account_id]

If you do not know the product_id you can ask the API to give you all SKUs that JOOR has and then programmatically filter for the SKU that you wish to update using the GET /skus endpoint.

  • For example: https://apisandbox.jooraccess.com/v4/skus?account=[your_account_id]
{
    "data": [
        {
            "id": "MHw1NTE3MDk1fDE4MjMwODYy",
            "product_id": "3295521",
            "external_id": "nyhat0001",
            "sku_identifier": "nyhatblue001s1",
            "trait_values": [
                {
                    "trait": {
                        "id": "U0tVVHJhaXQ6U3R5bGVDb2xvcg==",
                        "name": "Color"
                    },
                    "value": "Blue",
                    "external_id": "blue001",
                    "order_minimum": 0,
                    "order_nbr": 1,
                    "status": "ACTIVE",
                    "hexColor": null,
                    "swatch": null,
                    "images": null
                },
                {
                    "trait": {
                        "id": "U0tVVHJhaXQ6U2l6ZQ==",
                        "name": "Size"
                    },
                    "value": "Small",
                    "external_id": "S1",
                    "order_minimum": null,
                    "order_nbr": 1,
                    "status": "ACTIVE",
                    "hexColor": null,
                    "swatch": null,
                    "images": null
                }
            ],
            "identifiers": [
                {
                    "type": "upc",
                    "value": "03338300740"
                }
            ]
        }
    ],
    "errors": []
}

Capture the SKU id that you wish to update the price for, you will need it for the next step

  1. Use the GET /prices endpoint to see available prices for SKUs.
    a. Filter by the sku_ids from the GET /skus endpoint.
{
    "data": [
        {
            "id": "168378",
            "sku_id": "MHw1NTE3MDk1fDE4MjMwODYy",
            "price_type": {
                "id": "464601",
                "name": "US1",
                "currency_code": "USD",
                "retail_currency_code": "USD"
            },
            "wholesale_value": "100.000",
            "retail_value": "200.000"
        }
    ],
    "errors": []
}

Capture the price id that you wish to update, you will need it for the next step

  1. Now insert the price id into the UPDATE /prices endpoint to update your desired price.
[
  {
    "id": "168378",
    "wholesale_value": "80",
    "retail_value": "150"
  }
]