PSP Enrollment API

Integrate caregiver enrollment for payment service providers using /api/v1/psp_enrollment. Authenticate with a LEAP session token whose organisation code matches your PSP Code.

GET PUT
Overview

The PSP Enrollment API lets a payment service provider retrieve primary caregiver enrollment records for households assigned to their organisation, then submit completed enrollment responses (payment card / ezwich details).

  • Base path: /api/v1/psp_enrollment (alias /api/v1/psp-enrollment)
  • Content type: application/json for PUT body
  • GET filters: optional region_code, district_code, and community_code (match household location columns on lpm_households_selected_all)
  • PUT target: mark lpm_psp_enrollment_request as updated (requestStatusId = 2) and upsert into lpm_caregivers_psp
Authentication

Sign in with POST /api/v1/session to obtain a session token. Send that token on every request using one of these headers:

token: YOUR_SESSION_TOKEN
Authorization: Bearer YOUR_SESSION_TOKEN
x-access-token: YOUR_SESSION_TOKEN

Example login:

curl -X POST "https://YOUR_HOST/api/v1/session" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "0XXXXXXXXX",
    "password": "YOUR_PASSWORD",
    "organisation_code": "GHIPSS"
  }'
GET caregivers
GET /api/v1/psp_enrollment

Returns a paginated list of caregiver enrollment records for the authenticated PSP. Records require a named primary caregiver. Optional secondary caregiver fields are included when present. Each household returned is logged in the caregiver request audit table (LIST).

Query parameters
Name Type Default Description
offset integer 0 Number of rows to skip (≥ 0).
limit integer 100 Page size (1–500).
region_code string Optional. Region Code as received from Region endpoint.
district_code string Optional. District Code as received from District endpoint.
community_code string Optional. Community Code as received from Community endpoint.

Location filters may be combined with AND. They match region_code / district_code / community_code on lpm_households_selected_all.

Example request
curl -X GET "https://YOUR_HOST/api/v1/psp_enrollment?offset=0&limit=100&region_code=02&district_code=02-03&community_code=02-03-006" \
  -H "token: YOUR_SESSION_TOKEN"
Example response
{
  "successful": true,
  "totalCount": 1250,
  "offset": 0,
  "limit": 100,
  "data": [
    {
      "communityCode": "02-03-006",
      "communityId": "412",
      "communityName": "Example Community",
      "districtCode": "02-03",
      "districtId": "88",
      "districtName": "Example District",
      "gpsLatitude": "6.92999836",
      "gpsLongitude": "-2.83813443",
      "householdCode": "03-BJSJ",
      "householdHeadName": "AUGUSTINA MAWUENA",
      "householdPhoneNumber": "0531122057",
      "householdUUID": "02-03-006-1740462725749-B@7fc4447",
      "householdUniqueCode": "03-02-03-006-000005",
      "primaryCaregiverDateOfBirth": "1989-01-01",
      "primaryCaregiverFirstname": "AUGUSTINA",
      "primaryCaregiverGhanaCardFirstname": "",
      "primaryCaregiverGhanaCardLastname": "",
      "primaryCaregiverGhanaCardNumber": "GHA-726422577-6",
      "primaryCaregiverLastname": "",
      "primaryCaregiverOthernames": "MAWUENA",
      "primaryCaregiverPhoneNumber": "0531122057",
      "primaryCaregiverSex": "Female",
      "primaryCaregiverUUID": "",
      "regionCode": "02",
      "regionId": "2",
      "regionName": "Example Region",
      "secondaryCaregiverDateOfBirth": "",
      "secondaryCaregiverFirstname": "",
      "secondaryCaregiverGhanaCardFirstname": "",
      "secondaryCaregiverGhanaCardLastname": "",
      "secondaryCaregiverGhanaCardNumber": "",
      "secondaryCaregiverId": "15",
      "secondaryCaregiverLastname": "",
      "secondaryCaregiverOthernames": "",
      "secondaryCaregiverPhoneNumber": "0244000000",
      "secondaryCaregiverSex": "",
      "secondaryCaregiverUUID": ""
    }
  ]
}

Response object keys are returned in alphabetical order. When is_special is yes on the household, that field is included.

