Apply discounts on cart

Request

POST https://api.nexway.store/discounts/discount/cart

Request body

The request body takes a complete Cart resource, containing the following writable properties:

{
    "buyerBehavior": {
        "abandonedCart": "boolean",
        "renewal": "boolean",
        "retainBuyer": "boolean"
    },
    "catalogId": "string",
    "currency": "string",
    "customerId": "string",
    "discounts": [
        "string"
    ],
    "discountsStatus": [
        {
            "discount": "string",
            "discountLabel": "string",
            "status": "string"
        }
    ],
    "endUser": {
        "country": "string",
        "email": "string",
        "locale": "string"
    },
    "id": "string",
    "locale": "string",
    "price": {
        "currency": "string",
        "discountedPrice": {
            "discountCode": "string",
            "discountId": "string",
            "discountLabel": "string",
            "discountRate": "double",
            "discountedGrossPrice": "double",
            "discountedNetPrice": "double",
            "grossPriceDiscountAmount": "double",
            "netPriceDiscountAmount": "double",
            "signedDiscount": "string",
            "vatDiscountAmount": "double"
        },
        "grossPrice": "double",
        "netPrice": "double",
        "vatAmount": "double",
        "vatRate": "double"
    },
    "products": [
        {
            "crossSellBy": "string",
            "customerId": "string",
            "discountsStatus": [
                {
                    "discount": "string",
                    "discountLabel": "string",
                    "status": "string"
                }
            ],
            "forcedBy": "string",
            "fullPrice": {
                "currency": "string",
                "discountedPrice": {
                    "discountCode": "string",
                    "discountId": "string",
                    "discountLabel": "string",
                    "discountRate": "double",
                    "discountedGrossPrice": "double",
                    "discountedNetPrice": "double",
                    "grossPriceDiscountAmount": "double",
                    "netPriceDiscountAmount": "double",
                    "signedDiscount": "string",
                    "vatDiscountAmount": "double"
                },
                "grossPrice": "double",
                "netPrice": "double",
                "vatAmount": "double",
                "vatRate": "double"
            },
            "id": "string",
            "price": {
                "currency": "string",
                "discountedPrice": {
                    "discountCode": "string",
                    "discountId": "string",
                    "discountLabel": "string",
                    "discountRate": "double",
                    "discountedGrossPrice": "double",
                    "discountedNetPrice": "double",
                    "grossPriceDiscountAmount": "double",
                    "netPriceDiscountAmount": "double",
                    "signedDiscount": "string",
                    "vatDiscountAmount": "double"
                },
                "grossPrice": "double",
                "netPrice": "double",
                "vatAmount": "double",
                "vatRate": "double"
            },
            "publisherRefId": "string",
            "quantity": "double",
            "unitPrice": {
                "currency": "string",
                "discountedPrice": {
                    "discountCode": "string",
                    "discountId": "string",
                    "discountLabel": "string",
                    "discountRate": "double",
                    "discountedGrossPrice": "double",
                    "discountedNetPrice": "double",
                    "grossPriceDiscountAmount": "double",
                    "netPriceDiscountAmount": "double",
                    "signedDiscount": "string",
                    "vatDiscountAmount": "double"
                },
                "grossPrice": "double",
                "netPrice": "double",
                "vatAmount": "double",
                "vatRate": "double"
            },
            "upSellBy": "string",
            "variantOf": "string"
        }
    ],
    "storeId": "string",
    "totalAmount": "double"
}

Properties

Name Type Description Additional
buyerBehavior object BuyerBehavior Optional
buyerBehavior.abandonedCart boolean Optional
buyerBehavior.renewal boolean Optional
buyerBehavior.retainBuyer boolean Optional
catalogId string Optional
currency string

Currency of cart

Optional
customerId string

Customer linked to cart

Optional
discounts[] array of string

