Customer Attributes

The Customer Attributes Import Endpoint

https://{BASE_URL}/imports/customer_attributes

All import integration endpoints use the same authentication parameters, please see Authentication page for more details.

Like the Product Import, this endpoint uses Import Queues to handle all imported data.

You may post any amount of Customer Attributes to the endpoint. Existing attributes are overwritten based on their id.

JSON Example

[
    {
        "id": "member_type",
        "name": { "da": "Medlemstype", "en": "Member type" },
        "type": {
            "options": {
                "gold": {
                    "id": "gold",
                    "name": { "da": "Guld", "en": "Gold" }
                },
                "platinum": {
                    "id": "platinum",
                    "name": { "da": "Platin", "en": "Platinum" }
                }
            }
        }
    },
    {
        "id" : "rating",
        "name" : "Rating",
        "type" : {
            "number" : {
                "scale" : 0,
                "suffix" : "points"
            }
        }
    },
    {
        "id" : "note",
        "name" : "Note",
        "type" : {
            "text": {
                "text":  true
            }
        }
    },
    ...
]

Models

The attribute model looks like this

{
    "id": "<string, required>",
    "name": "<L10nString, required>",
    "type": "<Attribute type, required>"
}

L10nString is a localized string.

There are 3 types of attributes

  • options
  • number
  • text

The simplest is the text type. Since we just need to specify that the attribute is a free text attribute, we just need a presence in the json.

{
    "text": {
        "text":  true
    }
}

For the number type you need to specify a decimal scale and a suffix that can be used in presentation. The suffix can be an empty string if you don't need any.

{
    "number" : {
        "scale" : "<integer, should be 0, 1, 2 or 3>",
        "suffix" : "<string>"
    }
}

The options attribute type specifies a set of text options that a product can use.

{
    "options": {
        "denmark": {
            "id": "<string, required, must be equal to object key (denmark)>",
            "name": "<L10nString, required>"
        },
        "france": {
            "id": "<string, required, must be equal to object key (france)>",
            "name": "<L10nString, required>"
        }
    }
}

Shared Integration Queue Parameters

For all integration queue import endpoints, you need to specify account, integration and apikey. Please read the Import Queues below for details about these parameters.

https://{BASE_URL}/imports/customer_attributes?account=[ACCOUNT ID]&integration=[INTEGRATION QUEUE ID]&apikey=[INTEGRATION QUEUE API KEY]

Deleting Attributes

Send an HTTP DELETE request to the endpoint with a body containing a JSON array of Product Attribute ids.

[
  "country", "grape"
]