PUT caregiver enrollment
PUT /api/v1/psp_enrollment

Submit one or more completed caregiver enrollment responses as a JSON array. Each item is validated and processed in order.

For each item the API:

  • Body must be a non-empty JSON array (1–500 items).
  • Send requestId for reliable matching.
  • Overall HTTP status: 200 all ok, 207 partial, 400 none saved / invalid body.
Required item fields
Field Required Description
paymentCardNumber Yes Payment / ezwich card number (max 80 characters). Alias: primaryCaregiverEzwichCardNumber.
paymentCardFirstname Yes Name on the payment card (max 150).
paymentCardLastname Yes Last name on the payment card (max 150).
paymentCardExpiryDate Yes Valid card expiry date (ISO or YYYY-MM-DD).
enrolmentReferenceId Yes Enrollment reference id (max 100). Alias: enrollmentReferenceId.
primaryCaregiverFirstname Yes Primary caregiver first name (max 150).
primaryCaregiverLastname Yes Primary caregiver last name (max 150).
primaryCaregiverPhoneNumber Yes Primary caregiver phone number (max 50).
primaryCaregiverSex Yes Male or Female (case-insensitive).
primaryCaregiverGhanaCardNumber Yes Ghana Card number (max 50).
requestId Recommended lpm_psp_enrollment_request.id. Preferred for matching. When omitted, the latest matching request for the household is used.
householdUUID Recommended Household UUID used to locate the enrollment request. Alias: gnhr_uuid.
primaryCaregiverUUID No Stored on the caregivers PSP row when provided.
Optional item fields (persisted on upsert)

Additional attributes are accepted, including (non-exhaustive): updateDate, primaryCaregiverId, primaryCaregiverOthernames, primaryCaregiverDateOfBirth, secondary caregiver fields, enrolmentDate, paymentCardType, paymentCardIssueDate, paymentCardOthernames, and isDuplicate.

