Documentation

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.

PG Router API
MCP

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 NameDescription
X-API-KEYYour 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.

POST /api/v1/payments/request

Request Body Parameters

ParameterTypeRequiredDescription
amountNumberYesPayment amount (e.g., 15000 for KRW or 20 for USD).
orderNameStringYesOrder title displayed on the Toss checkout window (e.g., "Pro Plan Subscription").
orderIdStringNoMerchant order ID. Auto-generated if omitted.
pgStringNoPG routing target: toss (Single Card), toss_billing (Billing Key), toss_paypal (PayPal USD).
currencyStringNoKRW (default) or USD.
customerNameStringNoBuyer name.
customerEmailStringNoBuyer email address.
successUrlStringNoExternal project URL to redirect upon payment completion.
failUrlStringNoExternal project URL to redirect if payment fails or is canceled.
webhookUrlStringNoServer-to-server webhook endpoint to receive payment.completed events.

cURL Example (Request Payment)

curl -X POST "https://uwspayments.com/api/v1/payments/request" \ -H "X-API-KEY: YOUR_UWS_PAY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 29000, "orderName": "AI SaaS Pro Plan", "pg": "toss", "customerName": "Hong Gildong", "customerEmail": "user@example.com", "successUrl": "https://myproject.com/payment/success", "failUrl": "https://myproject.com/payment/fail" }'

Python Example (Requests)

import requests url = "https://uwspayments.com/api/v1/payments/request" headers = { "X-API-KEY": "YOUR_UWS_PAY_API_KEY", "Content-Type": "application/json" } payload = { "amount": 29000, "orderName": "AI SaaS Pro Plan", "pg": "toss", "customerName": "Hong Gildong", "customerEmail": "user@example.com", "successUrl": "https://myproject.com/payment/success", "failUrl": "https://myproject.com/payment/fail" } response = requests.post(url, json=payload, headers=headers) print(response.json())

Node.js / Frontend Example (Fetch & Open PG Window)

const response = await fetch('https://uwspayments.com/api/v1/payments/request', { method: 'POST', headers: { 'X-API-KEY': 'YOUR_UWS_PAY_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ amount: 29000, orderName: 'AI SaaS Pro Plan', pg: 'toss', // 'toss' (단건) | 'toss_billing' (빌링) | 'toss_paypal' (페이팔 USD) | 'stripe' customerName: 'Hong Gildong', customerEmail: 'user@example.com', successUrl: 'https://myproject.com/payment/success', failUrl: 'https://myproject.com/payment/fail' }) }); const data = await response.json(); // 토스페이먼츠 SDK가 없어도 반환된 checkoutUrl로 이동하거나 팝업을 열면 즉시 PG 결제창이 실행됩니다! window.location.href = data.checkoutUrl;

1-Line Browser SDK Example (토스 미구현 외부 사이트에서 팝업 PG창 즉시 호출)

<script src="https://uwspayments.com/sdk/uws-payments.js"></script> <script> UwsPayments.requestPayment({ apiKey: 'YOUR_UWS_PAY_API_KEY', amount: 29000, orderName: 'AI SaaS Pro Plan', pg: 'toss', // 'toss' | 'toss_billing' | 'toss_paypal' | 'stripe' mode: 'popup', // 'popup' (팝업 결제창) 또는 'redirect' (현재 창 이동) onSuccess: function(result) { console.log('결제 완료:', result.orderId, result.paymentKey); } }); </script>

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/confirm
POST /api/v1/payments/cancel
GET /api/v1/payments/:orderId

Direct Confirm Parameters (POST /api/v1/payments/confirm)

ParameterTypeRequiredDescription
paymentKeyStringYesToss Payments paymentKey received from the payment window.
orderIdStringYesMerchant order ID matching the payment request.
amountNumberYesExact payment amount to verify and confirm.
orderNameStringNoOrder title to record in the UWS Payments unified log.
pgStringNotoss (default) or toss_paypal.

Cancel / Refund Parameters (POST /api/v1/payments/cancel)

ParameterTypeRequiredDescription
orderIdStringYes*Order ID to cancel (or provide paymentKey).
paymentKeyStringNoToss paymentKey (optional if orderId is provided).
cancelReasonStringNoReason for cancellation/refund (e.g., "Customer requested refund").

cURL Example (Cancel / Refund Payment)

curl -X POST "https://uwspayments.com/api/v1/payments/cancel" \ -H "X-API-KEY: YOUR_UWS_PAY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "orderId": "UWS_1729812000_AB12CD", "cancelReason": "Customer requested refund" }'

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)

FieldTypeDescription
statusString"success" when the payment session is created.
sessionIdStringUnique UWS Payments checkout session ID.
orderIdStringMerchant order ID tracked across Toss Payments and UWS logs.
orderNameStringOrder name displayed on the checkout screen.
amountNumberPayment amount to be charged.
currencyStringCurrency code (KRW or USD).
pgStringSelected PG route (toss, toss_billing, toss_paypal).
serviceNameStringService name bound to the API key.
domainStringDomain bound to the API key.
checkoutUrlStringHosted checkout URL where the user completes payment.
createdAtString (ISO Date)Timestamp when the session was created.

Example Response

Loading...