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
}).guestRedirect(email) // Details for this can be found in the "SDK: Expedited Guest Checkout" page

📘

orderDetailsCallback - Expedited Guest Checkout vs. Skipify Button

The orderDetailsCallback for the Expedited Guest Checkout and Skipify Button 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:

FieldRequired?TypeExamples
lineItemsNo, but highly recommended to show the customer details 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.
subtotalYesNumber500 (for $5)
423 (for $4.23)
totalYesNumber500 (for $5)
423 (for $4.23)
taxNo; can be used as an alternative to tax callbacksNumber50 (for $0.50)
shippingNo; can be used as an alternative to shipping callbacksNumber500 (for $5)
orderIdYesString"your_order_id"
"123-abc"
orderDescriptionYesString"some_description"
"from store 3
currencyCodeYesString"USD"
purchaseDetailsNoArray[
   {
     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
}).guestRedirect(email) // Details for this can be found in the "SDK: Expedited Guest Checkout" 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
FieldRequired?TypeDescription
NameNoStringThe name of the line item
AmountNoNumberThe total for the line item.

ex: 525 for $5.25
SKUYesStringThe stock keeping unit for the line item
CategoryNoStringThe 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.

603

📘

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).

FieldDescriptionExampleOutput
levelThis 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 3See example of placement below
labelThe label for this purchase detail. These fields can accept a maximum of 30 characters.AddressAddress
descriptionThe 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

Check out our API Reference for additional details!