Skip to main content

3.1 Create deposit

POST /api/v2/deposits

Send a JSON object with the v2 authentication headers. Sign the raw request body. Put the MYR P2P routing values in fields and send the request without a query string.

Request​

FieldTypeRequiredWhat to send
order_idstring, up to 255 charactersYesUnique deposit reference for your merchant. Reuse it when retrying this order.
amountJSON numberYesPositive MYR amount with at most two decimal places.
currencystringYesMYR.
methodstringIf using a non-default shopYour assigned shop code. Omit it to use the merchant's active default shop.
fields.wallet_providerstringYesThe wallet provider code enabled for your MYR P2P shop.
fields.bank_codestringYesThe bank code enabled for the shop.
callback_urlHTTPS URLYesPublic endpoint for deposit callbacks.
success_url, pending_url, fail_urlHTTP(S) URLsYes, all threeBrowser return destinations for the three possible v2 payment statuses.
customer_account_idJSON integerOptionalYour customer reference.
fields.merchant_user_ipstringOptionalThe customer's IPv4 or IPv6 address, when available.

Replace your_myr_shop, WALLET_CODE and BANK_CODE with the values agreed for your shop. Use your own callback and return URLs.

{
"order_id": "DEP-MYR-1001",
"amount": 125.50,
"currency": "MYR",
"method": "your_myr_shop",
"customer_account_id": 42,
"callback_url": "https://merchant.example.com/webhooks/payin",
"success_url": "https://merchant.example.com/orders/DEP-MYR-1001/paid",
"pending_url": "https://merchant.example.com/orders/DEP-MYR-1001/pending",
"fail_url": "https://merchant.example.com/orders/DEP-MYR-1001/failed",
"fields": {
"wallet_provider": "WALLET_CODE",
"bank_code": "BANK_CODE"
}
}

If either routing field is missing or empty, the API returns 400 with the v2 error format.

Response and customer return​

A successful create request returns 200.

{
"transaction_id": "12346",
"redirect_url": "https://pay.example.com/payin-pages/12346?expires=1801227600&signature=example-signature"
}

Store transaction_id and send the customer to the complete redirect_url returned by the API. The signed URL can initially show payment preparation. Keep its query parameters intact. The browser return takes the customer to the URL that corresponds to the current status.

Check deposit status using transaction_id. Fulfill the order when the status is SUCCESS. If the create response is lost, retry the original request with the same order_id and order data. Changed data under the same identifier can return 409.