Ecommerce: Taxes
GET /shops/{shopId}/taxes
Sending GET request to this url, returns collection of TAX resources that belong to given shop.
You can narrow down list of resources by passing proper query parameters (list of which you can find below in request params section). You can basically search by:
- name
- createdOn
You can specify which page of results you want and how many results per page should be there. You can also specify sort-order using one or more of allowed fields (listed below in request params section).
Last but not least you can even specify which fields from resource you want to get. If you pass param `fields` with list of fields (separated by comma [,]) we will return list of resources with only those fields (we will always add resource id to ensure that you can use that data later on)
Returns status code
200
Request url
/shops/p/taxes?query[name]=foo&query[createdOn][from]=2010-10-13&query[createdOn][to]=2020-03-15
Request params
Field name | Field type | Field description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
query | hash | Used to search only resources that meets criteria. You can specify multiple parameters, then it uses AND logic.
| |||||||||
fields | string | List of fields that should be returned. Id is always returned. Fields should be separated with comma | |||||||||
sort | hash | Enable sorting using specified field (set as a key) and order (set as a value). You can specify multiple fields to sort by.
| |||||||||
perPage | int | Number results on page | |||||||||
page | int | Page number |
Example Response
[
{
"taxId": "Sk",
"href": "https://api.getresponse.com/v3/shops/nM/taxes/Sk",
"name": "VAT",
"rate": 23,
"createdOn": "2017-03-24T15:49:59+0000",
"updatedOn": "2017-03-24T15:49:59+0000"
}
]
Possible Errors
GET /shops/{shopId}/taxes/{taxId}
Method returns TAX with given taxId in context of given shopId
Returns status code
200
Request url
/shops/p/taxes/P?fields=name
Request params
Field name | Field type | Field description |
---|---|---|
fields | string | List of fields that should be returned. Id is always returned. Fields should be separated with comma |
Example Response
{
"taxId": "Sk",
"href": "https://api.getresponse.com/v3/shops/nM/taxes/Sk",
"name": "VAT",
"rate": 23,
"createdOn": "2017-03-24T15:49:59+0000",
"updatedOn": "2017-03-24T15:49:59+0000"
}
Possible Errors
POST /shops/{shopId}/taxes
Sending a POST request to this url, will create a new TAX resource.
In order to create a new TAX, you need to send TAX resource in BODY of the request (remember that you need to serialize body into JSON string)
Returns status code
201
Example Request Body
{
"name": "VAT",
"rate": 23
}
Body params
Field name | Field type | Field description |
---|---|---|
name (required) | string | Name |
rate (required) | string | Rate value, min=0, max=99.9 |
Example Response
{
"taxId": "Sk",
"href": "https://api.getresponse.com/v3/shops/nM/taxes/Sk",
"name": "VAT",
"rate": 23,
"createdOn": "2017-03-24T15:49:59+0000",
"updatedOn": "2017-03-24T15:49:59+0000"
}
Possible Errors
POST /shops/{shopId}/taxes/{taxId}
Update properties of shops TAX. You should send only those fields that need to be changed. The rest of properties will stay the same.
Returns status code
200
Example Request Body
{
"name": "VAT",
"rate": 23
}
Body params
Field name | Field type | Field description |
---|---|---|
name | string | Name |
rate | string | Rate value, min=0, max=99.9 |
Example Response
{
"taxId": "Sk",
"href": "https://api.getresponse.com/v3/shops/nM/taxes/Sk",
"name": "VAT",
"rate": 23,
"createdOn": "2017-03-24T15:49:59+0000",
"updatedOn": "2017-03-24T15:49:59+0000"
}