Enter one or more
mandate creation details
Start
Fire
POST /api/v1/Mandates
Is effective_date
valid
{
  "status": "99",
  "error": "Invalid effective date."
}
Is frequency
valid
( "DL", "WK", "MT", "YR")
{
  "status": "99",
  "error": "Invalid Frequency."
}
Is 
max_frequency
between 1 and 999
{
  "status": "99",
  "error": "Max Frequency outside of allowed range."
}
Is purpose
not null or empty
{
  "status": "99",
  "error": "Invalid Purpose."
}
Is max_amount
>= MYR 1.00
{
  "status": "99",
  "error": "Amount below Min Amount."
}
Are all inputs valid
{
  "status": "99",
  "error": "Invalid Data Format."
}
General Inputs Handling
Has
any exception
thrown
{
  "status": "99",
  "result": [],
  "message": "Invalid Request"
}
Inputs Validation
{
  "status": "00",
  "result":
  [
    {  // create successfully
       "status": "00",
       "reference_number": "<system_generated>",
       "key": "<system_generated>",
       "url": "<system_generated>"
    },
    {  // error occurred
        "status": "99",
        "error": "<error_description>"
    },
    ...
  ],
  "message": "Success"
}
End
No
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Mandate created
with status = "Draft"
Perform update or confirm by calling
PUT /api/v1/Mandates
Send mandate link to your customer for authorization
No
Yes
Customer fills in
required details and submits
(Day t)
Create Collection Settings
 for next collection at Day t
Direct Debit
Auto Debit
Wait for 
Mandate Approval Callback
(Day t + 1 - Next working day after submission)
Create Collection Settings
for next collection at
Day t + 2
Wait for
Mandate Authorization Callback
(Day t)

    // Mandate - Authorization Callback Response (Day t)
    "amount": "1.00", // for authorization purpose and non-refundable 
    "currency": "MYR",
    "customer_name": "Test Customer",
    "description": "Monthly Subscription Plan",
    "reference_number": "MN10000011621583965",
    "payment_intent": "b96165b897c746c0a2a42032e8bfafea",
    "collection_id": "owbnr7xq",
    "invoice_id": "",
    "txn_id": "PX10000011627008035",
    "external_txn_id": "2009151119230241",
    "response": "Approved",
    "auth_code": "00",
    "auth_number": "15733223",
    "txn_date": "20210723104035",
    "fpx_mode": "01",
    "fpx_buyer_name": "N@me()/ .-_,&Buyer'`~*;:",
    "fpx_buyer_bank_id": "TEST0021",
    "fpx_buyer_bank_name": "SBI BANK A",
    "card_holder_name": null,
    "card_number": null,
    "card_brand": null,
    "signature": "3b0806197e8b948a81b2faff2839b3194b9f52707a336e5039a522
04a2591abfbd5d4e5aceec4381b15cf0431e02aa6e2c9d17c255e6e7083e47ccfe
c182cbaa",
    "txn_type": "Mandate - Authorization"
    "nonce": "lenKjMY3VInjYHmtSX398aT2socMZGCOkLIQ8OPPeIaerXSVRW0A
rzd33dLnd5M8"
}
{  
    // Mandate Approval Callback Response
    "application_type": "01",
    "approval_status": "00",
    "approval_date": "20210721",
    "txn_id": "PX10000171626952548",
    "reference_number": "MN10000171626860885",
    "record_number": "E-20210721Q964879",
    "fpx_mode": "01",
    "fpx_buyer_name": "N@me()/ .-_,&Buyer'`~*;:",
    "fpx_buyer_bank_name": "SBI BANK A",
    "fpx_buyer_bank_account": "********1234",
    "signature": "68f21dfb966f264dbd996ad809828b8e763bc5798fbefb5ada434af3
c6a87873d525f7066c5b9e9963ef676f2e672d2835779bc59b09522
3a43058dc935b04f3",
    "txn_type": "Mandate - Approval"
}

    // Auto Debit - Authorization Callback Response (Day t)
    "amount": "88.00", // customer will be charged this amount instantly
    "currency": "MYR",
    "customer_name": "Test Customer",
    "description": "Monthly Subscription Plan",
    "reference_number": "MN10000011621583965",
    "payment_intent": "b96165b897c746c0a2a42032e8bfafea",
    "collection_id": "owbnr7xq",
    "invoice_id": "",
    "txn_id": "PX10000011627008035",
    "external_txn_id": "2009151119230241",
    "response": "Approved",
    "auth_code": "00",
    "auth_number": "15733223",
    "txn_date": "20210723104035",
    "fpx_mode": null,
    "fpx_buyer_name": null,
    "fpx_buyer_bank_id": null,
    "fpx_buyer_bank_name": null,
    "card_holder_name": "N@me()/ .-_,&Buyer'`~*;:",
    "card_number": "************1111",
    "card_brand": "VISA", // can be any of "VISA", "MASTERCARD", "UNIONPAY" 
    "card_on_file": "761d35566422d504c96a0f28f3637eeea0d9808a73897f533b5
