Hi,
I’m trying to create an order with discounts that apply to specific line items,
followed what I’ve understood from the docs, added the discounts to the order (with scope) and the discount UID to each order line item applied_discounts,
Would appreciate any assistance,
Sandbox App Id:
sandbox-sq0idb-InQP_pPUsVWjbrQXm93ktA
Thanks,
Example for a request that failed:
{
“request”: {
“method”: “POST”,
“url”: “https://connect.squareupsandbox.com/v2/orders”,
“headers”: {
“user-agent”: “Square-TypeScript-SDK/11.0.0”,
“content-type”: “application/json”,
“authorization”: “Bearer xxxxxx”,
“Square-Version”: “2021-05-13”,
“accept”: “application/json”
},
“body”: {
“type”: “text”,
“content”: “{“order”:{“location_id”:“CF69ZFKDKYQS3”,“source”:{“name”:“app-server”},“customer_id”:“PNZT14RE5S4G1CM5PJFYFFMMX4”,“line_items”:[{“quantity”:“1”,“catalog_object_id”:“UYEZHMUYMLLNXNXAZQ43GWCG”,“modifiers”:,“applied_discounts”:[{“discount_uid”:“248c0f”}]},{“quantity”:“1”,“catalog_object_id”:“GIZRWRATYJTPE34KN35YTX7D”,“modifiers”:}],“taxes”:[{“catalog_object_id”:“ZAVPI7WZUXAVZZUL4SRZPJIJ”}],“discounts”:[{“uid”:“248c0f”,“name”:”$2 Off Pastries",“type”:“FIXED_AMOUNT”,“amount_money”:{“amount”:200,“currency”:“USD”},“scope”:“LINE_ITEM”}],“fulfillments”:[{“type”:“PICKUP”,“pickup_details”:{“recipient”:{“customer_id”:“PNZT14RE5S4G1CM5PJFYFFMMX4”,“display_name”:“OOO ppp perez”},“schedule_type”:“ASAP”,“prep_time_duration”:“P0DT0H0M1S”}}]},“idempotency_key”:“5ffc31b8-d19b-4075-afa4-c59ad9da55a4”}"
}
},
“statusCode”: 400,
“headers”: {
“date”: “Wed, 09 Jun 2021 07:49:48 GMT”,
},
“body”: “{“errors”: [{“code”: “BAD_REQUEST”,“detail”: “mixed usage of applied adjustments fields with deprecated adjustments fields is not supported”,“category”: “INVALID_REQUEST_ERROR”}]}\n”,
“result”: {
“errors”: [
{
“code”: “BAD_REQUEST”,
“detail”: “mixed usage of applied adjustments fields with deprecated adjustments fields is not supported”,
“category”: “INVALID_REQUEST_ERROR”
}
]
}