I’m using the API Explorer to create a new discount catalog object. Since it’s new, the docs say I should enter a #
in the id field. However I’m getting an error saying that’s not valid. Is this just a bug within the explorer or is there another way I’m supposed to create a new discount? Leaving the id blank also results in an error saying the field can’t be blank.
curl https://connect.squareup.com/v2/catalog/object \
-X POST \
-H 'Square-Version: 2024-12-18' \
-H 'Authorization: Bearer ' \
-H 'Content-Type: application/json' \
-d '{
"idempotency_key": "47360dee-757d-463d-8536-6d786519529d",
"object": {
"type": "DISCOUNT",
"id": "#",
"discount_data": {
"discount_type": "FIXED_AMOUNT",
"amount_money": {
"amount": 1000,
"currency": "USD"
},
"modify_tax_basis": "MODIFY_TAX_BASIS"
}
}
}'
{
"errors": [
{
"category": "INVALID_REQUEST_ERROR",
"code": "INVALID_VALUE",
"detail": "Object ID must be blank, start with '#', or match an existing object: ID=\"#\".",
"field": "id"
}
]
}