3dd9850e4dfbb", // 64 alphanumeric key length
    "signature": "3b0806197e8b948a81b2faff2839b3194b9f52707a336e5039a522
04a2591abfbd5d4e5aceec4381b15cf0431e02aa6e2c9d17c255e6e7083e47ccfe
c182cbaa",
    "txn_type": "Malaysian Debit Card",  // can be any of "Malaysian Debit Card", "Malaysia Credit Card", "Foreign Card"
    "nonce": "lenKjMY3VInjYHmtSX398aT2socMZGCOkLIQ8OPPeIaerXSVRW0A
rzd33dLnd5M8"
}
Notes:
- You only have to provide one callback url and we will send different responses to it
- 'txn_type' is used to differentiate between different callback responses (refer to the list below) 
List of available 'txn_type' for callback 
1. Mandate - Authorization
2. Auto Debit - Authorization
3. Mandate - Approval
4. Malaysian Debit Card
5. Malaysian Credit Card
6. Foreign Card
What to do next (for success case)
Status Codes:
- For mandate authorization, refer to Response Codes with Type = 'FPX' for Direct Debit and Response Codes with Type = 'Card' for Auto Debit
- For auto debit collection, refer to Response Codes with Type = 'Card'
- For direct debit collection, refer to Response Codes with Type = 'BILLING'
- when 'txn_type' is either of 'Mandate - Authorization' and 'Auto Debit - Authorization', both will incur a non-refundable amount of MYR 1.00 to your customer
- There're two callbacks for Direct Debit mandate, first callback is for customer authorization and second callback is for bank approval
- There's only one callback for Auto Debit mandate for authorization and approval at the same time   
initial_amount
>
MYR 1.00

    // Auto Debit - Authorization Callback Response (Day t)
    "amount": "1.00", // for authorization purpose and non-refundable
    "currency": "MYR",
    "customer_name": "Test Customer",
    "description": "Monthly Subscription Plan",
    "reference_number": "MN10000011621583965",
    "payment_intent": "b96165b897c746c0a2a42032e8bfafea",
    "collection_id": "owbnr7xq",
    "invoice_id": "",
    "txn_id": "PX10000011627008035",
    "external_txn_id": "2009151119230241",
    "response": "Approved",
    "auth_code": "00",
    "auth_number": "15733223",
    "txn_date": "20210723104035",
    "fpx_mode": null,
    "fpx_buyer_name": null,
    "fpx_buyer_bank_id": null,
    "fpx_buyer_bank_name": null,
    "card_holder_name": "N@me()/ .-_,&Buyer'`~*;:",
    "card_number": "************1111",
    "card_brand": "VISA", // Can be any of "VISA", "MASTERCARD", "UNIONPAY" 
    "card_on_file": "761d35566422d504c96a0f28f3637eeea0d9808a73897f533b5
3dd9850e4dfbb", // 64 alphanumeric key length
    "signature": "3b0806197e8b948a81b2faff2839b3194b9f52707a336e5039a522
04a2591abfbd5d4e5aceec4381b15cf0431e02aa6e2c9d17c255e6e7083e47ccfe
c182cbaa",
    "txn_type": "Auto Debit - Authorization" 
    "nonce": "lenKjMY3VInjYHmtSX398aT2socMZGCOkLIQ8OPPeIaerXSVRW0A
rzd33dLnd5M8"
}
No
Yes
System created
Collection Settings for you
automatically at Day t
// sample request body
[
  {
    "customer_name": "string",
    "email": "user@example.com",
    "contact_number": "string",
    "merchant_reference_number": "string",
    "id_type": "1", // can be any of "1", "2", "3", "4", "5"  ("1" - New IC Number, "2" - Old IC Number, "3" - Passport Number, "4" - Business Registration, "5" - Others)
    "id_number": "string",
    "fpx_mode": "01", // can be any of "01", "02" ("01" - Retail, "02" - Corporate)
    "fpx_buyer_bank_id": "string",
    "effective_date": "yyyyMMdd",
    "expiry_date": "yyyyMMdd",
    "max_amount": 1000, // cannot be lower than 100 (MYR 1.00)
    "initial_amount": 1000, // cannot be lower than 100 (MYR 1.00)
    "frequency": // can be any of "DL", "WK", "MT", "YR"  ("DL" - daily, "WK" - weekly, "MT" - monthly, "YR" - yearly)
    "max_frequency": 1, // max number of charges within a collection cycle
    "purpose": "string",
    "debit_type": "DD", // can be any of "DD", "AD" ("DD" - direct debit, "AD" - auto debit)
    "return_url": "string",
    "callback_url": "string",
    "accept_url": "string",
    "reject_url": "string",
    "address": "string",
    "postcode": "string",
    "city": "string",
    "state": "string",
    "country": "string",
    "status": "Pending",
    "auto": true, // auto collect
    "retry": true, // auto retry if previous collection has failed
    "retry_count": 0 // max 4
  }
]