etsy api create listing example

Etsy API: Create Listing Example

By Joseph Lee
AD

Are you a developer eager to leverage the power of Etsy's API for creating listings? You're in the right place. Etsy's REST API allows developers to programmatically create, manage, and retrieve listings, among other functionalities. In this guide, we'll walk you through a comprehensive example of how to create a listing using the Etsy API.

Before we dive into the API nuts and bolts, let's understand the benefits of using Etsy's API for listing creation. By automating the process, you can streamline your workflow, reduce manual effort, and potentially expand your Etsy business with unique integrations and automation tools.

Setting Up Your Environment

To get started, you'll need to set up your development environment with the necessary libraries and credentials. Etsy uses OAuth 2.0 for authentication, which means you'll need to register your application on Etsy to get your Client ID and Client Secret.

AD
Etsy Seller Complete Guide 2026 | How to Start an Etsy Shop & Make Passive Income Online
Etsy Seller Complete Guide 2026 | How to Start an Etsy Shop & Make Passive Income Online
How to write a title on Etsy
How to write a title on Etsy
etsy api create listing example
etsy api create listing example

Once you have your credentials, you can use them to initialize the Etsy::API::Client library in Ruby, or the Etsy API library in Python. For this example, we'll use Ruby, as it's widely used and well-documented in the Etsy API documentation.

Authenticating with Etsy

To authenticate with Etsy, you'll need to direct users to Etsy's authentication page, where they'll grant your application the necessary permissions. Once they've authorized your app, Etsy will redirect them to a callback URL you've set up, carrying an authorization code.

The Best Way to write Esty Listings even as a beginner
The Best Way to write Esty Listings even as a beginner
Etsy Seller Checklist for Beginners | Start, Create, List & Grow
Etsy Seller Checklist for Beginners | Start, Create, List & Grow
Why Your Etsy Listing Isn't Getting Clicks | 6 Mistakes That Hurt Etsy Sales
Why Your Etsy Listing Isn't Getting Clicks | 6 Mistakes That Hurt Etsy Sales

Here's a simple example of how you might handle this in Ruby using the OmniAuth gem:

get '/auth/:provider/callback' do
  auth = request.env["omniauth.auth"]
  session[:auth] = auth
  redirect "/profile"
end

Requesting a Refresh Token

After obtaining the authorization code, you'll exchange it for a refresh token, which you can use to obtain access and update tokens as needed. Here's how you might do this with the Etsy API's token endpoint:

AD
client_id = 'YOUR_CLIENT_ID'
client_secret = 'YOUR_CLIENT_SECRET'
code = 'THE_AUTHORIZATION_CODE'
url = 'https://api.etsy.com/v2/oauth/token'
payload = {
  client_id: client_id,
  client_secret: client_secret,
  code: code,
  grant_type: 'authorization_code'
}
response = Net::HTTP.post_form(URI.parse(url), payload)
refresh_token = JSON.parse(response.body)['refresh_token']

Creating a Listing

With authentication out of the way, you're ready to start creating listings. Etsy's API allows you to create listings in many ways, but let's focus on creating a simple listing using the API's listing endpoint.

Sell AI-Generated Digital Products on Etsy | Beginner's Guide to Make Passive Income | Side Hustle
Sell AI-Generated Digital Products on Etsy | Beginner's Guide to Make Passive Income | Side Hustle
Sleek and stylish Canva Etsy Listing Template
Sleek and stylish Canva Etsy Listing Template
Etsy SEO Made Easy: Get Seen, Make Sales and Repeat
Etsy SEO Made Easy: Get Seen, Make Sales and Repeat
a page from the book etsyseo part 2, which is written in black and
a page from the book etsyseo part 2, which is written in black and
Beginner Etsy Course | Create Digital Products with Canva | Sell on Etsy | Instant Download
Beginner Etsy Course | Create Digital Products with Canva | Sell on Etsy | Instant Download
How to Setup an Etsy Shop and Create Your First Listing
How to Setup an Etsy Shop and Create Your First Listing

First, let's obtain access and update tokens using the refresh token we obtained earlier:

url = 'https://api.etsy.com/v2/oauth/token'
payload = {
  client_id: client_id,
  client_secret: client_secret,
  refresh_token: refresh_token,
  grant_type: 'refresh_token'
}
response = Net::HTTP.post_form(URI.parse(url), payload)
access_token = JSON.parse(response.body)['access_token']
update_token = JSON.parse(response.body)['update_token']

Preparing the Listing Data

Before creating the listing, you'll need to prepare the data you want to send to Etsy. This includes details about your listing like title, description, price, and more. Here's an example of what this data might look like:

AD
title = 'Handmade Candle'
description = 'A beautifully made candle with a delightful scent.'
price = {
  currency_code: 'USD',
  value: 15
}
quantity = 10
listing = {
  title: title,
  description: description,
  price: price,
  quantity: quantity,
  materials: [' Soy wax', 'Fragrance oil'],
  category_id: '10091', # Home & Living > Candles
}

Creating the Listing

With your listing data prepared, you can now make a POST request to Etsy's listing endpoint with your listing data. Here's how you might do this in Ruby:

10 Free Tools to Create Printables to Sell on Etsy, Shopify, or your Blog
10 Free Tools to Create Printables to Sell on Etsy, Shopify, or your Blog
How to Create Etsy Listing Photos with Ideogram AI: No Mockup Templates Needed
How to Create Etsy Listing Photos with Ideogram AI: No Mockup Templates Needed
7 Etsy Listing Images Every Digital Product Seller Needs
7 Etsy Listing Images Every Digital Product Seller Needs
How to Make and Sell Digital Downloads on Etsy: A Beginner's Guide to Printables and Passive Income
How to Make and Sell Digital Downloads on Etsy: A Beginner's Guide to Printables and Passive Income
Etsy Listing Guide: From Photos to Tags
Etsy Listing Guide: From Photos to Tags
Etsy SEO Made Simple | 7 Easy Tips to Get More Views & Sales
Etsy SEO Made Simple | 7 Easy Tips to Get More Views & Sales
I will promote and advertise your shopify, etsy, ebay and amazon store for quick sales
I will promote and advertise your shopify, etsy, ebay and amazon store for quick sales
Follow for the top AI tools for creators in 2025 🛠️
Follow for the top AI tools for creators in 2025 🛠️
I will create etsy seller approved etsy seller account etsy product listing
I will create etsy seller approved etsy seller account etsy product listing
🛍️ How to Start an Etsy Shop Step by Step in 2026
🛍️ How to Start an Etsy Shop Step by Step in 2026
40 free etsy listings for you
40 free etsy listings for you
How to fill Etsy listing images
How to fill Etsy listing images
url = 'https://api.etsy.com/v2/listings'
headers = {
  'Authorization' => "Bearer #{access_token}",
  'Update-Token' => update_token
}
response = Net::HTTP.post(URI.parse(url), listing.to_json, headers)
if response.is_a?(Net::HTTPSuccess)
  puts "Listing created successfully!"
else
  puts "Error creating listing: #{response.body}"
end

The listing will now be live on Etsy, visible to anyone who searches for candles or browses the candles category. Congratulations, you've just created your first listing using the Etsy API!

Remember, this is just the beginning. Etsy's API offers a wealth of functionality, from managing orders and inventory to running shop and listing analytics. With some creativity and exploration, you can build powerful tools to help manage and grow your Etsy business.

AD

Happy coding, and here's to your success on Etsy!

AD