Skip to content

addCoupons.v1

POST
/shopgate.cart.addCoupons.v1

Adds multiple coupons to the cart. The coupon code needs to be unique. There can’t be two coupons with identical code in the cart at any given time.

Note: Some shops don’t support more than one coupon, or none at all.

Media typeapplication/json

Code of the coupon.

Array<string>
Examplegenerated
[
"example"
]

Returns an empty object after the action was performed.

Media typeapplication/json
object
output
required
object
Example
{
"output": {}
}

The pipeline can’t be called in the given context.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: EUNKNOWN
message
string
Example
{
"error": {
"code": "EINVALIDCALL",
"message": "The pipeline can't be called in the given context."
}
}

This error is thrown when there is an issue with adding a counpon to the cart.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: ECART
message
string
errors
Array<object>
object
entityId
required
string
code
required
string
Allowed values: ENOTFOUND EINVALIDCOUPON ECOUPONEXPIRED
message
required

The message specific to the coupon with the matching identifier. This is either a translation string or an already translated string. Translation strings are just keys within locale files, that have a translation which could be applied.

string
messageParams

The message params for the translation string. Translation params are just key/value pairs defined in the translation string defined in the ‘locales/.json’ for the translation key in the message property. It defaults to an empty object if the property is missing or null. The translation string syntax is described here: https://github.com/yahoo/intl-messageformat#message-syntax

object
my-custom-key
string
my-custom-value
string
translated

Indicates if the ‘message’ property contains a translated string (true) or a translation string (false or undefined). Defaults to true if the property is missing or null.

boolean
Example
{
"error": {
"code": "ECART",
"message": "There was a problem while trying to add one or multiple counpons to the cart.",
"errors": [
{
"entityId": "TYPO-2019-FEB-20-PERCENT-OFF-SOCKS-TYPO",
"code": "EINVALIDCOUPON",
"message": "cart.error.invalidcoupon",
"messageParams": {
"enteredCouponCode": "TYPO-2019-FEB-20-PERCENT-OFF-SOCKS-TYPO"
},
"translated": false
},
{
"entityId": "FREE-SHIPPING-DEC-18",
"code": "ECOUPONEXPIRED",
"message": "The coupon 'FREE-SHIPPING-DEC-18' has expired.",
"translated": true
}
]
}
}

An internal error occurred.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: EUNKNOWN
message
string
Example
{
"error": {
"code": "EUNKNOWN",
"message": "An internal error occurred."
}
}