상품
상품 할인 설정
즉시할인을 정한다. 기준은 판매가(`salePrice`)다 — `RATE`는 판매가의 %, `AMOUNT`는 판매가에서 뺄 금액이고 결과(`discountedPrice`)는 10원 단위로 내린다. 기간 안이면 이 값이 구매자가 내는 한 개 가격이다. 정가(`originalPrice`)는 비교용 표시 값이라 할인 계산에 쓰지 않는다(스토어프론트가 정가 취소선을 그릴 때만 쓴다).
PUT
즉시할인을 정한다. 기준은 판매가(salePrice)다 — RATE는 판매가의 %, AMOUNT는 판매가에서 뺄 금액이고 결과(discountedPrice)는 10원 단위로 내린다. 기간 안이면 이 값이 구매자가 내는 한 개 가격이다. 정가(originalPrice)는 비교용 표시 값이라 할인 계산에 쓰지 않는다(스토어프론트가 정가 취소선을 그릴 때만 쓴다).
accessTokenheader
AuthorizationBearer <token>Sayren 계정 토큰(로그인 토큰 또는 개인 액세스 토큰, RFC 9068 JWT)
productId*stringX-Store-Id*string대상 상점 id. 토큰의 상점 범위 밖이면 403 STORE_NOT_GRANTED, 없으면 400 STORE_ID_REQUIRED다
application/json- body
discountType*stringValue in
"RATE""AMOUNT"discountValue*integerRange
1 <= valuestartAt?stringendAt?string성공
application/json- response
meta*data*error*|nullcurl -X PUT 'https://api.sayren.io/v1/products/string/discount' \ -H 'X-Store-Id: string' \ -H 'Content-Type: application/json' \ -d '{ "discountType": "RATE", "discountValue": 1}'{ "meta": { "status": 200, "code": "OK", "message": "OK", "isSuccess": true }, "data": { "productId": "string", "discountType": "RATE", "discountValue": 0, "discountedPrice": 0, "startAt": "string", "endAt": "string" }, "error": null}