Complete reference for all classes, methods, and response models in the nekuda SDKs.
https://api.nekuda.ai
as the default base_url
.
sk_live_
or sk_test_
). Must be
provided either directly or via the NEKUDA_API_KEY
environment variable.https://staging-api.nekuda.ai
) or if using a mock
server. The SDK normalizes this URL.sleep = (2 ** (retry_attempt - 1)) * backoff_factor
.user(userId) -> UserContext
UserContext
for a specific user. This context automatically includes the user ID in subsequent API calls made through it. A user ID is a mandatory string that uniquely identifies your end-user.UserContext
is preferred over passing user ID to each client method directly.createMandate / create_mandate
userContext.createMandate(mandateData)
instead.Creates a purchase mandate (intent to buy) for a given user. This is a required first step before a card reveal token can be requested.requestCardRevealToken / request_card_reveal_token
userContext.requestCardRevealToken(mandateId)
instead.Requests a one-time, short-lived token to reveal card details for a specific mandate. A mandate must have been successfully created first to obtain a mandate ID.revealCardDetails / reveal_card_details
userContext.revealCardDetails(revealToken)
instead.Reveals actual card details using a valid reveal token.client.user(userId)
that automatically includes the user ID in all its API calls. This is the recommended way to interact with user-specific endpoints.
UserContext
object has the following methods:create_mandate(mandate_data: MandateData, request_id: Optional[str] = None) -> MandateCreateResponse
request_card_reveal_token(mandate_id: Union[str, int]) -> CardRevealTokenResponse
reveal_card_details(reveal_token: str) -> CardDetailsResponse
create_mandate
call. If not provided,
the SDK generates one.NekudaError
class.
Refer to the Error Handling guide for a detailed hierarchy and usage patterns.
NekudaError
(Base class)NekudaApiError
(Base for API-returned errors)
AuthenticationError
(401 - Invalid API key)InvalidRequestError
(4xx - e.g., bad parameters, resource not found)
CardNotFoundError
(Specific 404 for card not found)RateLimitError
(429 - Rate limit exceeded, SDK retries these)ServerError
(5xx - Server-side issue at nekuda, SDK retries these)NekudaConnectionError
(Network issues like DNS or TCP errors)NekudaValidationError
(Client-side or response data validation failure against Pydantic models)