sayren Docs
구매자

구매자 적립금 지급·차감

`amount`가 양수면 지급, 음수면 차감이다. 헤더 `Idempotency-Key`가 필수이고 같은 키로 다시 보내면 처음 결과를 돌려준다. 지급의 소멸 시각은 `expiresAt`, 생략하면 적립금 정책의 유효 기간이다. 차감은 소멸이 이른 적립금부터 뺀다.

POST
/v1/customers/{customerId}/points/adjustments

amount가 양수면 지급, 음수면 차감이다. 헤더 Idempotency-Key가 필수이고 같은 키로 다시 보내면 처음 결과를 돌려준다. 지급의 소멸 시각은 expiresAt, 생략하면 적립금 정책의 유효 기간이다. 차감은 소멸이 이른 적립금부터 뺀다.

Authorization

accessToken
headerAuthorizationBearer <token>

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

Path Parameters

customerId*string

Header Parameters

X-Store-Id*string

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

idempotency-key?string

멱등키. 같은 키로 다시 보내면 처음 결과를 돌려주고 한 번만 적용한다. 재시도에는 같은 키를 쓴다

Lengthlength <= 255

Request Body

application/json
  1. body
amount*integer

지급은 양수, 차감은 음수(원)

Range-10000000 <= value <= 10000000
reason*string

사유(필수). 구매자에게는 보이지 않는다

Length1 <= length <= 200
expiresAt?string

지급분의 소멸 시각. 생략하면 정책 유효 기간(expiryDays)으로 정한다. 정책 유효 기간이 없으면 지급에 필수다(없으면 400 POINT_EXPIRY_REQUIRED). 차감에는 주지 않는다

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
Formatdate-time

Response Body

조정 완료

application/json
  1. response
meta*
data*
error*|null
curl -X POST 'https://api.sayren.io/v1/customers/string/points/adjustments' \  -H 'X-Store-Id: string' \  -H 'Content-Type: application/json' \  -d '{  "amount": -10000000,  "reason": "string"}'
{  "meta": {    "status": 201,    "code": "OK",    "message": "OK",    "isSuccess": true  },  "data": {    "entry": {      "entryId": "string",      "memberId": "string",      "type": "EARN_REVIEW",      "amount": 0,      "balanceAfter": 0,      "refType": "string",      "refId": "string",      "memo": "string",      "actor": "string",      "createdAt": "string"    },    "balance": 0  },  "error": null}