PrinPoll developer docs

Developers

Errors

Understand API error responses and choose the right recovery action.

Response format

Partner API errors use an error object with code, message, and request_id. Every response also includes X-Request-Id. Request validation errors use the standard FastAPI 422 body, {"detail": [...]}. While the partner platform is disabled, routes return 404 {"detail":"Not Found"}.

Partner error response

Partner error response

{
  "error": {
    "code": "payment_refused",
    "message": "The payment could not be started.",
    "request_id": "req_example"
  }
}

Error codes

HTTPCodeMeaningWhat to do
400invalid_embed_originWidget embed_origin is not an https://host origin.Fix how the embedding page origin is derived.
400idempotency_key_requiredA required create/payment request omitted its key.Send the same Idempotency-Key when retrying the same attempt.
400payment_refusedCheckout refused the payment; message explains why.Show the message to the payer.
400sandbox_test_number_requiredThe sandbox received a non-test number.Use one of the sandbox numbers.
400wrong_mode_for_deploymentA key mode cannot be issued on this deployment.Create the key on the matching deployment.
401api_key_requiredA widget request omitted its key.Provide the publishable key.
401invalid_api_keyThe key is unknown or revoked.Check the key and replace it if revoked.
401wrong_key_typeThe request used the wrong key type.Use a secret key for server API routes or publishable key for widget routes.
401secret_key_in_browserA secret key arrived with an Origin header.Move the request to your server and rotate an exposed key.
403developer_not_activeDeveloper access is not approved or is suspended.Check access status in the organizer dashboard.
403origin_not_allowedA widget call did not come from PrinPoll's embed page.Use the supplied PrinPoll iframe flow.
403domain_not_allowedThe embedding domain is not allowed.Add the https domain in widget settings.
403widget_not_enabledThe developer has disabled the widget.Enable it in widget settings.
403test_key_on_liveA test key was sent to production.Use the sandbox API.
403live_key_on_sandboxA live key was sent to the sandbox.Use a test key or production API.
403unpublished_by_adminAn admin unpublished this API event.Contact PrinPoll; only an admin can republish it.
404event_not_availableThe event is not available to the widget.Check event ownership, publish state, readiness, and widget settings.
404results_not_availableThe vote event does not expose public results.Hide the results view.
404not_foundThe requested resource or payment is not available to this developer.Check the ID and refresh the resource.
409wrong_event_typeThe operation does not match the event type.Use the vote or ticket operation for that event.
409event_offlineThe API event is unpublished or otherwise offline.Bring the event online before accepting payments.
409event_not_readyThe event has no approved nominee or ticket type.Add the required event content first.
409premium_ticket_plan_missingThe Premium ticket plan is unavailable.Contact PrinPoll.
409request_in_progressThe same idempotency key is still processing.Retry after the response's Retry-After interval.
422idempotency_key_reusedThe same key was reused with a different request body.Use a new key for a new purchase attempt.
429rate_limitedA documented request or payment limit was reached.Wait for Retry-After before retrying.
503momo_unavailableThe mobile-money provider is unavailable.Retry later with the same idempotency key.
503rate_limiter_unavailableThe platform could not check rate limits.Retry later; the request is not allowed through unmetered.
503keys_not_configuredKey authentication or creation is not available.Contact PrinPoll.
503sandbox_misconfiguredThe sandbox payment service is not configured safely.Contact PrinPoll; do not retry against production.

The widget contract also documents 5xx responses for momo_unavailable, rate_limiter_unavailable, and keys_not_configured. Other server errors may be temporary; use a safe retry strategy.

Validation errors

A 422 response uses {"detail": [...]} for an invalid or missing field or parameter. Check each detail entry and correct the request before retrying. Do not retry an unchanged validation error.

Request IDs

Include request_id from the JSON body or X-Request-Id from the response headers when asking PrinPoll support about a failed request.