List of discounts (promo code or signed discount

Optional
discountsStatus[] array

List of discount statuses

Optional
discountsStatus[].discount string Optional
discountsStatus[].discountLabel string Optional
discountsStatus[].status string

Possible values are:

  • INVALID
  • NOT_APPLICABLE
  • APPLIED
  • OVERLAPPING
  • OVERUSED
Optional
endUser object EndUser Optional
endUser.country string Optional
endUser.email string Optional
endUser.locale string Optional
id string Optional
locale string

Locale of cart

Optional
price object FullPrice Optional
price.currency string

Amount currency (ISO-4217)

Optional
price.discountedPrice object DiscountedPrice Optional
price.discountedPrice.discountCode string

Discount promo code

Optional
price.discountedPrice.discountId string

Discount ID

Optional
price.discountedPrice.discountLabel string

Discount label

price.discountedPrice.discountRate double

Discount rate

price.discountedPrice.discountedGrossPrice double

Discounted cost of product with taxes included

price.discountedPrice.discountedNetPrice double

Discounted cost of product without taxes included

price.discountedPrice.grossPriceDiscountAmount double

Gross price discount amount

price.discountedPrice.netPriceDiscountAmount double

Net price discount amount

price.discountedPrice.signedDiscount string

Signed discount

Optional
price.discountedPrice.vatDiscountAmount double

VAT discount amount

price.grossPrice double

Cost of product with taxes included.

Optional
price.netPrice double

Net price

Optional
price.vatAmount double

The VAT amount (amount - netAmount)

Optional
price.vatRate double

Sales tax rate

Optional
products[] array

List of products in cart

Optional
products[].crossSellBy string

Cross-sell product by this product ID

Optional
products[].customerId string

Customer ID of the product

Optional
products[].discountsStatus[] array

List of discounts status

Optional
products[].discountsStatus[].discount string Optional
products[].discountsStatus[].discountLabel string Optional
products[].discountsStatus[].status string

Possible values are:

  • INVALID
  • NOT_APPLICABLE
  • APPLIED
  • OVERLAPPING
  • OVERUSED
Optional
products[].forcedBy string

Forced by this product ID

Optional
products[].fullPrice object FullPrice Optional
products[].fullPrice.currency string

Amount currency (ISO-4217)

Optional
products[].fullPrice.discountedPrice object DiscountedPrice Optional
products[].fullPrice.discountedPrice.discountCode string

Discount promo code

Optional
products[].fullPrice.discountedPrice.discountId string

Discount ID

Optional
products[].fullPrice.discountedPrice.discountLabel string

Discount label

products[].fullPrice.discountedPrice.discountRate double

Discount rate

products[].fullPrice.discountedPrice.discountedGrossPrice double

Discounted cost of product with taxes included

products[].fullPrice.discountedPrice.discountedNetPrice double

Discounted cost of product without taxes included

products[].fullPrice.discountedPrice.grossPriceDiscountAmount double

Gross price discount amount

products[].fullPrice.discountedPrice.netPriceDiscountAmount double

Net price discount amount

products[].fullPrice.discountedPrice.signedDiscount string

Signed discount

Optional
products[].fullPrice.discountedPrice.vatDiscountAmount double

VAT discount amount

products[].fullPrice.grossPrice double

Cost of product with taxes included.

Optional
products[].fullPrice.netPrice double

Net price

Optional
products[].fullPrice.vatAmount double

The VAT amount (amount - netAmount)

Optional
products[].fullPrice.vatRate double

Sales tax rate

Optional
products[].id string Optional
products[].price object FullPrice Optional
products[].price.currency string

Amount currency (ISO-4217)

Optional
products[].price.discountedPrice object DiscountedPrice Optional
products[].price.discountedPrice.discountCode string

Discount promo code

Optional
products[].price.discountedPrice.discountId string

Discount ID

Optional
products[].price.discountedPrice.discountLabel string

Discount label

products[].price.discountedPrice.discountRate double

Discount rate

products[].price.discountedPrice.discountedGrossPrice double

Discounted cost of product with taxes included

products[].price.discountedPrice.discountedNetPrice double

Discounted cost of product without taxes included

products[].price.discountedPrice.grossPriceDiscountAmount double

Gross price discount amount

products[].price.discountedPrice.netPriceDiscountAmount double

Net price discount amount

products[].price.discountedPrice.signedDiscount string

Signed discount

Optional
products[].price.discountedPrice.vatDiscountAmount double

VAT discount amount

products[].price.grossPrice double

Cost of product with taxes included.

Optional
products[].price.netPrice double

Net price

Optional
products[].price.vatAmount double

The VAT amount (amount - netAmount)

Optional
products[].price.vatRate double

Sales tax rate

Optional
products[].publisherRefId string

Publisher reference of the product

Optional
products[].quantity double

Quantity

Optional
products[].unitPrice object FullPrice Optional
products[].unitPrice.currency string

Amount currency (ISO-4217)

Optional
products[].unitPrice.discountedPrice object DiscountedPrice Optional
products[].unitPrice.discountedPrice.discountCode string

Discount promo code

Optional
products[].unitPrice.discountedPrice.discountId string

Discount ID

Optional
products[].unitPrice.discountedPrice.discountLabel string

Discount label

products[].unitPrice.discountedPrice.discountRate double

Discount rate

products[].unitPrice.discountedPrice.discountedGrossPrice double

Discounted cost of product with taxes included

products[].unitPrice.discountedPrice.discountedNetPrice double

Discounted cost of product without taxes included

products[].unitPrice.discountedPrice.grossPriceDiscountAmount double

Gross price discount amount

products[].unitPrice.discountedPrice.netPriceDiscountAmount double

Net price discount amount

products[].unitPrice.discountedPrice.signedDiscount string

Signed discount

Optional
products[].unitPrice.discountedPrice.vatDiscountAmount double

VAT discount amount

products[].unitPrice.grossPrice double

Cost of product with taxes included.

Optional
products[].unitPrice.netPrice double

Net price

Optional
products[].unitPrice.vatAmount double

The VAT amount (amount - netAmount)

Optional
products[].unitPrice.vatRate double

Sales tax rate

Optional
products[].upSellBy string

Upsell product by this product ID

Optional
products[].variantOf string

Variant of

Optional
storeId string

Store linked to cart

Optional
totalAmount double

Total amount of this order

Optional

Authorisation

This request requires the use of one of following authorisation methods: OAuth2.

Response

The following HTTP status codes may be returned, optionally with a response resource.

Status code Description Resource
200 OK

Success

Cart
401 Unauthorized

Unauthorized

403 Forbidden

Forbidden

404 Not Found

Not Found

500 Internal Server Error

Failure

Example

{
    "buyerBehavior": {},
    "endUser": {},
    "price": {
        "discountedPrice": {}
    }
}

Explore this API

cart

cart

Request Content-Type
Response Content-Type

Choose an authorisation method:

Access Token Access token to be used for request
Try it out!