commerce/carts/cartcoupons

Use the Cart Coupons subresource to apply a coupon to a defined cart or remove a coupon from a cart. When the shopper proceeds to checkout, the coupons applied to the cart apply to the order.

JSON Example

AppliedDiscount Properties

Property Description
couponCode

type: string

The coupon code that a shopper uses to redeem an associated discount on a purchase. This is also the unique identifier of the coupon itself.

discount

type: discount

Name of the discount added and applied to a shopping cart and order for a shopper's purchase.

discount.expirationDate

type: DateTime

Date and time in UTC format when a discount, credit, wish list, or cart expires. An expired discount no longer can be redeemed. An expired wish list is no longer available. An expired credit can no longer be redeemed for a purchase. Acart becomes inactive and expired based on a system-calculated interval. For example, if an anonymous shopper has 14 days of inactivity, the cart is considered abandoned after that period of inactivity. System-supplied and read-only.

discount.id

type: int

Unique identifier of the source property, such as a catalog, discount, order, or email template.

For a product field it will be the name of the field.

For a category ID, must be a positive integer not greater than 2000000. By default, Kibo eCommerce auto-generates a category ID when categories are created. If you want to specify an ID during creation (which preserves category link relationships when migrating tenant data from one sandbox to another), you must also include the useProvidedId query string in the endpoint. For example, api/commerce/catalog/admin/categories/?useProvidedId=true. Then, use the id property to specify the desired category ID.

For a product attribute it will be the Attribute FQN.

For a document, the ID must be specified as a 32 character, case-insensitive, alphanumeric string. You can specify the ID as 32 sequential characters or as groups separated by dashes in the format 8-4-4-4-12. For example, bba0a1a885e2413bb097ceacf7bac366
or
bba0a1a8-85e2-413b-b097-ceacf7bac366.

For email templates, the ID must be one of the following values:
BackInStock
OrderChanged
OrderShipped
OrderFulfillmentDetailsChanged
ShopperLoginCreated
ShopperPasswordReset
ReturnCreated
ReturnAuthorized
ReturnUpdated
ReturnRejected
ReturnCancelled
ReturnClosed
RefundCreated
StoreCreditCreated
StoreCreditUpdated
GiftCardCreated

discount.itemIds

type: list of string

List of cart or order items to which the discount applies, if applicable.

discount.name

type: string

The user supplied name that appears in Admin. You can use this field for identification purposes.

excluded

type: bool

Indicates if a discount is not used for the product or product line item in an order. If true, the system ignores this discount when pricing the order.

impact

type: decimal

The value of the discount applied to the cart or order, represented as a negative currency amount to apply to the original price.

Operations

Operation Name Request URI Description
ApplyCoupon PUT %7bcartId%7d%2fcoupons%2f%7bcouponCode%7d%3fresponseFields%3d%7bresponseFields%7d

Applies a defined coupon to the cart specified in the request.

RemoveCoupon DELETE %7bcartId%7d%2fcoupons%2f%7bcouponcode%7d

Removes an applied coupon from the cart specified in the request.

RemoveCoupons DELETE %7bcartId%7d%2fcoupons

Removes all coupons from the cart specified in the request.