POST /transactions
Endpoint for depositing money to a customer's account in the digital bank.
Security
// TODO
Request
Body - application/json
field name | Required | type | description |
---|---|---|---|
accountNumber | Yes | string length: 12 Pattern: ^[0-9]{12}$ | Target account number to send the money to |
amount | Yes | number value > 0 | Amount to deposit to account. Must be greater than zero, and only have up to two decimal points. |
merchantRefNum | Yes | string min. length: 1 Pattern: ^[A-Za-z0-9-_]+$ | Reference number generated by the merchant for this transaction. Must be unique. If the reference number already exists in the system, an error is returned. |
merchantName | Yes | string (enum) allowed values:
| Name of the merchant |
currency | Yes | string | Currency of transaction |
callbackUrl | No | string | Callback URL where the transaction status will be sent |
Sample Request Body
{ "accountNumber": "001234567890", "amount": 100, "merchantRefNum": "test-merchant-ref-num1", "merchantName": "digipay", "currency": "PHP", "callbackUrl": "https://webhook.com" }
Responses
200 - Success
Transaction was successfully completed and money was successfully deposited to the target account
Body - application/json
name | type | description |
---|---|---|
accountNumber | string length: 12 Pattern: ^[0-9]{12}$ | Target account number to send the money to |
transactionId | string min. length: 1 Pattern: ^[A-Za-z0-9-_]+$ | Transaction ID generated by digital bank |
amount | number value > 0 | Amount (in PHP) to deposit to account. Must be greater than zero, and only have up to two decimal points. |
merchantRefNum | string min. length: 1 Pattern: ^[A-Za-z0-9-_]+$ | Reference number generated by the merchant for this transaction. Must be unique. If the reference number already exists in the system, an error is returned. |
merchantName | string allowed values:
| Name of the merchant |
currency | string | Currency of transaction |
status | string values: in-process, failed, success | Current status of the transaction |
Sample Response
{ "accountNumber": "001234567890", "amount": 100, "merchantRefNum": "test-merchant-ref-num-1", "transactionId": "36d6f405-ed56-4315-a9e4-9a5cf793132f", "merchantName": "digipay", "status": "in-process", "currency": "PHP" }
400 - Bad Request
401 - Unauthorized
500 - Internal Server Error
Notification Callback
We will send a notification to the callbackUrl sent in the POST /transactions call when the transaction reaches a terminal state, either success or failed.
We expect that the callback accepts POST calls, and will send the notification as a JSON payload.
Callback Payload
The payload for the notification will be sent as a JSON object and follows the same schema as the success response for POST /transactions.
GET /transactions/{transactionId}
Endpoint for retrieving the status and details of a specific transaction, using the transaction ID generated by the digital bank.
URL Param | description |
---|---|
transactionId | Transaction ID generated by digital bank. Returned in the response for POST /transactions |
Responses
200 - Success
Success response follows the same schema as the success response for POST /transactions.
Documents
OpenAPI Spec:
Attachments:
Transaction-API.yaml (application/x-yaml)
Transaction-API.yaml (application/x-yaml)