Mandates

Cancel Mandate

Cancel an active mandate, stopping all future collections

Cancel an active mandate, preventing any further collections against it.

Endpoint

POST /api/mandates/{mandate_id}/cancel

Authentication: Required (API Key)

Important Restrictions

  • Only mandates with status active can be cancelled
  • Cancellation is permanent. It cannot be undone.

Parameters

Path Parameters

ParameterTypeRequiredDescription
mandate_idintegerYesThe NjiaPay internal mandate ID

Example Request

curl -X POST "https://api.njiapay.com/api/mandates/42/cancel" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

Success (204 No Content)

No body is returned on success.

Error Responses

403 Forbidden

{
  "detail": "Mandate does not belong to this merchant"
}

404 Not Found

{
  "detail": "No active mandate found for this reference_id"
}

502 Bad Gateway

{
  "detail": "Mandate cancellation failed at payment provider"
}

Causes:

  • The payment provider returned an error or is unreachable.