In Lesson 2.3 Eric’s enrollment failed with 409 ALREADY_ENROLLED, which made the workflow fail. But Eric is enrolled. For Irembo that is a success. New idea: successCondition + successTransform, which turn a partner error into a success.
| Field | Value | |
|---|---|---|
| **Endpoint adapter *** | PMAPPING (push) |
locked after save |
| **Endpoint code *** | VICTOR_KEZA_ENROLLMENT_SAFE_PUSH |
locked after save |
| **Endpoint url *** | http://mock-service-engine.apps:8000/victor/keza/v1/enrollments |
|
| **Endpoint type *** | PUSH (set by the adapter) |
|
| **Endpoint name *** | Victor KEZA Enrollment Safe |
|
| **Partner *** | KEZA |
locked after save |
| Active | ON |
|
| **Endpoint description *** | Victor course: enrollment push that treats ALREADY_ENROLLED as success. |
**Endpoint Mapping ***
{
"method": "POST",
"body": {
"applicationNumber": applicationNumber,
"programCode": programCode,
"centerCode": centerCode,
"learner": {
"nationalId": nationalId,
"fullName": firstName & " " & lastName,
"phone": phoneNumber
}
},
"auth": {
"type": "USER_CREDENTIALS",
"baseUrl": "http://mock-service-engine.apps:8000",
"parameters": {
"authPath": "/victor/keza/v1/auth/login",
"bodyTemplate": { "username": "irembo-integration", "password": "Keza@2026" }
},
"tokenConfig": {
"storageKey": "VICTOR_KEZA_TOKEN",
"headerName": "Authorization",
"tokenPrefix": "Bearer",
"expiryBuffer": 300,
"extractPath": "data.token"
}
},
"response": {
"validation": {
"successCondition": code = "ALREADY_ENROLLED",
"successTransform": {
"enrollmentId": enrollmentId,
"status": "CONFIRMED",
"note": "KEZA already had this enrollment"
}
}
}
}
Secrets · training literal. Hard-coded only because KEZA is a training mock. In a real integration use the environment variable instead: Keza@2026 → "${KEZA_PASSWORD}" (the whole quoted string, nothing before or after; see Lesson 3.4).
Eric is pushed with a new application number, C260926081700VICTR3. KEZA answers 409 ALREADY_ENROLLED. What will the engine return: HTTP status, responseCode and message?
HTTP 200 1.29 s captured on staging · 26 Sep 2026
1 · Request (curl)
curl -s -X POST "https://admin-gateway.staging.iremboinc.com/integration/v1/push/sync" \
-H "Authorization: Bearer $TOKEN" \
-H "portal: administration-management-portal" \
-H "Content-Type: application/json" \
-d '{
"endpointCode": "VICTOR_KEZA_ENROLLMENT_SAFE_PUSH",
"callerId": "victor-course",
"requester": "victor-course",
"applicationNumber": "C260926081700VICTR3",
"payload": {
"applicationNumber": "C260926081700VICTR3",
"programCode": "DATA_ANALYTICS",
"centerCode": "KZ-GSB-01",
"nationalId": "1199770098765432",
"firstName": "Eric",
"lastName": "Habimana",
"phoneNumber": "0788000111"
}
}' | jq
2 · Real response
{
"status": true,
"responseCode": "PUSH_SYNC",
"responseMessage": "PUSH_SYNC",
"data": {
"id": "35976a6d-7de0-41b3-9f67-413517150b6f",
"endpointCode": "VICTOR_KEZA_ENROLLMENT_SAFE_PUSH",
"callerId": "victor-course",
"message": "{\"enrollmentId\":\"ENR-2026-0042\",\"status\":\"CONFIRMED\",\"note\":\"KEZA already had this enrollment\"}",
"adapterCode": "PMAPPING",
"applicationDetails": null
},
"timestamp": "2026-09-26T09:52:27.012775894",
"traceId": "6ab779ba96bed79dc52ee67f92c875b5"
}
3 · Decoded data.message
{
"enrollmentId": "ENR-2026-0042",
"status": "CONFIRMED",
"note": "KEZA already had this enrollment"
}
4 · What to notice
data.message holds the successTransform, with KEZA’s id ENR-2026-0042.Which validation do I need?
| Partner answers | Use | Caller gets |
|---|---|---|
| 2xx, but the body means “no” | failureCondition + errorMapping | 400 or 404 with your code |
| 4xx, but the body means “fine” | successCondition + successTransform | 200 with your object |
| 2xx and fine | optional transform | 200 |
| 4xx/5xx and really bad | nothing | 500 PARTNER_ERROR_* with the partner body |
A partner returns 404 {"code":"NO_DEBT"} when a citizen owes nothing, and the service should continue. Which mapping?
D. A 4xx never reaches transform or failureCondition. Only successCondition can turn it into a success.
Your turn · turn your 409 into a success
Create
${YOUR_FIRST_NAME}_KEZA_ENROLLMENT_SAFE_PUSH(PMAPPING: a workflow calls it) on your enrollment mock from Lesson 2.3. Replace the variables before saving (Aline →ALINE_…,/aline/…). Push Eric with a new application number, for exampleC2609260900${FIRST4}03.Done when: the push returns PUSH_SYNC 200 with KEZA’s enrollment id in
data.message. Then removesuccessCondition, push with another new number, and confirm 500 PARTNER_ERROR_PUSH. Restore the condition.
← 4.2 Reject business failures: eligibility decision · 4.4 Cache slow lookups: districts →