Offline Order Integration
The Apruve API allows you to integrate third-party systems with Apruve to enable offline orders. We call the standard, eCommerce customer-driven checkout an "online" order. "Offline" orders are created by a customer service representative on behalf of the customer. This is normally managed in the admin console of an eCommerce system, CRM or ERP.
There are two types of flows, depending on the business type of the merchant and the types of products being sold. The example below if for physical goods. See the "Alternate Flow" section below for other options.
Below is an example of a form which allows you to select a customer, add products to the order, and place the order.
In this case Apruve is assumed to be the default payment method. Most systems would have several payment methods to choose from.
Below is a description of the steps necessary to integrate this type of flow with Apruve.
Prerequisites
- The Merchant must have a merchant account set up with Apruve to be able to use the Apruve APIs
- The customer must have an Apruve account which establishes a line of credit with the merchant.
- The customer must be identifiable by the same email address in both systems
Step 1: Identify the Customer
The customer is identified in Apruve by their email address. This is the email address that they used when they applied for a corporate account with Apruve. The merchant system must be able to supply this email address to Apruve to identify the customer. Apruve supplies an API that allows you to look up their Apruve account information by email address.
The documentation for this API can be found here.
The API signature looks like this:
GET /merchants/{id}/corporate_accounts{?email}
The {id}
parameter needs to be replaced with the merchant ID from your merchant account, and the email parameter would be set to the customer's email address. The API returns a corporate account ID, which can then be used to place an order. If the customer is not found by the API, then they do not have an Apruve account and so they will not be allowed to check out using Apruve as a payment method.
Step 2: Create an Order
Once the customer is identified you can create an order on their behalf. The Create Order API is documented here.
The API signature looks like this:
POST /orders
The body of the request contains information about the merchant, the order, and the corporate account ID obtained in step 1. See the documentation linked above for more information. If the order is placed successfully the API will return the Apruve order ID, which can be stored in the merchant's system. This will allow you to make additional API calls to manage the order status. If the order cannot be placed (for example if the customer does not have enough credit) the API will return an error message.
Step 3: Wait for the Order to be approved
When an order is placed on behalf of the customer they will receive an email which allow them to approve or deny the order. When the order is approved we will send a Webhooks back to the Merchant system to indicate that the order is ready to be fulfilled. Usually this will trigger the order status to be updated in the merchant system.
Step 4: Create an Invoice
Apruve relies on a shipment notification before we start our invoicing process. We also need an invoice which matches the items contained in the shipment. It is generally best to wait until the items are shipped before you create an invoice so you can ensure that they match exactly, but this is not required.
To create an invoice you would call the Create Invoice API, which is documented here.
The API signature looks like this:
POST /orders/{order_id}/invoices
Calling this API is very similar to the Create Order API. You pass in the order ID and information about the items that are included in the shipment. The API then returns the invoice ID in the response, which will be used for the next API call
Step 5: Create a Shipment
To create a shipment notification you simply have to call our Shipment API with information about the items that are included in the shipment.
Note: Orders can have multiple shipments associated with them.
The Create Shipment API is very similar to the Create Invoice API, but it also allows you to send tracking information for shipment.
This API is documented here.
Alternate Flow
The Alternate flow is similar to what is described above but without the customer approval process. There are some scenarios where the approval is not necessary (for example: paying for services rendered).
The steps for this flow are as follows:
Step 1: Identify the Customer
Same as above
Step 2: Create an Order
Same as above, except that when the order is created, the invoice_on_create
flag is set to true. This will create an invoice without further API calls.
That's it!
Check out our other developer guides for more information about integrating with Apruve.
Updated over 7 years ago