Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 8d4b214

Browse files
authored
Merge pull request #7383 from swnsma/magento-devdocs-inventory-in-store-pickup-endpoints
#7376: REST: Inventory In-Store Pickup endpoints.
2 parents 438936f + 400934c commit 8d4b214

File tree

4 files changed

+412
-1
lines changed

4 files changed

+412
-1
lines changed

src/_data/toc/inventory.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ pages:
5050
- label: Manage source selection algorithms
5151
url: /rest/modules/inventory/manage-source-selection.html
5252

53+
- label: In-Store Pickup
54+
url: /rest/modules/inventory/in-store-pickup.html
55+
exclude_versions: ["2.3"]
56+
5357
- label: Manage Inventory Management modules
5458
url: /extensions/inventory-management/
5559
versionless: true

src/_data/toc/rest-api.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,8 @@ pages:
255255

256256
- label: Manage source selection algorithms
257257
url: /rest/modules/inventory/manage-source-selection.html
258+
259+
- label: In-Store Pickup
260+
url: /rest/modules/inventory/in-store-pickup.html
261+
exclude_versions: ["2.3"]
262+
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
group: rest-api
3+
title: In-Store Pickup
4+
contributor_name: Oleksandr Kravchuk
5+
contributor_link: https://github.com/swnsma
6+
---
7+
8+
The Inventory In-Store Pickup functionality exposes an endpoint that retrieves a list of pickup locations, and another endpoint that notifies the customer that their order is ready for pickup.
9+
10+
**Service names:**
11+
12+
```http
13+
inventoryInStorePickupApiGetPickupLocationsV1
14+
inventoryInStorePickupSalesApiNotifyOrdersAreReadyForPickupV1
15+
```
16+
17+
**REST endpoints:**
18+
19+
```http
20+
GET /V1/inventory/in-store-pickup/pickup-locations
21+
POST /V1/order/notify-orders-are-ready-for-pickup
22+
```
23+
24+
## Search for pickup locations
25+
26+
The `GET /V1/inventory/in-store-pickup/pickup-locations` endpoint searches for and filters on pickup locations, allowing the shopper to quickly narrow the results. The endpoint does not require authentication.
27+
28+
Search terms, filters, and other attributes are specified as query parameters in the URL. This endpoint uses a different syntax than other Magento GET calls that send `searchCriteria` parameters. Instead, the `GET /V1/inventory/in-store-pickup/pickup-locations` endpoint requires that each query parameter begins with `searchRequest`. The `scopeCode` parameter is required. All other parameters are optional.
29+
30+
Name | Type | Description
31+
--- | --- | ---
32+
`[scopeCode]=` | String | Required. The Sales Channel code of the assigned Stock.
33+
`[scopeType]=` | String | The Sales Channel type. The default value is `website`.
34+
`[area][radius]=` | Int | The radius, in kilometers, to search. The Distance Priority Algorithm must be configured to search an area. This parameter must be used with `[area][searchTerm]`.
35+
`[area][searchTerm]=` | String | The text to search, such as a city or region. This parameter must be used with `[area][radius]`.
36+
`[filters][country][value]=` | String | Filters by the specified `country_id`.
37+
`[filters][country][conditionType]=` | String | Optional. The default value is `eq`.
38+
`[filters][postcode][value]=` | String | Filters by the specified `postcode`.
39+
`[filters][postcode][conditionType]=` | String | Optional. The default value is `eq`.
40+
`[filters][region][value]=` | String | Filters by the specified `region`.
41+
`[filters][region][conditionType]=` | String | Optional. The default value is `eq`.
42+
`[filters][city][value]=` | String | Filters by the specified `city`.
43+
`[filters][city][conditionType]=` | String | Optional. The default value is `eq`.
44+
`[filters][street][value]=` | String | Filters by the specified `street`.
45+
`[filters][street][conditionType]=` | String | Optional. The default value is `eq`.
46+
`[filters][name][value]=` | String | Filters by the specified display `name`.
47+
`[filters][name][conditionType]=` | String | Optional. The default value is `eq`.
48+
`[filters][pickupLocationCode][value]=` | String | Filters by the specified source code name.
49+
`[filters][pickupLocationCode][conditionType]=` | String | Optional. The default value is `eq`.
50+
`[extensionAttributes][productsInfo][0][sku]=` | String | Returns a list of products with the specified SKU that are assigned to each pickup location. Locations without all the assigned products will be filtered out.
51+
`[extensionAttributes][productsInfo][0][extensionAttributes]=` | String | Extension point reserved for future use.
52+
`[pageSize]=` | Int | Specifies the maximum number of items to return.
53+
`[currentPage]=` | Int | Returns the current page.
54+
`[sort][0][field]=` | String | Specifies the field to sort on.
55+
`[sort][0][direction]=` | String | Specifies whether to return results in ascending (`ASC`) or descending (`DESC`) order. The default is `DESC`.
56+
57+
[Search using REST endpoints]({{page.baseurl}}/rest/performing-searches.html) provides a full list of supported condition types.
58+
59+
**Sample Usage:**
60+
61+
`GET <host>/rest/<store_code>/V1/inventory/in-store-pickup/pickup-locations`
62+
63+
**Payload:**
64+
65+
Define the payload as part of the `GET` request string.
66+
67+
```http
68+
searchRequest[area][radius]=1500&
69+
searchRequest[area][searchTerm]=Austin&
70+
searchRequest[scopeCode]=base&
71+
searchRequest[extensionAttributes][productsInfo][0][sku]=SKU1
72+
```
73+
74+
**Response:**
75+
76+
Magento returns Pickup Locations list, search request given and total results count.
77+
78+
```json
79+
{
80+
"items": [
81+
{
82+
"pickup_location_code": "txspeqs",
83+
"name": "Sport Equipment Store",
84+
"email": "[email protected]",
85+
"contact_name": "Ethan Carter",
86+
"description": "Sport Equipment Store description",
87+
"latitude": 29.7543,
88+
"longitude": -95.3609,
89+
"country_id": "US",
90+
"region_id": 57,
91+
"region": "Texas",
92+
"city": "Houston",
93+
"street": "4631 Airport Blvd #125",
94+
"postcode": "77010",
95+
"phone": "(555) 555-5555"
96+
}
97+
],
98+
"search_request": {
99+
"area": {
100+
"radius": 1500,
101+
"search_term": "Austin"
102+
},
103+
"current_page": 1,
104+
"scope_type": "website",
105+
"scope_code": "base",
106+
"extension_attributes": {
107+
"products_info": [
108+
{
109+
"sku": "SKU1"
110+
}
111+
]
112+
}
113+
},
114+
"total_count": 1
115+
}
116+
```
117+
118+
## Mark an order as ready for pickup
119+
120+
The `POST /V1/order/notify-orders-are-ready-for-pickup` endpoint creates a shipment and sends an email notifying the customer that the order is ready to be picked up.
121+
The endpoint requires appropriate permission to resource `Magento_InventoryInStorePickupApi::notify_orders_are_ready_for_pickup`.
122+
123+
**Sample Usage:**
124+
125+
`POST <host>/rest/<store_code>/V1/order/notify-orders-are-ready-for-pickup`
126+
127+
**Payload:**
128+
129+
```json
130+
{
131+
"orderIds": [
132+
81
133+
]
134+
}
135+
```
136+
137+
**Response:**
138+
139+
Magento returns an array with success status and an array of error messages for each failed order.
140+
141+
```json
142+
{
143+
"successful": true,
144+
"failed": []
145+
}
146+
```

src/guides/v2.4/rest/modules/inventory/manage-sources.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)