UWS Payments API & MCP Manual
Learn how to integrate UWS Payments PG Router API & MCP Server into your projects. Route Toss Payments (Single, Billing, PayPal) and Stripe across multiple domains with a single API call.
Authentication (Service & Domain Bound API Key)
When issuing an API key in the API Keys menu, you register the target Service Name and Domain. Every payment triggered with that API key automatically logs its associated service and domain in the UWS Payments ledger.
| Header Name | Description |
|---|---|
X-API-KEY | Your service & domain bound UWS Payments API key (e.g., uws_pay_...). |
1. Request Payment Session (PG Router API)
Create a payment session for any external project using the Toss Payments (Single, Billing, PayPal) keys registered in UWS Payments. Redirect the user to the returned checkoutUrl to complete the payment.
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | Number | Yes | Payment amount (e.g., 15000 for KRW or 20 for USD). |
orderName | String | Yes | Order title displayed on the Toss checkout window (e.g., "Pro Plan Subscription"). |
orderId | String | No | Merchant order ID. Auto-generated if omitted. |
pg | String | No | PG routing target: toss (Single Card), toss_billing (Billing Key), toss_paypal (PayPal USD). |
currency | String | No | KRW (default) or USD. |
customerName | String | No | Buyer name. |
customerEmail | String | No | Buyer email address. |
successUrl | String | No | External project URL to redirect upon payment completion. |
failUrl | String | No | External project URL to redirect if payment fails or is canceled. |
webhookUrl | String | No | Server-to-server webhook endpoint to receive payment.completed events. |
cURL Example (Request Payment)
Python Example (Requests)
Node.js / Frontend Example (Fetch & Open PG Window)
1-Line Browser SDK Example (토스 미구현 외부 사이트에서 팝업 PG창 즉시 호출)
2. Direct Confirm, Cancel & Order Status API
In addition to the hosted checkout router, you can confirm Toss payments directly from your backend, cancel/refund completed payments, or query real-time transaction status by orderId.
POST /api/v1/payments/cancel
GET /api/v1/payments/:orderId
Direct Confirm Parameters (POST /api/v1/payments/confirm)
| Parameter | Type | Required | Description |
|---|---|---|---|
paymentKey | String | Yes | Toss Payments paymentKey received from the payment window. |
orderId | String | Yes | Merchant order ID matching the payment request. |
amount | Number | Yes | Exact payment amount to verify and confirm. |
orderName | String | No | Order title to record in the UWS Payments unified log. |
pg | String | No | toss (default) or toss_paypal. |
Cancel / Refund Parameters (POST /api/v1/payments/cancel)
| Parameter | Type | Required | Description |
|---|---|---|---|
orderId | String | Yes* | Order ID to cancel (or provide paymentKey). |
paymentKey | String | No | Toss paymentKey (optional if orderId is provided). |
cancelReason | String | No | Reason for cancellation/refund (e.g., "Customer requested refund"). |
cURL Example (Cancel / Refund Payment)
Rate Limits
The current API rate limit is set to 60 requests per minute per IP address. Exceeding this limit will result in a 429 Too Many Requests response.
Response Format & Webhook Payload
A successful payment session request returns a JSON object containing the session ID, order ID, bound service name & domain, selected PG provider, and the hosted checkoutUrl.
Response Schema (POST /api/v1/payments/request)
| Field | Type | Description |
|---|---|---|
status | String | "success" when the payment session is created. |
sessionId | String | Unique UWS Payments checkout session ID. |
orderId | String | Merchant order ID tracked across Toss Payments and UWS logs. |
orderName | String | Order name displayed on the checkout screen. |
amount | Number | Payment amount to be charged. |
currency | String | Currency code (KRW or USD). |
pg | String | Selected PG route (toss, toss_billing, toss_paypal). |
serviceName | String | Service name bound to the API key. |
domain | String | Domain bound to the API key. |
checkoutUrl | String | Hosted checkout URL where the user completes payment. |
createdAt | String (ISO Date) | Timestamp when the session was created. |