iMerchant Sandbox: https://www.sandbox-checkout.imerchant.online/
iMerchant Production: https://www.checkout.imerchant.online/
Directly initiate payment from the merchant backend, and return the payment result after the payment is completed
Protocol parameter
variable name | required | field type |
---|---|---|
service_version | no | String(8) |
sign | yes | String(32) |
Request Body
bid string [32] required
bid is the account number generated by iMerchant for the merchant. It is a string of 32 bits long to uniquely identify the merchant generated by the system. It comes after the URL as a parameter url?bid=xxxxxx to visit the payment page
Example: py_live_gRDxmTUWdWrIzqsITuLzke9T
attach string [127]
attached data, which to be returned by it’s original form
out_trade_no string [32] required
It is a string of number to uniquely distribute the id to a specific order, which the id is created by merchants
amount Int required
total amount to be charged for an order. the units are cents, and in some areas the units are yuan. for details please refer to the ‘support currency’ chapter
currency string(3) required
must be the currency of the given range
spbill_create_ip string(64) required
buyer’s ip address for this transaction
email string(64) required
the buyer’s email address
body string(127) required
product name associated with the transaction
card string required
AES (Rijndael-128, CBC) encryption string with the same key as the signature key.The original format is a JSON string
{
"card_number":"4242424242424242",
"expire_year":"19",
"expire_month":"12",
"cvc":"123",
"name":"xxx",
"address_line1":"xxx",
"address_line2":"xxx",
"address_city":"xxx",
"address_state":"xxx",
"address_zip":"xxx",
"address_country":"xxx"
}
shipping string required
base64_encode(json_encode(str))
{
"first_name":"dsgerg",
"last_name":"eererger",
"line1":"address_line1 ",
"line2":"address_line2",
"city":"new york",
"state":"new york",
"country_code":"us",
"postal_code":"10022"
}
note: if the category operated by the merchant is required to be uploaded in the entity category, the “Shipping” can be omitted in the virtual category
item string
base64_encode(json_encode(str))
{
"name": "t-shirt",
"description": "i am description",
"unit_price": 10,
"qty": 2,
"Item_detail_link": ,
"upc": "324832";
"sku": "7394872394",
"brand": "iMerchant",
"images": {
"images1": "https://ae01.alicdn.com/kf/Hf688fae5f35f47ffb13140410fc2e82cU/New-Summer-Letter-Print-Casual-Women-s-Two-Piece-Outfits-Set-Tracksuit-Shirt-Sexy-Top-Biker.jpg",
"images2": "https://ae01.alicdn.com/kf/H88c8676fde5c42049bbad2250bbbe433O/New-Summer-Letter-Print-Casual-Women-s-Two-Piece-Outfits-Set-Tracksuit-Shirt-Sexy-Top-Biker.jpg"
},
"attributes": {
"color": "Yellow",
"size": "XXXXXL"
}
}
phone string rquired
the buyer’s phone address, cannot contain English letters and Chinese characters
tax Int required
the amount designated as a shipping fee. the unit is cents, and in some areas the unit is yuan
note: for details please refer to the ‘support currency’ chapter. the currency is remain the same as the original currency
shipping_charge Int required
the amount designated as a shipping fee. the units are cents, and in some areas the units are yuan. for details please refer to the ‘support currency’ chapter
merchant_is_capture Int
the value is 0 by default
example: 0: Charge; 1: Pre-authorization
Defult value: ‘0’
note: To set the value to ‘1’, merchants have to get approval from iMerchant
verify_3d string required
Whether to conduct 3DS secure check. Default value: ‘yes’
example:"yes", "no"
pay_source_site string(127) required
The site where the user shops
suffix string(18)
Dynamic billing suffix which should contain at least one letter; Cannot contain special characters
Minimum character: 2
Maximum character: 18
Paramater details
- shipping
first_name string [128] required
Recipient’s first name
last_name string [128] required
Recipient’s last name
line1 string [1000] required
The first line of the address
Fields that start with address_line provide the address’s most specific details, like street number, street name, and building name. They do not provide less specific details like city, state/province, or country (these details are provided in other fields)
e.g.: street, PO Box, or company name
line2 string [1000]
The second line of the address, if any
e.g.: apartment, suite, unit, or building
city string [50] required
The address’s country
e.g.: city, district, suburb, town, or village
state string [20] required
A civil entity within the address’s country. In the US, this is the state
e.g.: state, county, province, or region
postal_code string [20] required
The address’s postal code
country_code string [5] required
The address’s country, in ISO 3166-1-alpha-2 format
- item
name string required
Product name, it’s an optional additional information
description string [500] required
Product description, it’s an optional additional information
unit_price Int required
Product unit price, it’s an optional additional information
qty Int required
Number of items
image array required
Items’ image. Max url: 8
attribute string required
Item’s attribute
e.g.: color, length, and weight
}
"color": "yellow"
"size": "XL",
...
}
Max numbers of attribute: 5
Item_detail_link string
A link to be directed to the detail information of the item
upc string
A barcode symbology that is widely used in the United States, Canada, Europe, Australia, New Zealand, and other countries for tracking trade items in stores
example: "324832"
sku string
A scannable bar code, most often seen printed on product labels in a retail store. The label allows vendors to automatically track the movement of inventory
example: "7394872394"
brand string
a type of product manufactured by the company under a particular name
example: "iMerchant"