결제 링크(Invoice)를 생성하여 고객에게 전송해요. 고객은 링크를 통해 결제 페이지에 접속해 결제를 완료할 수 있어요.
코드 없이 생성하려면
관리자 콘솔에서 UI로 링크페이를 생성할 수도 있어요. → 관리자에서 생성
API 엔드포인트
POST
https://api.bootapi.com/v1/invoicesBasic Auth활용 시나리오
| 시나리오 | 설명 |
|---|---|
| 비대면 결제 | 고객에게 결제 링크를 SMS/이메일로 발송 |
| 오프라인 연동 | 매장에서 결제 링크를 생성하여 고객에게 전송 |
| 반복 청구 | 정기적으로 청구서를 생성하여 발송 |
처리 흐름
- 결제 안내 메시지 발송 (이메일, SMS, 알림톡)
- 고객이 링크 클릭 후 결제 진행
- 결제 완료 시 Webhook으로 결과 전달
- 고객에게 완료 알림 발송
링크 생성 전 결제 대상 고객 정보(이메일, 휴대폰 번호, 이름)를 먼저 등록해두면 user 파라미터로 바로 연결할 수 있어요.
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
name |
String | 필수 | 주문명 |
price |
Integer | 필수 | 결제 금액 |
tax_free_price |
Integer | 선택 | 면세 금액 |
delivery_price |
Integer | 선택 | 배송비 |
memo |
String | 선택 | 내부 메모 |
request_id |
String | 필수 | 가맹점 고유 식별자 (웹훅 매칭용) — 비우면 INVOICE_REQUEST_ID_BLANK 로 거절돼요 |
redirect_url |
String | 선택 | 결제 완료 후 이동할 URL |
webhook_url |
String | 선택 | 결제 결과를 받을 웹훅 URL |
header_content_type |
String | 선택 | 웹훅 전송 시 Content-Type |
usage_api_url |
String | 선택 | 사용량 기반 구독의 사용량 조회 URL |
use_notification |
Boolean | 선택 | 알림 자동 발송 여부 |
use_auto_login |
Boolean | 선택 | 링크 진입 시 자동 로그인 여부 |
expired_at |
String | 선택 | 링크 만료 시간 (ISO 8601) |
metadata |
Object | 선택 | 추가 데이터 |
extra |
Object | 선택 | 결제창 부가 설정 |
user |
Object | 필수 | 고객 정보 — 없으면 INVOICE_TARGET_NOT_FOUND 로 거절돼요 |
user.user_id |
String | 필수 | 고객 ID — 이 값이 없으면 user 객체 전체가 무시돼 요청이 거절돼요 |
user.email |
String | 선택 | 고객 이메일 |
user.phone |
String | 선택 | 고객 전화번호 |
products |
Array | 선택 | 상품 목록 |
products[].product_id |
String | 선택 | 상품 ID |
products[].quantity |
Integer | 선택 | 수량 |
products[].duration |
Integer | 선택 | 구독 기간 (-1: 무제한) |
코드 예제
const { BootpayCommerce } = require('@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: {
user_id: 'user_20250801',
email: 'user@example.com',
phone: '01012345678'
},
products: [
{
product_id: '67c95e64d01640bb9859c629',
quantity: 1,
duration: -1
}
]
})
console.log('payment_url:', response.payment_url)javascriptfrom 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={
'user_id': 'user_20250801',
'email': 'user@example.com',
'phone': '01012345678'
},
products=[
{
'product_id': '67c95e64d01640bb9859c629',
'quantity': 1,
'duration': -1
}
]
)
print('payment_url:', response['payment_url'])pythonuse 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' => [
'user_id' => 'user_20250801',
'email' => 'user@example.com',
'phone' => '01012345678'
],
'products' => [
[
'product_id' => '67c95e64d01640bb9859c629',
'quantity' => 1,
'duration' => -1
]
]
]);
echo 'payment_url: ' . $response['payment_url'];phpimport 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.userId = "user_20250801"; // 필수 — 이 값이 없으면 user 객체 전체가 무시돼요
user.email = "user@example.com";
user.phone = "01012345678";
SInvoiceProduct product = new SInvoiceProduct();
product.productId = "67c95e64d01640bb9859c629";
product.quantity = 1;
product.duration = -1;
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("payment_url: " + response.getData().get("payment_url"));javarequire 'bootpay-backend-ruby'
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: {
user_id: 'user_20250801',
email: 'user@example.com',
phone: '01012345678'
},
products: [
{
product_id: '67c95e64d01640bb9859c629',
quantity: 1,
duration: -1
}
]
)
puts "payment_url: #{response['payment_url']}"rubyimport "github.com/bootpay/backend-go/v2"
commerce := bootpay.NewCommerceApi("your-commerce-client-key", "your-commerce-secret-key")
response, err := commerce.Invoice.Create(bootpay.InvoiceCreateParams{
Name: "Professional 플랜 구독",
Price: 29900,
RequestId: "invoice_20250801_0001",
UseNotification: true,
SendTypes: []int{1, 2},
ExpiredAt: "2025-08-01T23:59:59Z",
RedirectUrl: "https://myshop.com/payment/complete",
User: bootpay.UserParams{
UserId: "user_20250801",
Email: "user@example.com",
Phone: "01012345678",
},
Products: []bootpay.ProductParams{
{
ProductId: "67c95e64d01640bb9859c629",
Quantity: 1,
Duration: -1,
},
},
})
fmt.Println("payment_url:", response["payment_url"])gousing Bootpay.Commerce;
var commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
var response = await commerce.Invoice.Create(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 {
user_id = "user_20250801",
email = "user@example.com",
phone = "01012345678"
},
products = new[] {
new {
product_id = "67c95e64d01640bb9859c629",
quantity = 1,
duration = -1
}
}
});
Console.WriteLine($"payment_url: {response.PaymentUrl}");csharp응답
성공 응답
{
"payment_url": "https://pay.bootpay.co.kr/invoice/abc123def456",
"invoice_id": "inv_687a1b2c3d4e5f",
"expired_at": "2025-08-01T23:59:59Z"
}json응답 필드 설명
| 필드 | 타입 | 설명 |
|---|---|---|
payment_url |
String | 고객에게 전달할 결제 페이지 URL |
invoice_id |
String | 생성된 링크페이 ID |
expired_at |
String | 링크 만료 시간 |
에러 코드
공통 에러
인증·권한 관련 에러는 에러 코드표를 참고해요.
| 코드 | 메시지 | 대처 방법 |
|---|---|---|
INVOICE_NOT_FOUND |
링크페이 정보가 없어요 | invoice_id를 확인해요 |
INVOICE_DENIED |
링크페이 정보에 조회권한이 없는 회원세션이에요 | 올바른 API 키를 사용하고 있는지 확인해요 |
use_notification: true로 설정하면 고객에게 SMS, 카카오톡, 이메일로 결제 링크가 자동 발송돼요.
