API Reference

Create Receive Money API

Use this API endpoint to generate QR Code, Virtual Account, eWallet links, and Credit Card acceptance.

Request Parameters

FieldTypeMandatoryDescription
typeStringMandatoryvirtual_account, ewallet, qrcode, or credit_card. Check table below for more explanation.
externalIdStringMandatoryUnique per transaction per client. Duplicate values will give DUPLICATE_EXTERNAL_ID error
attributesObjectConditionalVaries by type (see table below).
amountIntegerConditionalRequired for closed VA, QR code, eWallet, and credit card. Must be >0.
expireIntegerOptionalExpiration time in seconds. Final expiry depends on provider capability. If the provider's expiry time is not customisable, then the value will be ignored.
metadataStringOptionalCustom key-value pairs. Stored in Paystrator and returned in API/webhook, but never sent to providers. Read more about metadata here.

❗️

Notes on expiry time

The actual expiry time may vary depending on provider capability. Always refer to the response for the exact expiredAt value.


Type and Attributes Explanation

Type

Required Fields

Non-Required Fields

Notes

virtual_account

attributes.name


attributes.code

amount (conditional)


expire

  • Empty amount β†’ open VA.
  • With amount β†’ closed VA.

ewallet

attributes.code


amount

expire

qrcode

no required attribute

amount (conditional)


expire

Omit amount β†’ Dynamic QR

Include amount β†’ Static QR

credit_card

amount

expire

Always displays card form. Tokenization coming soon.



Error Handling

All error follow this scheme:

...
"error": {
    "code": "<machine_readable_code>",
    "message": "<human readable message>",
    "action": "<what the dev should do>",
    "reason": "<why it happened>"
}
...

HTTPCodeDescriptionAction Needed
400invalid_parameters_in_requestInvalid parameter (e.g., β€œOnly type QRCODE can be process”)Change type to a supported value
400wrong_parameters_in_requestMissing required fieldCheck your request for a mistake or missing parameter
400provider_sequences_not_foundNo provider sequence configuredPlease add or set the provider sequences
401unauthorizedInvalid/missing bearer tokenre-authenticate; send valid token
401permission deniedAuthenticated but role lacks permissionAdjust API permission on dashboard
405method_not_allowedWrong HTTP method usedUse the correct HTTP method
409invalid_parameters_in_requestDuplicate externalIdPlease use unique externalId
4xx/5xxprovider_errorError from providerPlease contact provider / retry


Payload Example

Please check example pages for examples of each type.

Language
Credentials
Header
Click Try It! to start a request and see the response here!