LogoLogo
  • Piriod API
  • Getting started
  • Integrations flows
  • Authentication
  • Error Handling
  • Pagination and Filtering
  • Core Resources
    • Customers
      • Create a customer
      • List customers
    • Contacts
    • Reminders
  • Billing
    • Products
    • Plans
    • Addons
    • Coupons
    • Subscriptions
    • Usages
    • Invoices
    • Credit Notes
    • Orders
  • Payments
    • Sources
    • Payments
  • Apps
    • Customer Base
      • Sessions
  • Collections
    • Documents
    • Currencies
    • Countries
    • States
Powered by GitBook
On this page
  • Get your API key
  • Get your Piriod Organization ID
  • Make an API request

Was this helpful?

Getting started

Get going and start building your Piriod integration.

PreviousPiriod APINextIntegrations flows

Last updated 11 months ago

Was this helpful?

To begin the integration with Piriod in your application or website requires that you have a Piriod account and complete the following three steps:

  1. so that you can authenticate requests to the API

Get your API key

Each Piriod User Account has one API key that allows access to all Piriod Organizations to which said user account has access.

Piriod authenticates your API requests using the API key of your User Account. If you don't send the API key in the request or the API key is wrong, Piriod will return an authentication error.

To obtain your API key you must go to the Account Security section in your .

Get your Piriod Organization ID

Each Piriod Organization has a unique identifier that is related with your Piriod User Account API key.

Piriod authenticates your API requests also using the Piriod Organization ID. If you don't submit the Organization ID or the Organization ID is wrong, Piriod will return an authentication error.

To obtain your API key you must go to the Organizations section in your .

Make an API request

import requests

PIRIOD_API_URL = 'https://api.piriod.com'
PIRIOD_API_KEY = '9bba430e7a8a64c2111bf29f497ec58b15906f47' # replace with your api id
PIRIOD_ORGANIZATION_ID = 'acc_8a64c2111bf29fc5' # replace with your organization id

headers = {
    'Authorization': f'Token {PIRIOD_API_KEY}',
    'x-simple-workspace': PIRIOD_ORGANIZATION_ID
}

payload = {
    'name': 'Acme LLC',
    'address': 'Main St 999',
    'country': 'US',
    'state': 'USAZ',
    'email': 'example@example.com',
    'tax_id': '897-56-9831'
}

r = request.post(f'{PIRIOD_API_URL}/customers/', json=payload, headers=headers)
{
    "id": "cus_dl6PTxQnTYy5BHYskV",
    "address": "Main St 999",
    "aggregations": {
        "sales": 0.00,
        "sales_current_period": 0.00,
        "balance": 0.00
    },
    "contacts": [],
    "country": {
        "id": "US",
        "name": "Estados Unidos",
        "name_en": "United states",
        "phone_code": "+1",
        "has_regulation": false,
        "tax_percent": 10
    },
    "currency": "USD",
    "email": "example@example.com",
    "metadata": {},
    "name": "Acme LLC",
    "phone": "",
    "sources": [],
    "state": {
        "id": "USAZ",
        "code": "AZ",
        "name": "Arizona"
    },
    "tax_id": "897-56-9831",
    "tax_settings": {},
    "website": "",
    "created": "2020-10-15T13:26:15.356289-03:00",
    "updated": "2020-10-15T13:26:15.356321-03:00"
}

If your API request was successful, you can now start integrating the different Piriod API resources. Learn how each resource works by navigating with the left side menu.

Piriod returns a object in response to your API request

User Account
User Account
Get your API key
Get your Piriod Organization ID
Make an API request
Customer