Module: BlommingApi::SellEndpoints

Included in:
Client
Defined in:
lib/blomming_api/sell_endpoints.rb

Instance Method Summary collapse

Instance Method Details

#sell_payment_types_create(payload, params = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/blomming_api/sell_endpoints.rb', line 20

def sell_payment_types_create (payload, params={})
  url = api_url "/sell/payment_types​/new"
  load = MultiJson.dump payload
  req = request_params(params)

  feed_or_retry do
    RestClient.post url, load, req 
  end  
end

#sell_payment_types_delete(id, params = {}) ⇒ Object



40
41
42
43
44
45
46
47
# File 'lib/blomming_api/sell_endpoints.rb', line 40

def sell_payment_types_delete (id, params={})
  url = api_url "/sell/payment_types​/#{id}"
  req = request_params(params)

  feed_or_retry do
    RestClient.delete url, req 
  end  
end

#sell_payment_types_find(params = {}) ⇒ Object

PAYMENT_TYPES



11
12
13
14
15
16
17
18
# File 'lib/blomming_api/sell_endpoints.rb', line 11

def sell_payment_types_find (params={})
  url = api_url "/sell/payment_types​/user_list"
  req = request_params(params)

  feed_or_retry do
    RestClient.get url, req
  end  
end

#sell_payment_types_update(id, payload, params = {}) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/blomming_api/sell_endpoints.rb', line 30

def sell_payment_types_update (id, payload, params={})
  url = api_url "/sell/payment_types​/#{id}"
  load = MultiJson.dump payload
  req = request_params(params)

  feed_or_retry do
    RestClient.put url, load, req 
  end  
end

#sell_register(payload, params = {}) ⇒ Object

REGISTER



52
53
54
55
56
57
58
59
60
# File 'lib/blomming_api/sell_endpoints.rb', line 52

def sell_register (payload, params={})
  url = api_url "/sell/register"
  load = MultiJson.dump payload
  req = request_params(params)

  feed_or_retry do
    RestClient.post url, load, req 
  end  
end

#sell_shipping_countries_all(params = {}) ⇒ Object

SHIPPING_COUNTRIES



65
66
67
68
69
70
71
72
# File 'lib/blomming_api/sell_endpoints.rb', line 65

def sell_shipping_countries_all (params={})
  url = api_url "/sell/shipping_countries​​/all"
  req = request_params({locale: @locale}.merge(params))

  feed_or_retry do
    RestClient.get url, req
  end  
end

#sell_shipping_profile_create(payload, params = {}) ⇒ Object



87
88
89
90
91
92
93
94
95
# File 'lib/blomming_api/sell_endpoints.rb', line 87

def sell_shipping_profile_create (payload, params={})
  url = api_url "/sell/shipping_profiles"
  load = MultiJson.dump payload
  req = request_params(params)

  feed_or_retry do
    RestClient.post url, load, req 
  end  
end

#sell_shipping_profile_delete(id, params = {}) ⇒ Object



119
120
121
122
123
124
125
126
# File 'lib/blomming_api/sell_endpoints.rb', line 119

def sell_shipping_profile_delete (id, params={})
  url = api_url "/sell/payment_types​/#{id}"
  req = request_params(params)

  feed_or_retry do
    RestClient.delete url, req 
  end  
end

#sell_shipping_profile_find(id, params = {}) ⇒ Object



128
129
130
131
132
133
134
135
# File 'lib/blomming_api/sell_endpoints.rb', line 128

def sell_shipping_profile_find (id, params={})
  url = api_url "/sell/payment_types​/#{id}"
  req = request_params(params)

  feed_or_retry do
    RestClient.get url, req 
  end  
end

#sell_shipping_profile_item_create(payload, item_id, params = {}) ⇒ Object



137
138
139
140
141
142
143
144
145
# File 'lib/blomming_api/sell_endpoints.rb', line 137

def sell_shipping_profile_item_create (payload, item_id, params={})
  url = api_url "/sell/shipping_profiles/items​/#{item_id}"
  load = MultiJson.dump payload
  req = request_params(params)

  feed_or_retry do
    RestClient.post url, load, req 
  end  
