Ecommerce: Shops
GET /shops/{shopId}
Method returns shop according to given shopsId
Returns status code
200
Request url
/shops/p
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 by comma |
Example Response
{
"shopId": "p",
"href": "https://api.getresponse.com/v3/shops/p",
"name": "shop58da437117287",
"locale": "PL",
"currency": "USD",
"createdOn": "2017-03-28T11:05:20+0000",
"updatedOn": "2017-03-29T07:00:25+0000"
}
Possible Errors
GET /shops
Sending GET request to this url, returns collection of SHOPS resources.
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
`name` fields can be a pattern and we will try to match this phrase.
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?query[name]=test&page=1&perPage=100&sort[name]=asc
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 by 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.
| |||||||||
page | integer | Specify which page of results return. | |||||||||
perPage | integer | Specify how many results per page should be returned |
Example Response
[
{
"shopId": "p",
"href": "https://api.getresponse.com/v3/shops/p",
"name": "shop58da437117287",
"locale": "PL",
"currency": "USD",
"createdOn": "2017-03-28T11:05:20+0000",
"updatedOn": "2017-03-29T07:07:11+0000"
}
]
Possible Errors
POST /shops
This method allows to create a new shop
Returns status code
201
Example Request Body
{
"name": "testShopReview",
"locale": "pl",
"currency": "USD"
}
Body params
Field name | Field type | Field description |
---|---|---|
name (required) | string | Name of the shop |
locale (required) | string | Language locale ( ISO 639-1 ) |
currency (required) | string | Currency code ( ISO 4217 ) |
Example Response
{
"shopId": "Vt",
"href": "https://api.getresponse.com/v3/shops/Vt",
"name": "testShopReview",
"locale": "PL",
"currency": "USD",
"createdOn": "2017-03-29T07:12:07+0000",
"updatedOn": "2017-03-29T07:12:07+0000"
}
Possible Errors
POST /shops/{shopId}
Allows you to update shop preferences. You should send only those fields that need to be changed. The rest of the properties remain the same.
Returns status code
200
Example Request Body
{
"name": "testShop22newReview",
"locale": "de",
"currency": "PLN"
}
Body params
Field name | Field type | Field description |
---|---|---|
name | string | Name of the shop |
locale | string | Language locale ( ISO 639-1 ) |
currency | string | Currency code ( ISO 4217 ) |
Example Response
{
"shopId": "p",
"href": "https://api.getresponse.com/v3/shops/p",
"name": "testShop22newReview",
"locale": "DE",
"currency": "PLN",
"createdOn": "2017-03-28T11:05:20+0000",
"updatedOn": "2017-03-29T07:24:16+0000"
}