getPurchaseOptions
GET
/api/v1/billing/purchase-options
const url = 'https://dev.api.endueos.com/api/v1/billing/purchase-options';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://dev.api.endueos.com/api/v1/billing/purchase-options \ --header 'Authorization: Bearer <token>'크레딧 구매 조건 (ENDUE-1105) — endue AI 와 같은 단가·수량·할인. endue 를 읽지 못하면 503 WALLET_UNAVAILABLE.
200
섹션 제목: “200”성공.
Media typeapplication/json
object
data
필수
크레딧 구매 조건 (ENDUE-1105) — endue AI 와 같은 상수(endue AI billing 이 SoT). 1 크레딧 = US$1.
결제는 Paddle 결제창에 items: [{ priceId: price_id, quantity }], customData: { user_id, kind: "credit_purchase" } 로 연다.
결제가 끝나면 endue AI 가 웹훅으로 크레딧을 넣고, 이 지갑은 다음 조회 때 같은 잔액을 보인다.
object
available
필수
지금 이 환경에서 살 수 있는가 — 가격이 없으면 false.
boolean
unit_price_usd
필수
number format: double
currency
필수
string
min_quantity
필수
integer format: int32
max_quantity
필수
integer format: int32
step
필수
integer format: int32
discount_tiers
필수
Array<object>
크레딧 구매 할인 구간 — 이 수량 이상이면 percent_off % 할인. 지금은 비어 있다 (ENDUE-1105 D-4).
object
min_quantity
필수
integer format: int32
percent_off
필수
number format: double
meta
필수
object
request_id
필수
string
timestamp
필수
string format: date-time
duration
서버 처리 시간(ms).
integer format: int32
예시
{ "data": { "currency": "USD", "paddle": { "environment": "sandbox" } }}401
섹션 제목: “401”인증이 없거나 무효다 — UNAUTHORIZED. 본문은 오류 봉투.
403
섹션 제목: “403”이 인증 수단으로는 못 하는 일이다 — FORBIDDEN (예: API 키로 클라우드 기기 만들기). 본문은 오류 봉투.
429
섹션 제목: “429”한도를 넘었다 — Retry-After 초 뒤에 다시. 본문은 오류 봉투.
500
섹션 제목: “500”서버 오류 — INTERNAL_ERROR. 본문은 오류 봉투.
503
섹션 제목: “503”의존 서비스에 닿지 못했다 — 잠시 뒤 다시. 본문은 오류 봉투.