Yedpay

Description (Create Transaction)

Create Transactions for The gateways. (POST)

  • * Alipay, VISA and WeChatPay

End Point

https://api.yedpay.com/v1/transactions/{{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_code String (1_1 - Alipay, 7_1 - VISA, 7_2 - MasterCard, 8_1 - WeChatPay)
2 amount Numeric String Transaction Amount Maximum 2 decimal places
3 currency String Transaction currency
4 token Numeric String Token Generated in Device of Client (alipay app)
5 extra_parameters String (optional) Be used for send custom information; information shall be written in the format of Json with and max lenght of 200 characters, Nested JSON is not supported.
6 custom_id String(30) (optional) Unique ID Send By Customer, only letters and numbers are accepted. Maximum length: 30
7 transaction_id String (optional) Unique Transaction ID received from Initializing Transaction Response

Response

# Name Type Description
1 success Boolean 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 String Id of the transaction
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 gateway_sub_id Integer Id of gateway subtype, default 1
7 gateway_sub_name String Name of the gateway subtype
8 gateway_code String {{gateway_id}}_{{gateway_sub_id}}
9 barcode_id String Id of the Barcode uset to generate the transaction (only apply for alipay Global)
10 status String Status of the transaction
11 amount Float Amount of the transaction
12 currency String Currency of the transaction
13 charge String Total of charge fee for the transaction
14 forex String Forex
15 paid_at String Date when the transaction was paid "YYYY-mm-dd h:i:s"
16 settled_at String Date when the transaction was settled "YYYY-mm-dd h:i:s"
17 transaction_id String Unique transaction identifier of Yedpay
18 payer String Email of the payer (Alipay Global)
19 extra_parameters String (optional) Custom information send by customer
20 custom_id String (optional) Custom Id Send By Customer
21 fixed_id String (optional) Id of the Fixed Code
22 refunded_at String Date when the transaction was Refunded "YYYY-mm-dd h:i:s"
23 created_at String Date when the transaction was created "YYYY-mm-dd h:i:s"
24 updated_at String Date when the was Updated "YYYY-mm-dd h:i:s"
25 expired_at String (optional) Date when the transaction Expire "YYYY-mm-dd h:i:s"

Example Success Response

            {
                "success": true,
                "data": {
                    "id": "xXxXxXxXxXXxXx",
                    "user_id": "xXxXxXxXxXXxXx",
                    "company_id": "xXxXxXxXxXXxXx",
                    "store_id": "xXxXxXxXxXXxXx",
                    "gateway_id": 1,
                    "gateway_sub_id": 1,
                    "gateway_sub_name": "xXxXxX",
                    "gateway_code": "1_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"
                }
            }
        

*NOTE

The status of the transaction will be pending if the ALIPAY USER don't complete the transaction.
The transaction will be closed after 40 seconds if the ALIPAY USER don't finish the payment of the transaction.
Can be requested the status of the transaction any time using https://api.yedpay.com/v1/transactions/{{id_transaction}}
*id_transaction is the id of the response.

Error Response - data

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

* Possible of Error Response

# Status Code Error Message Description
1 500 server_error Internal Error
2 400 TRADE_HAS_CLOSE Corresponding trade is closed, is not allowed for current operation.
3 400 BUYER_BALANCE_NOT_ENOUGH The buyer’s Alipay account do not have enough balance for current operation.
4 400 TOTAL_FEE_EXCEED Trade amount is exceed the limit.
5 400 BUYER_BANKCARD_BALANCE_NOT_ENOUGH The buyer’s bank account do not have enough balance for current operation.
6 400 PAYMENT_FAIL The transaction is failed.
7 400 MOBILE_PAYMENT_SWITCH_OFF The buyer switch off her/his mobile pay function, so we cannot do the operation.
8 400 BUYER_PAYMENT_AMOUNT_DAY_LIMIT_ERROR Total trade amount for the buyer is exceed user daily max-amount limit.
9 400 BUYER_PAYMENT_AMOUNT_MONTH_LIMIT_ERROR Total trade amount for the buyer is exceed user monthly max-amount limit.
10 400 ERROR_BALANCE_PAYMENT_DISABLE The buyer switch off her/his balance payment function, so we cannot do the operation.
11 400 BEYOND_PAY_RESTRICTION The payment limit exceeded.
12 400 Default Error Message The transaction is failed. Please try again.
13 400 Query Exception Query Exception. Please try again.

Example Error Response

            Response for BUYER_BALANCE_NOT_ENOUGH:
            {
                "success": false,
                "message": "The buyer’s Alipay account do not have enough balance for current operation.",
                "status": 400
            }
        
            Response for Internal Error:
            {
                "success": false,
                "message": "Internal Error",
                "status": 500
            }
        

v1.28.0-20190905 © The Payment Cards Group Limited. All rights reserved.