Skip to content

Trigger a sandbox event

POST
/open/sandbox/trigger

Send an event to your sandbox wallet, signed like a live one: as a webhook when the wallet has webhooks on, and as a callback for the events that have one. With an id it acts on a real sandbox record: a pending payment or payout settles that way (balance, status and event agree) and a bulk batch finishes. Without an id it sends a sample event and does not touch the balance. Sandbox only.

science

Sandbox Simulation Mode

All actions on this page are fully simulated. No real accounts are created, and no real money is debited or credited. Use this environment to safely test your integration workflow.

history

Request History

Your request history will appear here.

Headers

X-API-USER stringrequired

Your Moolre username.

X-API-KEY stringoptional

Your wallet private API key. A public key is refused.

Body Params

accountnumberstringrequired

Your sandbox wallet account number.

eventstringrequired

The event to send.

externalrefstringoptional

externalref of a payment or payout to settle or re-send.

transactionidstringoptional

Alternative to externalref.

batchidstringoptional

For bulk_payout.completed: the batch to finish.

invoiceidstringoptional

For invoice.paid, which is an action, not an event: pays this sandbox invoice and sends nothing.

amountstringoptional

A sample amount, or a part payment for invoice.paid.

reasonstringoptional

The failure reason for payment.failed.

finalstringoptional

For bulk_payout.completed: how pending items settle.

Responses

The event was sent. data.delivered says whether your endpoint answered 2xx. data.webhook and data.callback show each delivery (null when it was not sent).

statusinteger
1 for success
codestring
Response code, SBX01
messagestring
Response message
dataobject
Result
gonull
Navigation hint
metaobject
Always present. meta.requestid is the unique id of this request (also the X-Request-Id header); quote it to support. meta.notices is an array, empty when there is nothing to report. meta.replayed is true only on an idempotent replay.
{  "status": 1,  "code": "SBX01",  "message": "Event sent.",  "data": {    "event": "payment.succeeded",    "transactionid": "1001",    "event_id": "evt_0123456789abcdef01234567",    "delivered": true,    "state": "delivered",    "http": 200,    "error": null,    "webhook": {      "event_id": "evt_0123456789abcdef01234567",      "delivered": true,      "state": "delivered",      "http": 200,      "error": null    },    "callback": null  },  "go": null,  "meta": {    "requestid": "req_c68f4c66115c26725c796242",    "notices": []  }}

The sandbox wallet has webhooks off, and no callback URL for an event that has a callback. Set them with Update Account.

statusinteger
0 for failure
codestring
Response code, for example SBX02
messagestring
Error message
datastring | object | null
The failing field, or details
metaobject
Always present: meta.requestid (the unique id of this request) and meta.notices (an array)
{  "status": 0,  "code": "SBX02",  "message": "Webhooks are off on this sandbox wallet. Turn them on with POST /open/account/update (webhook_url and webhook 1).",  "data": "webhook_url",  "go": null,  "meta": {    "requestid": "req_c68f4c66115c26725c796242",    "notices": []  }}

Fields every response can carry

On failures, read code, message and data (the first failing field). meta is always present and holds requestid (also the X-Request-Id header), notices and, only on idempotent replays, replayed. There is no outcome field: use status, code and data.txstatus. Send X-Moolre-Http-Status: strict to receive real HTTP status codes. See Responses and request IDs and Errors and status codes.

Language

curl --request POST \     --url 'https://sandbox.moolre.com/open/sandbox/trigger' \     --header 'X-API-USER: Your Username' \     --header 'Content-Type: application/json' \     --data '{  "accountnumber": "",  "event": "payment.succeeded",  "externalref": ""}'

Response

Body

{  "status": 1,  "code": "SBX01",  "message": "Event sent.",  "data": {    "event": "payment.succeeded",    "transactionid": "1001",    "event_id": "evt_0123456789abcdef01234567",    "delivered": true,    "state": "delivered",    "http": 200,    "error": null,    "webhook": {      "event_id": "evt_0123456789abcdef01234567",      "delivered": true,      "state": "delivered",      "http": 200,      "error": null    },    "callback": null  },  "go": null,  "meta": {    "requestid": "req_c68f4c66115c26725c796242",    "notices": []  }}