Reset sandbox data API

Environment: Sandbox

Reset sandbox test data for a wallet.

# Reset sandbox data API

Clear test data for one sandbox wallet that is yours. After a reset an externalref can be used again. Sandbox only.

## Endpoint
- **Method**: POST
- **URL**: https://sandbox.moolre.com/open/sandbox/reset

## Headers
| Header | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| X-API-USER | string | Yes | Your Moolre username. |
| X-API-KEY | string | Yes | Your wallet private API key. A public key is refused. |

## Request Body
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| accountnumber | string | Yes | Your sandbox wallet account number. |
| scope | string | No | all (default), transactions (also clears OTP and idempotency rows and restores the balance), balance, webhooks, bulk or invoices. |
| balance | string | No | The balance to restore, for example 1000.00. |

## Response (200 Success)
The number of rows deleted per table and the new balance.

```json
{
  "status": 1,
  "code": "SBR01",
  "message": "Sandbox data reset.",
  "data": {
    "deleted": {
      "transactions": 12,
      "webhook_deliveries": 4
    },
    "balance": "1000.00"
  },
  "go": null,
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```

## Response (200 (HTTP 400 in strict mode) Bad scope)
scope is not one of the allowed values.

```json
{
  "status": 0,
  "code": "SBR03",
  "message": "scope must be one of all, transactions, balance, webhooks, bulk, invoices.",
  "data": "scope",
  "go": null,
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```


## Fields every response can carry

These fields are additive: existing fields keep their names, order and types.

| Field | Meaning |
| :--- | :--- |
| error | On a failure: { code, message, fields: [{ field, code, message }] } listing every failing field. |
| meta | Always present, last in the object. meta.replayed is true only when the response is the stored answer to a repeated Idempotency-Key (absent otherwise). meta.requestid is the unique id of the request (also the X-Request-Id response header): quote it when you contact support. meta.notices is always an array, empty when there is nothing to report; each notice is { code, message, docs? }, for example that a deprecated way of sending credentials was used. See [Deprecations](https://docs.moolre.com/guides/deprecations). |

There is no outcome field. Decide the result from status, code and, on payment and transfer endpoints, data.txstatus (0 pending, 1 succeeded, 2 failed). These codes mean the result is unknown and may still succeed, so treat them as pending and check the status: PY01, PY02, TR01, TR02, TP11, TP18, APY10, APY16, ASL06, SYS500. Status 1 with TR08, OBGH01, OTGH01, OBNG01, GHQ03 or OM03 is final success; any other status 1 is an accepted, unfinished request.

Send X-Moolre-Http-Status: strict to receive real HTTP status codes (400, 401, 403, 404, 409, 422, 429, 5xx) instead of HTTP 200. See [Responses and request IDs](https://docs.moolre.com/guides/responses).

Back to the Moolre AI documentation index