구독 API
고객이 상품을 정기적으로 청구받는 구독에 관한 API 입니다.
타입 정의
API 요청/응답의 각 필드에서 사용되는 타입 정의들을 확인할 수 있습니다
AddSubscriptionDiscountBody: { storeId, discountId, appliesTo, ... }
구독 할인 추가 입력 정보
AddSubscriptionDiscountError: | | | ...
AddSubscriptionDiscountResponse: { subscription }
구독 할인 추가 성공 응답
CancelSubscriptionError: | | | ...
CancelSubscriptionResponse: { subscription }
구독 해지 성공 응답
ChargeTestSubscriptionBody: { storeId, simulateFailure }
테스트 구독 즉시 청구 입력 정보
ChargeTestSubscriptionError: | | | ...
ChargeTestSubscriptionResponse: { subscription, invoice }
테스트 구독 즉시 청구 성공 응답
Country: "AD" | "AE" | "AF" | ...
국가
CreateSubscriptionBody: { storeId, id, customerId, ... }
구독 생성 입력 정보
CreateSubscriptionError: | | | ...
CreateSubscriptionResponse: { subscription, firstInvoice }
구독 생성 성공 응답
Currency: "KRW" | "USD" | "JPY" | ...
통화
ForbiddenError: { type, message }
요청이 거절된 경우
GetSubscriptionDiscountUsagesError: | | | ...
GetSubscriptionDiscountUsagesResponse: { items }
구독에 붙은 할인 조회 성공 응답
GetSubscriptionError: | | | ...
GetSubscriptionInvoicesBody: { storeId, page, from, ... }
구독 인보이스 다건 조회 입력 정보
GetSubscriptionInvoicesError: | | | ...
GetSubscriptionInvoicesResponse: { items, page }
구독 인보이스 다건 조회 성공 응답
GetSubscriptionResponse: { subscription }
구독 조회 성공 응답
GetSubscriptionsBody: { storeId, page, status, ... }
구독 다건 조회 입력 정보
GetSubscriptionsError: | |
GetSubscriptionsResponse: { items, page }
구독 다건 조회 성공 응답
InvalidRequestError: { type, message }
요청된 입력 정보가 유효하지 않은 경우
허가되지 않은 값, 올바르지 않은 형식의 요청 등이 모두 해당됩니다.
Locale: "KO_KR" | "EN_US" | "ZH_CN" | ...
결제 언어
Map_String: { [key: string]: string }
PageInfo: { number, size, totalCount }
반환된 페이지 결과 정보
PageInput: { number, size }
다건 조회 API 에 사용되는 페이지 입력 정보
PauseSubscriptionError: | | | ...
PauseSubscriptionResponse: { subscription }
구독 일시중지 성공 응답
PaymentProductType: "PHYSICAL" | "DIGITAL"
상품 유형
PreRegisterSubscriptionBody: { storeId, id, customer, ... }
구독 사전 등록 입력 정보
PreRegisterSubscriptionError: | | | ...
PreRegisterSubscriptionResponse: { subscription, customer, registrationSecret }
구독 사전 등록 성공 응답
PreviewSubscriptionInvoiceError: | | | ...
PreviewSubscriptionInvoiceResponse: { preview }
다음 인보이스 미리보기 성공 응답
RemoveSubscriptionDiscountBody: { appliesTo }
구독 할인 제거 입력 정보
RemoveSubscriptionDiscountError: | | | ...
RemoveSubscriptionDiscountResponse: { subscription }
구독 할인 제거 성공 응답
ResumeSubscriptionError: | | | ...
ResumeSubscriptionResponse: { subscription }
구독 재개 성공 응답
Subscription: { id, customerId, items, ... }
구독
SubscriptionAlreadyExistsError: { type, message }
같은 아이디의 구독이 이미 존재하는 경우
SubscriptionCurrencyMismatchError: { type, message }
담긴 상품들의 통화가 다른 경우
SubscriptionCustomer: { id, name, email, ... }
구독 고객
구독 결제의 대상이 되는 고객입니다. 고객당 빌링키는 하나입니다.
SubscriptionCustomerBillingKeyMethod: "CARD" | "PAYPAL"
구독 고객 빌링키 결제수단
SubscriptionCustomerCard: { issuerName, number }
구독 고객 카드 정보
SubscriptionCustomerEmailRequiredError: { type, message }
인보이스 메일을 보내려는데 구독 고객의 이메일이 없는 경우
SubscriptionCustomerHasNoBillingKeyError: { type, message }
구독 고객에게 사용 가능한 빌링키가 없는 경우
SubscriptionCustomerNotFoundError: { type, message }
요청된 구독 고객이 존재하지 않는 경우
SubscriptionCustomerNotInTestModeError: { type, message }
구독 고객이 테스트 고객이 아닌 경우
SubscriptionCustomerStatus: "ACTIVE"
구독 고객 상태
SubscriptionDiscountAlreadyAppliedError: { type, message }
같은 구독 할인이 이미 붙어 있는 경우
SubscriptionDiscountApplication: { discountId, appliesTo, duration }
구독에 붙일 할인
SubscriptionDiscountAppliesTo: |
SubscriptionDiscountAppliesToProducts: { type, productIds }
지정한 상품 항목에만 적용
SubscriptionDiscountAppliesToSubscription: { type }
인보이스 전체에 적용
SubscriptionDiscountArchivedError: { type, message }
구독 할인이 보관된 경우
SubscriptionDiscountCurrencyMismatchError: { type, message }
구독 할인의 통화가 구독의 통화와 다른 경우
SubscriptionDiscountDuration: | |
SubscriptionDiscountDurationCycles: { type, count }
지정한 회차만큼 적용
SubscriptionDiscountDurationForever: { type }
소진 없이 계속 적용
SubscriptionDiscountDurationOnce: { type }
한 회차만 적용
SubscriptionDiscountNotFoundError: { type, message }
요청된 구독 할인이 존재하지 않는 경우
SubscriptionDiscountProductsNotInSubscriptionError: { type, message, productIds }
구독 할인의 적용 대상 상품이 구독에 담겨 있지 않은 경우
SubscriptionDiscountRedeemByPassedError: { type, message }
구독 할인의 적용 마감일이 지난 경우
SubscriptionDiscountType: "PERCENT" | "AMOUNT"
구독 할인 유형
SubscriptionDiscountUsage: { discountId, appliedAt, remainingCount, ... }
구독 할인 사용 현황
구독에 붙어 있는 할인의 적용 범위·지속 방식과 남은 회차, 상태입니다. 할인 금액 조건은 할인 아이디로 조회합니다.
SubscriptionDiscountUsageStatus: "ACTIVE" | "EXHAUSTED" | "REMOVED"
구독 할인 사용 상태
SubscriptionEndReason: "CANCELED" | "ONE_TIME_EXHAUSTED" | "END_DATE_REACHED"
구독 종료 사유
SubscriptionInterval: { unit, count }
구독 주기
SubscriptionIntervalMismatchError: { type, message }
담긴 정기 상품들의 청구 주기가 서로 다르거나, 시작한 구독의 청구 주기와 다른 경우
SubscriptionIntervalUnit: "DAY" | "WEEK" | "MONTH" | ...
구독 주기 단위
SubscriptionInvoice: { id, subscriptionId, customerId, ... }
구독 인보이스
SubscriptionInvoiceDiscountLine: { discountId, name, type, ... }
구독 인보이스 할인 내역
인보이스 발행 시점의 할인 조건을 그대로 담습니다. 원본 할인이 이후에 바뀌어도 변하지 않습니다.
SubscriptionInvoiceItem: { productId, name, unitPrice, ... }
구독 인보이스 항목
SubscriptionInvoiceMethod: "CARD_BILLING" | "PAYPAL_BILLING"
구독 인보이스 결제 수단
SubscriptionInvoicePayment: { paymentId, billingKey, failure, ... }
구독 인보이스 결제 정보
SubscriptionInvoicePaymentFailure: { type, pgCode, pgMessage, ... }
구독 인보이스 결제 실패 정보
SubscriptionInvoicePaymentFailureReason: "INSUFFICIENT_FUNDS_OR_LIMIT_EXCEEDED" | "CARD_UNAVAILABLE" | "CARD_EXPIRED" | ...
구독 인보이스 결제 실패 사유 분류
결제사 실패 메시지를 단어로 묶은 것입니다.
SubscriptionInvoicePaymentFailureType: "PG_PROVIDER" | "BILLING_KEY_NOT_FOUND" | "BILLING_KEY_ALREADY_DELETED" | ...
구독 인보이스 결제 실패 유형
SubscriptionInvoicePreview: { billingAt, sequence, items, ... }
다음 인보이스 미리보기 결과
SubscriptionInvoiceRefund: { cancellationId, amount, refundedAt, ... }
구독 인보이스 환불
결제 건이 결제취소 API·콘솔로 취소된 한 건입니다. 부분 취소마다 한 건씩 쌓입니다.
SubscriptionInvoiceSettlement: { method }
구독 인보이스 수동 완납 정보
SubscriptionInvoiceSettlementMethod: "BANK_TRANSFER" | "CARD" | "OTHER"
구독 인보이스 수동 완납 방법
SubscriptionInvoiceSource: "AUTO" | "MANUAL"
구독 인보이스 생성 경로
SubscriptionInvoiceStatus: "PENDING" | "PAID" | "FAILED" | ...
구독 인보이스 상태
SubscriptionItem: { productId, quantity }
구독 항목
SubscriptionNotFoundError: { type, message }
요청된 구독이 존재하지 않는 경우
SubscriptionPaymentOptions: { locale, productType, installmentMonth, ... }
구독 결제 옵션
매 회차 결제 요청에 그대로 실리는 값입니다. 빌링키 결제 예약의 같은 이름 필드와 의미가 같습니다.
SubscriptionPreRegisterCustomerInput: { id, name, email, ... }
함께 등록할 구독 고객 정보
SubscriptionProductArchivedError: { type, message }
구독 상품이 보관되어 수정할 수 없는 경우
SubscriptionProductBillingPausedError: { type, message, productIds }
구독 상품의 청구가 중지된 경우
SubscriptionProductNotFoundError: { type, message }
요청된 구독 상품이 존재하지 않는 경우
SubscriptionStatus: "ACTIVE" | "INCOMPLETE" | "PAUSED" | ...
구독 상태
SubscriptionStatusNotAllowedError: { type, message, status }
현재 구독 상태에서 허용되지 않는 요청인 경우
UpdateSubscriptionBody: { storeId, items, endDate, ... }
구독 수정 입력 정보
UpdateSubscriptionBodyPaymentOptions: { locale, productType, installmentMonth, ... }
구독 결제 옵션 수정 입력
입력한 필드만 고칩니다. null을 보내면 그 필드를 지웁니다.
UpdateSubscriptionError: | | | ...
UpdateSubscriptionResponse: { subscription }
구독 수정 성공 응답