UseePay API
  1. Payment Intents
UseePay API
  • Introduction
  • Product Overview
  • Authentication
  • Errors
  • Changelog
  • Integration
    • Get started with online payments
    • Get started with subscriptions
  • Payment Intents
    • Create a PaymentIntent
      POST
    • Retrieve a PaymentIntent
      GET
    • Update a PaymentIntent
      POST
    • Confirm a PaymentIntent
      POST
    • Cancel a PaymentIntent
      POST
    • Capture a PaymentIntent
      POST
    • List all payment intents
      GET
  • Customers
    • Create a customer
      POST
    • Retrieves a customer
      GET
    • Update a customer
      POST
    • List all customers
      GET
  • Subscriptions
    • Create a subscription
      POST
    • Retrieves a subscription
      GET
    • Update a subscription
      POST
    • List all subscriptions
      GET
    • Cancel a subscription
      POST
  • Invoices
    • Create a invoice
      POST
    • Retrieves a invoice
      GET
    • Update a invoice
      POST
    • List all invoices
      GET
    • Pay a invoice
      POST
  • Payment Methods
    • Create a payment method
    • Retrieves a payment method
    • Update a payment method
    • List all payment methods
  • Mandates
    • Create a mandate
    • Retrieves a mandate
    • Update a mandate
    • List all mandates
  • Refunds
    • Create a refund
    • Retrieves a refund
    • Update a refund
    • List all refunds
  • Webhooks
    • Webhook envents
    • Create a webhook
    • Retrieves a webhook
    • Update a webhook
    • List all webhooks
  • Payment Links
    • Create a payment link
    • Retrieves a payment link
    • Update a payment link
    • List all payment links
  • Embedded Checkout
    • Payment Elements
  • About Testing
    • Test Cards
    • ApplePay&GooglePay
  1. Payment Intents

Create a PaymentIntent

POST
/api/v1/payment_intents/create
Creates a PaymentIntent object.
After the PaymentIntent is created, attach a payment method and confirm to continue the payment.
When you use confirm=true during creation, it’s equivalent to creating and confirming the PaymentIntent in the same call. You can use any parameters available in the confirm API when you supply confirm=true.

Request

Header Params

Body Params application/json

