beyond_api 0.5.1.pre → 0.6.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +57 -3
- data/Gemfile.lock +3 -3
- data/lib/beyond_api/resources/carts.rb +18 -9
- data/lib/beyond_api/resources/categories.rb +2 -2
- data/lib/beyond_api/resources/categories_view.rb +13 -2
- data/lib/beyond_api/resources/checkout_settings.rb +16 -1
- data/lib/beyond_api/resources/customers.rb +333 -0
- data/lib/beyond_api/resources/newsletter_target.rb +1 -1
- data/lib/beyond_api/resources/order_settings.rb +45 -28
- data/lib/beyond_api/resources/orders.rb +175 -87
- data/lib/beyond_api/resources/payment_methods.rb +28 -25
- data/lib/beyond_api/resources/product_attribute_definitions.rb +3 -5
- data/lib/beyond_api/resources/products/attachments.rb +13 -14
- data/lib/beyond_api/resources/products/availability.rb +12 -10
- data/lib/beyond_api/resources/products/cross_sells.rb +159 -0
- data/lib/beyond_api/resources/products/custom_attributes.rb +7 -7
- data/lib/beyond_api/resources/products/images.rb +47 -8
- data/lib/beyond_api/resources/products/videos.rb +146 -0
- data/lib/beyond_api/resources/products.rb +11 -9
- data/lib/beyond_api/resources/products_view.rb +6 -51
- data/lib/beyond_api/resources/shipping_zones.rb +5 -5
- data/lib/beyond_api/resources/shop.rb +16 -21
- data/lib/beyond_api/resources/signers.rb +1 -1
- data/lib/beyond_api/resources/users.rb +13 -10
- data/lib/beyond_api/resources/variations/images.rb +160 -0
- data/lib/beyond_api/resources/variations.rb +40 -37
- data/lib/beyond_api/resources/webhook_subscriptions.rb +1 -1
- data/lib/beyond_api/session.rb +5 -5
- data/lib/beyond_api/version.rb +1 -1
- metadata +7 -4
- data/lib/beyond_api/resources/product_settings.rb +0 -28
@@ -14,14 +14,14 @@ module BeyondApi
|
|
14
14
|
# -H 'Accept: application/hal+json' \
|
15
15
|
# -H 'Authorization: Bearer <Access token>'
|
16
16
|
#
|
17
|
-
# @beyond_api.scopes +pypr:r
|
17
|
+
# @beyond_api.scopes +pypr:r+
|
18
18
|
#
|
19
19
|
# @param order_id [String] the order UUID
|
20
20
|
#
|
21
21
|
# @return [OpenStruct]
|
22
22
|
#
|
23
23
|
# @example
|
24
|
-
# @payment_process = session.orders.active_payment_process("
|
24
|
+
# @payment_process = session.orders.active_payment_process("208e2c1d-6610-43c7-b2f1-20aad6f029b9")
|
25
25
|
#
|
26
26
|
def active_payment_process(order_id)
|
27
27
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes/payments/active")
|
@@ -37,14 +37,14 @@ module BeyondApi
|
|
37
37
|
# -H 'Accept: application/hal+json' \
|
38
38
|
# -H 'Authorization: Bearer <Access token>'
|
39
39
|
#
|
40
|
-
# @beyond_api.scopes +rfpr:r
|
40
|
+
# @beyond_api.scopes +rfpr:r+
|
41
41
|
#
|
42
42
|
# @param order_id [String] the order UUID
|
43
43
|
#
|
44
44
|
# @return [OpenStruct]
|
45
45
|
#
|
46
46
|
# @example
|
47
|
-
# @refund_process = session.orders.active_refund_process("
|
47
|
+
# @refund_process = session.orders.active_refund_process("8613295f-4d44-4143-bfd0-6b81fc178618")
|
48
48
|
#
|
49
49
|
def active_refund_process(order_id)
|
50
50
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes/refunds/active")
|
@@ -55,7 +55,7 @@ module BeyondApi
|
|
55
55
|
#
|
56
56
|
# A +GET+ request is used to list all orders of the shop in a paged way. Each item in the response represents a summary of the order data.
|
57
57
|
#
|
58
|
-
# @beyond_api.scopes +ordr:r
|
58
|
+
# @beyond_api.scopes +ordr:r+
|
59
59
|
#
|
60
60
|
# @option params [Integer] :size the page size
|
61
61
|
# @option params [Integer] :page the page number
|
@@ -79,10 +79,10 @@ module BeyondApi
|
|
79
79
|
# -H 'Accept: application/hal+json' \
|
80
80
|
# -H 'Authorization: Bearer <Access token>' \
|
81
81
|
# -d '{
|
82
|
-
#
|
82
|
+
# "comment" : "This needs to be done fast!"
|
83
83
|
# }'
|
84
84
|
#
|
85
|
-
# @beyond_api.scopes +clpr:c
|
85
|
+
# @beyond_api.scopes +clpr:c+
|
86
86
|
#
|
87
87
|
# @param order_id [String] the order UUID
|
88
88
|
# @param body [Hash] the request body
|
@@ -93,7 +93,7 @@ module BeyondApi
|
|
93
93
|
# body = {
|
94
94
|
# "comment"=> "This needs to be done fast!"
|
95
95
|
# }
|
96
|
-
# @order = session.orders.cancel("
|
96
|
+
# @order = session.orders.cancel("e3f9264a-395b-407d-9036-00f38f609be6", body)
|
97
97
|
#
|
98
98
|
def cancel(order_id, body)
|
99
99
|
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/cancel", body)
|
@@ -109,7 +109,7 @@ module BeyondApi
|
|
109
109
|
# -H 'Accept: application/hal+json' \
|
110
110
|
# -H 'Authorization: Bearer <Access token>'
|
111
111
|
#
|
112
|
-
# @beyond_api.scopes +clpr:r
|
112
|
+
# @beyond_api.scopes +clpr:r+
|
113
113
|
#
|
114
114
|
# @param order_id [String] the order UUID
|
115
115
|
# @param cancelation_id [String] the cancelation UUID
|
@@ -117,7 +117,7 @@ module BeyondApi
|
|
117
117
|
# @return [OpenStruct]
|
118
118
|
#
|
119
119
|
# @example
|
120
|
-
# @pcancelation_process = session.orders.cancelation_process("
|
120
|
+
# @pcancelation_process = session.orders.cancelation_process("f16cf0db-7449-4029-a886-76f38b4aa464", "365b4b63-45a8-49f6-94c5-a65e0dee83b5")
|
121
121
|
#
|
122
122
|
def cancelation_process(order_id, cancelation_id)
|
123
123
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes/payments/cancelations/#{cancelation_id}")
|
@@ -133,7 +133,7 @@ module BeyondApi
|
|
133
133
|
# -H 'Accept: application/hal+json' \
|
134
134
|
# -H 'Authorization: Bearer <Access token>'
|
135
135
|
#
|
136
|
-
# @beyond_api.scopes +clpr:r
|
136
|
+
# @beyond_api.scopes +clpr:r+
|
137
137
|
#
|
138
138
|
# @param order_id [String] the order UUID
|
139
139
|
# @option params [Integer] :size the page size
|
@@ -142,7 +142,7 @@ module BeyondApi
|
|
142
142
|
# @return [OpenStruct]
|
143
143
|
#
|
144
144
|
# @example
|
145
|
-
# @pcancelation_processes = session.orders.cancelation_processes("
|
145
|
+
# @pcancelation_processes = session.orders.cancelation_processes("b8cb904d-4c82-4c39-a3a4-de7cb181a5d3", {page: 0, size: 20})
|
146
146
|
#
|
147
147
|
def cancelation_processes(order_id, params = {})
|
148
148
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes/payments/cancelations", params)
|
@@ -157,7 +157,7 @@ module BeyondApi
|
|
157
157
|
# -H 'Accept: application/hal+json' \
|
158
158
|
# -H 'Authorization: Bearer <Access token>'
|
159
159
|
#
|
160
|
-
# @beyond_api.scopes +pypr:u
|
160
|
+
# @beyond_api.scopes +pypr:u+
|
161
161
|
#
|
162
162
|
# @param order_id [String] the order UUID
|
163
163
|
# @param payment_id [String] the payment UUID
|
@@ -165,10 +165,10 @@ module BeyondApi
|
|
165
165
|
# @return [OpenStruct]
|
166
166
|
#
|
167
167
|
# @example
|
168
|
-
# @payment_process = session.orders.capture_payment_process("
|
168
|
+
# @payment_process = session.orders.capture_payment_process("ebfd99d6-f025-4c97-96d2-d5adbb45d6c2", "2936deca-fd56-4c0d-88e2-8030c897bf90")
|
169
169
|
#
|
170
170
|
def capture_payment_process(order_id, payment_id)
|
171
|
-
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/processes/payments/#{payment_id}/capture"
|
171
|
+
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/processes/payments/#{payment_id}/capture")
|
172
172
|
|
173
173
|
handle_response(response, status)
|
174
174
|
end
|
@@ -188,7 +188,7 @@ module BeyondApi
|
|
188
188
|
# } ]
|
189
189
|
# }'
|
190
190
|
#
|
191
|
-
# @beyond_api.scopes +clpr:c
|
191
|
+
# @beyond_api.scopes +clpr:c+
|
192
192
|
#
|
193
193
|
# @param order_id [String] the order UUID
|
194
194
|
# @param body [Hash] the request body
|
@@ -203,10 +203,10 @@ module BeyondApi
|
|
203
203
|
# "productLineItemId"=> "0e1f8ab4-ec78-42a6-9a46-a3384cd17d52"
|
204
204
|
# }]
|
205
205
|
# }
|
206
|
-
# @
|
206
|
+
# @cancelation_process = session.orders.create_cancelation_process("9072c00d-1bc7-4fd8-8836-94ada5084e7a", body)
|
207
207
|
#
|
208
208
|
def create_cancelation_process(order_id, body)
|
209
|
-
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/processes/payments/cancelations")
|
209
|
+
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/processes/payments/cancelations", body)
|
210
210
|
|
211
211
|
handle_response(response, status)
|
212
212
|
end
|
@@ -220,7 +220,7 @@ module BeyondApi
|
|
220
220
|
# -H 'Authorization: Bearer <Access token>' \
|
221
221
|
# -d '{"deliveryDateNote": "Test DeliveryDateNote", "invoiceNote": "Test invoiceNote"}'
|
222
222
|
#
|
223
|
-
# @beyond_api.scopes +ordr:u
|
223
|
+
# @beyond_api.scopes +ordr:u+
|
224
224
|
#
|
225
225
|
# @param order_id [String] the order UUID
|
226
226
|
# @param body [Hash] the request body
|
@@ -232,7 +232,7 @@ module BeyondApi
|
|
232
232
|
# "deliveryDateNote" => "Test DeliveryDateNote",
|
233
233
|
# "invoiceNote" => "Test invoiceNote"
|
234
234
|
# }
|
235
|
-
# @order = session.orders.create_invoice("
|
235
|
+
# @order = session.orders.create_invoice("a5d4d6c6-e77d-4180-8dbf-729f38a698b2", body)
|
236
236
|
#
|
237
237
|
def create_invoice(order_id, body)
|
238
238
|
response, status = BeyondApi::Request.put(@session, "/orders/#{order_id}/create-invoice", body)
|
@@ -261,7 +261,7 @@ module BeyondApi
|
|
261
261
|
# }
|
262
262
|
# }'
|
263
263
|
#
|
264
|
-
# @beyond_api.scopes +rtpr:c
|
264
|
+
# @beyond_api.scopes +rtpr:c+
|
265
265
|
#
|
266
266
|
# @param order_id [String] the order UUID
|
267
267
|
# @param body [Hash] the request body
|
@@ -282,7 +282,7 @@ module BeyondApi
|
|
282
282
|
# "amount": 19.99
|
283
283
|
# }
|
284
284
|
# }
|
285
|
-
# @return_process = session.orders.create_return_process("
|
285
|
+
# @return_process = session.orders.create_return_process("29007bb7-739a-46f5-8c70-4e1029b52fa5", body)
|
286
286
|
#
|
287
287
|
def create_return_process(order_id, body)
|
288
288
|
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/processes/returns", body)
|
@@ -300,7 +300,7 @@ module BeyondApi
|
|
300
300
|
# -d '{
|
301
301
|
# "comment" : "This needs to be done fast!",
|
302
302
|
# "sendMail" : true,
|
303
|
-
# "
|
303
|
+
# "createPackingSlip" : true,
|
304
304
|
# "trackingCode" : "lookAtMyTrackingCodeWow",
|
305
305
|
# "trackingLink" : "http://tracking.is/fun?code=lookAtMyTrackingCodeWow",
|
306
306
|
# "lineItems" : [ {
|
@@ -309,7 +309,7 @@ module BeyondApi
|
|
309
309
|
# } ]
|
310
310
|
# }'
|
311
311
|
#
|
312
|
-
# @beyond_api.scopes +shpr:c
|
312
|
+
# @beyond_api.scopes +shpr:c+
|
313
313
|
#
|
314
314
|
# @param order_id [String] the order UUID
|
315
315
|
# @param body [Hash] the request body
|
@@ -320,7 +320,7 @@ module BeyondApi
|
|
320
320
|
# body = {
|
321
321
|
# "comment" => "This needs to be done fast!",
|
322
322
|
# "send_mail" => true,
|
323
|
-
# "
|
323
|
+
# "create_packing_slip" => true,
|
324
324
|
# "tracking_code" => "lookAtMyTrackingCodeWow",
|
325
325
|
# "tracking_link" => "http=>//tracking.is/fun?code=lookAtMyTrackingCodeWow",
|
326
326
|
# "line_items" => [ {
|
@@ -328,7 +328,7 @@ module BeyondApi
|
|
328
328
|
# "product_line_item_id" => "e96e1b33-d9e9-4508-862a-816235b541f7"
|
329
329
|
# } ]
|
330
330
|
# }
|
331
|
-
# @shipping_process = session.orders.create_shipping_process("
|
331
|
+
# @shipping_process = session.orders.create_shipping_process("8df2fe3b-5149-492f-932a-073f012305eb", body)
|
332
332
|
#
|
333
333
|
def create_shipping_process(order_id, body)
|
334
334
|
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/processes/shippings", body)
|
@@ -343,7 +343,7 @@ module BeyondApi
|
|
343
343
|
# -H 'Accept: application/hal+json' \
|
344
344
|
# -H 'Authorization: Bearer <Access token>'
|
345
345
|
#
|
346
|
-
# @beyond_api.scopes +ordr:r
|
346
|
+
# @beyond_api.scopes +ordr:r+
|
347
347
|
#
|
348
348
|
# @param order_id [String] the order UUID
|
349
349
|
# @option params [Integer] :size the page size
|
@@ -352,7 +352,7 @@ module BeyondApi
|
|
352
352
|
# @return [OpenStruct]
|
353
353
|
#
|
354
354
|
# @example
|
355
|
-
# @events = session.orders.find("
|
355
|
+
# @events = session.orders.find("66b6aab5-2ed4-4f36-855e-3adb2ea873ee", { size: 100, page: 0 })
|
356
356
|
#
|
357
357
|
def events(order_id, params = {})
|
358
358
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/events", params)
|
@@ -368,14 +368,14 @@ module BeyondApi
|
|
368
368
|
# -H 'Accept: application/hal+json' \
|
369
369
|
# -H 'Authorization: Bearer <Access token>'
|
370
370
|
#
|
371
|
-
# @beyond_api.scopes +ordr:r
|
371
|
+
# @beyond_api.scopes +ordr:r+
|
372
372
|
#
|
373
373
|
# @param order_id [String] the order UUID
|
374
374
|
#
|
375
375
|
# @return [OpenStruct]
|
376
376
|
#
|
377
377
|
# @example
|
378
|
-
# @order = session.orders.find("
|
378
|
+
# @order = session.orders.find("a27f1019-3690-40d1-bd9d-d60dff4c4cf8")
|
379
379
|
#
|
380
380
|
def find(order_id)
|
381
381
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}")
|
@@ -400,7 +400,7 @@ module BeyondApi
|
|
400
400
|
# }
|
401
401
|
# }'
|
402
402
|
#
|
403
|
-
# @beyond_api.scopes +pypr:u
|
403
|
+
# @beyond_api.scopes +pypr:u+
|
404
404
|
#
|
405
405
|
# @param order_id [String] the order UUID
|
406
406
|
# @param payment_id [String] the payment UUID
|
@@ -419,7 +419,7 @@ module BeyondApi
|
|
419
419
|
# }
|
420
420
|
# }
|
421
421
|
#
|
422
|
-
# @payment_process = session.orders.mark_payment_process_as_paid("
|
422
|
+
# @payment_process = session.orders.mark_payment_process_as_paid("9a1a1aaa-e37d-4c71-bc95-cbc228463fec", "cb8c9a16-2d81-4ec1-9a4a-84a4c36124ae", body)
|
423
423
|
#
|
424
424
|
def mark_payment_process_as_paid(order_id, payment_id, body)
|
425
425
|
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/processes/payments/#{payment_id}/mark-paid", body)
|
@@ -435,10 +435,10 @@ module BeyondApi
|
|
435
435
|
# -H 'Accept: application/hal+json' \
|
436
436
|
# -H 'Authorization: Bearer <Access token>' \
|
437
437
|
# -d '{
|
438
|
-
#
|
438
|
+
# "comment" : "comment"
|
439
439
|
# }'
|
440
440
|
#
|
441
|
-
# @beyond_api.scopes +pypr:u
|
441
|
+
# @beyond_api.scopes +pypr:u+
|
442
442
|
#
|
443
443
|
# @param order_id [String] the order UUID
|
444
444
|
# @param payment_id [String] the payment UUID
|
@@ -451,7 +451,7 @@ module BeyondApi
|
|
451
451
|
# "comment" => "comment"
|
452
452
|
# }
|
453
453
|
#
|
454
|
-
# @payment_process = session.orders.mark_payment_process_as_voided("
|
454
|
+
# @payment_process = session.orders.mark_payment_process_as_voided("a5558b7f-55f4-47d4-b603-9bf7eb59c05b", "5bcc48e7-2641-42a8-a042-189ae92e9901", body)
|
455
455
|
#
|
456
456
|
def mark_payment_process_as_voided(order_id, payment_id, body)
|
457
457
|
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/processes/payments/#{payment_id}/mark-voided", body)
|
@@ -467,16 +467,16 @@ module BeyondApi
|
|
467
467
|
# -H 'Accept: application/hal+json' \
|
468
468
|
# -H 'Authorization: Bearer <Access token>' \
|
469
469
|
# -d '{
|
470
|
-
#
|
471
|
-
#
|
472
|
-
#
|
473
|
-
#
|
474
|
-
#
|
470
|
+
# "comment" : "comment",
|
471
|
+
# "details" : {
|
472
|
+
# "amount" : {
|
473
|
+
# "currency" : "EUR",
|
474
|
+
# "amount" : 19.98
|
475
|
+
# }
|
475
476
|
# }
|
476
|
-
# }
|
477
477
|
# }'
|
478
478
|
#
|
479
|
-
# @beyond_api.scopes +rfpr:r
|
479
|
+
# @beyond_api.scopes +rfpr:r+
|
480
480
|
#
|
481
481
|
# @param order_id [String] the order UUID
|
482
482
|
#
|
@@ -492,7 +492,7 @@ module BeyondApi
|
|
492
492
|
# }
|
493
493
|
# }
|
494
494
|
# }
|
495
|
-
# @refund_process = session.orders.mark_refund_process_as_paid("
|
495
|
+
# @refund_process = session.orders.mark_refund_process_as_paid("60baa84c-9e11-4d55-97a9-1a7b00a0691c", body)
|
496
496
|
#
|
497
497
|
def mark_refund_process_as_paid(order_id)
|
498
498
|
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/processes/refunds/active/mark-paid")
|
@@ -511,7 +511,7 @@ module BeyondApi
|
|
511
511
|
# "comment" : "comment"
|
512
512
|
# }'
|
513
513
|
#
|
514
|
-
# @beyond_api.scopes +shpr:u
|
514
|
+
# @beyond_api.scopes +shpr:u+
|
515
515
|
#
|
516
516
|
# @param order_id [String] the order UUID
|
517
517
|
# @param shipping_id [String] the shipping UUID
|
@@ -524,7 +524,7 @@ module BeyondApi
|
|
524
524
|
# "comment" => "comment",
|
525
525
|
# }
|
526
526
|
#
|
527
|
-
# @shipping_process = session.orders.mark_shipping_process_as_delivered("
|
527
|
+
# @shipping_process = session.orders.mark_shipping_process_as_delivered("b5642d1f-0f7f-444e-96d5-1c1d1642ea5e", "619d06d8-0077-4efd-b341-5103f71bfb2d", body)
|
528
528
|
#
|
529
529
|
def mark_shipping_process_as_delivered(order_id, shipping_process_id, body)
|
530
530
|
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/processes/shippings/#{shipping_process_id}/mark-delivered", body)
|
@@ -548,7 +548,7 @@ module BeyondApi
|
|
548
548
|
# }
|
549
549
|
# }'
|
550
550
|
#
|
551
|
-
# @beyond_api.scopes +shpr:u
|
551
|
+
# @beyond_api.scopes +shpr:u+
|
552
552
|
#
|
553
553
|
# @param order_id [String] the order UUID
|
554
554
|
# @param shipping_id [String] the shipping UUID
|
@@ -566,7 +566,7 @@ module BeyondApi
|
|
566
566
|
# }
|
567
567
|
# }
|
568
568
|
#
|
569
|
-
# @shipping_process = session.orders.mark_shipping_process_as_shipped("
|
569
|
+
# @shipping_process = session.orders.mark_shipping_process_as_shipped("dd6a7e20-16be-4509-bf83-fb8ee072ddad", "a0b0c4a5-0c80-47f4-98c3-0f55f4161176", body)
|
570
570
|
#
|
571
571
|
def mark_shipping_process_as_shipped(order_id, shipping_id, body)
|
572
572
|
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/processes/shippings/#{shipping_id}/mark-shipped", body)
|
@@ -582,7 +582,7 @@ module BeyondApi
|
|
582
582
|
# -H 'Accept: application/hal+json' \
|
583
583
|
# -H 'Authorization: Bearer <Access token>'
|
584
584
|
#
|
585
|
-
# @beyond_api.scopes +pypr:r
|
585
|
+
# @beyond_api.scopes +pypr:r+
|
586
586
|
#
|
587
587
|
# @param order_id [String] the order UUID
|
588
588
|
# @param payment_id [String] the payment UUID
|
@@ -590,7 +590,7 @@ module BeyondApi
|
|
590
590
|
# @return [OpenStruct]
|
591
591
|
#
|
592
592
|
# @example
|
593
|
-
# @payment_process = session.orders.payment_process("
|
593
|
+
# @payment_process = session.orders.payment_process("d44ed295-6a08-47ba-a288-90d4f3ba9fff", "be56bfbd-af95-45b9-8b0e-cb0c184aaf60")
|
594
594
|
#
|
595
595
|
def payment_process(order_id, payment_id)
|
596
596
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes/payments/#{payment_id}")
|
@@ -606,7 +606,7 @@ module BeyondApi
|
|
606
606
|
# -H 'Accept: application/hal+json' \
|
607
607
|
# -H 'Authorization: Bearer <Access token>'
|
608
608
|
#
|
609
|
-
# @beyond_api.scopes +pypr:r
|
609
|
+
# @beyond_api.scopes +pypr:r+
|
610
610
|
#
|
611
611
|
# @param order_id [String] the order UUID
|
612
612
|
# @option params [Integer] :size the page size
|
@@ -615,7 +615,7 @@ module BeyondApi
|
|
615
615
|
# @return [OpenStruct]
|
616
616
|
#
|
617
617
|
# @example
|
618
|
-
# @payment_processes = session.orders.payment_processes("
|
618
|
+
# @payment_processes = session.orders.payment_processes("2012b775-a706-41e0-b0f9-5142864ca4a0", {page: 0, size: 20})
|
619
619
|
#
|
620
620
|
def payment_processes(order_id, params = {})
|
621
621
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes/payments", params)
|
@@ -631,14 +631,14 @@ module BeyondApi
|
|
631
631
|
# -H 'Accept: application/hal+json' \
|
632
632
|
# -H 'Authorization: Bearer <Access token>'
|
633
633
|
#
|
634
|
-
# @beyond_api.scopes +ordr:r
|
634
|
+
# @beyond_api.scopes +ordr:r+
|
635
635
|
#
|
636
636
|
# @param order_id [String] the order UUID
|
637
637
|
#
|
638
638
|
# @return [OpenStruct]
|
639
639
|
#
|
640
640
|
# @example
|
641
|
-
# @
|
641
|
+
# @processes = session.orders.processes("934ece52-055c-4896-8d16-560f1461ea56")
|
642
642
|
#
|
643
643
|
def processes(order_id)
|
644
644
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes")
|
@@ -654,7 +654,7 @@ module BeyondApi
|
|
654
654
|
# -H 'Accept: application/hal+json' \
|
655
655
|
# -H 'Authorization: Bearer <Access token>'
|
656
656
|
#
|
657
|
-
# @beyond_api.scopes +rfpr:r
|
657
|
+
# @beyond_api.scopes +rfpr:r+
|
658
658
|
#
|
659
659
|
# @param order_id [String] the order UUID
|
660
660
|
# @param refund_id [String] the refund UUID
|
@@ -662,7 +662,7 @@ module BeyondApi
|
|
662
662
|
# @return [OpenStruct]
|
663
663
|
#
|
664
664
|
# @example
|
665
|
-
# @refund_process = session.orders.refund_process("
|
665
|
+
# @refund_process = session.orders.refund_process("801885c8-0b25-44a2-a1a4-60cbf3f9ecca", "4c02883f-be31-4fb2-ad0d-ccbc3678a9f5")
|
666
666
|
#
|
667
667
|
def refund_process(order_id, refund_id)
|
668
668
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes/refunds/#{refund_id}")
|
@@ -678,7 +678,7 @@ module BeyondApi
|
|
678
678
|
# -H 'Accept: application/hal+json' \
|
679
679
|
# -H 'Authorization: Bearer <Access token>'
|
680
680
|
#
|
681
|
-
# @beyond_api.scopes +rfpr:r
|
681
|
+
# @beyond_api.scopes +rfpr:r+
|
682
682
|
#
|
683
683
|
# @param order_id [String] the order UUID
|
684
684
|
# @option params [Integer] :size the page size
|
@@ -687,7 +687,7 @@ module BeyondApi
|
|
687
687
|
# @return [OpenStruct]
|
688
688
|
#
|
689
689
|
# @example
|
690
|
-
# @refund_processes = session.orders.refund_processes("
|
690
|
+
# @refund_processes = session.orders.refund_processes("6f86e42f-763e-4514-a37d-fb8f88cdc14c", {page: 0, size: 20})
|
691
691
|
#
|
692
692
|
def refund_processes(order_id, params = {})
|
693
693
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes/refunds", params)
|
@@ -703,7 +703,7 @@ module BeyondApi
|
|
703
703
|
# -H 'Accept: application/hal+json' \
|
704
704
|
# -H 'Authorization: Bearer <Access token>'
|
705
705
|
#
|
706
|
-
# @beyond_api.scopes +rtpr:r
|
706
|
+
# @beyond_api.scopes +rtpr:r+
|
707
707
|
#
|
708
708
|
# @param order_id [String] the order UUID
|
709
709
|
# @param return_process_id [String] the return process UUID
|
@@ -711,7 +711,7 @@ module BeyondApi
|
|
711
711
|
# @return [OpenStruct]
|
712
712
|
#
|
713
713
|
# @example
|
714
|
-
# @return_process = session.orders.return_process("
|
714
|
+
# @return_process = session.orders.return_process("cb9927e4-60d1-4a90-b40c-f5a8e2b25301", "910a3fde-cb23-418f-876a-694ce42245ef")
|
715
715
|
#
|
716
716
|
def return_process(order_id, return_process_id)
|
717
717
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes/returns/#{return_process_id}")
|
@@ -727,7 +727,7 @@ module BeyondApi
|
|
727
727
|
# -H 'Accept: application/hal+json' \
|
728
728
|
# -H 'Authorization: Bearer <Access token>'
|
729
729
|
#
|
730
|
-
# @beyond_api.scopes +rtpr:r
|
730
|
+
# @beyond_api.scopes +rtpr:r+
|
731
731
|
#
|
732
732
|
# @param order_id [String] the order UUID
|
733
733
|
# @option params [Integer] :size the page size
|
@@ -736,7 +736,7 @@ module BeyondApi
|
|
736
736
|
# @return [OpenStruct]
|
737
737
|
#
|
738
738
|
# @example
|
739
|
-
# @return_processes = session.orders.return_processes("
|
739
|
+
# @return_processes = session.orders.return_processes("9e26232f-aa7a-408b-8041-9439999268c5", {page: 0, size: 20})
|
740
740
|
#
|
741
741
|
def return_processes(order_id, params = {})
|
742
742
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes/returns", params)
|
@@ -747,17 +747,22 @@ module BeyondApi
|
|
747
747
|
#
|
748
748
|
# A +GET+ request is used to retrieve the details of an order by cart ID.
|
749
749
|
#
|
750
|
-
#
|
750
|
+
# $ curl 'https://api-shop.beyondshop.cloud/api/orders/search/find-by-cart-id?cartId=82e859a8-7f70-4c19-83c1-ed03457b2ceb' -i -X GET \
|
751
|
+
# -H 'Content-Type: application/json' \
|
752
|
+
# -H 'Accept: application/hal+json' \
|
753
|
+
# -H 'Authorization: Bearer <Access token>'
|
754
|
+
#
|
755
|
+
# @beyond_api.scopes +ordr:r+
|
751
756
|
#
|
752
757
|
# @param cart_id [String] the cart UUID
|
753
758
|
#
|
754
759
|
# @return [OpenStruct]
|
755
760
|
#
|
756
761
|
# @example
|
757
|
-
# @order = session.orders.search_by_cart_id("
|
762
|
+
# @order = session.orders.search_by_cart_id("82e859a8-7f70-4c19-83c1-ed03457b2ceb")
|
758
763
|
#
|
759
764
|
def search_by_cart_id(cart_id)
|
760
|
-
response, status = BeyondApi::Request.get(@session, "/orders/search/find-by-cart-id", {
|
765
|
+
response, status = BeyondApi::Request.get(@session, "/orders/search/find-by-cart-id", { cart_id: cart_id })
|
761
766
|
|
762
767
|
handle_response(response, status)
|
763
768
|
end
|
@@ -765,12 +770,19 @@ module BeyondApi
|
|
765
770
|
#
|
766
771
|
# A +GET+ request is used to retrieve the +orderNumber+ and +orderId+ of an order by cart Id. If there is no order for the given cart Id, a HTTP 404 - NOT FOUND response is returned.
|
767
772
|
#
|
773
|
+
# $ curl 'https://api-shop.beyondshop.cloud/api/orders/search/find-order-number-by-cart-id?cartId=7f1cf6c8-7780-430f-9de0-91cbe31c4bf6' -i -X GET \
|
774
|
+
# -H 'Content-Type: application/json' \
|
775
|
+
# -H 'Accept: application/hal+json' \
|
776
|
+
# -H 'Authorization: Bearer <Access token>'
|
777
|
+
#
|
778
|
+
# @beyond_api.scopes +ordr:r+
|
779
|
+
#
|
768
780
|
# @param cart_id [String] the cart UUID
|
769
781
|
#
|
770
782
|
# @return [OpenStruct]
|
771
783
|
#
|
772
784
|
# @example
|
773
|
-
# @order = session.orders.
|
785
|
+
# @order = session.orders.search_order_number_by_cart_id("7f1cf6c8-7780-430f-9de0-91cbe31c4bf6")
|
774
786
|
#
|
775
787
|
def search_order_number_by_cart_id(cart_id)
|
776
788
|
response, status = BeyondApi::Request.get(@session, "/orders/search/find-order-number-by-cart-id", {"cartId": cart_id})
|
@@ -781,19 +793,26 @@ module BeyondApi
|
|
781
793
|
#
|
782
794
|
# A +GET+ request is used to send an invoice for the order.
|
783
795
|
#
|
784
|
-
# $ curl 'https://api-shop.beyondshop.cloud/api/orders/
|
796
|
+
# $ curl 'https://api-shop.beyondshop.cloud/api/orders/acc1f22f-a992-4534-be92-b378a0319fcd/send-order-document' -i -X POST \
|
785
797
|
# -H 'Accept: application/hal+json' \
|
786
|
-
# -H 'Authorization: Bearer <Access token>'
|
798
|
+
# -H 'Authorization: Bearer <Access token>' \
|
799
|
+
# -d '{
|
800
|
+
# "orderDocumentUri" : "https://myshop.com/api/pdf-storage/attachments/invoice_10003.pdf?hash=9e5e2631c6f5877d64cb3d40db46ec6eb48a3a92"
|
801
|
+
# }'
|
802
|
+
#
|
803
|
+
# @beyond_api.scopes +ordr:u+
|
787
804
|
#
|
788
|
-
# @param order_id [String] the
|
805
|
+
# @param order_id [String] the order UUID
|
806
|
+
# @param order_document_uri [String] the document url
|
789
807
|
#
|
790
808
|
# @return [OpenStruct]
|
791
809
|
#
|
792
810
|
# @example
|
793
|
-
# @order = session.orders.
|
811
|
+
# @order = session.orders.send_order_document("acc1f22f-a992-4534-be92-b378a0319fcd",
|
812
|
+
# "https://myshop.com/api/pdf-storage/attachments/invoice_10003.pdf?hash=9e5e2631c6f5877d64cb3d40db46ec6eb48a3a92")
|
794
813
|
#
|
795
|
-
def
|
796
|
-
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/send-
|
814
|
+
def send_order_document(order_id, order_document_uri)
|
815
|
+
response, status = BeyondApi::Request.post(@session, "/orders/#{order_id}/send-order-document", { order_document_uri: order_document_uri })
|
797
816
|
|
798
817
|
handle_response(response, status)
|
799
818
|
end
|
@@ -806,7 +825,7 @@ module BeyondApi
|
|
806
825
|
# -H 'Accept: application/hal+json' \
|
807
826
|
# -H 'Authorization: Bearer <Access token>'
|
808
827
|
#
|
809
|
-
# @beyond_api.scopes +shpr:r
|
828
|
+
# @beyond_api.scopes +shpr:r+
|
810
829
|
#
|
811
830
|
# @param order_id [String] the order UUID
|
812
831
|
# @param shipping_process_id [String] the shipping process UUID
|
@@ -814,7 +833,7 @@ module BeyondApi
|
|
814
833
|
# @return [OpenStruct]
|
815
834
|
#
|
816
835
|
# @example
|
817
|
-
# @shipping_process = session.orders.refund_process("
|
836
|
+
# @shipping_process = session.orders.refund_process("af42860f-2813-4130-85d9-2d315a4f802e", "80ebe96b-bcd5-4a34-a428-8a67ed114ce6")
|
818
837
|
#
|
819
838
|
def shipping_process(order_id, shipping_process_id)
|
820
839
|
response, status = BeyondApi::Request.get(@session, "/orders/#{order_id}/processes/shippings/#{shipping_process_id}")
|
@@ -830,7 +849,7 @@ module BeyondApi
|
|
830
849
|
# -H 'Accept: application/hal+json' \
|
831
850
|
# -H 'Authorization: Bearer <Access token>'
|
832
851
|
#
|
833
|
-
# @beyond_api.scopes +shpr:r
|
852
|
+
# @beyond_api.scopes +shpr:r+
|
834
853
|
#
|
835
854
|
# @param order_id [String] the order UUID
|
836
855
|
# @option params [Integer] :size the page size
|
@@ -850,7 +869,41 @@ module BeyondApi
|
|
850
869
|
#
|
851
870
|
# A +PUT+ request is used to change the customer’s billing address.
|
852
871
|
#
|
853
|
-
#
|
872
|
+
# $ curl 'https://api-shop.beyondshop.cloud/api/orders/6c36e5e3-dc4c-4d00-b4e8-3fbf9a4bed14/billing-address' -i -X PUT \
|
873
|
+
# -H 'Content-Type: application/json' \
|
874
|
+
# -H 'Accept: application/hal+json' \
|
875
|
+
# -H 'Authorization: Bearer <Access token>' \
|
876
|
+
# -d '{
|
877
|
+
# "address" : {
|
878
|
+
# "salutation" : "Mrs",
|
879
|
+
# "gender" : "FEMALE",
|
880
|
+
# "company" : "Astrid Alster GmbH",
|
881
|
+
# "title" : null,
|
882
|
+
# "firstName" : "Astrid",
|
883
|
+
# "middleName" : "Agnes",
|
884
|
+
# "lastName" : "Alster",
|
885
|
+
# "street" : "Alsterwasserstraße",
|
886
|
+
# "houseNumber" : "3",
|
887
|
+
# "street2" : "Erdgeschoss",
|
888
|
+
# "addressExtension" : "Hinterhof",
|
889
|
+
# "postalCode" : "20999",
|
890
|
+
# "dependentLocality" : "Seevetal",
|
891
|
+
# "city" : "Alsterwasser",
|
892
|
+
# "country" : "DE",
|
893
|
+
# "state" : "Hamburg",
|
894
|
+
# "email" : "a.alsterh@example.com",
|
895
|
+
# "phone" : "(800) 555-0102",
|
896
|
+
# "mobile" : "(800) 555-0103",
|
897
|
+
# "vatId" : "DE123456789",
|
898
|
+
# "taxNumber" : "HRE 987654/32123/864516",
|
899
|
+
# "birthDate" : "1985-05-11",
|
900
|
+
# "displayAddressLines" : [ "Astrid Alster GmbH", "Astrid Agnes Alster", "Alsterwasserweg 2", "Erdgeschoss", "Seevetal", "20999 Alsterwasser", "Germany" ],
|
901
|
+
# "_id" : null
|
902
|
+
# },
|
903
|
+
# "comment" : "Updated billing address"
|
904
|
+
# }'
|
905
|
+
#
|
906
|
+
# @beyond_api.scopes +ordr:u+
|
854
907
|
#
|
855
908
|
# @param order_id [String] the order UUID
|
856
909
|
# @param body [Hash] the request body
|
@@ -887,7 +940,7 @@ module BeyondApi
|
|
887
940
|
# },
|
888
941
|
# "comment" => "Updated billing address"
|
889
942
|
# }
|
890
|
-
# @order = session.orders.update_billing_address("
|
943
|
+
# @order = session.orders.update_billing_address("6c36e5e3-dc4c-4d00-b4e8-3fbf9a4bed14", body)
|
891
944
|
#
|
892
945
|
def update_billing_address(order_id, body)
|
893
946
|
response, status = BeyondApi::Request.put(@session, "/orders/#{order_id}/billing-address", body)
|
@@ -898,29 +951,64 @@ module BeyondApi
|
|
898
951
|
#
|
899
952
|
# A +PUT+ request is used to change the order note.
|
900
953
|
#
|
901
|
-
#
|
954
|
+
# $ curl 'https://api-shop.beyondshop.cloud/api/orders/58545e43-f4ba-48e2-b0bf-e340fd64f7b8/order-note' -i -X PUT \
|
955
|
+
# -H 'Content-Type: application/json' \
|
956
|
+
# -H 'Authorization: Bearer <Access token>' \
|
957
|
+
# -d '{
|
958
|
+
# "orderNote" : "not paid yet"
|
959
|
+
# }'
|
960
|
+
#
|
961
|
+
# @beyond_api.scopes +ordr:u+
|
902
962
|
#
|
903
963
|
# @param order_id [String] the order UUID
|
904
|
-
# @param
|
964
|
+
# @param order_note [String] the order note
|
905
965
|
#
|
906
966
|
# @return [OpenStruct]
|
907
967
|
#
|
908
968
|
# @example
|
909
|
-
#
|
910
|
-
# "orderNote" => "not paid yet"
|
911
|
-
# }
|
912
|
-
# @order = session.orders.update_order_note("268a8629-55cd-4890-9013-936b9b5ea14c", body)
|
969
|
+
# @order = session.orders.update_order_note("58545e43-f4ba-48e2-b0bf-e340fd64f7b8", "not paid yet" )
|
913
970
|
#
|
914
|
-
def update_order_note(order_id,
|
915
|
-
response, status = BeyondApi::Request.put(@session, "/orders/#{order_id}/order-note",
|
971
|
+
def update_order_note(order_id, order_note)
|
972
|
+
response, status = BeyondApi::Request.put(@session, "/orders/#{order_id}/order-note", { order_note: order_note })
|
916
973
|
|
917
974
|
handle_response(response, status)
|
918
975
|
end
|
919
976
|
|
920
977
|
#
|
921
|
-
# A +PUT+ request is used to change the customer
|
978
|
+
# A +PUT+ request is used to change the customer's shipping address.
|
922
979
|
#
|
923
|
-
#
|
980
|
+
# $ curl 'https://api-shop.beyondshop.cloud/api/orders/30327fed-812f-4b70-8931-43e34d8c8181/shipping-address' -i -X PUT \
|
981
|
+
# -H 'Content-Type: application/json' \
|
982
|
+
# -H 'Accept: application/hal+json' \
|
983
|
+
# -H 'Authorization: Bearer <Access token>' \
|
984
|
+
# -d '{
|
985
|
+
# "address" : {
|
986
|
+
# "salutation" : "Mrs",
|
987
|
+
# "gender" : "FEMALE",
|
988
|
+
# "company" : "Astrid Alster GmbH",
|
989
|
+
# "title" : null,
|
990
|
+
# "firstName" : "Astrid",
|
991
|
+
# "middleName" : "Agnes",
|
992
|
+
# "lastName" : "Alster",
|
993
|
+
# "street" : "Alsterwasserstraße",
|
994
|
+
# "houseNumber" : "3",
|
995
|
+
# "street2" : "Erdgeschoss",
|
996
|
+
# "addressExtension" : "Hinterhof",
|
997
|
+
# "postalCode" : "20999",
|
998
|
+
# "dependentLocality" : "Seevetal",
|
999
|
+
# "city" : "Alsterwasser",
|
1000
|
+
# "country" : "DE",
|
1001
|
+
# "state" : "Hamburg",
|
1002
|
+
# "email" : "a.alsterh@example.com",
|
1003
|
+
# "phone" : "(800) 555-0102",
|
1004
|
+
# "mobile" : "(800) 555-0103",
|
1005
|
+
# "doorCode" : "456",
|
1006
|
+
# "displayAddressLines" : [ "Astrid Alster GmbH", "Astrid Agnes Alster", "Alsterwasserweg 2", "Erdgeschoss", "Seevetal", "20999 Alsterwasser", "Germany" ],
|
1007
|
+
# "_id" : null
|
1008
|
+
# },
|
1009
|
+
# "comment" : "Updated shipping address"
|
1010
|
+
# }'
|
1011
|
+
# @beyond_api.scopes +ordr:u+
|
924
1012
|
#
|
925
1013
|
# @param order_id [String] the order UUID
|
926
1014
|
# @param body [Hash] the request body
|
@@ -957,7 +1045,7 @@ module BeyondApi
|
|
957
1045
|
# },
|
958
1046
|
# "comment" => "Updated shipping address"
|
959
1047
|
# }
|
960
|
-
# @order = session.orders.update_shipping_address("
|
1048
|
+
# @order = session.orders.update_shipping_address("30327fed-812f-4b70-8931-43e34d8c8181", body)
|
961
1049
|
#
|
962
1050
|
def update_shipping_address(order_id, body)
|
963
1051
|
response, status = BeyondApi::Request.put(@session, "/orders/#{order_id}/shipping-address", body)
|