링크 생성
결제 링크(Invoice)를 만듭니다. use_notification: true 면 고객에게 결제 안내도 보냅니다.
API 엔드포인트
처리 흐름
상품 없이 만들기 · 상품으로 만들기와 링크 상태는 링크페이에 있습니다.
요청 파라미터
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| name | String | Y | 주문명 |
| price | Integer | Y | 결제 금액 |
| tax_free_price | Integer | N | 면세 금액 |
| delivery_price | Integer | N | 배송비 |
| memo | String | N | 내부 메모 |
| request_id | String | Y | 가맹점 고유 식별자 (웹훅 매칭용) — 비우면 INVOICE_REQUEST_ID_BLANK 로 거절됩니다 |
| redirect_url | String | N | 결제 완료 후 이동할 URL |
| webhook_url | String | N | 결제 결과를 받을 웹훅 URL |
| header_content_type | String | N | 웹훅 전송 시 Content-Type |
| usage_api_url | String | N | 사용량 기반 구독의 사용량 조회 URL |
| use_notification | Boolean | N | 알림 자동 발송 여부 |
| use_auto_login | Boolean | N | 링크 진입 시 자동 로그인 여부 |
| expired_at | String | N | 링크 만료 시간 (ISO 8601). 생략하면 생성일로부터 3일 뒤 자정입니다. 과거 시각은 INVOICE_EXPIRED_DATE_INVALID 로 거절됩니다 |
| metadata | Object | N | 추가 데이터 |
| extra | Object | N | 결제창 부가 설정 |
| user | Object | Y | 고객 정보 — 없으면 INVOICE_TARGET_NOT_FOUND 로 거절됩니다 |
| └─ membership_type | String | N | 고객 유형 (member 기본 / guest) |
| └─ user_id | String | Y | 고객 ID — 이 값이 없으면 user 객체 전체가 무시돼 요청이 거절됩니다. member 면 부트페이에 등록된 고객의 user_id(몰 설정에 따라 로그인 ID·이메일도 가능)여야 하고, 없는 회원이면 INVOICE_TARGET_NOT_FOUND 입니다. guest 면 가맹점 쪽 식별자이고, 처음 보는 값이면 비회원 고객을 새로 만듭니다 |
| └─ name | String | N | 고객 이름 (guest 로 새로 만들 때 사용됩니다. 비우면 비회원) |
| └─ corporate_type | String | N | member 일 때 개인·기업 구분 (individual 기본 / corporate) |
| String | N | 고객 이메일 | |
| └─ phone | String | N | 고객 전화번호 |
| products | Array | N | 상품 목록 |
| └─ product_id | String | N | 상품 ID |
| └─ product_option_id | String | N | 옵션 ID. 옵션이 있는 상품이면 필수(INVOICE_PRODUCT_OPTION_ID_REQUIRED) |
| └─ quantity | Integer | N | 수량 |
| └─ duration | Integer | N | 구독 회차 수. 구독 기간이 설정된 구독 상품이면 필수 — 상품에 등록된 회차 중 하나여야 합니다(INVOICE_PRODUCT_SUBSCRIPTION_DURATION_NOT_FOUND). 수시결제·사용량 구독은 생략합니다. subscription_duration 으로 보내면 이 API 는 읽지 않습니다 |
코드 예제
curl -X POST "https://api.bootapi.com/v1/invoices" \
-H "Authorization: Basic {base64(client_key:secret_key)}" \
-H "Content-Type: application/json" \
-d '{
"name": "Professional 플랜 구독",
"price": 29900,
"request_id": "invoice_20250801_0001",
"use_notification": true,
"expired_at": "2025-08-01T23:59:59Z",
"redirect_url": "https://myshop.com/payment/complete",
"user": {
"membership_type": "guest",
"user_id": "user_20250801",
"email": "user@example.com",
"phone": "01012345678"
},
"products": [
{
"product_id": "67c95e64d01640bb9859c629",
"quantity": 1,
"duration": 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.invoice.create({
name: 'Professional 플랜 구독',
price: 29900,
request_id: 'invoice_20250801_0001',
use_notification: true,
expired_at: '2025-08-01T23:59:59Z',
redirect_url: 'https://myshop.com/payment/complete',
user: {
membership_type: 'guest', // 부트페이에 등록된 고객이면 생략하고 그 고객의 user_id 를 넣습니다
user_id: 'user_20250801',
email: 'user@example.com',
phone: '01012345678'
},
products: [
{
product_id: '67c95e64d01640bb9859c629',
quantity: 1,
duration: 12
}
]
})
console.log('invoice_url:', response.invoice_url)from bootpay_backend import BootpayCommerce
commerce = BootpayCommerce(
client_key='your-commerce-client-key',
secret_key='your-commerce-secret-key',
mode='production'
)
response = commerce.invoice.create({
'name': 'Professional 플랜 구독',
'price': 29900,
'request_id': 'invoice_20250801_0001',
'use_notification': True,
'expired_at': '2025-08-01T23:59:59Z',
'redirect_url': 'https://myshop.com/payment/complete',
'user': {
'membership_type': 'guest',
'user_id': 'user_20250801',
'email': 'user@example.com',
'phone': '01012345678'
},
'products': [
{
'product_id': '67c95e64d01640bb9859c629',
'quantity': 1,
'duration': 12
}
]
})
print('invoice_url:', response['invoice_url'])use Bootpay\ServerPhp\BootpayCommerceApi;
$commerce = new BootpayCommerceApi('your-commerce-client-key', 'your-commerce-secret-key');
$response = $commerce->invoice->create([
'name' => 'Professional 플랜 구독',
'price' => 29900,
'request_id' => 'invoice_20250801_0001',
'use_notification' => true,
'expired_at' => '2025-08-01T23:59:59Z',
'redirect_url' => 'https://myshop.com/payment/complete',
'user' => [
'membership_type' => 'guest',
'user_id' => 'user_20250801',
'email' => 'user@example.com',
'phone' => '01012345678'
],
'products' => [
[
'product_id' => '67c95e64d01640bb9859c629',
'quantity' => 1,
'duration' => 12
]
]
]);
echo 'invoice_url: ' . $response->invoice_url;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.pojo.SInvoice;
import kr.co.bootpay.store.model.pojo.SInvoiceProduct;
import kr.co.bootpay.store.model.pojo.SInvoiceUser;
import java.util.Arrays;
TokenPayload tp = new TokenPayload("your-commerce-client-key", "your-commerce-secret-key");
BootpayStore commerce = new BootpayStore(tp).withToken();
SInvoiceUser user = new SInvoiceUser();
user.membershipType = SInvoiceUser.MEMBERSHIP_TYPE_GUEST; // 등록된 고객이면 생략하고 그 고객의 user_id 를 넣습니다
user.userId = "user_20250801"; // 필수 — 이 값이 없으면 user 객체 전체가 무시됩니다
user.email = "user@example.com";
user.phone = "01012345678";
SInvoiceProduct product = new SInvoiceProduct();
product.productId = "67c95e64d01640bb9859c629";
product.quantity = 1;
product.duration = 12;
SInvoice invoice = new SInvoice();
invoice.name = "Professional 플랜 구독";
invoice.price = 29900.0;
invoice.requestId = "invoice_20250801_0001"; // 필수 — 가맹점 고유 식별자
invoice.useNotification = true;
invoice.expiredAt = "2025-08-01T23:59:59Z";
invoice.redirectUrl = "https://myshop.com/payment/complete";
invoice.user = user;
invoice.products = Arrays.asList(product);
BootpayStoreResponse response = commerce.invoice.create(invoice);
System.out.println("invoice_url: " + response.getData().get("invoice_url"));require 'bootpay'
commerce = BootpayStore::RestClient.new(client_key: 'your-commerce-client-key', secret_key: 'your-commerce-secret-key')
response = commerce.request_checkout(
name: 'Professional 플랜 구독',
price: 29900,
request_id: 'invoice_20250801_0001',
use_notification: true,
expired_at: '2025-08-01T23:59:59Z',
redirect_url: 'https://myshop.com/payment/complete',
user: {
membership_type: 'guest',
user_id: 'user_20250801',
email: 'user@example.com',
phone: '01012345678'
},
products: [
{
product_id: '67c95e64d01640bb9859c629',
quantity: 1,
duration: 12
}
]
)
puts "invoice_url: #{response.data[:invoice_url]}" # BootpayStore::Response — 본문은 data, 키는 심볼import "github.com/bootpay/backend-go/v2"
commerce := bootpay.NewCommerceAPI("your-commerce-client-key", "your-commerce-secret-key", nil, "production")
// Go SDK 의 CommerceInvoice 구조체에는 user · products 칸이 없어 범용 Post 로 보냅니다
response, err := commerce.Post("invoices", map[string]interface{}{
"name": "Professional 플랜 구독",
"price": 29900,
"request_id": "invoice_20250801_0001",
"use_notification": true,
"expired_at": "2025-08-01T23:59:59Z",
"redirect_url": "https://myshop.com/payment/complete",
"user": map[string]interface{}{
"membership_type": "guest",
"user_id": "user_20250801",
"email": "user@example.com",
"phone": "01012345678",
},
"products": []map[string]interface{}{
{"product_id": "67c95e64d01640bb9859c629", "quantity": 1, "duration": 12},
},
})
if err != nil {
log.Fatal(err)
}
fmt.Println("invoice_url:", response["invoice_url"])using Bootpay.Commerce;
using System.Net.Http;
var commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
// .NET SDK 의 CommerceInvoice 에는 user · products 속성이 없어 SendAsync 로 보냅니다
var response = await commerce.SendAsync("invoices", HttpMethod.Post, new {
name = "Professional 플랜 구독",
price = 29900,
request_id = "invoice_20250801_0001",
use_notification = true,
expired_at = "2025-08-01T23:59:59Z",
redirect_url = "https://myshop.com/payment/complete",
user = new {
membership_type = "guest",
user_id = "user_20250801",
email = "user@example.com",
phone = "01012345678"
},
products = new[] {
new {
product_id = "67c95e64d01640bb9859c629",
quantity = 1,
duration = 12
}
}
});
Console.WriteLine(await response.Content.ReadAsStringAsync()); // invoice_url 이 들어 있습니다응답
성공 응답
주요 필드만 추린 예시입니다.
JSON
{
"invoice_id": "687a1b2c3d4e5f6789012345",
"name": "Professional 플랜 구독",
"price": 29900,
"status": 1,
"invoice_url": "https://i.bootpay.co.kr/i/{client_key}/687a1b2c3d4e5f6789012345",
"user_id": "68707c59b0eacea5cd974efd",
"expired_at": "2025-08-01 23:59:59",
"c_at": "2025-07-29T10:00:00+09:00"
}응답 필드 설명
| 필드 | 타입 | 설명 |
|---|---|---|
invoice_id | String | 생성된 링크페이 ID (24자리) |
invoice_url | String | 고객에게 전달할 결제 페이지 URL |
status | Integer | 링크페이 상태 (1 결제 가능 — 링크페이 상태) |
user_id | String | 연결된 부트페이 고객 ID |
expired_at | String | 링크 만료 시간 (YYYY-MM-DD HH:MM:SS) |
c_at | String | 생성 시각 (ISO 8601) |
에러 코드
오류 코드
| 코드 | 메시지 | 대처 방법 |
|---|---|---|
INVOICE_TARGET_NOT_FOUND | 링크페이에 등록된 사용자 정보가 없습니다 | user.user_id 를 넣었는지, member 라면 부트페이에 등록된 고객인지 확인합니다 |
INVOICE_REQUEST_ID_BLANK | 요청 ID가 필요합니다 | request_id 를 넣습니다 |
INVOICE_EXPIRED_DATE_INVALID | 만료일이 현재 시간보다 과거입니다 | expired_at 을 미래 시각으로 넣습니다 |
PRODUCT_NOT_FOUND | 존재하지 않는 상품입니다 | product_id 가 이 프로젝트의 상품인지 확인합니다 |
INVOICE_PRODUCT_NOT_FOUND | 존재하지 않는 상품이 포함되어 있습니다 | 판매 중(노출) 상품인지 확인합니다 |
INVOICE_ITEM_QTY_LT_ZERO | 상품 수량은 0보다 커야 합니다 | quantity 를 1 이상으로 넣습니다 |
INVOICE_PRODUCT_OPTION_ID_REQUIRED | 옵션이 필요한 상품이 포함되어 있습니다 | product_option_id 를 넣습니다 |
INVOICE_PRODUCT_OPTION_NOT_FOUND | 존재하지 않는 옵션이 포함되어 있습니다 | product_option_id 를 확인합니다 |
INVOICE_SUBSCRIPTION_REQUEST_ONLY_ONE | 구독 상품은 하나만 청구서에 포함될 수 있습니다 | 구독 상품은 한 줄만 넣습니다 |
INVOICE_PRODUCT_SUBSCRIPTION_DURATION_NOT_FOUND | 존재하지 않는 구독 기간이 포함되어 있습니다 | duration 을 상품에 등록된 회차로 넣습니다 |
INVOICE_NEED_USAGE_API_URL | 사용량 기반 구독 상품은 사용량 API URL이 필요합니다 | 상품에 사용량 조회 URL 을 등록합니다 |
API 와 관리자 콘솔 차이
| 항목 | API | 관리자 콘솔 |
|---|---|---|
| 생성 | 서버 코드로 생성 | 건별 수동 생성 |
| 대량 발송 | 반복 호출 | 다수 수신자 동시 지정 |
| 미리보기 | 없음 | 데스크톱·모바일 실시간 미리보기 |
| 발송 | 재발송 API 별도 호출 | 생성 시 함께 설정 |
| 상품 선택 | product_id 직접 지정 | UI 에서 검색·선택 |
| 오픈 링크 | 미지원 (생성 API 가 is_open_link 를 받지 않습니다) | UI 토글 |
관리자에서는 만료 기본값이 생성일로부터 3일이고, 결제완료 · 결제취소 상태의 링크는 편집할 수 없어 같은 내용으로 다시 보내려면 복제합니다. 관리자에서 발송 수단(알림톡 · 이메일)이 비활성이면 개발자 설정 > 메시지 설정에서 먼저 켭니다.