Website logo
⌘K
Introduction
Developer Overview
Welcome Developers
Live vs Test Environment
Authentication
Status Code
Api Response
Metadata
Idempotent requests
Rate Limits
Timestamps
Product Guides
Product Guide ReadMe First
Accounts
WorkFlow
Orders
Settlement
Payouts
Solutions
Solutions Guide ReadMe First
Affiliate Programs
Contractor Pay
B2B Invoices
FoodDelivery
Fintech (BNPL)
Marketplace
Docs powered by Archbee
Product Guides

Orders

10min

Introduction

Orders record transfer of money between accounts. Every order in Nuflow is created using a Workflow.

Order Identifiers

Just like accounts, orders can also have two different identifiers associated with them. Nulfow supports queries with either identifier for its orders APIs.

Client Order Identifier (required)

This is a required identifier which must be provided while creating an order. It's recommended to keep this same or similar to the unique identifier for the entity in your database for easy identification.

PO Identifier (optional)

PO Identifier, short for purchase order identifier, is the secondary identifier which Nuflow associates with an order. If a value is not provided for this identifier then po_identifieris saved as the value provided for client_order_identifier.

Order Status

An order can have the following values as it status:

  1. Created
  2. Confirmed
  3. Delivered
  4. Cancelled

When a new order is created is status is set to Created. The order status can be updated either from the dashboard or using the Update Order Status API. When the order status is changed to the trigger status of the workflow it uses, the money is moved to the accounts involved.

APIs

Base URL

The base URL for all orders API requests is /api/v1/ops/orders/.

All requests must be authenticated using an API key.

Create an order.
POST
Params
Body Parameters
client_order_identifier
required
String
Client order identifier for the order.
po_identifier
optional
String
Purchase order identifier for the order. If none then client order identifier is saved as the purchase order identifier.
order_details
required
Object
Details of the order.
order_status
optional
String
Initial status of the order which can take either one of the following values: Confirmed or Delivered. If none is provided then Created is set as the default order status.
transfer_instructions
required
Object
Details of the money transfer associated with this order.


Examples

Make sure that the respective accounts have been created before trying out these examples.



Moneyflow Transfer

Curl
curl --location --request POST 'https://app.nuflow.dev/api/v1/ops/orders/transfer' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <YOUR_API_KEY>' \
--data '{
  "client_order_identifier": "001",
  "order_details": {
    "amount_int": 100000,
    "currency": "SGD",
    "description": "Workflow order with two line items",
    "metadata": {
      "num_items": "2"
    }
  },
  "order_status": "Confirmed",
  "transfer_instructions": {
    "type": "Work-Flow",
    "template_name": "Fee Commission",
    "line_items": [
      {
        "name": "Item 1",
        "description": "First item",
        "price_int": 50000,
        "price_currency": "SGD",
        "quantity": 1,
        "amount_int": 50000,
        "amount_currency": "SGD",
        "source": {
          "label": "customer",
          "client_identifier": "002"
        },
        "destinations": [
          {
            "label": "supplier",
            "client_identifier": "001"
          },
          {
            "label": "revenue",
            "client_identifier": "self"
          },
          {
            "label": "gst",
            "client_identifier": "self"
          }
        ]
      },
      {
        "name": "Item 2",
        "description": "Second Item",
        "price_int": 50000,
        "price_currency": "SGD",
        "quantity": 1,
        "amount_int": 50000,
        "amount_currency": "SGD",
        "source": {
          "label": "customer",
          "client_identifier": "002"
        },
        "destinations": [
          {
            "label": "supplier",
            "client_identifier": "001"
          },
          {
            "label": "revenue",
            "client_identifier": "self"
          },
          {
            "label": "gst",
            "client_identifier": "self"
          }
        ]
      }
    ]
  }
}
'


Direct Transfer

curl
curl --location --request POST 'https://app.nuflow.dev/api/v1/ops/orders/transfer' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <YOUR_API_KEY>' \
--data '{
  "client_order_identifier": "001",
  "po_identifier": "001",
  "order_details": {
    "amount_int": 100000,
    "currency": "SGD",
    "description": "Order with two line items",
    "metadata": {
      "num_items": "2"
    }
  },
  "order_status": "Confirmed",
  "transfer_instructions": {
    "type": "Direct",
    "template_name": "Factorem Direct Transfer",
    "line_items": [
      {
        "name": "Item 1",
        "description": "First item",
        "price_int": 50000,
        "price_currency": "SGD",
        "quantity": 1,
        "amount_int": 50000,
        "amount_currency": "SGD",
        "source": {
          "label": "customer",
          "client_identifier": "001"
        },
        "destinations": [
          {
            "label": "markup",
            "client_identifier": "self",
            "value": {
              "amount_int": 1000,
              "currency": "SGD"
            }
          },
          {
            "label": "fee",
            "client_identifier": "self",
            "value": {
              "amount_int": 2000,
              "currency": "SGD"
            }
          },
          {
            "label": "vas",
            "client_identifier": "self",
            "value": {
              "amount_int": 2000,
              "currency": "SGD"
            }
          },
          {
            "label": "discount",
            "client_identifier": "self",
            "value": {
              "amount_int": 5000,
              "currency": "SGD"
            }
          },
          {
            "label": "supplier",
            "client_identifier": "002",
            "value": {
              "amount_int": 40000,
              "currency": "SGD",
              "settlement_amount_int": 43795,
              "settlement_currency": "JPY"
            }
          }
        ]
      },
      {
        "name": "Item 2",
        "description": "Second item",
        "price_int": 50000,
        "price_currency": "SGD",
        "quantity": 1,
        "amount_int": 50000,
        "amount_currency": "SGD",
        "source": {
          "label": "customer",
          "client_identifier": "001"
        },
        "destinations": [
          {
            "label": "markup",
            "client_identifier": "self",
            "value": {
              "amount_int": 1000,
              "currency": "SGD"
            }
          },
          {
            "label": "fee",
            "client_identifier": "self",
            "value": {
              "amount_int": 2000,
              "currency": "SGD"
            }
          },
          {
            "label": "vas",
            "client_identifier": "self",
            "value": {
              "amount_int": 2000,
              "currency": "SGD"
            }
          },
          {
            "label": "discount",
            "client_identifier": "self",
            "value": {
              "amount_int": 5000,
              "currency": "SGD"
            }
          },
          {
            "label": "supplier",
            "client_identifier": "002",
            "value": {
              "amount_int": 40000,
              "currency": "SGD",
              "settlement_amount_int": 43795,
              "settlement_currency": "JPY"
            }
          }
        ]
      }
    ]
  }
}'

Update order transfer.
PATCH
Params
Body Parameters
client_order_identifier
required
String
Client order identifier for the order.
po_identifier
optional
String
Purchase order identifier for the order. If none then client order identifier is saved as the purchase order identifier.
order_details
required
Object
Details of the order.
transfer_instructions
required
Object
Details of the money transfer associated with this order.

Update the status of an order.
PATCH
Params
Query Parameters
client_order_identifier
optional
String
The client order identifier for the order. Either this or purchase order identifier must be provided.
po_identifier
optional
String
The purchase order identifier for the order.
Body Parameters
order_status
required
String
The status to which the order must be updated to. Can be either Confirmed or Delivered.




Updated 24 Oct 2023
Did this page help you?
PREVIOUS
WorkFlow
NEXT
Settlement
Docs powered by Archbee