Versions in this module Expand all Collapse all v0 v0.1.0 Oct 18, 2026 Changes in this version + const DefaultBaseURL + const Version + var ErrWaitTimeout = errors.New("numberotp: timed out waiting for the code; the number is still open") + func Bool(v bool) *bool + func Float(v float64) *float64 + func Int(v int) *int + func String(v string) *string + func VerifyWebhook(rawBody []byte, signatureHeader, secret string) bool + type AccountService struct + func (s *AccountService) AppConfig(ctx context.Context, opts ...RequestOption) (*AppConfigResult, error) + func (s *AccountService) Delete(ctx context.Context, params DeleteMeParams, opts ...RequestOption) (*JSONObject, error) + func (s *AccountService) Get(ctx context.Context, opts ...RequestOption) (*MeResult, error) + func (s *AccountService) Transactions(ctx context.Context, opts ...RequestOption) (*ListResult, error) + type Activation struct + Cost float64 + Country string + CreatedAt string + ExpiresAt string + FullSMS *string + ID string + OTP *string + PhoneNumber string + Pool string + SMS []SMS + Service string + ServiceName string + Status string + func (a *Activation) Code() string + type ActivationClosedError struct + ActivationStatus string + func (e *ActivationClosedError) Error() string + type ActivationResult struct + Data Activation + Success bool + type ActivationsService struct + func (s *ActivationsService) Cancel(ctx context.Context, id string, opts ...RequestOption) (*ActivationResult, error) + func (s *ActivationsService) Create(ctx context.Context, params CreateActivationParams, opts ...RequestOption) (*CreateActivationResult, error) + func (s *ActivationsService) Finish(ctx context.Context, id string, opts ...RequestOption) (*ActivationResult, error) + func (s *ActivationsService) Get(ctx context.Context, id string, opts ...RequestOption) (*ActivationResult, error) + func (s *ActivationsService) List(ctx context.Context, params *ListActivationsParams, opts ...RequestOption) (*ListResult, error) + func (s *ActivationsService) Resend(ctx context.Context, id string, opts ...RequestOption) (*ActivationResult, error) + func (s *ActivationsService) WaitOnce(ctx context.Context, id string, opts ...RequestOption) (*WaitResult, error) + type ApiKeysService struct + func (s *ApiKeysService) Create(ctx context.Context, params CreateApiKeyParams, opts ...RequestOption) (*JSONObject, error) + func (s *ApiKeysService) Delete(ctx context.Context, params DeleteApiKeyParams, opts ...RequestOption) (*JSONObject, error) + func (s *ApiKeysService) List(ctx context.Context, opts ...RequestOption) (*JSONObject, error) + type AppConfig struct + IAP struct{ ... } + LatestVersion map[string]*string + Links map[string]string + Maintenance ... + MinVersion map[string]string + StoreURLs map[string]*string + WebTopup struct{ ... } + type AppConfigResult struct + Data AppConfig + Success bool + type AuthService struct + func (s *AuthService) DecideDeviceSignIn(ctx context.Context, params DecideDeviceSignInParams, opts ...RequestOption) (*JSONObject, error) + func (s *AuthService) GetDeviceSignIn(ctx context.Context, params *GetDeviceSignInParams, opts ...RequestOption) (*JSONObject, error) + func (s *AuthService) Revoke(ctx context.Context, params RevokeTokenParams, opts ...RequestOption) (*JSONObject, error) + func (s *AuthService) SendEmailCode(ctx context.Context, params SendEmailCodeParams, opts ...RequestOption) (*JSONObject, error) + func (s *AuthService) StartDeviceSignIn(ctx context.Context, params StartDeviceSignInParams, opts ...RequestOption) (*DeviceCode, error) + func (s *AuthService) Token(ctx context.Context, params OauthTokenParams, opts ...RequestOption) (*TokenResponse, error) + type Client struct + func NewClient(opts ...Option) *Client + func (c *Client) CreateAndWait(ctx context.Context, params CreateActivationParams, timeout time.Duration, ...) (*Activation, error) + func (c *Client) DeviceLogin(ctx context.Context, o DeviceLoginOptions) (*TokenResponse, error) + func (c *Client) RefreshToken() string + func (c *Client) SetTokens(tok TokenResponse) + func (c *Client) SignInWithEmailCode(ctx context.Context, email, code, platform, deviceName string) (*TokenResponse, error) + func (c *Client) SignOut(ctx context.Context) error + func (c *Client) StreamEvents(ctx context.Context, since string) iter.Seq2[Event, error] + func (c *Client) WaitForCode(ctx context.Context, id string, timeout time.Duration) (*Activation, error) + type ClientSession struct + CreatedAt string + Current bool + DeviceName string + ID string + LastSeenAt string + Platform string + Scopes []string + type ConvertResellerEarningsParams struct + Amount float64 + type CountriesService struct + func (s *CountriesService) List(ctx context.Context, params *ListCountriesParams, opts ...RequestOption) (*CountryList, error) + type Country struct + ID int + Name string + Rent int + Visible int + type CountryList struct + Data map[string]Country + Success bool + type CreateActivationParams struct + Country string + MaxPrice *float64 + Pool *string + Service string + WebhookURL *string + type CreateActivationResult struct + Balance float64 + Data struct{ ... } + Success bool + type CreateApiKeyParams struct + Name string + Scopes []string + type CreateAppleTopupParams struct + SignedTransaction string + type CreateCardTopupParams struct + Amount float64 + type CreateCryptoTopupParams struct + Amount float64 + type CreateGoogleTopupParams struct + ProductID string + PurchaseToken string + type CreateReminderParams struct + Country string + CountryName *string + Service string + ServiceName *string + type CreateRentalParams struct + Country string + Duration int + Service string + type CreateRentalResult struct + Balance float64 + Data struct{ ... } + Success bool + type CreateResellerCardTopupParams struct + Amount float64 + type CreateResellerCryptoTopupParams struct + Amount float64 + type CreateResellerUserParams struct + AllowSelfFund *bool + Email string + InitialBalance *float64 + Name *string + Password string + type DecideDeviceSignInParams struct + Action string + UserCode string + type DeleteApiKeyParams struct + ID string + type DeleteMeParams struct + Confirm string + type DeviceCode struct + DeviceCode string + ExpiresIn int + Interval int + UserCode string + VerificationURI string + VerificationURIComplete string + type DeviceLoginOptions struct + Client string + DeviceName string + OnCode func(DeviceCode) + type DevicesService struct + func (s *DevicesService) List(ctx context.Context, opts ...RequestOption) (*JSONObject, error) + func (s *DevicesService) Register(ctx context.Context, params RegisterPushDeviceParams, opts ...RequestOption) (*JSONObject, error) + func (s *DevicesService) Unregister(ctx context.Context, params UnregisterPushDeviceParams, opts ...RequestOption) (*JSONObject, error) + func (s *DevicesService) Update(ctx context.Context, params UpdatePushDeviceParams, opts ...RequestOption) (*JSONObject, error) + type Error struct + Body map[string]any + Code string + Message string + Status int + func (e *Error) Error() string + func (e *Error) IsConflict() bool + func (e *Error) IsInsufficientBalance() bool + func (e *Error) IsNotFound() bool + func (e *Error) IsRateLimited() bool + func (e *Error) IsUnauthorized() bool + type Event struct + CreatedAt string + Data json.RawMessage + ID string + Initiator string + Refunded *bool + StreamID string + Type string + func (e Event) Activation() (*Activation, error) + type EventPoll struct + Cursor string + Data []Event + Success bool + type EventsService struct + func (s *EventsService) Poll(ctx context.Context, params *StreamEventsParams, opts ...RequestOption) (*EventPoll, error) + type ExtendOptionsResult struct + Data map[string]float64 + Success bool + type ExtendRentalParams struct + Hours int + type GetDeviceSignInParams struct + UserCode string + type GetPricesParams struct + Country *string + Service *string + type GetRentPricesParams struct + Service string + type IapTopupResult struct + Data struct{ ... } + Success bool + type JSONObject map[string]any + type ListActivationsParams struct + Limit *int + Status *string + type ListCountriesParams struct + Service *string + type ListResult struct + Data []JSONObject + Success bool + type ListServicesParams struct + Country *string + type Loyalty struct + Discount float64 + Label string + Level int + NextTier ... + ProgressPct float64 + WeeklyActivations int + WeeklyTopup float64 + type Me struct + Auth struct{ ... } + Balance float64 + CreatedAt string + Currency string + Email string + EmailVerified bool + ID string + Loyalty *Loyalty + Name *string + OnHold float64 + OpenNumbers int + Restrictions struct{ ... } + type MeResult struct + Data Me + Success bool + type OauthTokenParams struct + Extra map[string]string + GrantType string + type Option func(*config) + func WithAPIKey(key string) Option + func WithBaseURL(u string) Option + func WithHTTPClient(h *http.Client) Option + func WithHeader(key, value string) Option + func WithMaxRetries(n int) Option + func WithOnTokens(fn func(TokenResponse)) Option + func WithTimeout(d time.Duration) Option + func WithTokens(accessToken, refreshToken string) Option + type PoolOffer struct + Cost float64 + Count int + Quality *float64 + type PriceEntry struct + Cost float64 + Count int + Personalized bool + Pool string + Pools map[string]PoolOffer + Quality float64 + type PriceList struct + Data map[string]map[string]PriceEntry + Success bool + type PricesService struct + func (s *PricesService) Get(ctx context.Context, params *GetPricesParams, opts ...RequestOption) (*PriceList, error) + func (s *PricesService) Rentals(ctx context.Context, params *GetRentPricesParams, opts ...RequestOption) (*RentPriceList, error) + type RegisterPushDeviceParams struct + Kind *string + Locale *string + Platform *string + ShowCode *bool + Subscription map[string]any + Token *string + type RemindersService struct + func (s *RemindersService) Create(ctx context.Context, params CreateReminderParams, opts ...RequestOption) (*JSONObject, error) + func (s *RemindersService) Delete(ctx context.Context, id string, opts ...RequestOption) (*JSONObject, error) + func (s *RemindersService) List(ctx context.Context, opts ...RequestOption) (*JSONObject, error) + type RentPriceList struct + Data map[string]map[string]struct{ ... } + Success bool + type Rental struct + Country string + ExpiresAt string + ID string + PhoneNumber string + RentDurationHours int + SMSHistory []struct{ ... } + Service string + ServiceName string + Status string + type RentalResult struct + Data Rental + Success bool + type RentalsService struct + func (s *RentalsService) Cancel(ctx context.Context, id string, opts ...RequestOption) (*JSONObject, error) + func (s *RentalsService) Create(ctx context.Context, params CreateRentalParams, opts ...RequestOption) (*CreateRentalResult, error) + func (s *RentalsService) Extend(ctx context.Context, id string, params ExtendRentalParams, ...) (*JSONObject, error) + func (s *RentalsService) ExtendOptions(ctx context.Context, id string, opts ...RequestOption) (*ExtendOptionsResult, error) + func (s *RentalsService) Get(ctx context.Context, id string, opts ...RequestOption) (*RentalResult, error) + func (s *RentalsService) List(ctx context.Context, opts ...RequestOption) (*ListResult, error) + type RequestOption func(*requestConfig) + func WithIdempotencyKey(k string) RequestOption + func WithRequestHeader(key, value string) RequestOption + func WithRequestRetries(n int) RequestOption + func WithRequestTimeout(d time.Duration) RequestOption + type ResellerPublicService struct + func (s *ResellerPublicService) Brand(ctx context.Context, resellerPublicId string, opts ...RequestOption) (*JSONObject, error) + func (s *ResellerPublicService) CardTopup(ctx context.Context, resellerPublicId string, ...) (*JSONObject, error) + func (s *ResellerPublicService) CryptoTopup(ctx context.Context, resellerPublicId string, ...) (*JSONObject, error) + func (s *ResellerPublicService) Signup(ctx context.Context, resellerPublicId string, params ResellerSignupParams, ...) (*JSONObject, error) + type ResellerService struct + func (s *ResellerService) CardTopup(ctx context.Context, params CreateResellerCardTopupParams, ...) (*JSONObject, error) + func (s *ResellerService) ConvertEarnings(ctx context.Context, params ConvertResellerEarningsParams, ...) (*JSONObject, error) + func (s *ResellerService) CreateUser(ctx context.Context, params CreateResellerUserParams, opts ...RequestOption) (*JSONObject, error) + func (s *ResellerService) CryptoTopup(ctx context.Context, params CreateResellerCryptoTopupParams, ...) (*JSONObject, error) + func (s *ResellerService) DeleteUser(ctx context.Context, subUserId string, opts ...RequestOption) (*JSONObject, error) + func (s *ResellerService) GetMarkup(ctx context.Context, opts ...RequestOption) (*JSONObject, error) + func (s *ResellerService) GetProfile(ctx context.Context, opts ...RequestOption) (*JSONObject, error) + func (s *ResellerService) GetUser(ctx context.Context, subUserId string, opts ...RequestOption) (*JSONObject, error) + func (s *ResellerService) ListUsers(ctx context.Context, opts ...RequestOption) (*JSONObject, error) + func (s *ResellerService) UpdateMarkup(ctx context.Context, params UpdateResellerMarkupParams, opts ...RequestOption) (*JSONObject, error) + func (s *ResellerService) UpdateProfile(ctx context.Context, params UpdateResellerProfileParams, opts ...RequestOption) (*JSONObject, error) + func (s *ResellerService) UpdateUser(ctx context.Context, subUserId string, params UpdateResellerUserParams, ...) (*JSONObject, error) + func (s *ResellerService) WithdrawEarnings(ctx context.Context, params WithdrawResellerEarningsParams, ...) (*JSONObject, error) + type ResellerSignupParams struct + Email string + Name *string + Password string + TurnstileToken string + type ResellerSubUserCardTopupParams struct + Amount float64 + type ResellerSubUserCryptoTopupParams struct + Amount float64 + type RevokeSessionsParams struct + All *bool + ID *string + type RevokeTokenParams struct + Token string + type SMS struct + Code string + ReceivedAt string + Text string + type SearchServicesParams struct + Limit *int + Q string + type SendEmailCodeParams struct + Email string + type ServiceList struct + Data struct{ ... } + Success bool + type ServiceMatch struct + Code string + Name string + Score int + type ServiceSearchResult struct + Data []ServiceMatch + Fallback *ServiceMatch + Query struct{ ... } + Success bool + type ServicesService struct + func (s *ServicesService) List(ctx context.Context, params *ListServicesParams, opts ...RequestOption) (*ServiceList, error) + func (s *ServicesService) Search(ctx context.Context, params *SearchServicesParams, opts ...RequestOption) (*ServiceSearchResult, error) + type SessionList struct + Data []ClientSession + Success bool + type SessionsService struct + func (s *SessionsService) List(ctx context.Context, opts ...RequestOption) (*SessionList, error) + func (s *SessionsService) Revoke(ctx context.Context, params RevokeSessionsParams, opts ...RequestOption) (*JSONObject, error) + type SetWebhookParams struct + WebhookURL *string + type StartDeviceSignInParams struct + Client *string + DeviceName *string + type StreamEventsParams struct + Since *string + type TokenResponse struct + AccessToken string + ExpiresIn int + NewUser *bool + RefreshToken string + Scope string + SessionID string + TokenType string + type Topup struct + Amount float64 + CreatedAt string + ID string + Method string + Status string + type TopupResult struct + Data Topup + Success bool + type TopupStarted struct + InvoiceID string + Success bool + TransactionID string + URL string + type TopupsService struct + func (s *TopupsService) Apple(ctx context.Context, params CreateAppleTopupParams, opts ...RequestOption) (*IapTopupResult, error) + func (s *TopupsService) Card(ctx context.Context, params CreateCardTopupParams, opts ...RequestOption) (*TopupStarted, error) + func (s *TopupsService) Crypto(ctx context.Context, params CreateCryptoTopupParams, opts ...RequestOption) (*TopupStarted, error) + func (s *TopupsService) Get(ctx context.Context, id string, opts ...RequestOption) (*TopupResult, error) + func (s *TopupsService) Google(ctx context.Context, params CreateGoogleTopupParams, opts ...RequestOption) (*IapTopupResult, error) + type UnregisterPushDeviceParams struct + ID *string + Token *string + type UpdatePushDeviceParams struct + ShowCode bool + Token string + type UpdateResellerMarkupParams struct + AutoAdjustLoyalty *bool + CountryOverrides map[string]any + Global *float64 + Overrides map[string]any + type UpdateResellerProfileParams struct + AllowSelfFundDefault *bool + BrandName *string + Color *string + LogoURL *string + MinSubUserTopup *float64 + WebhookSecret *string + WebhookURL *string + type UpdateResellerUserParams struct + AllowSelfFund *bool + BalanceDelta *float64 + Suspended *bool + type WaitResult struct + Data struct{ ... } + Success bool + type WebhookPayload struct + Country string + Event string + EventID string + FullSMS *string + ID string + OTP *string + PhoneNumber string + Service string + Status string + type WebhookService struct + func (s *WebhookService) Get(ctx context.Context, opts ...RequestOption) (*JSONObject, error) + func (s *WebhookService) Set(ctx context.Context, params SetWebhookParams, opts ...RequestOption) (*JSONObject, error) + type WithdrawResellerEarningsParams struct + Amount float64 + CryptoAddress string + Currency string