Skip to main content

Invoicing API

Project description

pnap-invoicing-api

List, fetch and pay invoices with the Invoicing API.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • Package version: 1.0.6
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://phoenixnap.com/

Requirements.

Python 3.9+

Installation & Usage

pip install

You can install this package directly from the Python Package Index using:

$ pip install pnap_invoicing_api

Then import the package:

import pnap_invoicing_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import pnap_invoicing_api

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import pnap_invoicing_api
from pnap_invoicing_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.phoenixnap.com/invoicing/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pnap_invoicing_api.Configuration(
    host = "https://api.phoenixnap.com/invoicing/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]


# Enter a context with an instance of the API client
with pnap_invoicing_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pnap_invoicing_api.InvoicesApi(api_client)
    number = '13218-1180326' # str | A user-friendly reference number assigned to the invoice. (optional)
    status = 'status_example' # str | Payment status of the invoice. (optional)
    sent_on_from = '2020-04-13T00:00:00.000Z' # datetime | Minimum value to filter invoices by sent on date. (optional)
    sent_on_to = '2022-04-13T00:00:00.000Z' # datetime | Maximum value to filter invoices by sent on date. (optional)
    limit = 100 # int | The limit of the number of results returned. The number of records returned may be smaller than the limit. (optional) (default to 100)
    offset = 0 # int | The number of items to skip in the results. (optional) (default to 0)
    sort_field = sentOn # str | If a sortField is requested, pagination will be done after sorting. Default sorting is by number. (optional) (default to sentOn)
    sort_direction = DESC # str | Sort Given Field depending on the desired direction. Default sorting is descending. (optional) (default to DESC)

    try:
        # List invoices.
        api_response = api_instance.invoices_get(number=number, status=status, sent_on_from=sent_on_from, sent_on_to=sent_on_to, limit=limit, offset=offset, sort_field=sort_field, sort_direction=sort_direction)
        print("The response of InvoicesApi->invoices_get:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling InvoicesApi->invoices_get: %s\n" % e)

To generate a token using the python-keycloak library:

from keycloak import KeycloakOpenID

clientId = "YOUR_CLIENT_ID"
clientSecret = "YOUR_CLIENT_SECRET"
serverUrl = "https://auth.phoenixnap.com/auth/"
realmName = "BMC"
grantType = "client_credentials"

keycloakOpenId =  KeycloakOpenID(server_url=serverUrl,
                        realm_name=realmName,
                        client_id=clientId,
                        client_secret_key=clientSecret)

ACCESS_TOKEN = keycloakOpenId.token(grant_type=grantType)['access_token']

Documentation for API Endpoints

All URIs are relative to https://api.phoenixnap.com/invoicing/v1

Class Method HTTP request Description
InvoicesApi invoices_get GET /invoices List invoices.
InvoicesApi invoices_invoice_id_generate_pdf_post POST /invoices/{invoiceId}/actions/generate-pdf Generate invoice details as PDF.
InvoicesApi invoices_invoice_id_get GET /invoices/{invoiceId} Get invoice details.
InvoicesApi invoices_invoice_id_pay_post POST /invoices/{invoiceId}/actions/pay Pay an invoice.

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

OAuth2

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
  • invoices: Grants full access to Invoicing API.
  • invoices.read: Grants read only access to Invoicing API.

Author

support@phoenixnap.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pnap_invoicing_api-1.0.6.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pnap_invoicing_api-1.0.6-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file pnap_invoicing_api-1.0.6.tar.gz.

File metadata

  • Download URL: pnap_invoicing_api-1.0.6.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for pnap_invoicing_api-1.0.6.tar.gz
Algorithm Hash digest
SHA256 0858e85876ba3868b75a59d6cb9a3cb1fdc17735b2d7aa8488e9161e2db1b049
MD5 1da7dc442a56bbef9b247493e017e02c
BLAKE2b-256 81aa6f1c29f9bf76b314c2e8ae4d60e9f3283e01aa864403631ed2eef74b250f

See more details on using hashes here.

File details

Details for the file pnap_invoicing_api-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for pnap_invoicing_api-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5dca2598c0f2476b39c1cb0740bd59ffa5846496dc0a74fcc3ce5ab91ea61a64
MD5 d1c8d6990351676828122f401e37520d
BLAKE2b-256 d92eaafa27afb861467aa0d8a999b6b6eb0b005e8e4a5aa30fc6bf4f3d05c965

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page