Creating an Order
Creating an order in Skipify is easy. The Skipify Button and Guest Checkout flows both use the same data, so once you understand the process, you can use it in both flows.
Overview
The Skipify SDK utilizes callback functions to handle API calls and return data back for your checkout experience. The details below cover the details of the callback function for creating an order: orderDetailsCallback
. To use this SDK callback, pass in an object with an asynchronous function to the orderDetailsCallback
property. That function accepts an actions
argument that can be used to create orders and calculate shipping/tax. You will use the createOrder
method to create orders; details about the parameters are described in the following sections.
new window.GoCartSDK.Button({
orderDetailsCallback: async (actions) => {
actions.createOrder({
// Order data will go here
})
},
// Details for other callbacks can be found in the 'Callbacks' page
}).render(“my-button-container”) // Details for this can be found in the "SDK: The GoCart Button" page
orderDetailsCallback - Expedited Guest Checkout vs. Skipify Button
The
orderDetailsCallback
for the Skipify Button and Expedited Guest Checkout flows is identical, so the same process can be used for both.
Create Order
As mentioned above, you will pass in details of the order to the createOrder
method. Descriptions for these details are described in the subsections below. Two of the createOrder
arguments, lineItems
and purchaseDetails
, accept arrays of objects and are described in the following two sections.
createOrder Parameters
The createOrder
method accepts an object with the following parameters:
Field | Required? | Type | Examples |
---|---|---|---|
lineItems | No, but highly recommended to show the customer detail of what they are purchasing. | Array | [ { name: "some item", amount: 100, SKU: "SKU", category: "some category" } ] See the Line Items section below for additional details. |
subtotal | Yes | Number | 500 (for $5) 423 (for $4.23) |
total | Yes | Number | 500 (for $5) 423 (for $4.23) |
tax | No; can be used as an alternative to tax callbacks | Number | 50 (for $0.50) |
shipping | No; can be used as an alternative to shipping callbacks | Number | 500 (for $5) |
orderId | Yes | String | "your_order_id" "123-abc" |
orderDescription | Yes | String | "some_description" "from store 3 |
currencyCode | Yes | String | "USD" |
purchaseDetails | No | Array | [ { level:1, label: Skipify Pizza description: 3 items } ] See the Purchase Details section below for additional details. |
createOrder Example
The orderDetailsCallback
callback and its corresponding createOrder
method should follow the format:
new window.GoCartSDK.Button({
orderDetailsCallback: async (actions) => {
actions.createOrder({
lineItems: [ // Required parameter, but can contain an empty list. See section below.
{
name: "Jacket",
amount: 1,
SKU: "xrb-24", // Required parameter
category: "Outerwear"
}
],
subtotal: 11500, // $115.00
total: 12734, // $127.34
orderId: "your_order_id",
orderDescription: "winter sale",
currencyCode: "USD",
purchaseDetails: [ // Optional Parameter. See section below.
{
level: 1,
label: 'Marco's Pizza',
description: '3 items',
},
{
level: 2,
label: 'Pickup',
description: '25 minutes',
},
{
level: 3,
label: 'Store Address',
description: '5321 Florida Ave S\nLakeland, FL 33813',
}
})
},
// Details for other callbacks can be found in the 'Callbacks' page
}).render(“my-button-container”) // Details for this can be found in the "SDK: The GoCart Button" page
Create Order - Line Items
The createOrder
method accepts an array of line items. The lineItems
field must be included when creating an order, but can contain an empty array. Skipify recommends including a full list of line items so they can be referenced in the future.
lineItems Parameters
Field | Required? | Type | Description |
---|---|---|---|
Name | No | String | The name of the line item |
Amount | No | Number | The total for the line item. ex: 525 for $5.25 |
SKU | Yes | String | The stock keeping unit for the line item |
Category | No | String | The category of the line item |
Create Order - Purchase Details
Purchase Details
allows you to provide additional information about an order to your customer within the Skipify wallet. As seen below, this feature appears in the top of the Skipify wallet and allows you to pass text-based information to your customers.
Given the flexibility of Purchase Details, you can choose to provide customers with many different types of information. Below includes an example where a merchant is providing details about the item count, store address, and pickup time.

Demo this feature in Merchant Portal
Merchant Portal provides a mechanism for demoing the Purchase Details feature. This can be helpful prior to implementation.
purchaseDetails Parameters
When an order is created, you can provide up to three labels with corresponding descriptions. The text fields accept plain text, but additional styling is not supported. Labels and their corresponding descriptions must be passed in together (you cannot provide a label without a corresponding description or vice versa).
Field | Description | Example | Output |
---|---|---|---|
level | This dictates the placement of this purchase detail. The levels 1, 2, and 3 correspond to the placement of the labels/descriptions below. | 1, 2, or 3 | See example of placement below |
label | The label for this purchase detail. These fields can accept a maximum of 30 characters. | Address | Address |
description | The description for this purchase detail. Levels 1 and 2 can accept a maximum of 30 characters. Level 3 can accept a maximum of 105 characters. It can also accept a line break when including a \n at the point of the break. | 3319 Washington St.\nDenver, CO 80213 (Note the \n character between 'St.' and 'Denver') | 3319 Washington St. Denver, CO 80213 (Note the line break between 'St.' and 'Denver') |

And that's it! You've created an order with Skipify.
API Reference
Our API Reference contains additional details about an endpoint used by this callback.
Updated 7 months ago