PATCH /commerce/{accountId}/baskets/{basketId}/discounts

Path parameters

  • accountId string Required
  • basketId string Required
application/json

Body

  • RAW_BODY array[object] Required

    dicounts

    Hide RAW_BODY attributes Show RAW_BODY attributes object
    • type string Required
    • provider string Required

      Value is restaurant.

    • amount integer(int32) Required
    • name string

Responses

  • 200 application/json

    200

    Hide response attributes Show response attributes object
    • id string
    • created string
    • updated string
    • deleted boolean

      Default value is true.

    • etag string
    • accountId string
    • storeId string
    • currency string
    • taxExclusive boolean

      Default value is true.

    • status string
    • items array[object]
      Hide items attributes Show items attributes object
      • menuId string
      • plu string
      • name string
      • quantity integer

        Default value is 0.

      • price integer

        Default value is 0.

      • gross integer

        Default value is 0.

      • taxes array
      • net integer

        Default value is 0.

      • subItems array
      • discounts array[object]
        Hide discounts attributes Show discounts attributes object
        • referenceId integer

          Default value is 0.

        • amount integer

          Default value is 0.

      • discountTotal integer

        Default value is 0.

    • payment object
      Hide payment attributes Show payment attributes object
      • tips array
      • discountsTotal integer

        Default value is 0.

      • taxTotal integer

        Default value is 0.

      • tipTotal integer

        Default value is 0.

      • total integer

        Default value is 0.

    • customer object
      Hide customer attributes Show customer attributes object
      • name string
      • companyName string
      • phoneNumber string
      • email string
    • fulfillment object
      Hide fulfillment attribute Show fulfillment attribute object
      • type string
    • taxes array
    • discounts array[object]
      Hide discounts attributes Show discounts attributes object
      • type string
      • referenceId integer

        Default value is 0.

      • amount integer

        Default value is 0.

      • provider string
      • name string
  • 400 application/json

    400

PATCH /commerce/{accountId}/baskets/{basketId}/discounts
curl \
 --request PATCH 'https://api.staging.deliverect.com/commerce/{accountId}/baskets/{basketId}/discounts' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '[{"name":"CONGRATS! HERE IS 1 EUR OFF","type":"order_flat_off","amount":100,"provider":"coupon"}]'
Request examples
[
  {
    "name": "CONGRATS! HERE IS 1 EUR OFF",
    "type": "order_flat_off",
    "amount": 100,
    "provider": "coupon"
  }
]
[
  {
    "name": "CONGRATS!10% OFF",
    "type": "order_percent_off",
    "value": 1000,
    "provider": "restaurant"
  }
]
[
  {
    "plu": "DLX-3",
    "name": "Free coke",
    "type": "item_free",
    "menuId": "668f7ff64dc853**c96**877",
    "provider": "restaurant",
    "externalId": "discount-123"
  }
]
[
  {
    "plu": "DLX-3",
    "name": "",
    "type": "item_bogof",
    "menuId": "668f7ff64dc853**c96**877",
    "provider": "restaurant",
    "externalId": "discount-bogo"
  }
]
[
  {
    "name": "Item flat off: $5",
    "type": "item_flat_off",
    "value": 5000,
    "menuId": "668f7ff64dc853**c96**877",
    "itemIds": [
      "6900f2f01306779be71e7b8e"
    ],
    "provider": "restaurant",
    "externalId": "discount-item-flat-123"
  }
]
[
  {
    "name": "Item percent off: 25%",
    "type": "item_percent_off",
    "value": 2500,
    "menuId": "668f7ff64dc853**c96**877",
    "itemIds": [
      "6900f2f01306779be71e7b8e"
    ],
    "provider": "restaurant",
    "externalId": "discount-123"
  }
]
[
  {
    "type": "wallet_cash",
    "value": 1000,
    "provider": "loyalty",
    "externalId": null
  }
]
[
  {
    "name": "Compensation card for $5",
    "type": "compensation_card",
    "value": 5000,
    "provider": "restaurant",
    "externalId": "cardnumber-123"
  }
]
Response examples (200)
{
  "id": "6643782d0c1914c93a846834",
  "etag": "c2046a6b9c21b9ebb38f8094c0a3ca02240742b3",
  "items": [
    {
      "net": 1450,
      "plu": "STK-01",
      "name": "Delicious Steak Frites",
      "gross": 1500,
      "price": 1500,
      "taxes": [],
      "menuId": "62d7f77f64c95193cc29aa91",
      "quantity": 1,
      "subItems": [],
      "discounts": [
        {
          "amount": 50,
          "referenceId": 1
        }
      ],
      "discountTotal": 50
    }
  ],
  "taxes": [],
  "status": "open",
  "created": "2024-05-14T14:41:49.738000+00:00",
  "deleted": false,
  "payment": {
    "tips": [],
    "total": 1450,
    "taxTotal": 0,
    "tipTotal": 0,
    "discountsTotal": 50
  },
  "storeId": "65eee6a9984a1bc1b9637c59",
  "updated": "2024-05-14T15:19:37.173000+00:00",
  "currency": "EUR",
  "customer": {
    "name": "Test",
    "email": "test@email.com",
    "companyName": "Company LTDA",
    "phoneNumber": "12345"
  },
  "accountId": "65c35d109a19b819b7cf78d8",
  "discounts": [
    {
      "name": "CONGRATS! HERE'S 5 EUR OFF",
      "type": "order_flat_off",
      "amount": 50,
      "provider": "restaurant",
      "referenceId": 1
    }
  ],
  "fulfillment": {
    "type": "pickup"
  },
  "taxExclusive": false,
  "channelLinkId": "65eee6a9984a1bc1b9637c59",
  "channelOrderId": null,
  "channelOrderDisplayId": null
}
Response examples (400)
{}