sayren Docs
상품

상품 할인 설정

즉시할인을 정한다. 기준은 판매가(`salePrice`)다 — `RATE`는 판매가의 %, `AMOUNT`는 판매가에서 뺄 금액이고 결과(`discountedPrice`)는 10원 단위로 내린다. 기간 안이면 이 값이 구매자가 내는 한 개 가격이다. 정가(`originalPrice`)는 비교용 표시 값이라 할인 계산에 쓰지 않는다(스토어프론트가 정가 취소선을 그릴 때만 쓴다).

PUT
/v1/products/{productId}/discount

즉시할인을 정한다. 기준은 판매가(salePrice)다 — RATE는 판매가의 %, AMOUNT는 판매가에서 뺄 금액이고 결과(discountedPrice)는 10원 단위로 내린다. 기간 안이면 이 값이 구매자가 내는 한 개 가격이다. 정가(originalPrice)는 비교용 표시 값이라 할인 계산에 쓰지 않는다(스토어프론트가 정가 취소선을 그릴 때만 쓴다).

Authorization

accessToken
headerAuthorizationBearer <token>

Sayren 계정 토큰(로그인 토큰 또는 개인 액세스 토큰, RFC 9068 JWT)

Path Parameters

productId*string

Header Parameters

X-Store-Id*string

대상 상점 id. 토큰의 상점 범위 밖이면 403 STORE_NOT_GRANTED, 없으면 400 STORE_ID_REQUIRED다

Request Body

application/json
  1. body
discountType*string
Value in"RATE""AMOUNT"
discountValue*integer
Range1 <= value
startAt?string
endAt?string

Response Body

성공

application/json
  1. response
meta*
data*
error*|null
curl -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}