Tax, shipping, and inventory Deprecated

    Use the Orders API to sell and organize your products through Stripe.

    The Orders API helps you manage pricing and inventory, automatically calculate shipping costs and taxes, and create and pay for orders. It’s based on three primary objects:

    • Product: A blanket representation of an item your business sells (e.g., 2015 Limited Edition T-shirt)
    • SKU (Stock Keeping Units): A specific product variation, taking into account any combination of attributes and cost (e.g., size, color, currency, cost)
    • Order: A combination of customer information and the SKUs they want to purchase

    To get started with orders, define products and SKUs and configure shipping and tax integrations. Once your inventory is set up, you can create and pay for orders.

    This guide focuses on developer usage of the Orders API. See the Orders API manual for additional information, including best practices and using webhooks.

    When to use orders

    Orders integrate nicely with other parts of the Stripe API that you might already be familiar with. For example, paying an order creates a Charge object. Similarly, returning an order will create a refund for all or part of that charge. Orders support additional features beyond basic charges that you might find helpful:

    • Calculate taxes due on orders via Avalara, TaxJar, or Taxamo
    • Retrieve shipping rates from USPS, FedEx, and more using EasyPost or Shippo
    • Keep track of fulfilled orders and seamlessly handle returns
    • Import products from a Google or LinkShare product feed

    Use the Orders API if any of the following apply to you:

    • You need to calculate taxes or shipping for the products you are selling
    • You sell physical goods than can be shipped and returned by customers

    On the other hand, there are some cases where other Stripe products would be easier to use:

    • If you want to charge customers on a recurring basis, subscriptions let you do that easily
    • If you are selling a variable-rate service (like a Lyft ride), charges give you more flexibility
    • If you already have an inventory, tax, and shipping system, you may not need the extra features that Stripe orders provide

    Define products and SKUs

    You can start out by creating your products and SKUs in the Dashboard. There are two kinds of products: goods and services. Goods can be physical things you ship or digital things that your customers download. A service is an amenity that is provided on an ongoing basis for a recurring fee. Goods are intended for use with the Orders API while services are for subscriptions. See the best practices for examples and additional tips.

    You can easily create products and SKUs programmatically:

    curl https://api.stripe.com/v1/products \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d name="Limited Edition T-Shirt" \ -d type=good \ -d "attributes[]"=size \ -d "attributes[]"=gender \ -d "attributes[]"=color \ -d description="Super awesome, one-of-a-kind t-shirt"
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' product = Stripe::Product.create({ name: 'Limited Edition T-Shirt', type: 'good', attributes: ['size', 'gender', 'color'], description: 'Super awesome, one-of-a-kind t-shirt', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' product = stripe.Product.create( name='Limited Edition T-Shirt', type='good', attributes=['size', 'gender', 'color'], description='Super awesome, one-of-a-kind t-shirt', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); $product = \Stripe\Product::create([ 'name' => 'Limited Edition T-Shirt', 'type' => 'good', 'attributes' => ['size', 'gender', 'color'], 'description' => 'Super awesome, one-of-a-kind t-shirt', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; ProductCreateParams params = ProductCreateParams.builder() .setName("Limited Edition T-Shrt") .setType(ProductCreateParams.Type.GOOD) .addAttribute("size") .addAttribute("gender") .addAttribute("color") .setDescription("Super awesome, one-of-a-kind t-shirt") .build(); Product product = Product.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const product = stripe.products.create({ name: 'Limited Edition T-Shirt', type: 'good', attributes: ['size', 'gender', 'color'], description: 'Super awesome, one-of-a-kind t-shirt', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.ProductParams{ Name: stripe.String("Limited Edition T-Shirt"), Type: stripe.String(string(stripe.ProductTypeGood)), Attributes: stripe.StringSlice([]string{ "size", "gender", "color", }), Description: stripe.String("Super awesome, one-of-a-kind t-shirt"), } prod, _ := product.New(params)
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new ProductCreateOptions { Name = "Limited Edition T-Shirt", Type = "good", Attributes = new string[] {"size", "gender", "color"}, Description = "Super awesome, one-of-a-kind t-shirt", }; var service = new ProductService(); Product product = service.Create(options);

    Products can have associated images, descriptions, and more. The attributes property is how a product defines the features that can be set on individual SKUs: the specific versions of the product a customer actually buys. For example, the above code says that the Limited Edition T-shirt product comes in different variations for size, gender, and color.

    With a product defined, create specific product variations as SKUs, taking into account all possible combinations of attributes.

    curl https://api.stripe.com/v1/skus \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d currency=usd \ -d "inventory[type]"=finite \ -d "inventory[quantity]"=500 \ -d price=1500 \ -d product=prod_Csxa7izZYC6b9f \ -d "attributes[size]"=Medium \ -d "attributes[gender]"=Unisex \ -d "attributes[color]"=Cyan curl https://api.stripe.com/v1/skus \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d currency=usd \ -d "inventory[type]"=finite \ -d "inventory[quantity]"=400 \ -d price=1500 \ -d product=prod_Csxa7izZYC6b9f \ -d "attributes[size]"=Large \ -d "attributes[gender]"=Unisex \ -d "attributes[color]"=Cyan
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' sku1 = Stripe::SKU.create({ currency: 'usd', inventory: { 'type' => 'finite', 'quantity' => 500, }, price: 1500, product: 'prod_Csxa7izZYC6b9f', attributes: { 'size' => 'Medium', 'gender' => 'Unisex', 'color' => 'Cyan', }, }) sku2 = Stripe::SKU.create({ currency: 'usd', inventory: { 'type' => 'finite', 'quantity' => 400, }, price: 1500, product: 'prod_Csxa7izZYC6b9f', attributes: { 'size' => 'Large', 'gender' => 'Unisex', 'color' => 'Cyan', }, })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' sku1 = stripe.SKU.create( currency='usd', inventory={ 'type': 'finite', 'quantity': 500, }, price=1500, product='prod_Csxa7izZYC6b9f', attributes={ 'size': 'Medium', 'gender': 'Unisex', 'color': 'Cyan', }, ) sku2 = stripe.SKU.create( currency='usd', inventory={ 'type': 'finite', 'quantity': 400, }, price=1500, product='prod_Csxa7izZYC6b9f', attributes={ 'size': 'Large', 'gender': 'Unisex', 'color': 'Cyan', }, )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); $sku1 = \Stripe\SKU::create([ 'currency' => 'usd', 'inventory' => [ 'type' => 'finite', 'quantity' => 500, ], 'price' => 1500, 'product' => 'prod_Csxa7izZYC6b9f', 'attributes' => [ 'size' => 'Medium', 'gender' => 'Unisex', 'color' => 'Cyan', ], ]); $sku2 = \Stripe\SKU::create([ 'currency' => 'usd', 'inventory' => [ 'type' => 'finite', 'quantity' => 400, ], 'price' => 1500, 'product' => 'prod_Csxa7izZYC6b9f', 'attributes' => [ 'size' => 'Large', 'gender' => 'Unisex', 'color' => 'Cyan', ], ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; SkuCreateParams params1 = SkuCreateParams.builder() .setCurrency("usd") .setInventory( SkuCreateParams.Inventory.builder() .setType(SkuCreateParams.Inventory.Type.FINITE) .setQuantity(500L) .build()) .setPrice(1500L) .setProduct("prod_Csxa7izZYC6b9f") .putAttribute("size", "Medium") .putAttribute("gender", "Unisex") .putAttribute("color", "Cyan") .build(); Sku sku1 = Sku.create(params1); SkuCreateParams params2 = SkuCreateParams.builder() .setCurrency("usd") .setInventory( SkuCreateParams.Inventory.builder() .setType(SkuCreateParams.Inventory.Type.FINITE) .setQuantity(400L) .build()) .setPrice(2500L) .setProduct("prod_Csxa7izZYC6b9f") .putAttribute("size", "Large") .putAttribute("gender", "Unisex") .putAttribute("color", "Cyan") .build(); Sku sku2 = Sku.create(params2);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const sku1 = await stripe.skus.create({ currency: 'usd', inventory: {'type': 'finite', 'quantity': 500}, price: 1500, product: 'prod_Csxa7izZYC6b9f', attributes: {'size': 'Medium', 'gender': 'Unisex', 'color': 'Cyan'}, }); const sku2 = await stripe.skus.create({ currency: 'usd', inventory: {'type': 'finite', 'quantity': 400}, price: 1500, product: 'prod_Csxa7izZYC6b9f', attributes: {'size': 'Large', 'gender': 'Unisex', 'color': 'Cyan'}, });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params1 := &stripe.SKUParams{ Currency: stripe.String(string(stripe.CurrencyUSD)), Inventory: &stripe.InventoryParams{ Type: stripe.String(string(stripe.SKUInventoryTypeFinite)), Quantity: stripe.Int64(500), }, Price: stripe.Int64(1500), Product: stripe.String("prod_Csxa7izZYC6b9f"), Attributes: map[string]string{ "size": "Medium", "gender": "Unisex" "color": "Cyan", }, } sku1, _ := sku.New(params1) params2 := &stripe.SKUParams{ Currency: stripe.String(string(stripe.CurrencyUSD)), Inventory: &stripe.InventoryParams{ Type: stripe.String(string(stripe.SKUInventoryTypeFinite)), Quantity: stripe.Int64(400), }, Price: stripe.Int64(1500), Product: stripe.String("prod_Csxa7izZYC6b9f"), Attributes: map[string]string{ "size": "Large", "gender": "Unisex" "color": "Cyan", }, } sku2, _ := sku.New(params2)
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var service = new SkuService(); var skuOptions1 = new SkuCreateOptions { Currency = "usd", Inventory = new InventoryOptions { Type = "finite", Quantity = 500, }, Price = 1500, Product = "prod_Csxa7izZYC6b9f", Attributes = new Dictionary<string, string> { {"size", "Medium"}, {"gender", "Unisex"}, {"color", "Cyan"}, }, }; Sku sku1 = service.Create(skuOptions1); var skuOptions2 = new SkuCreateOptions { Currency = "usd", Inventory = new InventoryOptions { Type = "finite", Quantity = 400, }, Price = 1500, Product = "prod_Csxa7izZYC6b9f", Attributes = new Dictionary<string, string> { {"size", "Large"}, {"gender", "Unisex"}, {"color", "Cyan"}, }, }; Sku sku2 = service.Create(skuOptions2);

    The above code creates two different SKUs—variants on a product, differentiated by size and price. You normally have exponentially more SKUs than products. If the Limited Edition T-shirt came in three sizes—small, medium, and large—and in two colors—cyan and magenta, there would be at least six SKUs representing it.

    Configure shipping and tax handling

    Real-world orders involve not only the cost of the items being purchased, but also shipping costs and taxes. Stripe can automatically and dynamically add these costs to your orders.

    Configure your shipping and tax preferences in the Dashboard. The Shipping and Taxes settings each offer four approaches.

    Shipping can be set as:

    • provider: A third-party provider like EasyPost or Shippo which will provide the shipping rates dynamically
    • flat_rate: One or more fixed-cost options like Standard, Express, and Overnight shipping. You can even opt to waive the shipping cost above a certain order total.
    • free: No additional cost, the default
    • callback: See below

    Taxes can be set as:

    • provider: A third-party provider like Avalara, TaxJar, or Taxamo which will provide the tax amount dynamically
    • percentage: A flat additional cost, as a percent of the order total, before shipping
    • included: No additional cost, the default
    • callback: See below

    Shipping and Taxes each offer a callback option. If you wish to calculate shipping and taxes yourself, provide an endpoint on your own server that Stripe will hit, in real time, to retrieve these costs. This can be helpful if you want to use the Orders API but have an existing system for shipping and taxes, or if you want to sell through an application or mobile app.

    Create and pay for orders

    With your products and SKUs already on Stripe, it is time to start creating orders. When using orders, your checkout flow will most likely look something like the following:

    1. A customer picks one or more items (SKUs) that they want to purchase
    2. You create an order containing those items to retrieve tax and shipping costs from Stripe
    3. The customer provides you with payment credentials that you use to pay the order

    We will focus on the two last steps here. To create an order, specify the SKUs in the order as well as the customer’s shipping address:

    curl https://api.stripe.com/v1/orders \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d currency=usd \ -d email="jenny.rosen@example.com" \ -d "items[][type]"=sku \ -d "items[][parent]"=sku_H8CtoiuBrkKOby \ -d "items[][quantity]"=2 \ -d "shipping[name]"="Jenny Rosen" \ -d "shipping[address][line1]"="1234 Main Street" \ -d "shipping[address][city]"="San Francisco" \ -d "shipping[address][state]"=CA \ -d "shipping[address][postal_code]"=94111 \ -d "shipping[address][country]"=US
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' order = Stripe::Order.create({ currency: 'usd', email: 'jenny.rosen@example.com', items: [ { type: 'sku', parent: 'sku_H8CtoiuBrkKOby', quantity: 2, }, ], shipping: { name: 'Jenny Rosen', address: { line1: '1234 Main Street', city: 'San Francisco', state: 'CA', postal_code: '94111', country: 'US', }, }, })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' order = stripe.Order.create( currency='usd', email='jenny.rosen@example.com', items=[ { 'type':'sku', 'parent':'sku_H8CtoiuBrkKOby', 'quantity': 2, }, ], shipping={ 'name':'Jenny Rosen', 'address':{ 'line1':'1234 Main Street', 'city':'San Francisco', 'state':'CA', 'postal_code':'94111', 'country':'US', }, }, )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); $order = \Stripe\Order::create([ 'currency' => 'usd', 'email' => 'jenny.rosen@example.com', 'items' => [ [ 'type' => 'sku', 'parent' => 'sku_H8CtoiuBrkKOby', 'quantity' => 2, ], ], 'shipping' => [ 'name' => 'Jenny Rosen', 'address' => [ 'line1' => '1234 Main Street', 'city' => 'San Francisco', 'state' => 'CA', 'postal_code' => '94111', 'country' => 'US', ], ], ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; OrderCreateParams params = OrderCreateParams.builder() .setCurrency("usd") .setEmail("jenny.rosen@example.com") .addItem( OrderCreateParams.Item.builder() .setType(OrderCreateParams.Item.Type.SKU) .setParent("sku_H8CtoiuBrkKOby") .setQuantity(2L) .build()) .setShipping( OrderCreateParams.Shipping.builder() .setName("Jenny Rosen") .setAddress( OrderCreateParams.Shipping.Address.builder() .setLine1("1234 Main Street") .setPostalCode("94111") .setCity("San Francisco") .setState("CA") .setCountry("US") .build()) .build()) .build(); Order order = Order.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const order = stripe.orders.create({ currency: 'usd', email: 'jenny.rosen@example.com', items: [ { type: 'sku', parent: 'sku_H8CtoiuBrkKOby', quantity: 2, }, ], shipping: { name: 'Jenny Rosen', address: { line1: '1234 Main Street', city: 'San Francisco', state: 'CA', postal_code: '94111', country: 'US', }, }, });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.OrderParams{ Currency: stripe.String(string(stripe.CurrencyUSD)), Email: stripe.String("jenny.rosen@example.com"), Items: []*stripe.OrderItemParams{ &stripe.OrderItemParams{ Type: stripe.String(string(OrderItemTypeSKU)), Parent: stripe.String("sku_H8CtoiuBrkKOby"), Quantity: stripe.Int64(2), }, }, Shipping: &stripe.ShippingParams{ Name: stripe.String("Jenny Rosen"), Address: &stripe.AddressParams{ Line1: stripe.String("1234 Main Street"), City: stripe.String("San Francisco"), State: stripe.String("CA"), PostalCode: stripe.String("94111"), Country: stripe.String("US"), }, }, } ord, _ := order.New(params)
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new OrderCreateOptions { Currency = "usd", Email = "jenny.rosen@example.com", Items = new List<OrderItemOptions> { new OrderItemOptions { Type = "sku", Parent = "sku_H8CtoiuBrkKOby", Quantity = 2, }, }, Shipping = new ShippingOptions { Name = "Jenny Rosen", Address = new AddressOptions { Line1 = "1234 Main Street", City = "San Francisco", State = "CA", PostalCode = "94111", Country = "US", }, }, }; var service = new OrderService(); Order order = service.Create(options);

    You will receive an order object in the response (some fields omitted for brevity):

    { "id": "or_18Q3IaDAu10Yox5RqlL8JnnS", "amount": 2172, "status": "created", "items": [ { "type": "sku", "amount": 1500, "description": "* Limited Edition T-shirt", "parent": "sku_H8CtoiuBrkKOby", ... }, { "type": "tax", "amount": 112, "description": "CA STATE TAX (P0000000)", "parent": null, ... }, { "type": "shipping", "amount": 560, "description": "USPS Priority Mail", "parent": "ad989a994218446fbd48978a6ac905b0", ... } ], "selected_shipping_method": "0083dfe889534b75bf8ca73aa703e938", "shipping_methods": [ { "id": "ad989a994218446fbd48978a6ac905b0", "amount": 560, "description": "USPS Priority Mail", ... }, { "id": "db18a419e6f14aba82aa41f2bb9ec08e", "amount": 595, "description": "USPS Parcel Select", ... } ], .. }

    When creating an order, Stripe performs the following actions:

    • Verifies that the SKU was still in stock and retrieves its current price
    • Retrieves the taxes due from your tax provider and adds a $1.12 tax line item
    • Retrieves shipping rates from your shipping provider and adds the available shipping methods. The default rate of $5.60 is already included in the order as a shipping line item.
    • Sums up all the line items and packs them into the order object

    You should store the order id in your database and present the customer with the order total of $82.39. When your customer is ready to pay, you can collect their payment details. Then, simply pass the token to Stripe to pay the order:

    curl https://api.stripe.com/v1/orders/or_1Ce6vg2eZvKYlo2CcQtHtXdu/pay \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d source="{{TOKEN}}"
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' # Token is created using Checkout or Elements! # Get the payment token ID submitted by the form: token = params[:stripeToken] order = Stripe::Order.pay( 'or_1Ce6vg2eZvKYlo2CcQtHtXdu', {source: token} )
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' # Token is created using Checkout or Elements! # Get the payment token ID submitted by the form: token = request.form['stripeToken'] # Using Flask order = stripe.Order.pay( 'or_1Ce6vg2eZvKYlo2CcQtHtXdu', source=token )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); // Token is created using Checkout or Elements! // Get the payment token ID submitted by the form: $token = $_POST['stripeToken']; $order = \Stripe\Order::retrieve('or_1Ce6vg2eZvKYlo2CcQtHtXdu'); $order->pay(['source' => $token]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; // Token is created using Checkout or Elements! // Get the payment token ID submitted by the form: String token = request.getParameter("stripeToken"); Order order = Order.retrieve("or_1Ce6vg2eZvKYlo2CcQtHtXdu"); OrderPayParams params = OrderPayParams.builder() .setSource(token) .build(); order.pay(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); // Token is created using Checkout or Elements! // Get the payment token ID submitted by the form: var token = request.body.stripeToken; // Using Express stripe.orders.pay('or_1Ce6vg2eZvKYlo2CcQtHtXdu', { source: token, })
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" // Token is created using Checkout or Elements! // Get the payment token ID submitted by the form: token := r.FormValue("stripeToken") params = &stripe.OrderPayParams{} params.SetSource(token) ord, _ := order.Pay("or_1Ce6vg2eZvKYlo2CcQtHtXdu", params)
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; // Token is created using Checkout or Elements! // Get the payment token submitted by the form: var token = model.Token; // Using ASP.NET MVC var options = new OrderPayOptions { Source = token, }; var service = new OrderService(); Order order = service.Pay("or_1Ce6vg2eZvKYlo2CcQtHtXdu", options);

    Next steps

    Congrats! You've gone through how to use the APIs for products, SKUs and orders. Some things you might want to see next:

    Was this page helpful?

    Feedback about this page?

    Thank you for helping improve Stripe's documentation. If you need help or have any questions, please consider contacting support.

    On this page