Example
{
    "amount":100.23,
    "currency":"USD",
    "merchant_order_id":"72934khwqjry09ew807",
    "customer":{
        "email":"test@useepay.com"
        ,"first_name":"zhang"
        ,"last_name":"shan"
        ,"phone_number":"+8613624569293"
        ,"address":{
            "country":"US"
            ,"city":"New York"
            ,"state":"NY"
            ,"postcode": "100000"
            ,"line1":"Pudong District"
        }
        ,"merchant_customer_id":"cust00002"
    },
    "customer_id":"{{customer-id}}",
    "payment_method_id": null,
    "confirm": true,
    "auto_capture": false,
    "description":"Airwallex - T-shirt",
    "device_data": {
        "accept_header": "*/*",
        "browser": {
            "java_enabled": false,
            "javascript_enabled": true,
            "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"
        },
        "device_id": "00000000-000000000000000",
        "ip_address": "212.121.222.123 or 2001:0db8:0000:0000:0000:ff00:0042:8329",
        "language": "EN or en-US",
        "location": {
            "lat": "-37.81892",
            "lon": "144.95913"
        },
        "mobile": {
            "device_model": "Apple IPHONE 7",
            "os_type": "IOS or ANDROID",
            "os_version": "IOS 14.5"
        },
        "screen_color_depth": 24,
        "screen_height": 1080,
        "screen_width": 1920,
        "timezone": "-2 or 3:30"
    },
    "metadata": {
        "id": 1
    },
    "order":{
        "category":"Apparel and accessories",
         "products": [
            {
                "category": "Apparel and accessories",
                "code": "12334455",
                "desc": "IPHONE 7",
                "effective_end_at": "2020-12-31T23:59:59Z",
                "effective_start_at": "2020-01-01T00:00:00Z",
                "name": "IPHONE7",
                "quantity": 5,
                "seller": {
                    "identifier": "string",
                    "name": "string"
                },
                "sku": "100004",
                "type": "physical",
                "unit_price": 100.01,
                "url": "https://www.xxx.com/item/12345"
            }
        ],
        "shipping": {
            "address": {
                "city": "Shanghai",
                "country_code": "CN",
                "postcode": "100000",
                "state": "Shanghai",
                "line1": "Pudong District"
            },
            "first_name": "John",
            "last_name": "Doe",
            "phone_number": "13800000000",
            "shipping_method": "sameday"
        }
    },
    "payment_method_options": {
        "type":"card",
        "card": {
            "authorization_type": "final_auth",
            "auto_capture": true,
            "three_ds_action": "force_3ds"
        }
    },
    "return_url": "http://www.example.com",
    "risk_control_options": {
        "skip_risk_processing": false,
        "tra_applicable": false
    }
    ,"invoice_id":"{{invoice-id}}"
    ,"mandate_id":null
    ,"mandate_data":{
        "customer_acceptance":{
        "type":"online"
        ,"accepted_at":"2024-10-06T10:56:21Z"
        ,"online":{
            "ip_address":"192.168.12.1"
            ,"user_agent":"user agent"
        }
        }
    }
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://openapi1.uat.useepay.com/api/v1/payment_intents/create' \
--header 'x-merchant-no: 500000000007245' \
--header 'x-api-key: FUYTIUvjhgfytfuytwiue' \
--header 'x-app-id: www.pay.com' \
--header 'x-api-version;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount":100.23,
    "currency":"USD",
    "merchant_order_id":"72934khwqjry09ew807",
    "customer":{
        "email":"test@useepay.com"
        ,"first_name":"zhang"
        ,"last_name":"shan"
        ,"phone_number":"+8613624569293"
        ,"address":{
            "country":"US"
            ,"city":"New York"
            ,"state":"NY"
            ,"postcode": "100000"
            ,"line1":"Pudong District"
        }
        ,"merchant_customer_id":"cust00002"
    },
    "customer_id":"cus_1JA7UDDQG3800",
    "payment_method_id": null,
    "confirm": true,
    "auto_capture": false,
    "description":"Airwallex - T-shirt",
    "device_data": {
        "accept_header": "*/*",
        "browser": {
            "java_enabled": false,
            "javascript_enabled": true,
            "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"
        },
        "device_id": "00000000-000000000000000",
        "ip_address": "212.121.222.123 or 2001:0db8:0000:0000:0000:ff00:0042:8329",
        "language": "EN or en-US",
        "location": {
            "lat": "-37.81892",
            "lon": "144.95913"
        },
        "mobile": {
            "device_model": "Apple IPHONE 7",
            "os_type": "IOS or ANDROID",
            "os_version": "IOS 14.5"
        },
        "screen_color_depth": 24,
        "screen_height": 1080,
        "screen_width": 1920,
        "timezone": "-2 or 3:30"
    },
    "metadata": {
        "id": 1
    },
    "order":{
        "category":"Apparel and accessories",
         "products": [
            {
                "category": "Apparel and accessories",
                "code": "12334455",
                "desc": "IPHONE 7",
                "effective_end_at": "2020-12-31T23:59:59Z",
                "effective_start_at": "2020-01-01T00:00:00Z",
                "name": "IPHONE7",
                "quantity": 5,
                "seller": {
                    "identifier": "string",
                    "name": "string"
                },
                "sku": "100004",
                "type": "physical",
                "unit_price": 100.01,
                "url": "https://www.xxx.com/item/12345"
            }
        ],
        "shipping": {
            "address": {
                "city": "Shanghai",
                "country_code": "CN",
                "postcode": "100000",
                "state": "Shanghai",
                "line1": "Pudong District"
            },
            "first_name": "John",
            "last_name": "Doe",
            "phone_number": "13800000000",
            "shipping_method": "sameday"
        }
    },
    "payment_method_options": {
        "type":"card",
        "card": {
            "authorization_type": "final_auth",
            "auto_capture": true,
            "three_ds_action": "force_3ds"
        }
    },
    "return_url": "http://www.example.com",
    "risk_control_options": {
        "skip_risk_processing": false,
        "tra_applicable": false
    }
    ,"invoice_id":"inv_1JBQUCEC40000"
    ,"mandate_id":null
    ,"mandate_data":{
        "customer_acceptance":{
        "type":"online"
        ,"accepted_at":"2024-10-06T10:56:21Z"
        ,"online":{
            "ip_address":"192.168.12.1"
            ,"user_agent":"user agent"
        }
        }
    }
}'

