Skip to content

HPInc/oneflow-sdk-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python SDK for Site Flow

Site Flow API request client including the OneFlow credentials authentication logic.

Requirements

Python 3

See requirements.txt for Python package dependencies.

Installation instructions

Git

git clone https://github.com/HPInc/oneflow-sdk-python <your-target-directory>

Manually

Download the .zip file of this project and unzip it in the desire location. Download the last zip here

Basic usage

import os
from OneflowSDK import OneflowSDK

# Create a OneflowSDK instance
api_url = "https://orders.oneflow.io"
client = OneflowSDK(api_url, os.environ["OFS_TOKEN"], os.environ["OFS_SECRET"])

# Fill in request method, path and data
method = "POST"
path = "/api/order"
data = {
    # ... Order Data
}

# Make the request to the endpoint
result = client.request(method, path, data)

Samples

You can find Site Flow order validation and submission examples in the samples folder.