구독

금액 조정

할인·설치비 같은 조정 항목을 회차 금액에 그대로 얹어요.

구독 계약에 조정 항목을 추가해 금액을 조정하는 API예요. 설치비, 할인, 추가 요금 같은 항목을 회차에 반영할 때 사용해요.

API 엔드포인트

POSThttps://api.bootapi.com/v1/order_subscriptions/:id/adjustmentsBasic Auth

요청 파라미터

파라미터 타입 필수 설명
id String 필수 구독 계약 ID (URL 경로)
name String 필수 조정 항목명 (예: 설치비, 할인)
price Number 필수 조정 금액
tax_free_price Number 선택 면세 금액
type Number 필수 조정 타입 (0: 일회성, 2: 매회차 적용)
duration Number 선택 적용 회차

코드 예제

const { BootpayCommerce } = require('@bootpay/backend-js')

const commerce = new BootpayCommerce({
    client_key: '{client_key}',
    secret_key: '{secret_key}'
})

const response = await commerce.orderSubscriptionBill.adjustment.create('687a1b2c3d4e5f6789012345', {
    name: '설치비',
    price: 50000,
    tax_free_price: 0,
    type: 2,
    duration: 1
})
console.log(response)javascript

응답

{
  "order_subscription_id": "687a1b2c3d4e5f6789012345",
  "order_subscription_adjustments": [
    {
      "order_subscription_adjustment_id": "6965fc104cb8149d07712533",
      "name": "설치비",
      "price": 50000,
      "tax_free_price": 0,
      "type": 2,
      "duration": 1
    }
  ]
}json

조정 타입

설명
0 일회성 조정
2 매회차 반복 조정

이미 생성된 회차에 조정 항목이 추가되면 기존 회차가 삭제 후 재생성될 수 있어요.