From 1e151094d4ddd0e4f66cdb96ccdd84f76b5d1d73 Mon Sep 17 00:00:00 2001
From: gmanifavas
Date: Tue, 25 Jun 2024 13:03:18 +0300
Subject: [PATCH] Add documentation for tracking details endpoint in orders API
---
...ants_ecommerce_orders_tracking_details.yml | 31 +++++++++++++++++++
.../smart_cart/_order_object.html.md.erb | 8 +++++
.../smart_cart/orders_api.html.md.erb | 26 ++++++++++++++++
3 files changed, 65 insertions(+)
create mode 100644 resources/responses/skroutz/merchants_ecommerce_orders_tracking_details.yml
diff --git a/resources/responses/skroutz/merchants_ecommerce_orders_tracking_details.yml b/resources/responses/skroutz/merchants_ecommerce_orders_tracking_details.yml
new file mode 100644
index 00000000..ba1373d0
--- /dev/null
+++ b/resources/responses/skroutz/merchants_ecommerce_orders_tracking_details.yml
@@ -0,0 +1,31 @@
+---
+:request:
+ :url: https://api.skroutz.gr/merchants/ecommerce/orders/191128-1234567/tracking_details
+ :headers:
+ :accept: application/vnd.skroutz+json; version=3.0
+ :authorization: Bearer xWmjOaQmNgLt3dVIYBGkWVWhbrcdg4XfYqS3Jb1dMVHvGIBJcPuzVQYjH-XKenxsZgFW8DSgc9f2fI_MBVBHNw==
+ :params:
+ :tracking_details:
+ - :courier: "acs"
+ :tracking_code: "224085551"
+ :verb: :post
+:response:
+ :status: 200
+ :headers:
+ Date: Wed, 6 Jul 2022 12:12:26 GMT
+ Connection: keep-alive
+ Content-Length: 6400
+ Server: h2o (Debian)
+ Content-Type: application/json; charset=utf-8
+ X-Meta-Client-Id: 27951bdf06a65ea4
+ Cache-Control: no-cache
+ X-Request-Id: 989369834
+ X-Runtime: 0.021923
+ X-App: as103_ssl
+ X-Varnish: 989369834
+ Age: 0
+ Via: 1.1 varnish (Varnish/5.0)
+ X-Origin: lb2
+ X-Cache: MISS
+ X-Cached: skroutz miss(0)
+ :body: '{"success":true}'
diff --git a/source/localizable/smart_cart/_order_object.html.md.erb b/source/localizable/smart_cart/_order_object.html.md.erb
index 01c18c7d..b088d6eb 100644
--- a/source/localizable/smart_cart/_order_object.html.md.erb
+++ b/source/localizable/smart_cart/_order_object.html.md.erb
@@ -198,3 +198,11 @@ ID | Label | Requires Available
`4` | `Περιορισμένα τεμάχια` | True
`5` | `To προϊόν καταργήθηκε` | False
`6` | `Λάθος ταξινόμηση προϊόντος` | False
+
+
+#### Tracking details option: Courier
+These are the possible courier values when [updating tracking details](/smart_cart/orders_api/#update-tracking-details-fbm-only)
+
+Name | Type | Value |
+------------ | ------ | ----- |
+`courier` | String | `acs`, `dhl`, `geniki_taxydromiki`, `dpd`, `gls`
diff --git a/source/localizable/smart_cart/orders_api.html.md.erb b/source/localizable/smart_cart/orders_api.html.md.erb
index 953e3535..30139ce7 100644
--- a/source/localizable/smart_cart/orders_api.html.md.erb
+++ b/source/localizable/smart_cart/orders_api.html.md.erb
@@ -151,6 +151,32 @@ Only one file is allowed per order. If the file is already uploaded, it will by
+### Update tracking details (FBM only)
+To allow shipment tracking, you need to provide the `courier` and `tracking_code` for each order shipment.
+
+>
+> This endpoint is available only for FBM (Fulfilled By Merchant) orders
+>
+>
+>The existing API endpoint is limited to updating tracking details only for orders shipped to customers and does not currently support return orders.
+>These should be still handled through merchants panel for the time being.
+
+
+ POST /merchants/ecommerce/orders/:code/tracking_details
+
+
+
+<%= render_recording :merchants_ecommerce_orders_tracking_details %>
+
+
+curl -X POST https://api.skroutz.gr/merchants/ecommerce/orders/191128-1234567/tracking_details \
+ -H 'Accept: application/vnd.skroutz+json; version=3.0' \
+ -H 'Content-Type: application/json; charset=utf-8' \
+ -H 'Authorization: Bearer your_access_token_here' \
+ -d '{ "tracking_details": [ { "courier":"acs", "tracking_code":"224085551" } ] }'
+
+
+
## Error handling
In case of errors, the response will have a representative HTTP status code