Skip to main content

Getting Started with Univapay Public API

Introduction

OpenAPI specification for the Univapay Online Payment API.

Authentication (JWT)

This API uses JWT (JSON Web Tokens) for authentication via the HTTP Authorization header. To authenticate, you must generate an Application Token in the Univapay dashboard. This generates two components: 1. Token ({jwt}) 2. Secret ({secret})

⚠️ Security Warning

The Secret grants extensive privileges (e.g., creating charges, capturing authorized card charges, refunding). NEVER expose the {secret} in frontend application code (e.g., consumer browsers) or public repositories. It is strictly for backend server-to-server communication. Univapay is not responsible for accidents caused by leaked secrets.

Bearer Auth Formats

Depending on where you are calling the API from, the Bearer format changes:

  • Frontend / Browser (No Secret): Bearer {jwt} (Used for Widgets or Inline Forms. You must register your allowed domains in the dashboard when creating the token).
  • Backend / Server (With Secret): Bearer {secret}.{jwt} (Required for all backend processing).

We will assume that all requests are going to originate from a backend server thus, all requests will require the secret

Token Types

  • Store Token: Grants full access to requests for that specific store.
  • Merchant Token: Can't create transaction tokens but can access data from multiple stores.

Install the Package

The package is compatible with Python versions 3.7+. Install the package from PyPi using the following pip command:

pip install univapay-apimatic-sdk==1.0.2

You can also view the package at: https://pypi.python.org/pypi/univapay-apimatic-sdk/1.0.2

Test the SDK

You can test the generated SDK and the server with test cases. unittest is used as the testing framework and pytest is used as the test runner. You can run the tests as follows:

Navigate to the root directory of the SDK and run the following commands

pip install -r test-requirements.txt pytest

Initialize the API Client

Note: Documentation for the client can be found here.

The following parameters are configurable for the API Client:

Parameter Type Description
base_url str Base URL for the API
Default: "https://api.gyro-n.money"
direct_debit_base_url str Base URL for the Direct Debit API
Default: "https://staging-direct-debit.gopay-services.com"
environment Environment The API environment.
Default: Environment.PRODUCTION
http_client_instance Union[Session, HttpClientProvider] The Http Client passed from the sdk user for making requests
override_http_client_configuration bool The value which determines to override properties of the passed Http Client from the sdk user
http_call_back HttpCallBack The callback value that is invoked before and after an HTTP call is made to an endpoint
timeout float The value to use for connection timeout.
Default: 30
max_retries int The number of times to retry an endpoint call if it fails.
Default: 0
backoff_factor float A backoff factor to apply between attempts after the second try.
Default: 2
retry_statuses Array of int The http statuses on which retry is to be done.
Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]
retry_methods Array of string The http methods on which retry is to be done.
Default: ["GET", "PUT"]
proxy_settings ProxySettings Optional proxy configuration to route HTTP requests through a proxy server.
logging_configuration LoggingConfiguration The SDK logging configuration for API calls
bearer_auth_credentials BearerAuthCredentials The credential object for OAuth 2 Bearer token

The API client can be initialized as follows:

Code-Based Client Initialization

import logging

from univapayclientsdk.configuration import Environment
from univapayclientsdk.http.auth.oauth_2 import BearerAuthCredentials
from univapayclientsdk.logging.configuration.api_logging_configuration import LoggingConfiguration
from univapayclientsdk.logging.configuration.api_logging_configuration import RequestLoggingConfiguration
from univapayclientsdk.logging.configuration.api_logging_configuration import ResponseLoggingConfiguration
from univapayclientsdk.univapay_client_sdk_client import UnivapayClientSdkClient

client = UnivapayClientSdkClient(
    bearer_auth_credentials=BearerAuthCredentials(
        access_token='AccessToken'
    ),
    environment=Environment.PRODUCTION,
    base_url='https://api.gyro-n.money',
    direct_debit_base_url='https://staging-direct-debit.gopay-services.com',
    logging_configuration=LoggingConfiguration(
        log_level=logging.INFO,
        request_logging_config=RequestLoggingConfiguration(
            log_body=True
        ),
        response_logging_config=ResponseLoggingConfiguration(
            log_headers=True
        )
    )
)

Environment-Based Client Initialization

from univapayclientsdk.univapay_client_sdk_client import UnivapayClientSdkClient

# Specify the path to your .env file if it’s located outside the project’s root directory.
client = UnivapayClientSdkClient.from_environment(dotenv_path='/path/to/.env')

See the Environment-Based Client Initialization section for details.

Environments

The SDK can be configured to use a different environment for making API calls. Available environments are:

Fields

Name Description
PRODUCTION Default Staging Server

Authorization

This API uses the following authentication schemes.

List of APIs

Webhooks

SDK Infrastructure

Configuration

HTTP

Utilities

Metadata

Release files for univapay-apimatic-sdk 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for univapay-apimatic-sdk 1.0.2
File Size Uploaded Provenance Actions
univapay_apimatic_sdk-1.0.2.tar.gz 199.0 kB Without provenance Details for univapay_apimatic_sdk-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for univapay-apimatic-sdk 1.0.2
File Interpreter ABI Platform Actions
univapay_apimatic_sdk-1.0.2-py3-none-any.whl Python 3 none any Details for univapay_apimatic_sdk-1.0.2-py3-none-any.whl

Total release size: 696.8 kB

Release files / univapay_apimatic_sdk-1.0.2.tar.gz

Download URL univapay_apimatic_sdk-1.0.2.tar.gz
Size 199.0 kB
Tags Source
SHA-256 checksum
How to use checksums
40edc17f861b57308f3122d011ea8d82a4769dcb31bbdbd0f74eb8412c85a52a
BLAKE2b-256 checksum
How to use checksums
e13068b18c0322f37dfaf4a858f4705285f504cd12125233b728a1d3ec92f752
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.3 CPython/3.13.15 Linux/6.1.158.2-microsoft-standard

Release files / univapay_apimatic_sdk-1.0.2-py3-none-any.whl

Download URL univapay_apimatic_sdk-1.0.2-py3-none-any.whl
Size 497.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7192cd7c0920618c1f1cd9f93afb80fa133abb0fe9d29d2ed9b4b34c972d99d0
BLAKE2b-256 checksum
How to use checksums
7735deddd0a6e209c1ac8963ca5fb2d110cf7d03c714318c420d16b84b331798
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.3 CPython/3.13.15 Linux/6.1.158.2-microsoft-standard

Security for univapay-apimatic-sdk 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page