DianDian-OpenApi
  1. Acquiring
DianDian-OpenApi
  • Overview
  • Acquiring
    • Initiation of payments
      POST
    • Order inquiry
      POST
  1. Acquiring

Initiation of payments

POST
/api/v1/payment

Request

Header Params
Content-Type
string 
required
Indicate the media type of the request message defined in RFC2616
Example:
application/json; charset=UTF-8
signature
string 
required
Include the signature value of the request
Example:
*********
timestamp
string 
required
Unix timestamp (milliseconds)
Example:
1743487706607
timezone
string 
required
Time zone (based on the timestamp set by following)
Example:
Asia/Shanghai
Body Params application/json
merchant_id
string 
required
Merchant unique identifier
env
object 
required
terminal_type
string 
required
The terminal types applicable to merchant services.
The valid values are:
WEB: The client terminal type is a website, which can be opened through a PC browser.
WAP: The client terminal type is H5 page, which can be opened through a mobile browser.
APP: The client terminal type is a mobile application.
MINI-APP: The terminal type on the merchant end is a mobile mini program.
client_ip
string 
required
Customer IP address
<= 64 characters
browser_info
object 
required
Browser environment information for placing an order
device_info
object 
optional
order
object 
required
merchant_order_id
string 
required
The exclusive ID for identifying orders at the merchant end is assigned by the merchant who directly provides services or goods to the customer.
This field is used for displaying user consumption records and other further operations such as dispute tracking or handling customer complaints.
<= 64 characters
goods
array [object {8}] 
optional
Product information, including the ID, name, price, and quantity of the products in the order.
shipping
object 
required
Delivery information, including recipient (name, phone number, email, and delivery address) information, as well as delivery service provider information.
payment_amount
object 
required
Acquiring proportion
payment_method
object 
required
The payment method used by merchants or acquiring institutions for receiving payments.
metadata
object 
optional
Customize source data to be represented as key/value
redirect_url
string 
required
The merchant page link that the user is redirected to after completing the payment.
<= 2048 characters
Example
{
    "merchant_id": "1",
    "env": {
        "terminal_type": "WEB",
        "client_ip": "143.45.4.222",
        "browser_info": {
            "user_agent": "Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/5.1)"
        }
    },
    "order": {
        "merchant_order_id": "99999999999",
        "shipping": {
            "shipping_name": {
                "first_name": "KING",
                "last_name": "MIsa",
                "full_name": "KING MIsa"
            },
            "shipping_address": {
                "country": "US",
                "state": "TX",
                "city": "Austin",
                "address1": "789 Oak Ave",
                "address2": "",
                "zip_code": "78701"
            },
            "email": "example@example.com",
            "phone": "+864-281-1794",
            "carrier": "USPS"
        },
        "payment_amount": {
            "currency": "USD",
            "value": 1000
        },
        "payment_method": {
            "payment_type": "CARD",
            "payment_data": {
                "country": "US",
                "card_number": "4111111111111111",
                "expiry_year": "30",
                "expiry_month": "03",
                "cvv": "737",
                "card_holder_name": {
                    "first_name": "KING",
                    "last_name": "MIsa",
                    "full_name": "KING MIsa"
                },
                "billing_address": {
                    "country": "US",
                    "state": "TX",
                    "city": "Austin",
                    "address1": "789 Oak Ave",
                    "address2": "",
                    "zip_code": "78701"
                },
                "requires_3ds": false
            }
        },
        "metadata": {
            "shop": "happy",
            "domain": "example.com"
        }
    },
    "redirect_url": "https://example.com/reutrn"
}

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 '/api/v1/payment' \
--header 'signature: *********' \
--header 'timestamp: 1743487706607' \
--header 'timezone: Asia/Shanghai' \
--header 'Content-Type: application/json; charset=UTF-8' \
--data-raw '{
    "merchant_id": "1",
    "env": {
        "terminal_type": "WEB",
        "client_ip": "143.45.4.222",
        "browser_info": {
            "user_agent": "Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/5.1)"
        }
    },
    "order": {
        "merchant_order_id": "99999999999",
        "shipping": {
            "shipping_name": {
                "first_name": "KING",
                "last_name": "MIsa",
                "full_name": "KING MIsa"
            },
            "shipping_address": {
                "country": "US",
                "state": "TX",
                "city": "Austin",
                "address1": "789 Oak Ave",
                "address2": "",
                "zip_code": "78701"
            },
            "email": "example@example.com",
            "phone": "+864-281-1794",
            "carrier": "USPS"
        },
        "payment_amount": {
            "currency": "USD",
            "value": 1000
        },
        "payment_method": {
            "payment_type": "CARD",
            "payment_data": {
                "country": "US",
                "card_number": "4111111111111111",
                "expiry_year": "30",
                "expiry_month": "03",
                "cvv": "737",
                "card_holder_name": {
                    "first_name": "KING",
                    "last_name": "MIsa",
                    "full_name": "KING MIsa"
                },
                "billing_address": {
                    "country": "US",
                    "state": "TX",
                    "city": "Austin",
                    "address1": "789 Oak Ave",
                    "address2": "",
                    "zip_code": "78701"
                },
                "requires_3ds": false
            }
        },
        "metadata": {
            "shop": "happy",
            "domain": "example.com"
        }
    },
    "redirect_url": "https://example.com/reutrn"
}'

Responses

🟢200成功
application/json
Body
data
object 
required
amount
integer 
required
The amount value expressed in the form of a positive integer in the smallest currency unit. For example, if the currency is USD and the amount is $1.00, set the value of this parameter to 100
currency
string 
required
Currency code, the value is a three digit currency code that follows the ISO 4217 standard.
id
string 
required
Dot System Unique Identifier
merchant_order_id
string 
required
The exclusive ID for identifying orders at the merchant end is assigned by the merchant who directly provides services or goods to the customer.
This field is used for displaying user consumption records and other further operations such as dispute tracking or handling customer complaints.
result
object 
required
next_action
object 
optional
Further action is required from the customer
Example
{
    "data": {
        "amount": 7506,
        "currency": "USD",
        "id": "pi_dyanFivWOgqbD43bZihyyl5F",
        "merchant_order_id": "2d187596-2aa1-43a5-b4b3-4a339cd61491",
        "result": {
            "result_code": "SUCCEEDED",
            "result_status": "S"
        }
    }
}
Modified at 2025-05-19 05:23:06
Previous
Overview
Next
Order inquiry
Built with