Adding coupon(s) to the cart
POST
/carts/{cartId}/coupons
const url = 'https://myshop.com/shopgate/v1/carts/example/coupons';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '["example"]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://myshop.com/shopgate/v1/carts/example/coupons \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '[ "example" ]'Adds multiple coupons to the cart. The coupon code needs to be unique. There can’t be two coupons with identical codes in the cart at any given time.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”cartId
required
string
Request Body
Section titled “Request Body”Code of the coupon.
Array<string>
Examplegenerated
[ "example"]Code of the coupon.
Array<string>
Examplegenerated
0=exampleResponses
Section titled “Responses”Coupon was successfully added.
Media typeapplication/json
object
Examplegenerated
{}An invalid or expired coupon code was entered.
Media typeapplication/json
object
message
string
Example
{ "message": "Coupons is invalid! Please make sure that the coupon is correct."}Media typeapplication/json
object
message
string
name
string
Example
{ "message": "Invalid token: access token is invalid", "name": "invalid_token"}Media typeapplication/json
object
message
string
Example
{ "message": "Not found"}
