How to add Custom Properties to Offer.

Appxite

Introduction

This article explains how to add and manage custom properties for Products using the API. Understanding Product properties will help you extend Product data with custom fields for better organization, integration with external systems, and Product management across your catalog.

In this article:

Create Offer properties

POST https:///appxite-svc-product-marketing-p1-{envName}-01.azurewebsites.net/api/v1/OfferProperties

Body: 
{
  "vendorId": "",
  "offerId": "",
  "properties": [
    {
      "resellerId": "string",
      "fields": [
        {
          "key": "string",
          "value": "string"
        }
      ]
    }
  ]
}

Parameters description:

  • vendorId - GUID that identifies vendor
  • offerId - GUID that identifies offer
  • properties - array of custom properties to be added
  • resellerId - GUID that identifies resellerId
  • key - key that identifies the property. Can contain a string up to 100 alphanumeric chars.
  • value - value of the property. Can contain a string up to 100 alphanumeric chars.

Restrictions:

  1. It's not allowed to duplicate key within reseller and offer. The following payload is invalid:
"properties": [
    {
      "resellerId": "...",
      "fields": [
        {
          "key": "erpId",
          "value": "1233456789"
        },
		{
          "key": "erpId",
          "value": "987654321"
        }
      ]
    }
  1. If it forbidden to create property with key that is already existing in db. The bundle (offerId, resellerId, key) is unique.

The response contains offer with custom properties.

Edit offer properties

PUT https:///appxite-svc-product-marketing-p1-{envName}-01.azurewebsites.net/api/v1/OfferProperties

The body is the same as for POST method. Restrictions: If the property doesn't exist in db, it won't be added. The response contains offer with custom properties.

Get offer properties

GET https:///appxite-svc-product-marketing-p1-{envName}-01.azurewebsites.net/api/v1/OfferProperties/vendors/{vendorId}/offers/{offerId}/properties

Parameters description:

  • vendorId - GUID that identifies vendor
  • offerId - GUID that identifies offer

Example of response:

[
  {
    "resellerId": "9526b7b6-feac-4972-8259-3c135e51e19e",
    "fields": [
      {
        "key": "erpId",
        "value": "637291972186788707"
      },
      {
        "key": "materialId",
        "value": "dlfjdlkjfdk5777"
      }
    ]
  },
  {
    "resellerId": "b816525d-80ad-4c65-a8a3-b689cf0f3ddf",
    "fields": [
      {
        "key": "materialId",
        "value": "asddfgn"
      }
    ]
  }

Get offers by property value

GET https:///appxite-svc-product-marketing-p1-{envName}-01.azurewebsites.net/api/v1/OfferProperties/property/{property}/value/{value}/offers

Example of request:

api/v1/OfferProperties/property/materialId/value/asddfgn/offers

The response contains list of offers that have such property and the value of the property.

Get offers without specified property

GET https:///appxite-svc-product-marketing-p1-{envName}-01.azurewebsites.net/api/v1/OfferProperties/property/{property}/value/empty/offers

Example of request:

api/v1/OfferProperties/property/materialId/value/empty/offers

The response contains list of offers without specified property. This method was added by request of customer in order to find offers with the aim to add property in future.

Summary

Product custom properties can be created, edited, and retrieved using the OfferProperties API endpoints. Use POST to create new properties with vendor ID, Product ID, Seller ID, key, and value parameters, ensuring each key is unique per Seller and Product combination. Keys and values are limited to 100 alphanumeric characters, and duplicate keys within the same Seller and Product are not allowed. Use PUT to edit existing properties, noting that non-existent properties will not be added. Retrieve Product properties using GET with vendor ID and Product ID, search for Products by specific property values, or find Products without a specified property to identify which Products need properties added. The bundle of Product ID, Seller ID, and key must be unique across the system.

Was this article helpful?

0 out of 0 found this helpful

Add comment

Please sign in to leave a comment.