end

#sell_shipping_profile_update(payload, params = {}) ⇒ Object

def sell_shipping_profile_update (payload, params={})

  url = api_url "/sell/shipping_profiles"
  load = MultiJson.dump payload
  req = request_params(params)

  feed_or_retry do
    RestClient.put url, load, req 
  end  
end


109
110
111
112
113
114
115
116
117
# File 'lib/blomming_api/sell_endpoints.rb', line 109

def sell_shipping_profile_update (payload, params={})
  url = api_url "/sell/shipping_profiles/#{id}"
  load = MultiJson.dump payload
  req = request_params(params)

  feed_or_retry do
    RestClient.put url, load, req 
  end  
end

#sell_shipping_profiles(params = {}) ⇒ Object

SHIPPING_PROFILES



78
79
80
81
82
83
84
85
# File 'lib/blomming_api/sell_endpoints.rb', line 78

def sell_shipping_profiles (params={})
  url = api_url "/sell/shipping_profiles"
  req = request_params(params)

  feed_or_retry do
    RestClient.get url, req
  end
end

#sell_shipping_regions(params = {}) ⇒ Object

SHIPPING_REGIONS



151
152
153
154
155
156
157
158
# File 'lib/blomming_api/sell_endpoints.rb', line 151

def sell_shipping_regions (params={})
  url = api_url "/sell/shipping_regions​/all"
  req = request_params({locale: @locale}.merge(params))

  feed_or_retry do
    RestClient.get url, req
  end  
end

#sell_shop_dashboard(params = {}) ⇒ Object

SHOP_DASHBOARD



163
164
165
166
167
168
169
170
# File 'lib/blomming_api/sell_endpoints.rb', line 163

def sell_shop_dashboard (params={})
  url = api_url "/sell/shop/dashboard"
  req = request_params({locale: @locale}.merge(params))

  feed_or_retry do
    RestClient.get url, req
  end  
end

#sell_shop_item_create(payload, params = {}) ⇒ Object



184
185
186
187
188
189
190
191
192
# File 'lib/blomming_api/sell_endpoints.rb', line 184

def sell_shop_item_create (payload, params={})
  url = api_url '/sell/shop/items/new'
  load = MultiJson.dump payload
  req = request_params(params)

  feed_or_retry do
    RestClient.post url, load, req 
  end  
end

#sell_shop_item_delete(item_id, params = {}) ⇒ Object



213
214
215
216
217
218
219
220
# File 'lib/blomming_api/sell_endpoints.rb', line 213

def sell_shop_item_delete (item_id, params={})
  url = api_url "/sell/shop/items/#{item_id}"
  req = request_params(params)

  feed_or_retry do
    RestClient.delete url, req
  end  
end

#sell_shop_item_find(item_id, params = {}) ⇒ Object



194
195
196
197
198
199
200
201
# File 'lib/blomming_api/sell_endpoints.rb', line 194

def sell_shop_item_find (item_id, params={})
  url = api_url "/sell/shop/items/#{item_id}"
  req = request_params(params)

  feed_or_retry do
    RestClient.get url, req
  end  
end

#sell_shop_item_tags_add(*tags, item_id, params) ⇒ Object



222
223
224
225
226
227
228
229
230
231
232
# File 'lib/blomming_api/sell_endpoints.rb', line 222

def sell_shop_item_tags_add(*tags, item_id, params)
  url = api_url "/sell/shop/items/#{item_id}/add_tags"
  req = request_params({currency: @currency, locale: @locale}.merge(params))
  
  # with a hash sends parameters as a urlencoded form body
  load = {:tags => tags.join(','), :multipart => true}

  feed_or_retry do
    RestClient.post url, load, req
  end  
end

#sell_shop_item_tags_remove(*tags, item_id, params) ⇒ Object



234
235
236
237
238
239
240
241
242
243
244
# File 'lib/blomming_api/sell_endpoints.rb', line 234

def sell_shop_item_tags_remove(*tags, item_id, params)
  url = api_url "/sell/shop/items/#{item_id}/remove_tag"
  req = request_params({currency: @currency, locale: @locale}.merge(params))
  
  # with a hash sends parameters as a urlencoded form body
  load = {:tags => tags.join(','), :multipart => true}

  feed_or_retry do
    RestClient.post url, load, req
  end  
