UseePay API
  1. Payment Methods
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
    • Retrieves a invoice
    • Update a invoice
    • List all invoices
    • Pay a invoice
  • Payment Methods
    • Create a payment method
      POST
    • Retrieves a payment method
      GET
    • Update a payment method
      POST
    • List all payment methods
      GET
  • 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 Methods

Create a payment method

Developing
POST
/api/v1/payment_methods/create
Creates a PaymentMethod object.
Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately.

Request

Header Params

Body Params application/json

Example
{
    "type":"card"
    ,"customer_id":"{{customer-id}}"
    ,"card":{
        "cryptogram":null
        ,"name":"zhi.wang"
        ,"number":"13524189280"
        ,"number_type":"pan"
        ,"cvc":"2322"
        ,"expiry_month":"05"
        ,"expiry_year":"2025"
        ,"external_three_ds":{
            "authentication_value":null
            ,"ds_transaction_id":null
            ,"eci":null
            ,"three_ds_exemption":null
            ,"three_ds_server_transaction_id":null
            ,"version":null
        }
        ,"three_ds":{
            "acs_response":null
            ,"device_data_collection_res":null
            ,"ds_transaction_id":null
            ,"return_url":null
        }
    }
    ,"billing":{
        "address":{
            "country":"CN"
            ,"city":"shanghai"
            ,"postcode":"200100"
            ,"state":"shanghai"
            ,"line1":"pudong zhangjiang"
            ,"line2":"room 1002"
        }
        ,"date_of_birth":"1978-01-09"
        ,"name":"zhangsan"
        ,"email":"zhanghan@sina.com"
        ,"phone":"13527189021"
    }
}

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_methods/create' \
--header 'x-merchant-no: 500000000007245' \
--header 'x-api-key: FUYTIUvjhgfytfuytwiue' \
--header 'x-app-id: www.pay.com' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type":"card"
    ,"customer_id":"cus_1JA7UDDQG3800"
    ,"card":{
        "cryptogram":null
        ,"name":"zhi.wang"
        ,"number":"13524189280"
        ,"number_type":"pan"
        ,"cvc":"2322"
        ,"expiry_month":"05"
        ,"expiry_year":"2025"
        ,"external_three_ds":{
            "authentication_value":null
            ,"ds_transaction_id":null
            ,"eci":null
            ,"three_ds_exemption":null
            ,"three_ds_server_transaction_id":null
            ,"version":null
        }
        ,"three_ds":{
            "acs_response":null
            ,"device_data_collection_res":null
            ,"ds_transaction_id":null
            ,"return_url":null
        }
    }
    ,"billing":{
        "address":{
            "country":"CN"
            ,"city":"shanghai"
            ,"postcode":"200100"
            ,"state":"shanghai"
            ,"line1":"pudong zhangjiang"
            ,"line2":"room 1002"
        }
        ,"date_of_birth":"1978-01-09"
        ,"name":"zhangsan"
        ,"email":"zhanghan@sina.com"
        ,"phone":"13527189021"
    }
}'

Responses

🟢200Success
application/json
Body

Example
{
    "id": "pm_1JARUC40K0800",
    "type": "card",
    "billing": {
        "address": {
            "country": "CN",
            "city": "shanghai",
            "postcode": "200100",
            "state": "shanghai",
            "line1": "pudong zhangjiang",
            "line2": "room 1002"
        },
        "email": "zhanghan@sina.com",
        "name": "zhangsan",
        "phone": "13527189021",
        "date_of_birth": "1978-01-09",
        "first_name": null,
        "last_name": null
    },
    "applepay": null,
    "card": {
        "cryptogram": null,
        "cvc": "2322",
        "name": "zhi.wang",
        "number": "13524189280",
        "additional_info": null,
        "expiry_month": "05",
        "expiry_year": "2025",
        "external_three_ds": {
            "eci": null,
            "version": null,
            "authentication_value": null,
            "ds_transaction_id": null,
            "three_ds_exemption": null,
            "three_ds_server_transaction_id": null
        },
        "number_type": "pan",
        "three_ds": {
            "acs_response": null,
            "device_data_collection_res": null,
            "ds_transaction_id": null,
            "return_url": null
        }
    },
    "googlepay": null,
    "klarna": null,
    "wechatpay": null,
    "merchant_no": "500000000007264",
    "app_id": "www.pay.com",
    "create_at": "2024-10-25T07:14:09Z",
    "modify_at": "2024-10-25T07:14:09Z",
    "customer_id": "cus_1JA7UDDQG3800",
    "alipay_cn": null,
    "alipay_hk": null
}
Modified at 2024-11-07 10:56:14
Previous
Pay a invoice
Next
Retrieves a payment method
Built with