Payment status

Query payment state over POST
View as Markdown

Use this endpoint to read the current state of a payment after you create a payment. It complements webhooks: webhooks push updates; status is for checks and reconciliation.

All merchant calls use POST, Content-Type: application/json, x-api-key, and x-api-secret.


Endpoint

POST https://api.senjaropay.com/senjaropay/merchant/payments/status

Request

Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
x-api-keyYesDashboard Public Key (Authentication)
x-api-secretYesSecret API secret (Authentication)

Body

FieldTypeRequiredDescription
referenceIdstring (UUID)Yesdata.reference from the create payment response

Example

1POST /senjaropay/merchant/payments/status HTTP/1.1
2Host: api.senjaropay.com
3Content-Type: application/json
4x-api-key: <secret>
5x-api-secret: <secret>
6
7{"referenceId":"mock-ref-7b2a4f3e"}
$curl -sS -X POST "https://api.senjaropay.com/senjaropay/merchant/payments/status" \
> -H "Content-Type: application/json" \
> -H "x-api-key: ${SENJARO_API_KEY}" \
> -H "x-api-secret: ${SENJARO_API_SECRET}" \
> -d '{"referenceId":"mock-ref-7b2a4f3e"}'

Response

Successful responses return transaction status information for the provided reference.

Example

1{
2 "message": "Transaction status retrieved from database",
3 "transactionId": "TXN-MOCK-000123",
4 "displayId": "SPMOCK.0001.000123",
5 "method": "MOBILE",
6 "status": "PENDING",
7 "reference_id": "mock-ref-7b2a4f3e",
8 "amount": "1000.00",
9 "currency": "TZS",
10 "created_at": "2026-01-01T10:30:00.000Z"
11}

All values in this response snippet are mock values.


Payment states

Interpret status in your integration. Common values:

ValueMeaning
PENDINGAwaiting customer action (for example USSD authorization) or still processing
COMPLETEDFunds captured successfully; safe to fulfill per your policy
FAILEDTerminal failure; do not fulfill; inspect message or provider codes if present

Confirm enum values and extra fields (failure reasons, operator references) against your live API or OpenAPI definition.


Errors

HTTP statusTypical error_codeWhen
400validation_errorMalformed body or missing referenceId
401unauthorizedMissing or invalid x-api-key
404not_foundNo payment for the supplied referenceId

Example (validation)

1{
2 "status": "error",
3 "code": 400,
4 "error_code": "validation_error",
5 "message": "referenceId is required"
6}

Operations

  • Prefer webhooks for timely updates; use status to backfill missed events or to verify before shipping or crediting wallets.
  • When polling, use bounded retries and exponential backoff; avoid tight loops against production.
  • Make fulfillment idempotent (key orders or references) so duplicate status reads or duplicate webhooks never double-apply side effects.