end

#sell_shop_item_update(item_id, payload, params = {}) ⇒ Object



203
204
205
206
207
208
209
210
211
# File 'lib/blomming_api/sell_endpoints.rb', line 203

def sell_shop_item_update (item_id, payload, params={})
  url = api_url "/sell/shop/items/#{item_id}"
  load = MultiJson.dump payload
  req = request_params(params)

  feed_or_retry do
    RestClient.put url, load, req
  end    
end

#sell_shop_items(params = {}) ⇒ Object

SHOP_ITEMS



175
176
177
178
179
180
181
182
# File 'lib/blomming_api/sell_endpoints.rb', line 175

def sell_shop_items (params={})
  url = api_url '/sell/shop/items'
  req = request_params(params)

  feed_or_retry do
    RestClient.get url, req
  end  
end

#sell_shop_orders(order_status, params = {}) ⇒ Object



260
261
262
263
264
265
266
267
# File 'lib/blomming_api/sell_endpoints.rb', line 260

def sell_shop_orders (order_status, params={})
  url = api_url "/sell/shop/orders"
  req = request_params({ order_status: order_status, currency: @currency, locale: @locale}.merge(params))

  feed_or_retry do
    RestClient.get url, req
  end  
end

#sell_shop_orders_change_state(order_number, state, params = {}) ⇒ Object



278
279
280
281
282
283
284
285
286
# File 'lib/blomming_api/sell_endpoints.rb', line 278

def sell_shop_orders_change_state (order_number, state, params={})
  url = api_url "/sell/shop/orders/#{order_number}/change_state"
  req = request_params({state: state}.merge(params))

  feed_or_retry do
    # POST with a hash sends parameters as a urlencoded form body
    RestClient.post url, req
  end  
end

#sell_shop_orders_find(order_number, params = {}) ⇒ Object



269
270
271
272
273
274
275
276
# File 'lib/blomming_api/sell_endpoints.rb', line 269

def sell_shop_orders_find (order_number, params={})
  url = api_url "/sell/shop/orders/#{order_number}"
  req = request_params(params)

  feed_or_retry do
    RestClient.get url, req
  end  
end

#sell_shop_orders_request_cancellation(order_number, reason_string, params = {}) ⇒ Object



289
290
291
292
293
294
295
296
297
298
# File 'lib/blomming_api/sell_endpoints.rb', line 289

def sell_shop_orders_request_cancellation (order_number, reason_string, params={})
  url = api_url "/sell/shop/orders/#{order_number}/request_cancellation"
  req = request_params(params)
  load = MultiJson.dump reason: reason_string

  feed_or_retry do
    # POST with raw payloads
    RestClient.post url, load, req
  end  
end

#sell_shop_orders_states(params = {}) ⇒ Object

SHOP_ORDERS



251
252
253
254
255
256
257
258
# File 'lib/blomming_api/sell_endpoints.rb', line 251

def sell_shop_orders_states (params={})
  url = api_url "/sell/shop/orders/states"
  req = request_params(params)

  feed_or_retry do
    RestClient.get url, req
  end  
end

#sell_shop_shipping_profiles(params = {}) ⇒ Object

SHOP_SHIPPING_PROFILES



303
304
305
306
307
308
309
310
# File 'lib/blomming_api/sell_endpoints.rb', line 303

def sell_shop_shipping_profiles (params={})
  url = api_url "/sell/shop/shipping_profiles"
  req = request_params({locale: @locale}.merge(params))

  feed_or_retry do
    RestClient.get url, req
  end  
end

#sell_shop_user_details(params = {}) ⇒ Object

SHOP_USER_DETAILS



315
316
317
318
319
320
321
322
# File 'lib/blomming_api/sell_endpoints.rb', line 315

def sell_shop_user_details (params={})
  url = api_url "/sell/shop/user_details"
  req = request_params({locale: @locale}.merge(params))

  feed_or_retry do
    RestClient.get url, req
  end  
end