Internal Transfer API

Environment: Live

Initiate an internal transfer.

# Internal Transfer API

Initiate an internal transfer using your Moolre account.

## Endpoint
- **Method**: POST
- **URL**: https://api.moolre.com/open/transact/internal

## Headers
| Header | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| X-API-USER | string | Yes | Your Moolre username. |
| X-API-KEY | string | Yes | Your Private API Key. |
| Idempotency-Key | string | No | Optional. 1 to 128 printable characters. Repeating the request with the same key and body returns the stored response (with meta.replayed true) for 24 hours; a different body returns IDEM01. See Idempotency. |

## Request Body
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| type | integer | Yes | Must be 1. |
| currency | string | Yes | Currency code: GHS (Ghana Cedis) or NGN (Nigerian Naira). |
| amount | string | Yes | Amount to transfer. Must be greater than 0. |
| receiver | string | Yes | Destination Moolre account number. This must not be a mobile phone number. |
| externalref | string | Yes | Unique reference for the transfer: 1 to 128 characters, unique on the wallet (case-insensitive). Sending it again never pays twice: the reply is the original transfer (PY04, or PY05 when it failed). |
| reference | string | No | Optional narration or reference text. |
| accountnumber | string | Yes | Your Moolre Account Number. |

## Response (200 Success)
The internal transfer request was accepted. Confirm the final outcome through the transfer status workflow when your integration needs a terminal state.

```json
{
  "status": 1,
  "code": "TR099",
  "message": "Internal transfer initiated successfully",
  "data": "f25fc80e-791b-495b-8799-dcf87660457d",
  "go": null,
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```

## Response (200 (Repeated externalref) Original transfer)
The externalref was already used on this wallet. Nothing new is sent: the reply is the ORIGINAL transfer, with its status in data.txstatus. PY04 (status 1) when it is pending (0) or paid (1): record it, do not resend. PY05 (status 0, HTTP 409 in strict mode) with txstatus 2 when it failed: send it again with a new externalref. PY05 with data "extid" when another kind of transaction used it.

```json
{
  "status": "1",
  "code": "PY04",
  "message": [
    "Duplicate extid, this is the original pay out",
    "Click close to view transactions."
  ],
  "data": {
    "txstatus": 1,
    "receiver": "0240000007",
    "transactionid": "32759150",
    "externalref": "28171451",
    "thirdpartyref": "901733241086",
    "receivername": "",
    "amount": "1.00",
    "amountfee": "1.01",
    "networkfee": "0.00",
    "fee": "0.01"
  },
  "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 |
| :--- | :--- |
| 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, IS30, 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