UseePay Open API
UseePay PortalMechant Dashboard
Product Docs
Product Docs
  • V2.0
  • V1.0
UseePay PortalMechant Dashboard
Product Docs
Product Docs
  • V2.0
  • V1.0
  1. Payment Product Overview
  • Integration
    • Welcome to the UseePay Demo Page
    • Payment Product Overview
      • Hosted Checkout Integration Guide
      • Embedded Checkout Integration Guide
      • Express Checkout Integration Guide
      • Server to Server Integration Guide
    • About Payment Methods
      • Card
      • Apple Pay Web Integration (API Integration)
      • Google Pay Web Integration (API Integration)
      • Apple Pay(Hosted Checkout)
      • Google Pay
      • Klarna
      • Naver pay
      • Kakao Pay
      • Toss Pay
      • Payco
      • Affirm
      • Blik
      • Trustly
      • Cashapp
      • Pay with Link
    • Subscription
      • Get started with Subscription
    • Online payment
      • Get started with online payments
    • Payment Capabilities
      • Adaptive Price
      • Supported Payment Methods for Checkout
    • Checkout session
      • Checkout Session Guide
  • Developer
    • Introduction
    • Authentication
    • Errors
    • Error code
      • last_payment_error documentation
    • Best Integration
      • Quickly create a paymentIntent for a subscription
      • Auto-Charge Subscription Guide
    • Payment Intents
      • Payment Intent Overview
      • Quickly create a paymentIntent
      • Create a PaymentIntent
      • Retrieve a PaymentIntent
      • Update a PaymentIntent
      • Confirm a PaymentIntent
      • Cancel a PaymentIntent
      • Capture a PaymentIntent
      • List all payment intents
    • Customers
      • Create a customer
      • Retrieves a customer
      • Update a customer
      • List all customers
    • Subscriptions
      • Create a subscription
      • Retrieves a subscription
      • Update a subscription
      • List all subscriptions
      • Cancel a subscription
    • Invoices
      • Create a invoice
      • Retrieves a invoice
      • List all invoices
      • Pay a invoice
    • Payment Methods
      • Retieve Payment Method Session
    • Mandates
      • Create a mandate
      • Retrieves a mandate
      • List all mandates
    • Refunds
      • Create a refund
      • Retrieves a refund
      • List all refunds
    • Webhooks
      • Webhook Events Documentation
      • Webhook events for example
      • Webhook Activation/Signature Verification Steps
      • Create a webhook
      • Retrieves a webhook
      • Update a webhook
      • List all webhooks
    • Embedded Checkout
      • Payment Element
      • Payment Element (Deferred Intent)
      • Express Checkout Element
      • Checkout Session Element
    • About Testing
      • Test Cards
      • ApplePay&GooglePay
    • Payment Method Configuration
      • Retieve Payment Method Configuration
    • Checkout Session
      • Create Checkout Session
      • Retrieve Checkout Session
    • Trackers
      • upload trackers
      • Retrieve a tracker
    • Schemas
      • CheckoutSessionCreateRequest
      • PaymentMethod
      • CreatePaymentIntentRequest
      • LineItem
      • Customer
      • Address
      • ProductData
      • Shipping
      • SubscriptionData
      • Error
      • DiscountPeriodConfig
      • DeviceData
      • CheckoutSessionResponse
      • ErrorResponse
      • Order
      • Product
      • PaymentMethodOptions
      • RiskControlOptions
      • Mandate
      • PaymentIntent
      • Billing
      • Card
      • AliPay
      • Wallet
      • Klarna
      • WechatPay
      • Refund
      • Subscription
      • Recurring
      • PriceData
      • SubscriptionItem
      • Invoice
      • NextAction
      • Webhook
      • CollectableOptions
      • PaymentLink
      • last_payment_error
      • discount_period_config
  • Reconciliation
    • SFTP Access for Reconciliation
  • Message
    • Messaging Element
  • FAQ
    • Unable to receive Webhook notifications
  1. Payment Product Overview

Server to Server Integration Guide

Server to Server (S2S) is a fully API-driven integration where your server handles the entire payment flow — collecting card data, calling UseePay APIs directly, and managing the PaymentIntent lifecycle — without any UseePay-hosted UI or JS SDK.
Note: S2S integration requires your application to be PCI DSS compliant, as raw card data passes through your server.

