Quantcast
Channel: Square Developer Forums - Latest topics
Viewing all articles
Browse latest Browse all 1325

Create DiscountCodes error

$
0
0

I use the create DiscountCode API to create a discount code, but get the error result as below:

{
    "errors": [
        {
            "category": "INVALID_REQUEST_ERROR",
            "code": "INVALID_VALUE",
            "detail": "Cannot create Discount Code with ITEM OLOGOODHU3LKPJKK2Z4XLHGR: Unsupported catalog_object.",
            "field": "discount_code.pricing_rule_id"
        }
    ]
}

My request is as below:

curl --location 'https://connect.squareup.com/v2/discount-codes' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--header 'Cookie: __cf_bm=4HzvS0NbQWKgKDMOibkq8gw55fJOjPK8crg3HC0g08Q-1723442869-1.0.1.1-E.mRgYAec21mxuHurhubzpjN3qyuQ4vSUGEsvdQSRy483aQJlSOyqBHl800T.3HV7RuyQinbn7mqtF3h6q8OEw' \
--data '{
    "idempotency_key": "fc8f8caa083d82d008a21d94213a80bd23371894f2c24d62403ae22fb0cea25e",
    "discount_code": {
        "code": "100percentoff",
        "pricing_rule_id": "ORFQAPUPGRSYAY7RMF42KSCE",
        "customer_id": "CTYV23A15NCGNB1PW2KDF93NWR"        
    }
}'

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 1325

Trending Articles