PHPackages                             teraxis/etsy-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. teraxis/etsy-php-sdk

ActiveLibrary[API Development](/categories/api)

teraxis/etsy-php-sdk
====================

PHP SDK for Etsy API v3.

0.3.2(4y ago)07MITPHPPHP &gt;=7.1

Since Aug 5Pushed 4y agoCompare

[ Source](https://github.com/teraxis/etsy-php-sdk)[ Packagist](https://packagist.org/packages/teraxis/etsy-php-sdk)[ RSS](/packages/teraxis-etsy-php-sdk/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

Etsy PHP SDK
============

[](#etsy-php-sdk)

A PHP SDK for the Etsy API v3.

This package is still in development.

Requirements
------------

[](#requirements)

PHP 7.1 or greater.

Install
-------

[](#install)

Install the package using composer.

```
composer require rhysnhall/etsy-php-sdk
```

Include the OAuth client and Etsy class.

```
use Etsy\Etsy;
use Etsy\OAuth\Client;
```

Usage
-----

[](#usage)

### Authorizing your app

[](#authorizing-your-app)

The Etsy API uses OAuth 2.0 authentication. You can read more about authenticating with Etsy on their [documentation](https://developers.etsy.com/documentation/essentials/authentication).

The first step in OAuth2 is to request an OAuth token. You will need an existing App API key which you can obtained by registering an app [here](https://www.etsy.com/developers/register).

```
$client = new Etsy\OAuth\Client($api_key);
```

Generate a URL to redirect the user to authorize access to your app.

```
$url = $client->getAuthorizationUrl(
  $redirect_uri,
  $scopes,
  $code_challenge,
  $nonce
);
```

###### Redirect URI

[](#redirect-uri)

You must set an authorized callback URL. Check out the [Etsy documentation](https://developers.etsy.com/documentation/essentials/authentication#redirect-uris) for further information.

###### Scope

[](#scope)

Depending on your apps requirements, you will need to specify the [permission scopes](https://developers.etsy.com/documentation/essentials/authentication#scopes) you want to authorize access for.

```
$scopes = ["listings_d", "listings_r", "listings_w", "profile_r"];
```

You can get all scopes, but it is generally recommended to only get what you need.

```
$scopes = \Etsy\Utils\PermissionScopes::ALL_SCOPES;
```

###### Code challenge

[](#code-challenge)

You'll need to generate a [PKCE code challenge](https://developers.etsy.com/documentation/essentials/authentication#proof-key-for-code-exchange-pkce) and save this along with the verifier used to generate the challenge. You are welcome to generate your own, or let the SDK do this for you.

```
[$verifier, $code_challenge] = $client->generateChallengeCode();
```

###### Nonce

[](#nonce)

The nonce is a single use token used for CSRF protection. You can use any token you like but it is recommended to let the SDK generate one for you each time you authorize a user. Save this for verifying the response later on.

```
$nonce = $client->createNonce();
```

The URL will redirect your user to the Etsy authorization page. If the user grants access, Etsy will send back a request with an authorization code and the nonce (state).

```
https://www.example.com/some/location?
      code=bftcubu-wownsvftz5kowdmxnqtsuoikwqkha7_4na3igu1uy-ztu1bsken68xnw4spzum8larqbry6zsxnea4or9etuicpra5zi
      &state=superstate

```

It is up to you to validate the nonce. If they do not match you should discard the response.

For more information on Etsy's response, check out the [documentation here](https://developers.etsy.com/documentation/essentials/authentication#step-2-grant-access).

The final step is to get the access token for the user. To do this you will need to make a request using the code that was just returned by Etsy. You will also need to pass in the same callback URL as the first request and the verifier used to generate the PKCE code challenge.

```
[$access_token, $refresh_token] = $client->requestAccessToken(
  $redirect_uri,
  $code,
  $verifier
);
```

You'll be provided with both an access token and a refresh token. The access token has a valid duration of 3600 seconds (1 hour). Save both of these for late ruse.

#### Refreshing your token

[](#refreshing-your-token)

You can refresh your authorization token using the refresh token that was previously provided. This will provide you with a new valid access token and another refresh token.

```
[$access_token, $refresh_token] = $client->refreshAccessToken($refresh_token);
```

The [Etsy documentation](https://developers.etsy.com/documentation/essentials/authentication#requesting-a-refresh-oauth-token) states that refreshed access tokens have a duration of 86400 seconds (24 hours) but on testing they appear to only remain valid for up 3600 seconds (1 hour).

#### Exchanging legacy OAuth 1.0 token for OAuth 2.0 token

[](#exchanging-legacy-oauth-10-token-for-oauth-20-token)

If you previously used v2 of the Etsy API and still have valid authorization tokens for your users, you may swap these over for valid OAuth2 tokens.

```
[$access_token, $refresh_token] = $client->exchangeLegacyToken($legacy_token);
```

This will provide you with a brand new set of OAuth2 access and refresh tokens.

### Basic use

[](#basic-use)

Create a new instance of the Etsy class using your App API key and a user's access token.

```
$etsy = new Etsy\Etsy($api_key, $access_token);

// Get user.
$user = $etsy->getUser();

// Get shop.
$shop = $user->getShop();

// Update shop.
$shop->update([
  'title' => 'My exciting shop!'
]);
```

###### Collections

[](#collections)

When there is more than one result a collection will be returned.

```
$reviews = $shop->getReviews();

// Get first review.
$first = $reviews->first();

// Get 100 results using pagination.
foreach($reviews->paginate(100) as $review) {
  ...
}
```

---

Full documentation will be available soon. Email  for any assistance.

Contributing
------------

[](#contributing)

Help improve this SDK by contributing.

Before opening a pull request, please first discuss the proposed changes via Github issue or [email](mailto:hello@rhyshall.com).

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](https://github.com/rhysnhall/etsy-php-sdk/blob/master/LICENSE.md) file for details

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Total

7

Last Release

1675d ago

PHP version history (2 changes)0.1PHP &gt;=7.0

0.1.1PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/faf6851bddee09660e595be5b693c814910456af1ef616449e3e3eeed7ead880?d=identicon)[teraxis](/maintainers/teraxis)

---

Top Contributors

[![rhysnhall](https://avatars.githubusercontent.com/u/25257505?v=4)](https://github.com/rhysnhall "rhysnhall (23 commits)")[![teraxis](https://avatars.githubusercontent.com/u/38819145?v=4)](https://github.com/teraxis "teraxis (3 commits)")

---

Tags

phpapisdketsy

### Embed Badge

![Health badge](/badges/teraxis-etsy-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/teraxis-etsy-php-sdk/health.svg)](https://phpackages.com/packages/teraxis-etsy-php-sdk)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M24](/packages/php-opencloud-openstack)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
