Skip to content

Create Transaction

This operation is to create transaction at bank side.

Implemented by: Partner bank · Called by: EDC App / Web

Operation

Description Value
URL https://{domain}/transaction/create
Method POST

Request Payload

Field Type Required Remark
merchant_id string Yes Merchant ID at bank side
transaction_id string Yes Transaction reference number from EDC
transaction_amount decimal Yes Amount to pay
transaction_currency string Yes Currency code (ISO 4217)
transaction_description string No Description
bill_type string Yes freeze or utility
return_url string Yes The URL that bank will redirect to after payment completed
callback_url string Yes The URL that bank will send transaction details to EDC side to confirm the transaction (webhook)
hash string Yes Hash calculation field (bank provide hash algorithm)
details json list No List of each consumer details and amount (Max Length for this field size)

Request Payload of "details"

Field Type Required Remark
company_code string Yes Company code
company_name string Yes Company name
consumer_code string Yes Consumer code
consumer_name string Yes Consumer name
consumer_name_latin string No Consumer name in Latin
amount decimal Yes Amount to pay of the consumer

Example Request Payload

{
    "merchant_id": "EDC",
    "transaction_id": "174952172035635",
    "transaction_amount": 100000.00,
    "transaction_currency": "KHR",
    "transaction_description": "",
    "bill_type": "utility",
    "return_url": "https://example.com/transaction/complete",
    "callback_url": "https://example.com/transaction/callback",
    "hash": "4be8fc1f50834aacb5c46005501cda8b...",
    "details": [
        {
            "company_code": "EDC-BTB",
            "company_name": "អគ្គិសនីបាត់ដំបង",
            "consumer_code": "80581211",
            "consumer_name": "លោក ជា សំណាង",
            "consumer_name_latin": "Mr. Chea Samnang",
            "amount": 30000.00
        },
        {
            "company_code": "EDC",
            "company_name": "អគ្គិសនីកម្ពុជា",
            "consumer_code": "90481599",
            "consumer_name": "លោក លីសីហា",
            "consumer_name_latin": "Mr. Ly Seyha",
            "amount": 70000.00
        }
    ]
}

Response Payload

Field Type Remark
code string Response code
message string Response message
data json Data object

Response Payload for "data"

Field Type Remark
web_payment_url string The URL to call web payment
mobile_deep_link string The deep link to call bank app

Example Response Payload

{
    "code": "000",
    "message": "",
    "data": {
        "web_payment_url": "https://bankdomain/payment/....",
        "mobile_deep_link": "bank://..."
    }
}