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
| Field | Type | Required | What to send |
|---|---|---|---|
order_id | string, up to 255 characters | Yes | Unique deposit reference for your merchant. Reuse it when retrying this order. |
amount | JSON number | Yes | Positive MYR amount with at most two decimal places. |
currency | string | Yes | MYR. |
method | string | If using a non-default shop | Your assigned shop code. Omit it to use the merchant's active default shop. |
fields.wallet_provider | string | Yes | The wallet provider code enabled for your MYR P2P shop. |
fields.bank_code | string | Yes | The bank code enabled for the shop. |
callback_url | HTTPS URL | Yes | Public endpoint for deposit callbacks. |
success_url, pending_url, fail_url | HTTP(S) URLs | Yes, all three | Browser return destinations for the three possible v2 payment statuses. |
customer_account_id | JSON integer | Optional | Your customer reference. |
fields.merchant_user_ip | string | Optional | The 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.