Adding Customer attributes

The square bracket idea in the code didnt work.

But it seems that the only way I could pull it off is to make multiple definitions and use one definition per value.

So if I had a customer buy for say 20 people, then I’d have to make 20 calls in advance to square to make 20 definitions then set values to match each definition.

So something like this would work after creating 2 string definitions with string key string123 and string1234

And yes I just used x y and z and me as samples for customer ID and idempotency key and bearer.

I didn’t think it’d be this much of a challenge to upload an array of strings per customer.

curl https://connect.squareupsandbox.com/v2/customers/custom-attributes/bulk-upsert \
  -X POST \
  -H 'Square-Version: 2024-07-17' \
  -H 'Authorization: Bearer me \
  -H 'Content-Type: application/json' \
  -d '{
    "values": {
	"i1":{
        "custom_attribute": {"key": "string123","value": "abcd"},
        "customer_id": "x",
        "idempotency_key": "y"
      },
	"i2":{
        "custom_attribute": {"key": "string1234","value": "efgh"},
        "customer_id": "x",
        "idempotency_key": "z"
      }
    }
  }'