-
Notifications
You must be signed in to change notification settings - Fork 1
/
shop.clj
39 lines (31 loc) · 1.37 KB
/
shop.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(ns etsy.api.shop
(:require [etsy.client :refer [api-call]]))
;; http://www.etsy.com/developers/documentation/reference/shop
(defn find-all-shops
"Finds all Shops. If there is a keywords parameter, finds shops with shop_name starting with keywords."
[& {:keys [shop-name limit offset page lat lon distance-max] :as params}]
(api-call :GET "/shops" :params params))
(defn get-shop
"Retrieves a Shop by id."
[shop-id & {:keys [fields] :as params}]
(api-call :GET (str "/shops/" shop-id) :params params))
(defn update-shop
"Updates a Shop"
[shop-id & {:keys [title announcement sale_message policy_welcome policy_payment policy_shipping policy_refunds policy_additional policy_seller_info digital_sale_message] :as params}]
(api-call :PUT "/shops/:shop_id" :params params))
(defn upload-shop-banner
"Upload a new shop banner image"
[shop-id img]
(api-call :POST "/shops/:shop_id/appearance/banner"))
(defn delete-shop-banner
"Deletes a shop banner image"
[shop-id]
(api-call :DELETE "/shops/:shop_id/appearance/banner"))
(defn get-listing-shop
"Retrieves a shop by a listing id."
[listing-id]
(api-call :GET (str "/shops/listing/" listing-id)))
(defn find-all-user-shops
"Retrieves a set of Shop objects associated to a User."
[user-id & {:keys [limit offset page] :as params}]
(api-call :GET (str "/users/" user-id "/shops") :params params))