Personalization Examples#
This page provides detailed examples for reading, writing, and deleting listing personalization data. For a full description of the endpoints, data structure, and constraints, see the Personalization Migration Guide.
Getting personalization data through the dedicated personalization GET endpoint#
This endpoint retrieves a listing’s personalization questions by listing ID. It returns a personalization_questions array. If the listing has no personalization configured, the array is empty.
The following procedure retrieves the personalization questions attached to a listing.
Form a valid URL for
getListingPersonalization, which must include alisting_id. For example, if yourlisting_idis "987654", the URL is:https://api.etsy.com/v3/application/listings/987654/personalization
Execute a
getListingPersonalizationGET request with your x-api-key.The response contains a
personalization_questionsobject:
Getting personalization data via endpoints that return listings with associations#
You can also retrieve the personalization data for a listing by using the following endpoints and including the parameter ?includes=personalization in your requests:
- getListingsByShop -
GET /v3/application/shops/{shop_id}/listings - getListing -
GET /v3/application/listings/{listing_id} - getListingsByListingIds -
GET /v3/application/listings/batch
Example url for the getListing endpoint: https://api.etsy.com/v3/application/shops/12345678/listings?includes=personalization\&language=en
Example response:
Examples of question types#
Dropdown questions#
Unlabeled file uploads#
Labeled file uploads#
note
For labeled file upload questions, the max_allowed_files value must be 2 or more, and must match the number of labels provided in the options array.
Adding or updating personalization data through the dedicated personalization POST endpoint#
To create or update personalization questions for a listing you must first have an existing listing. If you do not have one, you can create a new listing using the createDraftListing endpoint before utilizing this endpoint.
warning
If your app has been updated to support multiple questions and all three question types, then you should send the query parameter ?supports_multiple_personalization_questions=true in your request to update the listing. If this parameter is omitted, an attempt to overwrite previously configured personalization questions will result in a 409 Conflict response. Adding the param without updating the application can lead to deleting data provided by the seller on Etsyweb.
The following procedure creates and attaches a personalization profile to a specific listing with the maximum number of personalization questions allowed and an unlabeled file upload question:
Form a valid URL for
updateListingPersonalization, which must include ashop_idand alisting_idand include the?supports_multiple_personalization_questions=trueparam. For example, if yourshop_idis "12345678", and yourlisting_idis “987654” then theupdateListingPersonalizationURL would be:Build the
updateListingPersonalizationrequest body, which must include:personalization_questions- Array of question objects, with the following shape:
- Execute an
updateListingPersonalizationPOST request with yourlistings_wscoped OAuth token and x-api-key. For example, a request with the previouspersonalization_questionsmight look like this:
- JavaScript fetch
- You should get a
201 Createdresponse that would look similar to this:
- The content of this request replaces any existing personalization data on the listing.
Updating a listing with existing personalization#
When updating personalization on a listing, the payload must contain all the personalization information that you want on the listing, as the POST request replaces the existing listing personalization data.
If the update includes existing questions — for instance, if you are adding an additional question to existing ones — include the question_id for each of the existing questions in your POST request to the updateListingPersonalization endpoint.
The following procedure updates listing personalization with an existing question:
Obtain the
question_idthrough thegetListingPersonalizationGET endpoint. A valid URL must include alisting_id. For example, if yourlisting_idis "987654", the URL is:https://api.etsy.com/v3/application/listings/987654/personalization
Read the
question_idvalue from the response.
Form a valid URL for
updateListingPersonalization, which must include ashop_idand alisting_idand include the?supports_multiple_personalization_questions=trueparam. For example, if yourshop_idis "12345678", and yourlisting_idis “987654” then theupdateListingPersonalizationURL would be:Build the
updateListingPersonalizationrequest body, which must include:personalization_questions- Array of question objects, each question should include itsquestion_idif you’re editing an existing question:
- Execute an
updateListingPersonalizationPOST request with yourlistings_wscoped OAuth token and x-api-key, similar to the example above. - You should get a
201 Createdresponse that would look similar to this:
- Keep in mind that the
question_idis not stable and it might change in a successful response if Etsy detects any changes to the current question.
Deleting personalization from a listing through the dedicated DELETE endpoint#
This endpoint deletes personalization for a listing. It clears personalization by setting is_personalizable to false and removing the listing’s personalization data.
The following procedure deletes the personalization questions attached to a listing.
Form a valid URL for
deleteListingPersonalization, which must include ashop_idand alisting_id. For example, if yourshop_idis "12345678", and yourlisting_idis “987654” then thedeleteListingPersonalizationURL would be:https://api.etsy.com/v3/application/shops/12345678/listings/987654/personalization
Execute a
deleteListingPersonalizationDELETE request with yourlistings_wscoped OAuth token and x-api-key.Check the response. On success, the endpoint returns
204 No Content.