Example request
curl -X PUT "https://YOUR_HOST/api/v1/psp_enrollment" \
  -H "Content-Type: application/json" \
  -H "token: YOUR_SESSION_TOKEN" \
  -d '[
  {
    "requestId": 391599,
    "householdUUID": "f65935be-536b-11f1-960f-7aaf00f2bedf",
    "primaryCaregiverUUID": "b65f1776-536b-11f1-960f-7aaf00f2bedf",
    "updateDate": "2026-07-02T00:00:00.000Z",
        "enrolmentDate": "2026-05-12",
        "paymentCardType": "CARD",
        "paymentCardNumber": "GC178708643679180420",
        "primaryCaregiverId": 2294637,
        "paymentCardLastname": "AWUDU",
        "primaryCaregiverSex": "Male",
        "enrolmentReferenceId": "GH940601000013",
        "paymentCardFirstname": "ISSIFU",
        "paymentCardIssueDate": "2026-05-12T00:00:00.000Z",
        "primaryCaregiverUUID": "d7a14b02-536b-11f1-960f-7aaf00f2bedf",
        "secondaryCaregiverId": 0,
        "paymentCardExpiryDate": "2036-05-04T00:00:00.000Z",
        "paymentCardOthernames": "",
        "secondaryCaregiverSex": "",
        "secondaryCaregiverUUID": "",
        "primaryCaregiverLastname": "AWUDU",
        "primaryCaregiverFirstname": "ISSIFU",
        "primaryCaregiverOthernames": " ",
        "secondaryCaregiverLastname": "",
        "primaryCaregiverDateOfBirth": "1994-06-01T00:00:00.000Z",
        "primaryCaregiverPhoneNumber": "+233246032178",
        "secondaryCaregiverFirstname": "",
        "primaryCaregiverIsDuplicated": false,
        "secondaryCaregiverOthernames": "",
        "secondaryCaregiverDateOfBirth": null,
        "secondaryCaregiverPhoneNumber": "",
        "primaryCaregiverGhanaCardNumber": "GHA-729527365-4",
        "secondaryCaregiverGhanaCardNumber": ""
  }
]'
Response envelope
Field Description
successful true only when every item succeeded.
totalCount Number of items in the request array.
successCount / failureCount How many items succeeded or failed.
data Per-item results (same order as the request), each with its own successful, index, status, and message.
Per-item success fields
Field Description
requestId Matched lpm_psp_enrollment_request.id.
requestStatusId Set to 2 (updated) after a successful PUT.
responseAction ENROLLED.
paymentCardNumber Saved payment / ezwich card number.
caregiversPspId Row id in lpm_caregivers_psp (inserted or updated).
caregiversPspUpserted inserted or updated.
requestRowsUpdated Rows updated on lpm_psp_enrollment_request (normally 1).
Example success response (HTTP 200)
{
  "successful": true,
  "message": "Caregiver enrollments saved.",
  "totalCount": 1,
  "successCount": 1,
  "failureCount": 0,
  "data": [
    {
      "successful": true,
      "index": 0,
      "householdUUID": "f65935be-536b-11f1-960f-7aaf00f2bedf",
      "requestId": 391599,
      "primaryCaregiverUUID": "b65f1776-536b-11f1-960f-7aaf00f2bedf",
      "paymentCardNumber": "1022105822",
      "responseAction": "ENROLLED",
      "requestStatusId": 2,
      "caregiversPspId": 42,
      "caregiversPspUpserted": "inserted",
      "message": "Caregiver enrollment saved.",
      "requestRowsUpdated": 1,
      "status": 200
    }
  ]
}
Example partial failure (HTTP 207)
{
  "successful": false,
  "message": "Completed with some failures.",
  "totalCount": 2,
  "successCount": 1,
  "failureCount": 1,
  "data": [
    {
      "successful": true,
      "index": 0,
      "householdUUID": "f65935be-536b-11f1-960f-7aaf00f2bedf",
      "requestId": 391599,
      "primaryCaregiverUUID": "b65f1776-536b-11f1-960f-7aaf00f2bedf",
      "paymentCardNumber": "1022105822",
      "responseAction": "ENROLLED",
      "requestStatusId": 2,
      "caregiversPspId": 42,
      "caregiversPspUpserted": "updated",
      "message": "Caregiver enrollment saved.",
      "requestRowsUpdated": 1,
      "status": 200
    },
    {
      "successful": false,
      "index": 1,
      "householdUUID": "UNKNOWN-UUID",
      "requestId": 999999,
      "message": "No enrollment request found for this householdUUID / requestId.",
      "status": 404
    }
  ]
}
Errors
HTTP When
400 Invalid/empty body, more than 500 items, missing required enrollment fields, or every array item failed.
207 Partial success — inspect each entry in data for per-item status / message.
401 No valid session token.
403 Session is not a registered/active PSP.
404 Per-item: no matching lpm_psp_enrollment_request for your PSP / householdUUID / requestId.
409 Per-item: enrollment request found but could not be updated.
405 Unsupported method (POST / DELETE).
500 Database or server error.
Response fields

Each object in the GET data array uses these fields. Empty strings are returned when a value is unavailable.

Field Notes
householdUUIDGNHR household UUID (gnhrHouseholdUUID).
householdUniqueCodeLEAP unique code (e.g. 03-02-03-006-000005).
householdCodeShort household code (e.g. 03-BJSJ).
householdHeadNameFrom primary caregiver name parts, else household head name.
householdPhoneNumberHead phone, else primary caregiver phone.
gpsLatitude / gpsLongitudeHousehold GPS coordinates.
regionCode / regionId / regionNameFrom household region_code joined to lpm_regions.
districtCode / districtId / districtNameFrom household district_code joined to lpm_districts.
communityCode / communityId / communityNameFrom household community_code joined to lpm_communities.
primaryCaregiverUUIDPrimary caregiver UUID when available.
primaryCaregiverFirstname / Othernames / LastnameSplit from caregiver display / non-member name.
primaryCaregiverSexMale or Female.
primaryCaregiverDateOfBirthYYYY-MM-DD.
primaryCaregiverPhoneNumberPrimary caregiver contact number.
primaryCaregiverGhanaCard*Ghana Card number and name fields.
secondaryCaregiverIdSecondary caregiver row id when present.
secondaryCaregiver*Secondary caregiver name, phone, and Ghana Card fields when present.
is_specialIncluded only when the household flag is yes.