Skip to Content
Sayren 유저가이드
장바구니

장바구니 담기

POST
/storefront/v1/cart/items

Authorization

headerAuthorizationBearer <JWT>

회원 accessToken

Header Parameters

x-cart-token*string

Request Body

application/json
  1. body
productId*string
optionId?string
quantity*integer
Range1 <= value <= 999
addons?array<>

고른 추가 선택(옵션명마다 하나, 고르지 않은 옵션명은 빼고 보낸다). 필수 옵션명을 빼면 400 ADDON_OPTION_REQUIRED, 없거나 꺼진 값이거나 한 옵션명에서 둘을 고르면 400 ADDON_OPTION_NOT_FOUND

Itemsitems <= 20
customInputs?array<>

직접 입력값. 필수 항목을 비우면 400 CUSTOM_INPUT_REQUIRED, 최대 글자 수를 넘으면 400 CUSTOM_INPUT_TOO_LONG, 없는 항목이면 400 CUSTOM_INPUT_NOT_FOUND, 항목 타입에 맞지 않으면 400 CUSTOM_INPUT_INVALID

Itemsitems <= 20
stay?

숙박 기간(날짜별 재고 상품만). 체크인 날부터 체크아웃 전날까지 박마다 재고·가격을 본다. 최대 30박. 날짜별 재고 상품에 빠지면 400 STAY_REQUIRED, 다른 상품에 주면 400 STAY_NOT_APPLICABLE, 재고가 없는 날이 있으면 409 DATES_UNAVAILABLE

Response Body

성공

application/json
  1. response
meta*
data*
error*|null
Example Request
curl -X POST 'https://api.sayren.io/storefront/v1/cart/items' \
  -H 'x-cart-token: string' \
  -H 'Content-Type: application/json' \
  -d '{
  "productId": "string",
  "quantity": 1
}'
Example Response201
{
  "meta": {
    "status": 201,
    "code": "OK",
    "message": "OK",
    "isSuccess": true
  },
  "data": {
    "items": [
      {
        "cartItemId": "string",
        "productId": "string",
        "productNo": null,
        "productName": "string",
        "thumbnailUrl": "http://example.com",
        "optionId": "string",
        "optionName": "string",
        "optionSelections": [],
        "customInputs": [],
        "stay": {
          "checkIn": "string",
          "checkOut": "string",
          "nights": [
            {
              "date": "string",
              "price": 0
            }
          ]
        },
        "quantity": 0,
        "unitPrice": 0,
        "totalPrice": 0,
        "fulfillment": {
          "type": "string",
          "requiresShipping": true,
          "method": "string"
        },
        "purchasable": true,
        "unpurchasableReason": "SOLD_OUT",
        "currency": "KRW",
        "availableInMarket": true
      }
    ],
    "summary": {
      "currency": "KRW",
      "productAmount": 0,
      "deliveryFee": 0,
      "totalAmount": 0,
      "requiresShipping": true
    }
  },
  "error": null
}