# Sales Status API

Check the status of an Airtime or Data sale directly from the sales records. Only sales belonging to the wallet in accountnumber are searched. Look up the original external reference, transaction ID, or reference returned in the sale reply.

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

## Headers
| Header | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| Content-Type | string | Yes | Send application/json. |
| X-API-USER | string | Yes | Your Moolre username. |
| X-API-KEY | string | Yes | Your Private API Key for the paying wallet. |

## Request Body
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| type | integer | Yes | Sales status function. Must be 1. |
| accountnumber | string | Yes | Moolre wallet account number used for the sale. Only this wallet's sales are searched. |
| idtype | integer | Yes | 1 = original externalref/extid sent with the sale; 2 = transactionid from the sale reply; 3 = reference from the sale reply. |
| id | string | Yes | Existing sale identifier corresponding to idtype. Do not generate a new external reference for a status lookup. |

## Response (200 Sent (ASS01))
Supplied Data sale status example: sent, with txstatus 1. Other outcomes are described below; exact response bodies for them were not supplied.

```json
{
  "status": "1",
  "code": "ASS01",
  "message": "Sale Successful",
  "data": {
    "txstatus": 1,
    "product": "data",
    "network": "mtn",
    "bundle": "RACT_Data_GHC_3_Others",
    "receiver": "233240000000",
    "amount": "3.00",
    "discount": "0.18",
    "charged": "2.82",
    "accountnumber": "10XXXXXXXXXXXX",
    "transactionid": "123456789",
    "refundid": null,
    "reference": "SALE-REFERENCE",
    "externalref": "your-extid",
    "thirdpartyref": "PROVIDER-REF",
    "ts": "2026-10-16 09:00:00",
    "updated": "2026-10-16 09:00:03"
  },
  "go": null
}
```

## Before you begin

Before using the Airtime or Data Sales APIs, you must create a Sell on Our Platform Service in the Moolre App.

[Open the Moolre App](https://app.moolre.com/).

## Special payment pricing

Special payment pricing is available for businesses that want to sell airtime and data. Contact Moolre Support to request this pricing.

[Contact Moolre Support](mailto:hello@moolre.com?subject=Airtime%20and%20Data%20Sales%20pricing).

## Look up an existing sale

This endpoint reads Airtime and Data sales records directly. Only sales belonging to the wallet in accountnumber are searched. Use data.txstatus and the application code to distinguish pending, sent, failed-and-refunded, and not-found outcomes. A pending or uncertain purchase must not be treated as delivered or blindly resubmitted with a new reference.

| idtype | Identifier | Guidance |
| --- | --- | --- |
| 1 | External reference | Use the original externalref (or extid) sent with the Airtime or Data sale. Do not generate a new reference for this lookup. |
| 2 | Transaction ID | Use the transactionid returned in the sale reply. |
| 3 | Sale reference | Use the reference returned in the sale reply, not an assumed value from the optional request narration. |

## Transaction status

| txstatus | Outcome | Meaning |
| --- | --- | --- |
| 0 | Pending | The sale is not yet final. Check its status again before deciding what to do next. |
| 1 | Sent | The airtime or data sale was sent. |
| 2 | Failed and refunded | refundid identifies the refund transaction. |
| 3 | Not found | No sale was found for this lookup in the selected wallet. Check the wallet, identifier type, and identifier. |

## Status application codes

These are application codes, not HTTP status codes. Exact response bodies for pending, failed/refunded, not-found, and error replies have not been supplied; do not infer their shapes from the sent example.

| Code | Meaning | Next step |
| --- | --- | --- |
| ASS01 | Sent. | The sale was sent; read data.txstatus and the recorded sale details. |
| ASS02 | Failed and refunded. | Read refundid for the refund transaction. |
| ASS03 | Pending. | Check the status again before treating the sale as complete or retrying a purchase. |
| ASS04 | Not found. | Check accountnumber, idtype, and id; only sales belonging to that wallet are searched. |
| ASS05 | Identifier type invalid. | Use idtype 1, 2, or 3 with the corresponding identifier. |
| ASS06 | Parameters incomplete. | Supply type, accountnumber, idtype, and id. |
| ASS07 | Type invalid. | Send type 1. |
| ASS08 | Unknown error. | The lookup did not establish a final outcome. Do not assume the purchase failed or automatically resubmit it. |
| ASS00 | Authentication error. | Check X-API-USER and X-API-KEY for the selected wallet and environment. |

## Recorded Data sale fields

| Field | Type | Meaning |
| --- | --- | --- |
| txstatus | integer | 0 pending, 1 sent, 2 failed and refunded, 3 not found. |
| product | string | Recorded product; data in the supplied example. |
| network | string | Recorded network; mtn in the supplied example. |
| bundle | string | Recorded data bundle ID in the supplied Data sale example. |
| receiver | string | Phone number receiving the airtime or data. |
| amount | string | Sale amount as a decimal string. |
| discount | string | Recorded discount as a decimal string. |
| charged | string | Recorded wallet charge as a decimal string. |
| accountnumber | string | Wallet account number; masked in the supplied example. |
| transactionid | string | Sale transaction ID, used as id with idtype 2. |
| refundid | string or null | Refund transaction ID when failed and refunded; null in the supplied sent example. |
| reference | string | Reference returned in the sale reply, used as id with idtype 3. |
| externalref | string | Original externalref/extid supplied with the sale, used as id with idtype 1. |
| thirdpartyref | string | Reference recorded from the provider. |
| ts | string | Recorded sale timestamp. |
| updated | string | Last recorded update timestamp. |

[Sell airtime](https://docs.moolre.com/api/sales/airtime) or [sell data](https://docs.moolre.com/api/sales/data); use their original sale identifiers for this lookup.
