NAV
bash javascript php

Info

Welcome to the generated API reference.

Welcome to Moolahgo API v2.0

What's New

12 Apr 2020

21 Feb 2020

Introduction

The API allows third party software/system to integrate into Moolahgo system to perform transaction and data updates. If you have many transactions frequently, it would be desirable to write a script to automate the process and create the transaction into our system.

Suggested Workflow

Below is the suggested workflow to create transaction in Moolahgo:

Request Sandbox

If you are interested in automating your workflow with our API, you can request for sandbox access by email to us at sales@moolahgo.com. Please include the following details in your email:

Alternatively, you can choose to connect with us through our website contact info.

Authentication

All authentication endpoints are access through https://identity.moolahgo.com/

Login

This endpoint login to Moolahgo system. ( https://identity.moolahgo.com/login )

NOTE: URL parameter passing is deprecated and will be removed in future release. Please pass parameters through HTTP body content.

Login using your username and password to obtain a transactional token. The token is to be used as bearer token in all other API request.

Example request:

curl -X POST "/login" \
    -H "X-API-KEY: please-request-key" \
    -H "Content-Type: application/json" \
    -d '{"username":"joe","password":"12345","userpin":"12345"}'
const url = new URL("/login");

let headers = {
    "X-API-KEY": "please-request-key",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "username": "joe",
    "password": "12345",
    "userpin": "12345"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post("/login", [
    'headers' => [
            "X-API-KEY" => "please-request-key",
            "Content-Type" => "application/json",
        ],
    'json' => [
            "username" => "joe",
            "password" => "12345",
            "userpin" => "12345",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "token": "tokenXXXX",
    "otprequired": 0,
    "refreshtoken": "refreshXXXX",
    "status": "Active",
    "group": {
        "id": "L1",
        "detail": {
            "sgd": {
                "daily": {
                    "default": {
                        "max": 15000
                    },
                    "wallettopup": {
                        "max": 15000
                    },
                    "send": {
                        "max": 15000
                    },
                    "convert": {
                        "max": 15000
                    },
                    "p2p": {
                        "max": 15000
                    },
                    "walletmerchantpayment": {
                        "max": 15000
                    }
                },
                "monthly": {
                    "default": {
                        "max": 15000
                    }
                },
                "annually": {
                    "default": {
                        "max": 15000
                    }
                },
                "walletlimit": 4000000
            }
        }
    }
}

HTTP Request

POST /login

Body Parameters

Parameter Type Status Description
username string required User name use to login.
password string optional Password use to login, either this or PIN is required.
userpin string optional PIN to login, either this or password is required.

Token

This endpoint exchange a refresh token with a new access token. ( https://identity.moolahgo.com/token )

Obtain a new access token using an existing refresh token.

Example request:

curl -X POST "/token" \
    -H "X-API-KEY: please-request-key" \
    -H "Content-Type: application/json" \
    -d '{"refresh_token":"xxxxxxxxxxxxx"}'
const url = new URL("/token");

let headers = {
    "X-API-KEY": "please-request-key",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "refresh_token": "xxxxxxxxxxxxx"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post("/token", [
    'headers' => [
            "X-API-KEY" => "please-request-key",
            "Content-Type" => "application/json",
        ],
    'json' => [
            "refresh_token" => "xxxxxxxxxxxxx",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "token": "tokenXXXX",
    "status": "Active",
    "group": {
        "id": "L1",
        "detail": {
            "sgd": {
                "daily": {
                    "default": {
                        "max": 15000
                    },
                    "wallettopup": {
                        "max": 15000
                    },
                    "send": {
                        "max": 15000
                    },
                    "convert": {
                        "max": 15000
                    },
                    "p2p": {
                        "max": 15000
                    },
                    "walletmerchantpayment": {
                        "max": 15000
                    }
                },
                "monthly": {
                    "default": {
                        "max": 15000
                    }
                },
                "annually": {
                    "default": {
                        "max": 15000
                    }
                },
                "walletlimit": 4000000
            }
        }
    }
}

HTTP Request

POST /token

Body Parameters

Parameter Type Status Description
refresh_token string required A valid refresh token.

Logout


Requires authentication This end point logout and invalidate the token.

Example request:

curl -X POST "/logout" \
    -H "AUTHORIZATION: Bearer tokenXXXX" \
    -H "X-API-KEY: please-request-key"
const url = new URL("/logout");

let headers = {
    "AUTHORIZATION": "Bearer tokenXXXX",
    "X-API-KEY": "please-request-key",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post("/logout", [
    'headers' => [
            "AUTHORIZATION" => "Bearer tokenXXXX",
            "X-API-KEY" => "please-request-key",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true
}

Example response (401):

{
    "error": "not authorized"
}

HTTP Request

POST /logout

Compliance

All compliance endpoints are access through https://compliance.moolahgo.com/

Get group settings

This endpoint get group settings in Moolahgo system. ( https://compliance.moolahgo.com/group )

Example request:

curl -X GET -G "/group/L0" \
    -H "AUTHORIZATION: Bearer tokenXXXX" \
    -H "X-API-KEY: please-request-key"
const url = new URL("/group/L0");

let headers = {
    "AUTHORIZATION": "Bearer tokenXXXX",
    "X-API-KEY": "please-request-key",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get("/group/L0", [
    'headers' => [
            "AUTHORIZATION" => "Bearer tokenXXXX",
            "X-API-KEY" => "please-request-key",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "result": {
        "L0": {
            "sgd": {
                "daily": {
                    "default": {
                        "max": 15000
                    },
                    "wallettopup": {
                        "max": 15000
                    },
                    "send": {
                        "max": 15000
                    },
                    "convert": {
                        "max": 15000
                    },
                    "p2p": {
                        "max": 15000
                    },
                    "walletmerchantpayment": {
                        "max": 15000
                    }
                },
                "monthly": {
                    "default": {
                        "max": 15000
                    }
                },
                "annually": {
                    "default": {
                        "max": 15000
                    }
                },
                "walletlimit": 4000000
            }
        }
    }
}

Example response (401):

{
    "error": "not authorized"
}

HTTP Request

GET /group/{groupID}

Market Data

All market data endpoints are access through https://rate.moolahgo.com/

Get exchange rate


Requires authentication This end point get the exchange rate to be used in the transaction.

Example request:

curl -X GET -G "/rate/SGD/IDR?sourcecurrency=SGD&destinationcurrency=CNY" \
    -H "AUTHORIZATION: Bearer tokenXXXX" \
    -H "X-API-KEY: please-request-key"
const url = new URL("/rate/SGD/IDR");

    let params = {
            "sourcecurrency": "SGD",
            "destinationcurrency": "CNY",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "AUTHORIZATION": "Bearer tokenXXXX",
    "X-API-KEY": "please-request-key",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get("/rate/SGD/IDR", [
    'headers' => [
            "AUTHORIZATION" => "Bearer tokenXXXX",
            "X-API-KEY" => "please-request-key",
        ],
    'query' => [
            "sourcecurrency" => "SGD",
            "destinationcurrency" => "CNY",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "rate": 5.0581766870575
}

Example response (401):

{
    "error": "not authorized"
}

HTTP Request

GET /rate/{source}/{destination}

Query Parameters

Parameter Status Description
sourcecurrency required Source currency code.
destinationcurrency required Destination currency code.

Recipient Management

All recipient management endpoints are access through https://transact.moolahgo.com/

Get a Recipient or all recipients


Requires authentication This endpoint get recipient(s) of current user. ( https://transact.moolahgo.com/recipient )

Example request:

curl -X GET -G "/recipient/1?id=123" \
    -H "AUTHORIZATION: Bearer tokenXXXX" \
    -H "X-API-KEY: please-request-key"
const url = new URL("/recipient/1");

    let params = {
            "id": "123",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "AUTHORIZATION": "Bearer tokenXXXX",
    "X-API-KEY": "please-request-key",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get("/recipient/1", [
    'headers' => [
            "AUTHORIZATION" => "Bearer tokenXXXX",
            "X-API-KEY" => "please-request-key",
        ],
    'query' => [
            "id" => "123",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "recipients": [
        {
            "id": 1,
            "userid": 1,
            "country": "Singapore",
            "city": "Singapore",
            "name": "Moolah Go",
            "bank": "DBS",
            "branch": "Central",
            "accountno": "0012345678",
            "email": "joe@moolahgo.com",
            "contact": "12345678",
            "contactcountrycode": "65",
            "createtime": "2018-01-25 18:00:01",
            "lastupdated": "2018-01-25 18:00:01",
            "lastused": null,
            "status": "active",
            "swift": null
        }
    ]
}

Example response (401):

{
    "error": "not authorized"
}

HTTP Request

GET /recipient/{id}

Query Parameters

Parameter Status Description
id required The recipient id or 'all' to get all recipient (limit at 50).

Create a new recipient


Requires authentication This end point create a new recipient and return the recipient id. ( https://transact.moolahgo.com/recipient )

Example request:

curl -X POST "/recipient" \
    -H "AUTHORIZATION: Bearer tokenXXXX" \
    -H "X-API-KEY: please-request-key" \
    -H "Content-Type: application/json" \
    -d '{"acctname":"John","acctlastname":"Doe","acctno":"123456789","bankname":"Bank Central Asia","branch":"Jakarta Pusat","bankcity":"Jakarta","country":"Indonesia","swift":"CENAIDJAXXX","recemail":"john.doe@example.com","phonenumber":"123456789","address":"100 Street 1"}'
const url = new URL("/recipient");

let headers = {
    "AUTHORIZATION": "Bearer tokenXXXX",
    "X-API-KEY": "please-request-key",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "acctname": "John",
    "acctlastname": "Doe",
    "acctno": "123456789",
    "bankname": "Bank Central Asia",
    "branch": "Jakarta Pusat",
    "bankcity": "Jakarta",
    "country": "Indonesia",
    "swift": "CENAIDJAXXX",
    "recemail": "john.doe@example.com",
    "phonenumber": "123456789",
    "address": "100 Street 1"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post("/recipient", [
    'headers' => [
            "AUTHORIZATION" => "Bearer tokenXXXX",
            "X-API-KEY" => "please-request-key",
            "Content-Type" => "application/json",
        ],
    'json' => [
            "acctname" => "John",
            "acctlastname" => "Doe",
            "acctno" => "123456789",
            "bankname" => "Bank Central Asia",
            "branch" => "Jakarta Pusat",
            "bankcity" => "Jakarta",
            "country" => "Indonesia",
            "swift" => "CENAIDJAXXX",
            "recemail" => "john.doe@example.com",
            "phonenumber" => "123456789",
            "address" => "100 Street 1",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "recipientid": "86"
}

Example response (401):

{
    "error": "not authorized"
}

HTTP Request

POST /recipient

Body Parameters

Parameter Type Status Description
acctname String required Account holder first name.
acctlastname String optional Last name of recipient.
acctno String required Account number of recipient.
bankname String required Name of recipient bank.
branch String required Branch of the bank.
bankcity String optional City of the bank.
country String required Destination country of transaction.
swift String optional Bank swift code.
recemail String optional Email of recipient.
phonenumber String optional Phone number of recipient.
address String optional Address of recipient.

Update a Recipient


Requires authentication This endpoint update a recipient. ( https://transact.moolahgo.com/recipient )

Example request:

curl -X PUT "/recipient/1?id=123" \
    -H "AUTHORIZATION: Bearer tokenXXXX" \
    -H "X-API-KEY: please-request-key" \
    -H "Content-Type: application/json" \
    -d '{"acctname":"John","acctlastname":"Doe","acctno":"123456789","bankname":"Bank Central Asia","branch":"Jakarta Pusat","bankcity":"Jakarta","country":"Indonesia","swift":"CENAIDJAXXX","recemail":"john.doe@example.com","phonenumber":"123456789","address":"100 Street 1"}'
const url = new URL("/recipient/1");

    let params = {
            "id": "123",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "AUTHORIZATION": "Bearer tokenXXXX",
    "X-API-KEY": "please-request-key",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "acctname": "John",
    "acctlastname": "Doe",
    "acctno": "123456789",
    "bankname": "Bank Central Asia",
    "branch": "Jakarta Pusat",
    "bankcity": "Jakarta",
    "country": "Indonesia",
    "swift": "CENAIDJAXXX",
    "recemail": "john.doe@example.com",
    "phonenumber": "123456789",
    "address": "100 Street 1"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put("/recipient/1", [
    'headers' => [
            "AUTHORIZATION" => "Bearer tokenXXXX",
            "X-API-KEY" => "please-request-key",
            "Content-Type" => "application/json",
        ],
    'query' => [
            "id" => "123",
        ],
    'json' => [
            "acctname" => "John",
            "acctlastname" => "Doe",
            "acctno" => "123456789",
            "bankname" => "Bank Central Asia",
            "branch" => "Jakarta Pusat",
            "bankcity" => "Jakarta",
            "country" => "Indonesia",
            "swift" => "CENAIDJAXXX",
            "recemail" => "john.doe@example.com",
            "phonenumber" => "123456789",
            "address" => "100 Street 1",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "recipientid": "86"
}

Example response (401):

{
    "error": "not authorized"
}

HTTP Request

PUT /recipient/{id}

Body Parameters

Parameter Type Status Description
acctname String required Account holder first name.
acctlastname String optional Last name of recipient.
acctno String required Account number of recipient.
bankname String required Name of recipient bank.
branch String required Branch of the bank.
bankcity String optional City of the bank.
country String required Destination country of transaction.
swift String optional Bank swift code.
recemail String optional Email of recipient.
phonenumber String optional Phone number of recipient.
address String optional Address of recipient.

Query Parameters

Parameter Status Description
id required The recipient id.

Transaction Management

All transaction management endpoints are access through https://transact.moolahgo.com/

Get a Quotation


Requires authentication This endpoint gets a quotation for a transaction. ( https://transact.moolahgo.com/listing/quote )

Example request:

curl -X GET -G "/listing/quote" \
    -H "AUTHORIZATION: Bearer tokenXXXX" \
    -H "X-API-KEY: please-request-key" \
    -H "Content-Type: application/json" \
    -d '{"fromcurr":"SGD","tocurr":"IDR","fromamount":1000,"toamount":1000000,"marketrate":false,"markup":0,"listingtype":"send","exrate":10339.618214546}'
const url = new URL("/listing/quote");

let headers = {
    "AUTHORIZATION": "Bearer tokenXXXX",
    "X-API-KEY": "please-request-key",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "fromcurr": "SGD",
    "tocurr": "IDR",
    "fromamount": 1000,
    "toamount": 1000000,
    "marketrate": false,
    "markup": 0,
    "listingtype": "send",
    "exrate": 10339.618214546
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get("/listing/quote", [
    'headers' => [
            "AUTHORIZATION" => "Bearer tokenXXXX",
            "X-API-KEY" => "please-request-key",
            "Content-Type" => "application/json",
        ],
    'json' => [
            "fromcurr" => "SGD",
            "tocurr" => "IDR",
            "fromamount" => "1000",
            "toamount" => "1000000",
            "marketrate" => "",
            "markup" => "0",
            "listingtype" => "send",
            "exrate" => "10339.618214546",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "status": "completed",
    "expectedcurrency": "SGD",
    "servicefee": 2,
    "fromamount": 10103.036930194,
    "toamount": 100000000,
    "rate": 9898.0139032388,
    "expectedamount": 10105.036930194,
    "savings": 252
}

Example response (401):

{
    "error": "not authorized"
}

HTTP Request

GET /listing/quote

Body Parameters

Parameter Type Status Description
fromcurr String required Source currency code.
tocurr String required Destination currency code.
fromamount float optional The amount to transact in source currency. Either this or toamount is required.
toamount float optional The amount to transact in destination currency. Either this or fromamount is required.
marketrate boolean optional Flag to indicate if the rate to be decided at the time of conversion (default: true).
markup float optional Percentage Markup/markdown from market rate (if marketrate=true, default: 0).
listingtype String optional 'send' or 'convert' (default: send).
exrate float optional The exchange rate from rate end point. If <=0 will be set to Moolahgo rate.

Get a Transaction


Requires authentication This endpoint get an existing listing in Moolahgo system. ( https://transact.moolahgo.com/listing )

Below are a list of status for a transaction:

Example request:

curl -X GET -G "/listing/1?id=123" \
    -H "AUTHORIZATION: Bearer tokenXXXX" \
    -H "X-API-KEY: please-request-key"
const url = new URL("/listing/1");

    let params = {
            "id": "123",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "AUTHORIZATION": "Bearer tokenXXXX",
    "X-API-KEY": "please-request-key",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get("/listing/1", [
    'headers' => [
            "AUTHORIZATION" => "Bearer tokenXXXX",
            "X-API-KEY" => "please-request-key",
        ],
    'query' => [
            "id" => "123",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "detail": {
        "listingid": "297",
        "sourcecurrency": "SGD",
        "destinationcurrency": "IDR",
        "sourceamount": "1000.00",
        "exchangerate": "10339.618214500000",
        "reason": "Business - Supplier Payments",
        "status": "Completed"
    }
}

Example response (401):

{
    "error": "not authorized"
}

HTTP Request

GET /listing/{id}

Query Parameters

Parameter Status Description
id required The pendingpaymentid or id of the listing to be obtained.

Create a Transaction


Requires authentication This endpoint creates a listing in Moolahgo system. ( https://transact.moolahgo.com/listing )

Example request:

curl -X POST "/listing" \
    -H "AUTHORIZATION: Bearer tokenXXXX" \
    -H "X-API-KEY: please-request-key" \
    -H "Content-Type: application/json" \
    -d '{"fromcurr":"SGD","tocurr":"IDR","fromamount":1000,"marketrate":false,"markup":0,"listingtype":"send","reason":"Business - Supplier Payments","isp2p":false,"validity":10,"country":"Indonesia","exrate":10339.618214546,"message":"This is message to recipient","recipientid":54,"webhook":"http:\/\/someurl","senderfirstname":"John","senderlastname":"Doe","senderdob":"1990-12-31","senderic":"S1234567T","sendernationality":"Singaporean","senderaddress":"1 Shenton Way","senderemail":"john.doe@moolahgo.com"}'
const url = new URL("/listing");

let headers = {
    "AUTHORIZATION": "Bearer tokenXXXX",
    "X-API-KEY": "please-request-key",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "fromcurr": "SGD",
    "tocurr": "IDR",
    "fromamount": 1000,
    "marketrate": false,
    "markup": 0,
    "listingtype": "send",
    "reason": "Business - Supplier Payments",
    "isp2p": false,
    "validity": 10,
    "country": "Indonesia",
    "exrate": 10339.618214546,
    "message": "This is message to recipient",
    "recipientid": 54,
    "webhook": "http:\/\/someurl",
    "senderfirstname": "John",
    "senderlastname": "Doe",
    "senderdob": "1990-12-31",
    "senderic": "S1234567T",
    "sendernationality": "Singaporean",
    "senderaddress": "1 Shenton Way",
    "senderemail": "john.doe@moolahgo.com"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post("/listing", [
    'headers' => [
            "AUTHORIZATION" => "Bearer tokenXXXX",
            "X-API-KEY" => "please-request-key",
            "Content-Type" => "application/json",
        ],
    'json' => [
            "fromcurr" => "SGD",
            "tocurr" => "IDR",
            "fromamount" => "1000",
            "marketrate" => "",
            "markup" => "0",
            "listingtype" => "send",
            "reason" => "Business - Supplier Payments",
            "isp2p" => "",
            "validity" => "10",
            "country" => "Indonesia",
            "exrate" => "10339.618214546",
            "message" => "This is message to recipient",
            "recipientid" => "54",
            "webhook" => "http://someurl",
            "senderfirstname" => "John",
            "senderlastname" => "Doe",
            "senderdob" => "1990-12-31",
            "senderic" => "S1234567T",
            "sendernationality" => "Singaporean",
            "senderaddress" => "1 Shenton Way",
            "senderemail" => "john.doe@moolahgo.com",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "status": "waiting for fee payment",
    "pendingpaymentid": 100,
    "expectedcurrency": "SGD",
    "expectedamount": 1012
}

Example response (401):

{
    "error": "not authorized"
}

HTTP Request

POST /listing

Body Parameters

Parameter Type Status Description
fromcurr String required Source currency code.
tocurr String required Destination currency code.
fromamount float required The amount to transact in source currency.
marketrate boolean optional Flag to indicate if the rate to be decided at the time of conversion (default: true).
markup float optional Percentage Markup/markdown from market rate (if marketrate=true, default: 0).
listingtype String optional 'send' or 'convert' (default: send).
reason String required The reason for the transaction (regulatory requirement).
isp2p boolean optional Flag to indicate if this submission is for peer to peer listing (default: false).
validity integer optional Number of days the listing should be active (only for peer to peer, default: 10).
country String required Destination country.
exrate float optional The exchange rate from rate end point. If <=0 will be set to Moolahgo rate.
message String optional The message for this listing.
recipientid integer required The id of recipient return from recipientrecord end point.
webhook string optional The webhook url (must be registered beforehand with moolahgo).
senderfirstname String optional Sender first name.
senderlastname String optional Sender last name.
senderdob String optional Sender date of birth in yyyy-mm-dd.
senderic String optional The IC of passport of sender.
sendernationality String optional Sender nationality.
senderaddress String optional Sender address.
senderemail String optional Sender email address.

Request Transaction Cancellation


Requires authentication This endpoint send a transaction cancellation request.

Example request:

curl -X DELETE "/listing/pendingpayment/1?status=pendingpayment&id=123" \
    -H "AUTHORIZATION: Bearer tokenXXXX" \
    -H "X-API-KEY: please-request-key"
const url = new URL("/listing/pendingpayment/1");

    let params = {
            "status": "pendingpayment",
            "id": "123",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "AUTHORIZATION": "Bearer tokenXXXX",
    "X-API-KEY": "please-request-key",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->delete("/listing/pendingpayment/1", [
    'headers' => [
            "AUTHORIZATION" => "Bearer tokenXXXX",
            "X-API-KEY" => "please-request-key",
        ],
    'query' => [
            "status" => "pendingpayment",
            "id" => "123",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true
}

Example response (401):

{
    "error": "not authorized"
}

HTTP Request

DELETE /listing/{status}/{id}

Query Parameters

Parameter Status Description
status required 'pendingpayment' or 'active'.
id required Listing ID to be cancelled.

User Management

All recipient management endpoints are access through https://identity.moolahgo.com/

Create user

This endpoint create a user in Moolahgo system. ( https://identity.moolahgo.com/user )

Example request:

curl -X POST "/user" \
    -H "X-API-KEY: please-request-key" \
    -H "Content-Type: application/json" \
    -d '{"username":"joe","password":"password","userpin":"123456","email":"joe@moolahgo.com","countrycode":"+65","contact":"98765432","countryname":"Singapore"}'
const url = new URL("/user");

let headers = {
    "X-API-KEY": "please-request-key",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "username": "joe",
    "password": "password",
    "userpin": "123456",
    "email": "joe@moolahgo.com",
    "countrycode": "+65",
    "contact": "98765432",
    "countryname": "Singapore"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post("/user", [
    'headers' => [
            "X-API-KEY" => "please-request-key",
            "Content-Type" => "application/json",
        ],
    'json' => [
            "username" => "joe",
            "password" => "password",
            "userpin" => "123456",
            "email" => "joe@moolahgo.com",
            "countrycode" => "+65",
            "contact" => "98765432",
            "countryname" => "Singapore",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "userid": "1234",
    "status": "Active",
    "group": {
        "id": "L0",
        "detail": {
            "sgd": {
                "daily": {
                    "default": {
                        "max": 15000
                    },
                    "wallettopup": {
                        "max": 15000
                    },
                    "send": {
                        "max": 15000
                    },
                    "convert": {
                        "max": 15000
                    },
                    "p2p": {
                        "max": 15000
                    },
                    "walletmerchantpayment": {
                        "max": 15000
                    }
                },
                "monthly": {
                    "default": {
                        "max": 15000
                    }
                },
                "annually": {
                    "default": {
                        "max": 15000
                    }
                },
                "walletlimit": 4000000
            }
        }
    }
}

HTTP Request

POST /user

Body Parameters

Parameter Type Status Description
username string required User name use to login.
password string optional Password use to login, either this or PIN is required.
userpin string optional PIN to login, either this or password is required.
email string optional User email.
countrycode string optional Phone country code.
contact string optional Phone number.
countryname string optional Country of residence.

Update user

This endpoint update user detail in Moolahgo system. ( https://identity.moolahgo.com/user )

Example request:

curl -X PUT "/user" \
    -H "X-API-KEY: please-request-key" \
    -H "Content-Type: application/json" \
    -d '{"password":"password","userpin":"123456","email":"joe@moolahgo.com","title":"Mr","fname":"Joe","lname":"Block","gender":"Female","dob":"1990-12-25","countrycode":"+65","contact":"98765432","icpassport":"S1234567G","address":"unit 2-22 Some Street","postcode":"555555","city":"Singapore","countryofresidence":"Singapore","nationality":"Singapore","occupation":"Trade","preferredlanguage":"en"}'
const url = new URL("/user");

let headers = {
    "X-API-KEY": "please-request-key",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "password": "password",
    "userpin": "123456",
    "email": "joe@moolahgo.com",
    "title": "Mr",
    "fname": "Joe",
    "lname": "Block",
    "gender": "Female",
    "dob": "1990-12-25",
    "countrycode": "+65",
    "contact": "98765432",
    "icpassport": "S1234567G",
    "address": "unit 2-22 Some Street",
    "postcode": "555555",
    "city": "Singapore",
    "countryofresidence": "Singapore",
    "nationality": "Singapore",
    "occupation": "Trade",
    "preferredlanguage": "en"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put("/user", [
    'headers' => [
            "X-API-KEY" => "please-request-key",
            "Content-Type" => "application/json",
        ],
    'json' => [
            "password" => "password",
            "userpin" => "123456",
            "email" => "joe@moolahgo.com",
            "title" => "Mr",
            "fname" => "Joe",
            "lname" => "Block",
            "gender" => "Female",
            "dob" => "1990-12-25",
            "countrycode" => "+65",
            "contact" => "98765432",
            "icpassport" => "S1234567G",
            "address" => "unit 2-22 Some Street",
            "postcode" => "555555",
            "city" => "Singapore",
            "countryofresidence" => "Singapore",
            "nationality" => "Singapore",
            "occupation" => "Trade",
            "preferredlanguage" => "en",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true
}

HTTP Request

PUT /user

Body Parameters

Parameter Type Status Description
password string optional Password use to login.
userpin string optional PIN to login.
email string optional User email.
title string optional User title.
fname string optional User first name.
lname string optional User last name.
gender string optional User gender (Male or Female).
dob string optional User date of birth in yyyy-mm-dd format.
countrycode string optional Phone country code.
contact string optional Phone number.
icpassport string optional User identification number.
address string optional User address.
postcode string optional User address postal code.
city string optional User address city.
countryofresidence string optional Country of residence.
nationality string optional User nationality.
occupation string optional User occupation.
preferredlanguage string optional Country of residence (value can be: en, id, ja, ko, zh).

Get user

This endpoint get a user detail in Moolahgo system. ( https://identity.moolahgo.com/user )

Example request:

curl -X GET -G "/user" \
    -H "X-API-KEY: please-request-key"
const url = new URL("/user");

let headers = {
    "X-API-KEY": "please-request-key",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get("/user", [
    'headers' => [
            "X-API-KEY" => "please-request-key",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true,
    "userid": "1234",
    "title": "Mr"
}

HTTP Request

GET /user

Update Images

This endpoint update KYC images to Moolahgo system. ( https://identity.moolahgo.com/user/image )

Image must be sent as http multipart data. Example below in curl:
curl --location --request POST '/user/image' \
--header 'x-api-key: please-request-key' \
--header 'Authorization: Bearer tokenXXXX' \
--form 'images[]=@/selfie.jpg'

Example request:

curl -X POST "/user/image" \
    -H "AUTHORIZATION: Bearer tokenXXXX" \
    -H "X-API-KEY: please-request-key"
const url = new URL("/user/image");

let headers = {
    "AUTHORIZATION": "Bearer tokenXXXX",
    "X-API-KEY": "please-request-key",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post("/user/image", [
    'headers' => [
            "AUTHORIZATION" => "Bearer tokenXXXX",
            "X-API-KEY" => "please-request-key",
        ],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true
}

Example response (401):

{
    "error": "not authorized"
}

HTTP Request

POST /user/image