When to Use S2S#

ScenarioRecommended
Native mobile app (iOS / Android)✅
Existing custom payment form✅
Full control over payment UI and flow✅
Server-side batch payments or auto-charge✅
Want UseePay to handle the payment UI❌ Use Embedded or Hosted Checkout instead

How It Works#


Integration Steps#

Step 1  ·  Collect Card Data on Your Frontend
Your frontend collects card details directly from the customer. You are responsible for securing the transmission (HTTPS required).
Minimum required fields
FieldDescription
Card number16-digit PAN
Expiry monthMM format
Expiry yearYY or YYYY format
CVV3 or 4 digits
Send the collected card data to your own backend over HTTPS. Never log or store raw card data.

Step 2  ·  Server · Create a PaymentIntent
Your server creates a PaymentIntent to represent the payment session.
Key parameters
ParameterDescription
amountAmount in minor units (e.g. 1000 = $10.00)
currencyISO 4217 code, e.g. USD
merchantOrderIdYour unique order ID
captureMethodautomatic · charge immediately / manual · auth only
returnUrlRedirect URL after 3DS completion
Response — store id for the next step.

Step 3  ·  Server · Confirm with Card Data
Submit the card details to confirm the PaymentIntent. This is where the actual charge attempt happens.
Key parameters
ParameterDescription
paymentMethod.card.numberEncrypted or raw card number
paymentMethod.card.expiryMonthCard expiry month
paymentMethod.card.expiryYearCard expiry year
paymentMethod.card.cvcCard CVV
returnUrlWhere to redirect after 3DS
Possible response statuses
StatusMeaningAction
succeededPayment completeFulfill order
requires_captureAuthorized (manual mode)Capture when ready
requires_action3DS requiredRedirect customer
failedPayment declinedShow error, retry

Step 4  ·  Handle 3DS Authentication (if required)
If the card requires 3DS, the confirm response will contain next_action:
{
  "status": "requires_action",
  "nextAction": {
    "type": "redirect",
    "redirect": {
      "url": "https://3ds.useepay.com/authenticate?token=xxx"
    }
  }
}
Redirect the customer to nextAction.redirect.url. After authentication, the customer is returned to your returnUrl:
https://yoursite.com/payment/result
  ?payment_intent=pi_1234567890
  &redirect_status=succeeded
Always verify the final status server-side — do not rely solely on the redirect params.

Step 5  ·  Capture (Manual Mode Only)
If you created the PaymentIntent with captureMethod: "manual", the card is authorized but not charged after confirmation. Capture when you are ready to fulfill the order.
The authorization hold will expire if not captured within the allowed window.

Step 6  ·  Receive Webhook Events
Set up a Webhook endpoint in the Merchant Dashboard to receive real-time payment notifications.
EventDescription
payment_intent.succeededPayment completed
payment_intent.payment_failedPayment failed
payment_intent.requires_captureAuthorized, awaiting capture
payment_intent.canceledPayment canceled
Webhook is the recommended way to confirm payment status — more reliable than redirect params or polling.

PaymentIntent Status Lifecycle#

requires_payment_method
         │
         ▼
 requires_confirmation
         │
         ▼
   requires_action ──── 3DS auth ────┐
         │                           │
         ▼                           │
 requires_capture (manual mode)      │
         │                           │
         ▼                           ▼
      succeeded ◄────────────────────┘

  canceled / failed  (terminal states)

Supported Payment Methods (S2S)#

Payment MethodNotes
Credit / Debit CardFull S2S support including 3DS
Apple PayRequires Apple Pay token from device
Google PayRequires Google Pay token from device

Go-Live Checklist#

Confirm your PCI DSS compliance scope with your security team
Obtain API keys from the Merchant Dashboard
Implement HTTPS on all pages that handle card data
Create PaymentIntent server-side before submitting card data
Handle requires_action status — redirect customer to 3DS URL
Set up Webhook endpoint and verify final payment status server-side
Implement refund flow via POST /refunds for failed fulfillments
Test with test cards in sandbox before going live
Modified at 2026-04-09 06:19:33
Previous
Express Checkout Integration Guide
Next
Card
Built with