Main API결제 API
POST /ai/payments/confirm
결제 승인
결제 승인
캔디페이 결제를 승인하고 주문 정보를 저장합니다.
| 항목 | 값 |
|---|---|
| 메서드 | POST |
| 경로 | /ai/payments/confirm |
| 인증 | 필요 |
요청
POST /ai/payments/confirm HTTP/1.1
Host: api.glowb.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json
{
"paymentKey": "payment_key_from_candypay",
"orderId": "ORDER_20240115_001",
"amount": 50000,
"deliveryAddress": {
"name": "홍길동",
"phone": "010-1234-5678",
"address": "서울시 강남구",
"addressDetail": "101동 1001호",
"zipCode": "06000"
},
"orderItems": [
{
"productId": 1,
"productName": "상품명",
"quantity": 2,
"price": 25000
}
]
}curl -X POST "https://api.glowb.com/ai/payments/confirm" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"paymentKey": "payment_key_from_candypay",
"orderId": "ORDER_20240115_001",
"amount": 50000
}'const response = await fetch('/ai/payments/confirm', {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
paymentKey: 'payment_key_from_candypay',
orderId: 'ORDER_20240115_001',
amount: 50000,
deliveryAddress: {
name: '홍길동',
phone: '010-1234-5678',
address: '서울시 강남구',
addressDetail: '101동 1001호',
zipCode: '06000'
},
orderItems: [
{ productId: 1, productName: '상품명', quantity: 2, price: 25000 }
]
})
});
const result = await response.json();Request Body 스키마
Prop
Type
deliveryAddress 스키마
Prop
Type
응답
성공 응답 (200 OK)
{
"status": 200,
"code": null,
"message": "결제 승인 성공",
"data": {
"paymentKey": "payment_key",
"orderId": "ORDER_20240115_001",
"status": "DONE",
"amount": 50000,
"approvedAt": "2024-01-15T10:30:00"
}
}에러 응답
| 상태 코드 | 코드 | 메시지 |
|---|---|---|
| 400 | INVALID_PAYMENT | 유효하지 않은 결제 정보 |
| 402 | PAYMENT_FAILED | 결제 실패 |
| 500 | INTERNAL_SERVER_ERROR | 서버 오류 |