Skip to content

oneflow/oneflow-sdk-js

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 

oneflow-sdk-js

Installation

    npm install oneflow-sdk-js

Basic usage

    const OneflowClient = require('oneflow-sdk-js');

    const client = new OneflowClient(
    	process.env.OFS_URL || 'https://pro-api.oneflowcloud.com/api',
    	process.env.OFS_TOKEN,
    	process.env.OFS_SECRET
    );

    // ...

    const destinationName  = 'oneflow';
    const orderData  = { sourceOrderId: 'aUniqueId' };
    const order = client.createOrder(destinationName, orderData);

    // ... instructions to complete the order data ...

    const result = await client.submitOrder();

If a unique routing rule path needs to be specified, it can be done using:

const result = await client.submitOrder({ routingRule: 'your routing rule key here' });

The routing rule key is a unique string of numbers and letters

For more detailed examples checkout the examples folder.

You can find more information about the required fields and the order structure in http://docs.oneflowcloud.com