1.1 Documentation description
The API interface interacts through HTTPS, and the entire API adopts a Restful structure. API calls are authorized through OAuth2. The data organization form of request and response adopts JSON format.
1.2 Instructions
First, you need to get the "Client ID" and "Client Secret" data of the merchant number from your account manager as OAuth2 authorization authentication verification parameters.
1.3 Interface address
https://openapi. omoney.com
1.4 Headers
Every time you submit an API request, you need to set the message header information, including the signature information. The following is a list of header information parameters.
parameter |
Is it required? |
illustrate |
Accept |
yes |
application/json |
Content-Type |
yes |
application/json, to obtain the access_token interface, you need to pass the value application/x-www-form- urlencoded |
1.5 Merchant authorization
Use OAuth2 authorization. The merchant
initiates a POST request to the payment platform to obtain access_token . The request address
is: /v1/oauth/token?grant_type=client_credentials&scope=
write,read
Header parameters
parameter |
Is it required? |
illustrate |
Authorization |
yes |
The value is "Basic "+base64(Client ID:Client Secret) |
Accept |
yes |
application/json |
Content-Type |
yes |
application/x-www-form- urlencoded |
The response data format is as follows:
{
" access_token " : "653633b2-8287-47b6-a7e4-40ec252fe9a8",
" token_type " : "bearer",
" expires_in " : 43035,
"scope " : " write,read "
}
Chapter 2 Merchant Standard Interface
2.1 Collection
The merchant system sends it in POST mode and uses UTF8 encoding format.
2.1.1 Data interaction
2.1.2 Request entry
/v1/paymentDirect
2.1.3 Header
parameter |
Is it required? |
illustrate |
Authorization |
yes |
The value is "Bearer " + access_token |
Accept |
yes |
application/json |
Content-Type |
yes |
application/json |
2.1.4 Payment request parameters
Request data description
parameter |
The maximum length |
Is it required? |
illustrate |
order_id |
50 |
yes |
Merchant order number. Note that the order number is a unique identifier and cannot be repeated. |
payment_method |
50 |
yes |
Payment method code, EPMB |
amount |
13,2 |
yes |
Amount, rounded to two decimal places |
currency |
3 |
yes |
Currency, such as: CNY, USD, EUR, etc. |
request_type |
50 |
yes |
Device identification, WEB, WAP, SDK |
description |
255 |
yes |
Order description, such as: product title/transaction title/order title/order keyword, etc. Note: Special characters such as /, =, &, etc. cannot be used. |
return_url |
255 |
yes |
Return to merchant address after payment is completed |
notify_url |
255 |
yes |
After the customer's payment is completed, the payment platform sends the payment result to the merchant, and the merchant system is responsible for receiving the notification URL. |
website |
255 |
yes |
Merchant site, format: http://www.mysite.com |
cardnum |
5 0 |
yes |
credit card number |
cardyear |
4 |
yes |
Credit card validity year, such as 2 022 |
cardmonth |
2 |
yes |
Credit card valid month, such as 0 9 |
cardcvv |
4 |
yes |
Credit card C VV 3-4 digits |
source |
|
yes |
Customer information, see customer information form for details |
2.1.5 Customer information (source)
parameter |
The maximum length |
Is it required? |
illustrate |
client_ip |
20 |
yes |
The IP of the customer when paying |
first_name |
64 |
yes |
Customer name |
middle_name |
64 |
no |
Customer middle name |
last_name |
64 |
yes |
Customer last name |
country |
3 |
yes |
The abbreviation of the country where the customer is located, such as: CN, US |
state |
50 |
yes |
Must be the abbreviation of the state/province where the customer's country is located, such as: BEIJING,FL (Credit card payment CA, US is required, other countries can leave it blank) |
city |
50 |
yes |
Customer's city |
zip |
10 |
yes |
(CA and US are required for credit card payment, and can be left blank for other countries) The postal code of the customer’s location, the US and CA postal code formats are as follows: US: [5 digits]-[4 digits], for example: 12345-6789 CA:[letter][number][letter][space][number][letter][number], for example: A1B 2C3 |
|
126 |
yes |
Customer email |
address1 |
255 |
yes |
Customer shipping address |
address2 |
255 |
no |
Customer detailed address |
phone _ |
50 |
yes |
Customer phone number |
f _ |
11 |
no |
Brazilian customer tax receipt, required for EBANX payment, 11 digits |
The merchant initiates an HTTP POST request to the payment platform API. The data format is as follows:
{
"return_ url ":"http://www.mysite.com/return_url",
"notify_ url ":"http://www.mysite.com/notify_url",
"payment_method":" xxxx ",
" request_type": "WEB ",
"order_id":"100096247512",
"amount":"1.00",
" currency":"CNY ",
"description":"Product title",
" website": "http://www.mysite.com ",
"source ":{
" first_name": "Chris ",
" middle_name ":"",
" last_name": "Ma ",
" country":"CN ",
"state":" BEIJING ",
"city":" BEIJING ",
"zip":"400000",
"email":"test@test.com",
"phone":"86-13800000000",
"address1":"32nd Floor, Zhongwai SOHO Building, Chaoyang District, Beijing",
"address2":"Area C",
" client_ip ":"113.204.136.66",
" cpf ":""
}
}
2.1.6 response
Response data description
parameter |
The maximum length |
Is it required? |
illustrate |
order_id |
50 |
yes |
Merchant order number |
payment_id |
50 |
yes |
Payment platform serial number |
transaction_id |
50 |
yes |
Payment platform order number |
payment_method |
50 |
yes |
payment method |
amount |
13,2 |
yes |
Amount, rounded to two decimal places |
currency |
3 |
yes |
Currency, CNY, USD, EUR, etc. |
request_type |
50 |
yes |
Device identification, WEB, WAP, SDK |
description |
255 |
yes |
Order description |
status |
50 |
yes |
Transaction status, SUCCESS is successful, FAIL is failed, WAIT_PAY is waiting for payment , PROCESSING is being processed, Redirect3DS is waiting for 3D authentication |
remarks |
50 |
yes |
Reason for transaction failure |
error_code |
100 |
yes |
error code |
create_time |
|
yes |
creation time |
update_time |
|
yes |
Update time |
pay_url |
|
no |
Payment processing link , redirected by the client to complete payment |
After the merchant initiates a request to the payment platform API, the merchant's payment data is returned synchronously in the following format:
{
" payment_id ": "65df5a6791a211e583461c6f65f84b6d",
" transaction_id ": "72c17f2d91a211e583461c6f65f84b6d",
" create_time ": "2015-07-07T08:05:38Z",
" update_time ": "2015-07-07T08:05:38Z",
" payment_method ": " xxxx ",
"status": "SUCCESS",
" error_code ": "",
"remarks": "",
" order_id ": " 100096247512",
"description": "Product title",
"amount": "1.00",
"currency": "CNY",
" request_type ": "WEB"
"pay_ url ":"https://....."
}
2.1.7 Payment order inquiry
The request entry is: /v1/payment/{ payment_id } or /v1/payment/order/{ order_ id }, the request method is GET, payment_id is the payment serial number returned by the platform, order_ id is the merchant order number, and the data is returned The format is the same as the payment response data format.
2.1.8 Payment result notification
parameter |
The maximum length |
Is it required? |
illustrate |
payment_id |
50 |
yes |
Payment platform serial number |
transaction_id |
50 |
yes |
Payment platform order number |
order_id |
50 |
yes |
Merchant order number |
status |
50 |
yes |
Transaction status, SUCCESS is successful, FAIL is failed, WAIT_PAY is waiting for payment, PROCESSING is being processed |
error_message |
100 |
yes |
Reason for transaction failure |
payment_method |
50 |
yes |
payment method |
the notify_url specified by the merchant . The data format is as follows:
{
"transaction_id":"72c17f2d91a211e583461c6f65f84b6d",
" order_id " : "100096247512",
" payment_id " : "65df5a6791a211e583461c6f65f84b6d",
"payment_method":" xxxx ",
" error_message ":"",
"status " : " SUCCESS "
}
2.2 Refund
The merchant refunds the specified order and sends it in POST mode, using UTF8 encoding format.
2.2.1Data interaction
2.2.2 Request entry
/v1/refund/{ order_id }, order_id is the
merchant’s payment order number
2.2.3 Header
parameter |
Is it required? |
illustrate |
Authorization |
yes |
The value is "Bearer " + access_token |
Accept |
yes |
application/json |
Content-Type |
yes |
application/json |
2.2.4 Refund request
parameter |
The maximum length |
Is it required ? |
illustrate |
refund_order_id |
50 |
yes |
Merchant refund order number |
amount |
13,2 |
yes |
Amount, rounded to two decimal places |
currency |
3 |
yes |
Currency, CNY, USD , EUR , etc. |
notify_url |
255 |
yes |
After the refund is completed, the payment platform sends the payment result to the merchant, and the merchant system is responsible for receiving the notification URL . |
Data Format
{
"amount":"1.00",
" currency":"CNY ",
"refund_order_id":"be8578eb-91a0-11e5-8346-1c6f65f84b6d",
"notify_ url ":"http://www.mysite.com/refund_notify_url"
}
2.2.5Refund response
parameter |
The maximum length |
Is it required ? |
illustrate |
refund_id |
50 |
yes |
Payment platform refund number |
refund_order_id |
50 |
yes |
Merchant refund order number |
order_id _ _ |
50 |
yes |
Merchant payment order number |
amount |
13,2 |
yes |
Amount, rounded to two decimal places |
currency |
3 |
yes |
Currency, CNY, USD , EUR , etc. |
notify_url |
255 |
yes |
After the refund is completed, the payment platform sends the payment result to the merchant, and the merchant system is responsible for receiving the notification URL . |
status |
50 |
yes |
Refund status , SUCCESS is successful , FAIL is failed, WAIT is waiting for refund. |
create_time |
|
yes |
creation time |
update_time |
|
yes |
Update time |
links |
|
yes |
Action link |
Data Format
{
" refund_id ": "2c04080b91a211e583461c6f65f84b6d",
" create_time ": "2015-07-07T09:10:52Z",
" update_time ": "2015-07-07T09:10:52Z",
"amount": "1.00",
"currency": "CNY",
" order_id ": "db9e9e6b-918e-11e5-8346-1c6f65f84b6d",
" refund_order_id ": " e8578eb-91a0-11e5-8346-1c6f65f84b6d ",
"links":
[
{
" href ": "http: //.xxx.com /v1/refund/2c04080b91a211e583461c6f65f84b6d",
" rel ": "self",
"method": "GET"
}
],
"status": "WAIT",
" notify_url ": " http://www.mysite.com/refund_notify_url "
}
2.2.6 Refund order inquiry
The request entry is: /v1/refund/{ refund _id}, the request method is GET , refund _id is the
refund number returned by the payment platform , and the return data format is the same as the
refund response data format .
2.2.7 Refund Notice
After the refund is completed, the payment platform initiates an HTTP POST request to the notify_url specified by the merchant . The data format is the same as the refund response data format .