Update Account API
Environment: Live
Update business wallet settings, webhooks, email alerts and settlement info.
# Update Account API
Update business wallet/account details and settlement settings.
## Endpoint
- **Method**: POST
- **URL**: https://api.moolre.com/open/account/update
## Headers
| Header | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| X-API-USER | string | Yes | Your Moolre username. |
| X-API-KEY | string | Yes | Your Private API Key. |
## Request Body
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| type | integer | Yes | Must be 1. |
| accountnumber | string | Yes | The account number you want to update. |
| accountname | string | No | Updated business name: 2 to 30 characters, letters in any script, digits, spaces and . , & ( ) ' ’ / _ - @ # + : (APGW02 otherwise). The name the wallet already has is accepted unchanged. |
| currency | string | Yes | Account currency. This endpoint always requires GHS, unless you send only webhook, webhook_url or email with accountnumber. |
| api | boolean | No | Only send this when you intend to change the account API access setting. Switching it off and on keeps the wallet secret; a wallet without one gets one. |
| callback | string | No | Callback URL for collection results. A new or changed callback must be an absolute https URL on port 443 with a public host name and no credentials or fragment (APGW13 otherwise). The callback the wallet already has is accepted unchanged, and an existing http or custom-port callback keeps receiving deliveries. |
| webhook | integer | No | Webhooks on or off; any other value is refused (APGW14). Leave it out to keep the current setting. webhook, webhook_url and email can be sent alone with accountnumber, on a wallet of any currency. Values: `1` On: needs a webhook_url, sent here or stored earlier (APGW16); `0` Off. |
| webhook_url | string | No | Where webhooks are sent: an https URL on port 443, at most 256 characters, with a public host name and no credentials or fragment (APGW15 otherwise). An empty string clears it and switches webhooks off. |
| email | integer | No | Email alerts to the account owner: 1 on, 0 off (APGW17 otherwise). Leave it out to keep the current setting. |
| settlement | object | No | Settlement details object (currency, frequency, channel, recipient, sublist). Results are sent as the webhooks settlement.succeeded, settlement.failed and settlement.reversed. |
## Response (200 Success)
Account updated successfully.
```json
{
"status": "1",
"code": "WCU02",
"message": "Account Updated Successfully",
"data": {
"status": 1,
"accountnumber": "100000157257",
"accountname": "My Business PLC",
"paymentid": "0757257",
"api": 0,
"callback": "https://nocall.com/noend",
"webhook": 1,
"webhook_url": "https://shop.example.com/moolre/hooks",
"email": 0,
"settlement": {
"currency": "GHS",
"frequency": "1",
"channel": "1",
"recipient": "0240000008",
"sublist": "300303"
},
"secret": "bcec3865-bea1-4a99-8e70-c6a434cac757"
},
"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).