Skip to main content

Error Reference

Token exchange errors

These errors are returned when the token exchange request fails.

Error CodeHTTP StatusDescriptionHow to fix
TokenExchange.InvalidGrantType400grantType is not the expected valueSet grantType to exactly urn:ietf:params:oauth:grant-type:jwt-bearer
TokenExchange.InvalidFormat400The assertion is not a valid JWTCheck that your assertion is a properly encoded JWT string
TokenExchange.MissingKid400JWT header is missing kid or it is not a valid UUIDAdd your API Key ID as the kid field in the JWT header
TokenExchange.KeyNotFound400No API key found for the given kidVerify your API Key ID in the Partner Portal
TokenExchange.KeyExpired400The API key has expiredRegister a new public key in the Partner Portal
TokenExchange.PartnerInactive400Your partner account is not activeContact RynoPay support
TokenExchange.InvalidSignature400JWT signature verification failedEnsure you are signing with the private key that matches the registered public key
TokenExchange.AssertionTooLong400JWT lifetime exceeds 5 minutesSet exp to no more than 300 seconds after iat
TokenExchange.SubMismatch400sub claim does not match issBoth iss and sub must be set to your Partner ID
TokenExchange.MissingJti400JWT is missing the jti claimAdd a unique jti value (UUID recommended)
TokenExchange.ReplayDetected400This jti has already been usedGenerate a new unique jti for every request
TokenExchange.KeyError400Stored public key could not be loadedContact RynoPay support -- this is a server-side configuration issue

API errors

These errors may be returned when calling any RynoPay API endpoint.

HTTP StatusDescriptionHow to fix
401 UnauthorizedAccess token is missing, invalid, or expiredPerform a new token exchange to get a fresh access token
403 ForbiddenInsufficient scope for this endpointRequest the required scope in your token exchange
429 Too Many RequestsRate limit exceededWait and retry. See Rate Limits

Error response format

All error responses follow this structure:

{
"isSuccess": false,
"error": {
"code": "TokenExchange.InvalidSignature",
"message": "JWT assertion signature validation failed"
}
}

Troubleshooting

"InvalidSignature" but my key is correct

  • Make sure the private key you are signing with matches the public key registered in the Partner Portal.
  • Verify you are using the correct kid (API Key ID). If you have multiple keys, you may be using the wrong one.
  • Check that your JWT library is using ES256 (not RS256 or another algorithm).

"ReplayDetected" on first attempt

  • Your jti must be globally unique. If you are restarting your application and generating jti values from a counter, switch to UUID v4.
  • Check your server clock -- if iat is in the past and the jti was already used in a previous session, this error will occur.

"AssertionTooLong" with a 5-minute expiry

  • The validation checks exp - iat, not exp - now. Make sure iat is set to the current time, not a time in the past.

Getting help

If you cannot resolve an error, contact the RynoPay partner support team with:

  • Your Partner ID
  • The error code and full response body
  • The timestamp of the failed request (UTC)
  • Your programming language and JWT library version