Yedpay

Description (Pre-Create Transaction)

Pre-Create Transactions for The gateways. (POST)

  • * This qr code has a lifetime of 24 hours

End Point

https://api.yedpay.com/v1/precreate/{{store_id}}

Variable

# Name Type Description
1 store_id String Store's ID

Request Header

# Key Value Description
1 Authorization Bearer {{access_token}} Login Token
2 Content-Type application/x-www-form-urlencoded x-www-form-urlencoded Format

Body

# Name Type Description
1 gateway_id id (1 - Alipay, 4 - Alipay Online, 8 - WeChatPay)
2 amount Numeric String Transaction AmountMaximum 2 decimal places
3 currency String Transaction currency
4 return_url String(255) Redirect url when transaction is done
*Mandatory in Alipay Online
5 notify_url String(255) Endpoint to notify the transaction
*Not needed in Alipay Global
*Mandatory for Alipay Online
*Only allowed HTTP and HTTPS ports (80 and 443) for notify_url
6 wallet String Alipay Wallet to create the transaction (CN, HK)
* Optional
* Default value - HK
* Only for Alipay Global and Alipay Online
7 extra_parameters String (optional) Be used for send information; information shall be written in the format of Json with and max lenght of 200 characters.
8 custom_id String (optional) Unique ID Send By Customer, only letters and numbers are accepted. Maximum length: 30
9 fixed_id String (optional) Id of the Fixed Code

Response

# Name Type Description
1 success Boolean Pre-Create Transaction Success or Fail
2 data Array Include transaction's information (id, user_id, company_id etc..)

Success Response - data

# Name Type Description
1 id Boolean Pre-Create Transaction Success or Fail
2 user_id String Id of the user who create the transaction
3 company_id String Id of the Company
4 store_id String Id of the Store
5 gateway_id Integer Id of the Gateway used to Generate the transaction
6 barcode_id String Id of the Barcode uset to generate the transaction (only apply for alipay Global)
7 status String Status of the transaction
8 amount Float Amount of the transaction
9 currency String Currency of the transaction
10 charge String Total of charge fee for the transaction
11 forex String Forex
12 paid_at String Date when the transaction was paid "YYYY-mm-dd h:i:s"
13 settled_at String Date when the transaction was settled "YYYY-mm-dd h:i:s"
14 transaction_id String Id of the transaction
15 payer String Email of the payer (Alipay Global)
16 extra_parameters String (optional) Custom information send by customer
17 custom_id String (optional) Custom Id Send By Customer
18 fixed_id String (optional) Id of the Fixed Code
19 refunded_at String Date when the transaction was Refunded "YYYY-mm-dd h:i:s"
20 created_at String Date when the transaction was created "YYYY-mm-dd h:i:s"
21 updated_at String Date when the was Updated "YYYY-mm-dd h:i:s"
22 expired_at String (optional) Date when the transaction Expire "YYYY-mm-dd h:i:s"
23 _links Array Include Checkout and QRCode Links:
- checkout
- qrcode
- (alipay online) checkout_wap
- (alipay online) qrcode_wap

Example Success Response

            {
                "success": true,
                "data": {
                    "id": "xXxXxXxXxXXxXx",
                    "user_id": "xXxXxXxXxXXxXx",
                    "company_id": "xXxXxXxXxXXxXx",
                    "store_id": "xXxXxXxXxXXxXx",
                    "gateway_id": 1,
                    "barcode_id": "xXxXxXxXxXXxXx",
                    "status": "pending",
                    "amount": "10.00",
                    "currency": "HKD",
                    "charge": 1.20,
                    "forex": 1,
                    "paid_at": "",
                    "settled_at": "",
                    "transaction_id": "251415799855257",
                    "payer": "",
                    "extra_parameters": "{\"old_macdonald\": \"had a farm\", \"chorus_1\": \"E I E I O\",  \"and_on_his_farm\": \"he had a cow\", \"chorus_2\": \"E I E I O\"}",
                    "custom_id": "XxXxXxXxXxXxXxXxXx",
                    "fixed_id": "",
                    "refunded_at": "",
                    "created_at": "2018-11-20 14:06:45",
                    "updated_at": "2018-11-20 14:06:45",
                    "expired_at": "2018-11-21 14:06:45",
                    "_links": [
                        {
                            "rel": "checkout",
                            "href": "https://qr.alipay.com/0ax03657vsedczja7yru8025"
                        },
                        {
                            "rel": "qrcode",
                            "href": "https://api.yedpay.com/v1/q/alipay/aHR0cHM6Ly9xci5hbGlwYXkuY29tL2JheDAzNjI3b3NlZHN6amE3eXJ1ODAyNA__"
                        }
                    ]
                }
            }
        

Error Response - data

# Name Type Description
1 success Boolean False
2 message String Message of the Error
3 status Integer Code Status

Example Error Response

            {
                "success": false,
                "message": "Internal Error",
                "status": 500
            }
        

*NOTE

The merchant could not attach parameters to the "return_url" and "notify_url", and hoping them be passed by Yedpay.
After program is executed, the page must print "success" (Alipay) or "" (Alipay Online) (without quote). If not, Yedpay server would keep re-sending notification, until over 20 minutes Generally, there are 4 notifications within 5 minutes Frequency.
Make sure the Notification Page notify_url is absolutely blank, only with "success" text in the body, without space, html tag, or any error message threw from the program system.
Only allowed HTTP and HTTPS ports (80 and 443) for notify_url

Example data in Return Endpoint

            https://example.url/endpoint?id=xXxXxXxXxXXxXx&user_id=xXxXxXxXxXXxXx&company_id=xXxXxXxXxXXxXx&store_id=xXxXxXxXxXXxXx&gateway_id=1&barcode_id=&status=paid&amount=10.00¤cy=HKD&charge=1.20&forex=1&paid_at=2018-11-20+14%3A45%3A44&settled_at=&transaction_id=251415799855257&payer=&refunded_at=&created_at=2018-11-20+14%3A44%3A44&updated_at=2018-11-20+14%3A45%3A44
        

v1.22.0-20190710 © The Payment Cards Group Limited. All rights reserved.