Hello. I would like to update the custom_attribute_values but I get a generic error. What is the right way to update the custom attribute in ITEM ?
Request:
curl https://connect.squareupsandbox.com/v2/catalog/batch-upsert \
-X POST \
-H 'Square-Version: 2021-11-17' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"idempotency_key": "square61ba2a15614bd",
"batches": [
{
"objects": [
{
"id": "H5QPX4M7JTSLRAECDXN4LIOP",
"type": "ITEM",
"item_data": {
"product_type": "REGULAR",
"name": "PS5 - PIM",
"description": "Awesome game - PIM",
"variations": [
{
"id": "VJONTMD4MWLCK4U6NIH2MRBW",
"type": "ITEM_VARIATION",
"item_variation_data": {
"name": "PS5 - PIM",
"sku": "PS5-PIM",
"ordinal": 0,
"track_inventory": true,
"pricing_type": "FIXED_PRICING",
"price_money": {
"amount": 8900,
"currency": "USD"
},
"item_id": "H5QPX4M7JTSLRAECDXN4LIOP"
},
"version": 1639589790562
}
],
"category_id": "2XTOFYBWOTCV7RWBKGNQDHHX"
},
"present_at_all_locations": true,
"version": 1639589790562,
"custom_attribute_values": {
"id_3": {
"selection_uid_values": [
"#brazil"
]
},
"id_2": {
"selection_uid_values": [
"#extrajoystick"
]
},
"id_1": {
"string_value": "Sony Entertainment"
}
}
}
]
}
]
}'
Response error:
{"errors":[{"category":"API_ERROR","code":"INTERNAL_SERVER_ERROR","detail":"An internal error has occurred, and the API was unable to service your request."}]}
My custom attribute definition objects:
{
"objects": [
{
"type": "CUSTOM_ATTRIBUTE_DEFINITION",
"id": "IGAI3QXU6TCIDETATG7OL2JD",
"updated_at": "2021-12-15T17:36:30.562Z",
"created_at": "1970-01-19T23:26:29.79Z",
"version": 1639589790562,
"is_deleted": false,
"present_at_all_locations": true,
"custom_attribute_definition_data": {
"type": "SELECTION",
"name": "Country PIM",
"source_application": {
"application_id": "sandbox-sq0idb-c1GGOzrCQTSYdhxEQLz9mA",
"name": "Sandbox for sq0idp-kyWNphVz8Z2udgya-GZrxQ"
},
"allowed_object_types": [
"ITEM",
"ITEM_VARIATION"
],
"seller_visibility": "SELLER_VISIBILITY_READ_WRITE_VALUES",
"app_visibility": "APP_VISIBILITY_HIDDEN",
"selection_config": {
"max_allowed_selections": 1,
"allowed_selections": [
{
"uid": "WRTMSKMUHO2IZF5GWJ3PMW2P",
"name": "Brazil"
},
{
"uid": "B47TXDZDEC4IAUTLRK7EI4HI",
"name": "Canada"
},
{
"uid": "MGVL7ETE52BYKJCTZ4BMD52M",
"name": "China"
},
{
"uid": "5LSVFM2WZ3QIHA7TOKBOJOV3",
"name": "USA"
}
]
},
"key": "id_3"
}
},
{
"type": "CUSTOM_ATTRIBUTE_DEFINITION",
"id": "4HID3QT5G6WETEYCLG3MWEKR",
"updated_at": "2021-12-15T17:36:30.562Z",
"created_at": "1970-01-19T23:26:29.79Z",
"version": 1639589790562,
"is_deleted": false,
"present_at_all_locations": true,
"custom_attribute_definition_data": {
"type": "SELECTION",
"name": "Extra Options PIM",
"source_application": {
"application_id": "sandbox-sq0idb-c1GGOzrCQTSYdhxEQLz9mA",
"name": "Sandbox for sq0idp-kyWNphVz8Z2udgya-GZrxQ"
},
"allowed_object_types": [
"ITEM",
"ITEM_VARIATION"
],
"seller_visibility": "SELLER_VISIBILITY_READ_WRITE_VALUES",
"app_visibility": "APP_VISIBILITY_HIDDEN",
"selection_config": {
"max_allowed_selections": 5,
"allowed_selections": [
{
"uid": "WERVUCCNGEDNB7UBG7PQZDCX",
"name": "External HD"
},
{
"uid": "OGVL3JWABVFJZIXUM7K6VTV6",
"name": "Extra Joystick"
},
{
"uid": "XDQ23DA4XVFURIPFWU2TDPLL",
"name": "PSN PLUS"
},
{
"uid": "R3GMGBK7AIUNAY77UX4YFO7Q",
"name": "USB Cable"
}
]
},
"key": "id_2"
}
},
{
"type": "CUSTOM_ATTRIBUTE_DEFINITION",
"id": "HHSWNX4EXIUS6WZMRSUKWOCZ",
"updated_at": "2021-12-15T17:36:30.562Z",
"created_at": "1970-01-19T23:26:29.79Z",
"version": 1639589790562,
"is_deleted": false,
"present_at_all_locations": true,
"custom_attribute_definition_data": {
"type": "STRING",
"name": "Brand PIM",
"source_application": {
"application_id": "sandbox-sq0idb-c1GGOzrCQTSYdhxEQLz9mA",
"name": "Sandbox for sq0idp-kyWNphVz8Z2udgya-GZrxQ"
},
"allowed_object_types": [
"ITEM",
"ITEM_VARIATION"
],
"seller_visibility": "SELLER_VISIBILITY_READ_WRITE_VALUES",
"app_visibility": "APP_VISIBILITY_HIDDEN",
"string_config": {
"enforce_uniqueness": false
},
"key": "id_1"
}
}
]
}