계약 조회
구독 계약 목록을 조회합니다. 계약마다 상태, 결제 주기, 다음 결제일 등이 함께 옵니다.
API 엔드포인트
요청 파라미터
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| order_number | String | N | 주문번호로 필터 (주문 ID가 아닙니다) |
| user_id | String | N | 고객 ID 또는 이 몰의 외부 회원 ID로 필터. 이 몰에 없거나 탈퇴한 회원이면 404 USER_NOT_FOUND가 옵니다 |
| user_group_id | String | N | 고객 그룹 ID로 필터 |
| status | String | N | 구독 상태 필터 — 아래 표 참고 |
| request_type | Integer | String | N | 현재 이 값을 보내면 서버 오류(500)가 발생합니다. 요청 유형별 조회는 신청 목록을 사용합니다 |
| keyword | String | N | 검색 키워드 |
| search_date_from | String | N | 검색 시작일 (계약 생성일 기준) · 별칭 s_at. 비우면 오늘 00:00 |
| search_date_to | String | N | 검색 종료일 (계약 생성일 기준) · 별칭 e_at. 비우면 오늘 23:59 |
| page | Integer | N | 페이지 번호 (기본: 1) |
| limit | Integer | N | 페이지당 데이터 수 (기본: 20, 최대 100) |
구독 상태 코드 (status)
| 키 | 값 | 설명 |
|---|---|---|
contract_requested_completed | 0 | 구독 신청 완료, 승인 대기 |
subscribing | 1 | 구독 중 (정상 결제 진행) |
auto_terminated | 15 | 자동 해지 (기간 만료 등) |
manual_terminated | 20 | 직접 해지 (사용자 요청) |
mid_term_transfer_approved | 25 | 중도 인수 승인 |
mid_term_transfer_requested | 26 | 중도 인수 요청 |
free_trial | -1 | 무료 체험 |
temporarily_paused | -2 | 일시정지 |
paused_due_to_issue | -3 | 이슈로 인한 일시정지 |
first_payment_error | -10 | 첫 결제 오류 |
admin_terminated | -11 | 관리자 해지 |
rejected | -12 | 구독 거절 |
코드 예제
import { BootpayCommerce } from '@bootpay/backend-js'
const commerce = new BootpayCommerce({
client_key: 'your-commerce-client-key',
secret_key: 'your-commerce-secret-key',
mode: 'production'
})
const response = await commerce.orderSubscription.list({
page: 1,
limit: 20,
status: 'subscribing'
})
console.log(response)from bootpay_backend import BootpayCommerce
commerce = BootpayCommerce(
client_key='your-commerce-client-key',
secret_key='your-commerce-secret-key',
mode='production'
)
response = commerce.order_subscription.list({'page': 1, 'limit': 20, 'status': 'subscribing'})
print(response)use Bootpay\ServerPhp\BootpayCommerceApi;
$commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
$response = $commerce->orderSubscription->getList([
'page' => 1,
'limit' => 20,
'status' => 'subscribing'
]);
print_r($response);import kr.co.bootpay.store.BootpayStore;
import kr.co.bootpay.store.model.request.TokenPayload;
import kr.co.bootpay.store.model.response.BootpayStoreResponse;
import kr.co.bootpay.store.model.request.orderSubscription.OrderSubscriptionListParams;
TokenPayload tp = new TokenPayload("your-commerce-client-key", "your-commerce-secret-key");
BootpayStore commerce = new BootpayStore(tp).withToken();
OrderSubscriptionListParams params = new OrderSubscriptionListParams();
params.page = 1;
params.limit = 20;
params.status = 1; // subscribing — Java SDK 의 status 는 Integer 라 숫자로 보냅니다
BootpayStoreResponse response = commerce.orderSubscription.list(params);
System.out.println(response);require 'bootpay'
commerce = BootpayStore::RestClient.new(client_key: 'your-commerce-client-key', secret_key: 'your-commerce-secret-key')
response = commerce.order_subscriptions(
page: 1,
limit: 20,
status: 'subscribing'
)
puts response.datacommerce := bootpay.NewCommerceAPI("your-commerce-client-key", "your-commerce-secret-key", nil, "production")
status := 1 // subscribing — Go SDK 는 숫자로 보냅니다
response, err := commerce.OrderSubscription.List(&bootpay.OrderSubscriptionListParams{
ListParams: bootpay.ListParams{Page: 1, Limit: 20},
Status: &status,
})
fmt.Println(response, err)using Bootpay.Commerce;
using Bootpay.Commerce.Models;
var commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
var response = await commerce.OrderSubscriptionList(new OrderSubscriptionListParams {
Page = 1,
Limit = 20,
Status = 1 // subscribing — .NET SDK 는 숫자로 보냅니다
});
Console.WriteLine(await response.Content.ReadAsStringAsync());응답
성공 응답
JSON
{
"count": 3,
"list": [
{
"order_subscription_id": "687a1b2c3d4e5f6789012345",
"order_number": "68707c59b0eacea5cd974efd",
"user_id": "67e4b4425ec892162491d0ec",
"status": "subscribing",
"approval_status": "approval_approved_auto",
"subscription_payment_cycle_type": "1month",
"price": 29900,
"payment_next_at": "2025-08-01T00:00:00+09:00",
"service_start_at": "2025-07-01T00:00:00+09:00",
"created_at": "2025-06-30T15:00:00+09:00"
}
]
}응답 필드 설명
| 필드 | 타입 | 설명 |
|---|---|---|
count | Integer | 총 구독 계약 수 |
list | Array | 구독 계약 목록 |
└─ order_subscription_id | String | 구독 계약 고유 ID |
└─ order_number | String | 연결된 주문번호 |
└─ status | String | 구독 상태 — 아래 표 참고 |
└─ approval_status | String | 승인 상태 |
└─ subscription_payment_cycle_type | String | 결제 주기 (1month, 1year 등) |
└─ price | Integer | 회차별 결제 금액 |
└─ payment_next_at | String | 다음 결제 예정일 |
└─ service_start_at | String | 구독 서비스 시작일 |
목록 외에 상태별 집계(sum_*)와 요청 유형별 집계(ing_*)가 최상위에 함께 옵니다.
에러 코드
오류 코드
| 코드 | 메시지 | 대처 방법 |
|---|---|---|
INVALID_PARAMETER | status 값을 해석할 수 없습니다. | 숫자 또는 상태 키(subscribing 등)로 보냅니다 |
USER_NOT_FOUND | 회원정보가 없습니다. 다시 확인해주세요. | user_id가 이 몰의 회원인지, 탈퇴하지 않았는지 확인합니다 |