All Tutorials

Build a sales channel with the Checkout API

All Tutorials

Build a sales channel with the Checkout API

Build a sales channel with the Checkout API

This guide teaches you how to enable payments so that customers can place orders for merchants’ products. The guide also covers how you can bill for your app to make money from your sales channel. For purposes of example, we'll build a sales channel that enables buyers to purchase a single merchant's products from your platform. When you build a sales channel you can use either the Admin API or Storefront API depending on your business case and the needs of your app.

Prerequisites

This guide assumes that you're familiar with the following:

Overview

By building a sales channel for Shopify, you can connect merchants' products with buyers on web, mobile and in-game. For example, you could use the Admin API to build an app that allows merchants to integrate products, orders, and customers with your channel. You could also use the Storefront and Admin APIs to develop a mobile app builder by leveraging the Mobile Buy SDKs.

Payments and order management

Building a sales channel with the Checkout API represents lower integration effort because Shopify makes it easy to handle the complexities of payment processing:

  • Shopify offers a variety of payment processing options, depending on your business case and the needs of your app.
  • When you use the Checkout API, Shopify handles paying out to the merchant for you.
  • If you use the Billing API, then it's easier to charge merchants platform fees.
  • Shopify keeps track of orders and fulfillments.
  • Shopify handles disputes, refunds or cancellations.

Creating and completing checkouts

After you've imported a merchant's products, you can accept and process payments for them by creating and completing checkouts. You can do this either using the Admin API or using the Storefront API.

Regardless of what API you choose, checkout creation and completion follows a similar flow and involves similar Shopify resources:

  1. Obtain the line item data necessary to create the checkout object
  2. Specify the shipping information (address, rate) and customer information
  3. Complete the checkout using the payment completion option that is right for your app:
    • Shopify web checkout
    • third party tokenization service (Stripe, Spreedly)
    • Shopify card vault

Checkout example

Payouts

Shopify processes the checkouts and handles payouts to the merchants for you.

Get paid

You can use Shopify's Billing API to charge merchants for your sales channel app. When using the Billing API, you can either charge merchants a recurring monthly subscription, or take a commission on sales by creating usage charges. Whichever charging model you use, you need to first create an appSubscription resource. Then, for commission-based sales, you need to create usage charges.

Recurring billing

You can use the appSubscriptionCreate mutation to create a recurring charge. The mutation returns the app subscription ID.

Charging commissions

Charging commissions requires two steps:

If you're charging commissions, then you need to be aware of how your app's fees impact merchant payouts, and how Shopify's platform fee works. The following diagram shows the lifecycle of this process. For demonstrative purposes, the app needs to charge 10 % fees on $100 in sales.

Sales channel get paid