Commerce

Create a discount — estimate

Price the request without executing it. Same body as POST /v1/messaging/commerce/discounts.

post/v1/messaging/commerce/discounts/estimate

Request

  • Base URL: https://apihub.co.il
  • URL: https://apihub.co.il/v1/messaging/commerce/discounts/estimate
  • Auth: HTTP bearer

Request body

codestring

Required for method code.

type'percentage' | 'fixed_amount' | 'free_shipping' required
titlestring required
amountstring

For type fixed_amount, a decimal in the store currency.

endsAtstring date-time nullable
method'code' | 'automatic' required
startsAtstring date-time

Defaults to now.

accountIdstring required
percentagenumber

For type percentage, e.g. 15 for 15%.

productIdsstring[]
usageLimitinteger nullable

Code discounts only: total uses allowed.

collectionIdsstring[]
minimumQuantityinteger nullable
minimumSubtotalstring nullable

Minimum order subtotal, a decimal in the store currency.

oncePerCustomerboolean

Code discounts only.

appliesOnEachItemboolean

fixed_amount only: take the amount off each item instead of once per order.

Response

Estimate

operationstring
estimated_creditsnumber
credits_to_reservenumber
estimated_usageobject
notestring nullable
sufficientboolean

Changes

No recorded changes to this operation across all 2 revisions of this API.