Skip to content

Contextual Prices

GEThttps://rebuyengine.com/api/v1/prices/{countryCode}

Use Cases

Returns contextual pricing information for product variants in a specified country, including both current prices and compare-at prices. Pricing is returned in the local currency for the specified country.

Query Parameters

productIds · string
Comma-separated list of Shopify Product IDs to retrieve pricing for
key · string
Rebuy API key
countryCode · string · Default: US
The ISO 3166-1 alpha-2 country code (e.g., "US", "CA", "GB")

Code Example

// GET https://rebuyengine.com/api/v1/prices/{countryCode}
const params = new URLSearchParams({
  productIds: "YOUR_VALUE",
  key: "YOUR_VALUE"
});

fetch(`https://rebuyengine.com/api/v1/prices/{countryCode}?${params}`)
  .then(response => response.json())
  .then(data => console.log(data));

Response Examples

200 - 200

{
  "successful": true,
  "data": [
    {
      "5054495686692": {
        "variants": [
          {
            "32619686232100": {
              "price": {
                "amount": "16.5"
              },
              "compareAtPrice": null
            }
          }
        ]
      }
    },
    {
      "7345019617316": {
        "variants": [
          {
            "40889079824420": {
              "price": {
                "amount": "13.2"
              },
              "compareAtPrice": {
                "amount": "16.5"
              }
            }
          },
          {
            "40889079857188": {
              "price": {
                "amount": "8.8"
              },
              "compareAtPrice": {
                "amount": "16.5"
              }
            }
          }
        ]
      }
    }
  ],
  "status": 200,
  "errorMessage": null
}

400 - 400

{
  "successful": false,
  "data": [],
  "status": 400,
  "errorMessage": "invalid parameter, country code is invalid"
}

401 - 401

{
  "status": false,
  "errorCode": "no-api-key",
  "errors": [
    "An API key or My Shopify Domain must be provided via a header Rebuy-Api-Key or using the GET variable \"?key=\"."
  ]
}