Responses

🟢200Success
application/json
Body

Example
{
    "id": "0d8ad1e128b54024aaec82e55a8ea2b8",
    "code": null,
    "source": null,
    "message": null,
    "amount": 100.23,
    "currency": "USD",
    "status": "requires_payment_method",
    "customer": {
        "id": null,
        "address": {
            "country": "US",
            "city": "New York",
            "postcode": "100000",
            "state": "NY",
            "line1": "Pudong District",
            "line2": null
        },
        "description": null,
        "name": null,
        "email": "test@useepay.com",
        "phone": null,
        "metadata": null,
        "shipping": null,
        "merchant_no": null,
        "app_id": null,
        "create_at": null,
        "modify_at": null,
        "first_name": "zhang",
        "last_name": "shan",
        "merchant_customer_id": "cust00003"
    },
    "description": "UseePay - T-shirt",
    "order": {
        "category": "Apparel and accessories",
        "products": [
            {
                "id": null,
                "name": "IPHONE7",
                "desc": "IPHONE 7",
                "quantity": 5,
                "sku": "100004",
                "type": "physical",
                "url": "https://example.useepay.com/product/123",
                "effective_end_at": "2020-12-31T23:59:59Z",
                "effective_start_at": "2020-01-01T00:00:00Z",
                "price": 100.01
            }
        ],
        "sellers": null,
        "shipping": {
            "address": {
                "country": null,
                "city": "Shanghai",
                "postcode": "100000",
                "state": "Shanghai",
                "line1": "Pudong District",
                "line2": null
            },
            "name": null,
            "phone": null,
            "first_name": "John",
            "last_name": "Doe",
            "shipping_method": "sameday"
        }
    },
    "metadata": {
        "id": 1
    },
    "confirm": false,
    "merchant_no": "500000000007264",
    "app_id": "www.pay.com",
    "create_at": "2024-10-24T11:19:26Z",
    "modify_at": "2024-10-24T11:19:26Z",
    "decline_code": null,
    "doc_url": null,
    "merchant_order_id": "72934khwqjry09ew802",
    "invoice_id": "inv_1J6K48EGK0800",
    "captured_amount": null,
    "customer_id": "cus_1J6N9TPUSIG00",
    "available_payment_method_types": [
        "card",
        "applepay",
        "googlepay"
    ],
    "payment_method_options": {
        "type": "card",
        "card": {
            "three_ds_action": "force_3ds",
            "authorization_type": "final_auth",
            "auto_capture": true
        },
        "klarna": null,
        "wechatpay": null,
        "alipay_hk": null
    },
    "cancellation_reason": null,
    "cancelled_at": null,
    "next_action": {
        "type": "redirect",
        "redirect": {
            "content_type": "application/json",
            "method": "POST",
            "url": "https://example.useepay.com/redirect?i=a"
        }
    },
    "return_url": "http://www.example.com",
    "client_secret": "0656dc044273b8663fa1d078b32cf385",
    "auto_capture": false,
    "mandate_id": "man_1JAJCTN280400"
}
🟠400Base Request
Modified at 2025-01-22 06:52:07
Previous
Get started with subscriptions
Next
Retrieve a PaymentIntent
Built with