Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.tax.setRates({
places: [],
});<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->tax->setRates([
'places' => [],
]);
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.tax.setRates(places=[])
curl --request POST \
--url https://api.shoply.gg/v1/stores/{storeId}/tax/rates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"places": [
{
"country": "DE",
"region": "CA",
"rate": 19
}
]
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/tax/rates"
payload := strings.NewReader("{\n \"places\": [\n {\n \"country\": \"DE\",\n \"region\": \"CA\",\n \"rate\": 19\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.shoply.gg/v1/stores/{storeId}/tax/rates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"places\": [\n {\n \"country\": \"DE\",\n \"region\": \"CA\",\n \"rate\": 19\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/tax/rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"places\": [\n {\n \"country\": \"DE\",\n \"region\": \"CA\",\n \"rate\": 19\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"collect": true,
"included": false,
"business": true,
"home": "DE",
"homeName": "Germany",
"rates": [
{
"country": "DE",
"countryName": "Germany",
"region": "",
"regionName": "",
"rate": 19,
"label": "VAT",
"standard": 19
},
{
"country": "US",
"countryName": "United States",
"region": "CA",
"regionName": "California",
"rate": 7.25,
"label": "Sales tax",
"standard": null
}
],
"standard": {
"AT": {
"label": "VAT",
"rate": 20
},
"BE": {
"label": "VAT",
"rate": 21
},
"BG": {
"label": "VAT",
"rate": 20
},
"HR": {
"label": "VAT",
"rate": 25
},
"CY": {
"label": "VAT",
"rate": 19
},
"CZ": {
"label": "VAT",
"rate": 21
},
"DK": {
"label": "VAT",
"rate": 25
},
"EE": {
"label": "VAT",
"rate": 24
},
"FI": {
"label": "VAT",
"rate": 25.5
},
"FR": {
"label": "VAT",
"rate": 20
},
"DE": {
"label": "VAT",
"rate": 19
},
"GR": {
"label": "VAT",
"rate": 24
},
"HU": {
"label": "VAT",
"rate": 27
},
"IE": {
"label": "VAT",
"rate": 23
},
"IT": {
"label": "VAT",
"rate": 22
},
"LV": {
"label": "VAT",
"rate": 21
},
"LT": {
"label": "VAT",
"rate": 21
},
"LU": {
"label": "VAT",
"rate": 17
},
"MT": {
"label": "VAT",
"rate": 18
},
"NL": {
"label": "VAT",
"rate": 21
},
"PL": {
"label": "VAT",
"rate": 23
},
"PT": {
"label": "VAT",
"rate": 23
},
"RO": {
"label": "VAT",
"rate": 21
},
"SK": {
"label": "VAT",
"rate": 23
},
"SI": {
"label": "VAT",
"rate": 22
},
"ES": {
"label": "VAT",
"rate": 21
},
"SE": {
"label": "VAT",
"rate": 25
},
"GB": {
"label": "VAT",
"rate": 20
},
"NO": {
"label": "VAT",
"rate": 25
},
"CH": {
"label": "VAT",
"rate": 8.1
},
"LI": {
"label": "VAT",
"rate": 8.1
},
"IS": {
"label": "VAT",
"rate": 24
},
"RS": {
"label": "VAT",
"rate": 20
},
"UA": {
"label": "VAT",
"rate": 20
},
"TR": {
"label": "VAT",
"rate": 20
},
"AU": {
"label": "GST",
"rate": 10
},
"NZ": {
"label": "GST",
"rate": 15
},
"CA": {
"label": "GST",
"rate": 5
},
"SG": {
"label": "GST",
"rate": 9
},
"IN": {
"label": "GST",
"rate": 18
},
"JP": {
"label": "Consumption tax",
"rate": 10
},
"KR": {
"label": "VAT",
"rate": 10
},
"TW": {
"label": "VAT",
"rate": 5
},
"TH": {
"label": "VAT",
"rate": 7
},
"MY": {
"label": "Service tax",
"rate": 8
},
"ID": {
"label": "VAT",
"rate": 11
},
"PH": {
"label": "VAT",
"rate": 12
},
"VN": {
"label": "VAT",
"rate": 10
},
"AE": {
"label": "VAT",
"rate": 5
},
"SA": {
"label": "VAT",
"rate": 15
},
"BH": {
"label": "VAT",
"rate": 10
},
"OM": {
"label": "VAT",
"rate": 5
},
"IL": {
"label": "VAT",
"rate": 18
},
"EG": {
"label": "VAT",
"rate": 14
},
"MA": {
"label": "VAT",
"rate": 20
},
"ZA": {
"label": "VAT",
"rate": 15
},
"NG": {
"label": "VAT",
"rate": 7.5
},
"KE": {
"label": "VAT",
"rate": 16
},
"MX": {
"label": "VAT",
"rate": 16
},
"CL": {
"label": "VAT",
"rate": 19
},
"CO": {
"label": "VAT",
"rate": 19
},
"AR": {
"label": "VAT",
"rate": 21
},
"PE": {
"label": "VAT",
"rate": 18
}
},
"eu": [
"AT",
"BE"
],
"regions": {
"US": [
{
"code": "AL",
"name": "Alabama"
},
{
"code": "AK",
"name": "Alaska"
}
]
},
"limit": 400,
"maxRate": 50
}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Tax
Add or change tax rates
Adds each place the store collects tax in, or changes its rate where it already does. The United States is taxed a state at a time. Answers the tax settings as they now stand. Refused with business_details_required until the store has its business details.
Needs the finance.write permission (Change Finance).
POST
/
stores
/
{storeId}
/
tax
/
rates
Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.tax.setRates({
places: [],
});<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->tax->setRates([
'places' => [],
]);
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.tax.setRates(places=[])
curl --request POST \
--url https://api.shoply.gg/v1/stores/{storeId}/tax/rates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"places": [
{
"country": "DE",
"region": "CA",
"rate": 19
}
]
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/tax/rates"
payload := strings.NewReader("{\n \"places\": [\n {\n \"country\": \"DE\",\n \"region\": \"CA\",\n \"rate\": 19\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.shoply.gg/v1/stores/{storeId}/tax/rates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"places\": [\n {\n \"country\": \"DE\",\n \"region\": \"CA\",\n \"rate\": 19\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/tax/rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"places\": [\n {\n \"country\": \"DE\",\n \"region\": \"CA\",\n \"rate\": 19\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"collect": true,
"included": false,
"business": true,
"home": "DE",
"homeName": "Germany",
"rates": [
{
"country": "DE",
"countryName": "Germany",
"region": "",
"regionName": "",
"rate": 19,
"label": "VAT",
"standard": 19
},
{
"country": "US",
"countryName": "United States",
"region": "CA",
"regionName": "California",
"rate": 7.25,
"label": "Sales tax",
"standard": null
}
],
"standard": {
"AT": {
"label": "VAT",
"rate": 20
},
"BE": {
"label": "VAT",
"rate": 21
},
"BG": {
"label": "VAT",
"rate": 20
},
"HR": {
"label": "VAT",
"rate": 25
},
"CY": {
"label": "VAT",
"rate": 19
},
"CZ": {
"label": "VAT",
"rate": 21
},
"DK": {
"label": "VAT",
"rate": 25
},
"EE": {
"label": "VAT",
"rate": 24
},
"FI": {
"label": "VAT",
"rate": 25.5
},
"FR": {
"label": "VAT",
"rate": 20
},
"DE": {
"label": "VAT",
"rate": 19
},
"GR": {
"label": "VAT",
"rate": 24
},
"HU": {
"label": "VAT",
"rate": 27
},
"IE": {
"label": "VAT",
"rate": 23
},
"IT": {
"label": "VAT",
"rate": 22
},
"LV": {
"label": "VAT",
"rate": 21
},
"LT": {
"label": "VAT",
"rate": 21
},
"LU": {
"label": "VAT",
"rate": 17
},
"MT": {
"label": "VAT",
"rate": 18
},
"NL": {
"label": "VAT",
"rate": 21
},
"PL": {
"label": "VAT",
"rate": 23
},
"PT": {
"label": "VAT",
"rate": 23
},
"RO": {
"label": "VAT",
"rate": 21
},
"SK": {
"label": "VAT",
"rate": 23
},
"SI": {
"label": "VAT",
"rate": 22
},
"ES": {
"label": "VAT",
"rate": 21
},
"SE": {
"label": "VAT",
"rate": 25
},
"GB": {
"label": "VAT",
"rate": 20
},
"NO": {
"label": "VAT",
"rate": 25
},
"CH": {
"label": "VAT",
"rate": 8.1
},
"LI": {
"label": "VAT",
"rate": 8.1
},
"IS": {
"label": "VAT",
"rate": 24
},
"RS": {
"label": "VAT",
"rate": 20
},
"UA": {
"label": "VAT",
"rate": 20
},
"TR": {
"label": "VAT",
"rate": 20
},
"AU": {
"label": "GST",
"rate": 10
},
"NZ": {
"label": "GST",
"rate": 15
},
"CA": {
"label": "GST",
"rate": 5
},
"SG": {
"label": "GST",
"rate": 9
},
"IN": {
"label": "GST",
"rate": 18
},
"JP": {
"label": "Consumption tax",
"rate": 10
},
"KR": {
"label": "VAT",
"rate": 10
},
"TW": {
"label": "VAT",
"rate": 5
},
"TH": {
"label": "VAT",
"rate": 7
},
"MY": {
"label": "Service tax",
"rate": 8
},
"ID": {
"label": "VAT",
"rate": 11
},
"PH": {
"label": "VAT",
"rate": 12
},
"VN": {
"label": "VAT",
"rate": 10
},
"AE": {
"label": "VAT",
"rate": 5
},
"SA": {
"label": "VAT",
"rate": 15
},
"BH": {
"label": "VAT",
"rate": 10
},
"OM": {
"label": "VAT",
"rate": 5
},
"IL": {
"label": "VAT",
"rate": 18
},
"EG": {
"label": "VAT",
"rate": 14
},
"MA": {
"label": "VAT",
"rate": 20
},
"ZA": {
"label": "VAT",
"rate": 15
},
"NG": {
"label": "VAT",
"rate": 7.5
},
"KE": {
"label": "VAT",
"rate": 16
},
"MX": {
"label": "VAT",
"rate": 16
},
"CL": {
"label": "VAT",
"rate": 19
},
"CO": {
"label": "VAT",
"rate": 19
},
"AR": {
"label": "VAT",
"rate": 21
},
"PE": {
"label": "VAT",
"rate": 18
}
},
"eu": [
"AT",
"BE"
],
"regions": {
"US": [
{
"code": "AL",
"name": "Alabama"
},
{
"code": "AK",
"name": "Alaska"
}
]
},
"limit": 400,
"maxRate": 50
}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Authorizations
A secret API key, made under Developers in the dashboard: Authorization: Bearer shoply_sk_...
Headers
A word of your own for this one change, up to 180 letters, digits, dots, dashes, underscores and colons. Sent again with the same key, the request is not carried out twice: the first answer comes back, with Idempotent-Replay: true.
Path Parameters
The store's ID. A key reaches the store it was made in: GET /key answers which.
Body
application/json
The places.
Show child attributes
Show child attributes

