> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.senjaropay.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.senjaropay.com/_mcp/server.

# Get payment status

POST https://api.senjaropay.com/senjaropay/merchant/payments/status
Content-Type: application/json

Reference: https://docs.senjaropay.com/api-documentation/collections/get-payment-status

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: SenjaroPay API
  version: 1.0.0
paths:
  /senjaropay/merchant/payments/status:
    post:
      operationId: getPaymentStatus
      summary: Get payment status
      tags:
        - subpackage_collections
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Status found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentStatusResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentStatusRequest'
servers:
  - url: https://api.senjaropay.com
    description: SenjaroPay API
components:
  schemas:
    PaymentStatusRequest:
      type: object
      properties:
        referenceId:
          type: string
      required:
        - referenceId
      title: PaymentStatusRequest
    PaymentStatusResponse:
      type: object
      properties:
        message:
          type: string
        transactionId:
          type: string
        displayId:
          type: string
        method:
          type: string
        status:
          type: string
        reference_id:
          type: string
        amount:
          type: string
        currency:
          type: string
        created_at:
          type: string
          format: date-time
      title: PaymentStatusResponse
    ApiError:
      type: object
      properties:
        status:
          type: string
        code:
          type: integer
        error_code:
          type: string
        message:
          type: string
      title: ApiError
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
    apiSecretAuth:
      type: apiKey
      in: header
      name: x-api-secret

```

## Examples



**Request**

```json
{
  "referenceId": "mock-ref-7b2a4f3e"
}
```

**Response**

```json
{
  "message": "Transaction status retrieved from database",
  "transactionId": "TXN-MOCK-000123",
  "displayId": "SPMOCK.0001.000123",
  "method": "MOBILE",
  "status": "PENDING",
  "reference_id": "mock-ref-7b2a4f3e",
  "amount": "1000.00",
  "currency": "TZS",
  "created_at": "2026-01-01T10:30:00.000Z"
}
```

**SDK Code**

```python collections_getPaymentStatus_example
import requests

url = "https://api.senjaropay.com/senjaropay/merchant/payments/status"

payload = { "referenceId": "mock-ref-7b2a4f3e" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript collections_getPaymentStatus_example
const url = 'https://api.senjaropay.com/senjaropay/merchant/payments/status';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"referenceId":"mock-ref-7b2a4f3e"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go collections_getPaymentStatus_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.senjaropay.com/senjaropay/merchant/payments/status"

	payload := strings.NewReader("{\n  \"referenceId\": \"mock-ref-7b2a4f3e\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby collections_getPaymentStatus_example
require 'uri'
require 'net/http'

url = URI("https://api.senjaropay.com/senjaropay/merchant/payments/status")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"referenceId\": \"mock-ref-7b2a4f3e\"\n}"

response = http.request(request)
puts response.read_body
```

```java collections_getPaymentStatus_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.senjaropay.com/senjaropay/merchant/payments/status")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"referenceId\": \"mock-ref-7b2a4f3e\"\n}")
  .asString();
```

```php collections_getPaymentStatus_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.senjaropay.com/senjaropay/merchant/payments/status', [
  'body' => '{
  "referenceId": "mock-ref-7b2a4f3e"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp collections_getPaymentStatus_example
using RestSharp;

var client = new RestClient("https://api.senjaropay.com/senjaropay/merchant/payments/status");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"referenceId\": \"mock-ref-7b2a4f3e\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift collections_getPaymentStatus_example
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["referenceId": "mock-ref-7b2a4f3e"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.senjaropay.com/senjaropay/merchant/payments/status")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```