구독 계약에 조정 항목을 추가해 금액을 조정하는 API예요. 설치비, 할인, 추가 요금 같은 항목을 회차에 반영할 때 사용해요.
API 엔드포인트
POST
https://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)javascriptfrom bootpay_backend.commerce import BootpayCommerce
commerce = BootpayCommerce('{client_key}', '{secret_key}')
response = commerce.order_subscription_adjustment_create('687a1b2c3d4e5f6789012345', {
'name': '설치비',
'price': 50000,
'tax_free_price': 0,
'type': 2,
'duration': 1
})
print(response)pythonuse Bootpay\ServerPhp\BootpayCommerceApi;
$commerce = new BootpayCommerceApi('{client_key}', '{secret_key}');
$response = $commerce->orderSubscriptionAdjustmentCreate('687a1b2c3d4e5f6789012345', [
'name' => '설치비',
'price' => 50000,
'tax_free_price' => 0,
'type' => 2,
'duration' => 1
]);
print_r($response);phpBootpayCommerceApi commerce = new BootpayCommerceApi("{client_key}", "{secret_key}");
HashMap<String, Object> params = new HashMap<>();
params.put("name", "설치비");
params.put("price", 50000);
params.put("tax_free_price", 0);
params.put("type", 2);
params.put("duration", 1);
HashMap<String, Object> response = commerce.orderSubscriptionAdjustmentCreate("687a1b2c3d4e5f6789012345", params);
System.out.println(response);javacommerce = BootpayStore::Api.new('{client_key}', '{secret_key}')
response = commerce.order_subscription_adjustment_create('687a1b2c3d4e5f6789012345', {
name: '설치비',
price: 50000,
tax_free_price: 0,
type: 2,
duration: 1
})
puts responserubycommerce := bootpay.NewCommerceApi("{client_key}", "{secret_key}")
response, err := commerce.OrderSubscriptionAdjustmentCreate("687a1b2c3d4e5f6789012345", map[string]interface{}{
"name": "설치비",
"price": 50000,
"tax_free_price": 0,
"type": 2,
"duration": 1,
})
fmt.Println(response)govar commerce = new BootpayCommerceApi("{client_key}", "{secret_key}");
var response = await commerce.OrderSubscriptionAdjustmentCreate("687a1b2c3d4e5f6789012345", new {
name = "설치비",
price = 50000,
tax_free_price = 0,
type = 2,
duration = 1
});
Console.WriteLine(response);csharp응답
{
"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 |
매회차 반복 조정 |
이미 생성된 회차에 조정 항목이 추가되면 기존 회차가 삭제 후 재생성될 수 있어요.
