Selling on Twitter through Relay

Leverage Stripe Relay to sell products directly through Twitter. If you need help after reading this, check out our answers to common questions or chat live with other developers in #stripe on freenode.

The Orders API also lets Stripe users sell products across an expansive and expanding network of popular media. Customers can buy your goods through tweets, social media posts, in-app interfaces, ads, or even simple links.

Just add products to your Stripe account and connect to any number of apps–social media platforms like Twitter or mobile shopping apps like ShopStyle. The app can be used to promote your products, will handle the ordering process, and even securely accept payment on your behalf. Once an order is created and paid for, you simply fulfill the order to complete the transaction. You can start selling on third-party applications by connecting to Relay apps. This guide also outlines how to manage orders from Relay applications.

Stripe’s Orders API provides facilities for representing your product catalog in a structured manner, allowing seamless integration with Twitter’s “Buy now” functionality. With Relay, selling on Twitter is as easy as setting up your product catalog on Stripe. The most complicated steps–taking the customer’s information, creating an order, and accepting payment for the order–are handled for you.

This recipe walks through the simple, basic steps:

  1. Connect your Stripe account to Twitter
  2. Set your shipping and tax policies
  3. Create products
  4. Tweet!
  5. Manage your orders

All of this can be done using the Dashboard alone, which is the focus in this guide. If you’re a developer, you can use the powerful Orders API instead, and the Orders API overview goes through that experience in detail (but not focused on Twitter alone).

Connect your Stripe account to Twitter

The heart of Relay is the ability to allow common and popular platforms, such as Twitter, to process orders on your behalf. You’ll need to grant Twitter–or any application–permission to do so by connecting your Stripe account to their app.

  1. Start on the Relay tab of your account settings.
  2. Click Sign in with Twitter.
  3. On the resulting Twitter page, click Authorize app. (This does assume you are logged into your Twitter account.)
  4. When you are returned to the Stripe Dashboard, enter your sales terms and shipping policy in the dialog, and click Enable.

Your Stripe account is now connected to Twitter! Rest assured that although Twitter can create and handle payments for your orders, they cannot access your bank account or your personal information. And, of course, you can easily disconnect the Twitter app–on the Relay tab of your account settings–at any time.

Set your shipping and tax policies

Next, configure your shipping and tax preferences in your Stripe account. Shipping can be set as:

  • free : No additional cost, the default.
  • flat_rate: A flat additional cost, regardless of the items ordered, the quantity, or the customer’s geographic location. You can even opt to waive the shipping cost above a certain order total.

Tax can be set as:

  • included: No additional cost, the default.
  • percentage: A flat additional cost, as a percent of the order total, before shipping.

Once you’ve set your shipping and tax policies, Twitter will automatically factor those costs in when orders are created.

Create products

Having connected your account to Twitter, you need products to sell! There are two core ideas involved:

  • A product is an umbrella for something you sell, such as a “Fixed-Gear Bicycle”.
  • A SKU is a particular stock keeping unit representing a specific version of a product, such as a “Women’s, Road Version” (of the “Fixed-Gear Bicycle”).

Products should not be too generally defined, and SKUs will be the actual item purchased. This relationship will make even more sense when you create both in the Dashboard, and see that key order-related information–price, inventory, and so on–are part of the SKUs, not the products.

As another example, “Sunglasses” would be too vague as a product, but “Knightly Sunglasses”–in theory, a specific line of sunglasses you offer, would be appropriate. The SKUs for such a product might then be:

  • Women’s, standard
  • Women’s, polarized
  • Men’s, standard
  • Men’s, polarized

For more on the distinction between products and SKUs, see the Orders API best practices.

With a mental model of your catalog in place, start creating products and SKUs in the Dashboard. Products are created first:

  1. On your account’s Products page, click Create your first product (or New product, if you’ve already created one). Only real, live products can be sold through Twitter.
  2. On the Create a product page, fill out the form and click Save product.
    • Name should be descriptive but short-ish, and meant to be seen by the customer.
    • Caption and Description will be shown to customers through Twitter.
    • Use the URL input to provide a link to the product on your site for even more details.
    • Attributes will distinguish SKUs–product variations (e.g., Gender, Model, or Style).
    • Provide one or more images to help your products sell. To best display your product, the product image should be a square (1x1). Twitter crops the top and bottom of the image to a rectangle (2x1) when displaying it in the timeline, so the product should be within the middle 50% of the image.
    • Mark physical products as Shippable and then fill in the product’s size and weight.

The form for creating a product.

The newly created product.

Having created a product, you can now create SKUs for it. Remember that a SKU is the actual version of the product that the customer will purchase.

  1. On the product’s page in the Dashboard, click Add SKU.
  2. In the resulting dialog,
    • Select an Image to use. Twitter will display this as a square (1x1) image, cropping it if necessary.
    • Enter the Price.
    • Fill out the attribute values for this particular SKU (e.g., Women’s for Gender and Road Version for Model).
    • Set the inventory available for sale. The inventory can be finite–a specific number on hand, infinite, or bucket, which allows you to just indicate the inventory is “In stock”, “Out of stock”, or “Limited”.
  3. Click Add SKU.
  4. Repeat these steps for each product variation you’re selling.

The form for creating a SKU.

Twitter Buy Now Requirements

To make your product ready for selling on Twitter, double check that it:

  • Is marked as active
  • Has at least one SKU marked as active
  • Has an image that is least 280x280 pixels
  • Has no more than three attributes
  • Has an accurate description

Tweet!

The moment of truth! On your product’s page within the Stripe Dashboard, select and copy the Tweetable URL for your product. Tweet the URL as part of your message.

And that is it! The Twitter app will show users a “Buy now” button along with the first image of your product as part of an interface similar to that shown at the top of this page. After clicking “Buy now”, users will also see the first image from each of the product’s SKUs. People will see your tweet and be able to purchase your product simply by clicking “Buy now”. The Twitter app will handle the rest of the payment directly through Twitter without the user ever going to your website.

Manage your orders

When a Twitter user clicks a “Buy Now” button, generated by the URL you tweeted, they are taken to a page within Twitter that showcases the product and optionally allows them to choose a particular SKU to purchase. Once the user selects what they want to purchase, Twitter creates an order in your Stripe account.

Stripe responds to the creation request by providing the proper amounts considering your shipping and tax policies, and returns that information to Twitter. Twitter then displays the full total to the user. During this entire flow, the user never has to leave Twitter (unless they decide to follow the product’s URL you provided to Stripe.) The user completes the checkout flow–paying for the order, and the transaction is complete.

We’ll automatically notify you via email about all created and paid orders. When you receive notice that an email has been paid for, click the link in the email to view the order in your Dashboard (you can also browse within the Dashboard orders page to find it).

On the order page, you can view the customer’s details–such as name and shipping address, and the items purchased. After shipping the order, click Mark as fulfilled in the Dashboard to indicate you’ve done so.