Create Payment ID API
Environment: Live
Create permanent payment IDs for secure collections.
# Create Payment ID API
Generate a unique permanent payment ID for use in making payments. In Live mode, customers dial *203*paymentid#; in Sandbox mode, they dial *203*6000*paymentid#.
## Endpoint
- **Method**: POST
- **URL**: https://api.moolre.com/open/account/create
## Headers
| Header | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| X-API-USER | string | Yes | Your Moolre username. |
| X-API-PUBKEY | string | Yes | Your Public API Key. |
## Request Body
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| type | integer | Yes | ID of the function. Must be 2. |
| phone | string | Yes | Phone number of the customer in +233 format (e.g., +233240000002). |
| name | string | Yes | Name of the Customer or a Unique ID. |
| currency | string | Yes | Currency of your account/wallet: GHS (Ghana Cedis) or NGN (Nigerian Naira). |
| amount | string | No | Optional preset payment amount. Omit it to create a Payment ID without a preset limit; when provided, it must be greater than 0. |
| externalref | string | Yes | Unique external reference for this request. |
| accountnumber | string | Yes | Your Moolre Account Number. |
## Response (200 Success)
Payment ID generated. data.terminalid carries the same value as data.paymentid. In Sandbox the message reads "Terminal Creation Successful" and data has no terminalid, so check code AD14 and read data.paymentid.
```json
{
"status": 1,
"code": "AD14",
"message": "Payment ID Creation Successful",
"data": {
"terminalid": "08160984",
"paymentid": "08160984",
"name": "Kofi Adeniyi",
"qrcode": null
},
"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).