@@ -60,10 +60,9 @@ MAGENTO_API_VERSION="V1"
6060
6161Example:
6262``` php
63- use Grayloon\Magento\ Magento;
63+ use Magento;
6464
65- $magento = new Magento();
66- $response = $magento->api('products')->all();
65+ $response = Magento::api('products')->all();
6766
6867$response->body() : string;
6968$response->json() : array|mixed;
@@ -82,7 +81,7 @@ $response->ok() : bool;
8281
8382Generate a admin token:
8483``` php
85- $magento-> api('integration')->adminToken($username, $password);
84+ Magento:: api('integration')->adminToken($username, $password);
8685```
8786
8887#### Carts
@@ -91,7 +90,7 @@ $magento->api('integration')->adminToken($username, $password);
9190
9291Returns information for the cart for the authenticated customer. Must use a single store code.
9392``` php
94- $magento-> api('carts')->mine();
93+ Magento:: api('carts')->mine();
9594```
9695
9796#### Cart Items (quoteCartItemRepositoryV1)
@@ -100,14 +99,14 @@ $magento->api('carts')->mine();
10099
101100Lists items that are assigned to a specified customer cart. Must have a store code.
102101``` php
103- $magento-> api('cartItems')->mine();
102+ Magento:: api('cartItems')->mine();
104103```
105104
106105` /V1/carts/mine/items/ `
107106
108107Add/update the specified cart item with a customer token. Must have a store code.
109108``` php
110- $magento-> api('cartItems')->addItem($cartId, $sku, $quantity);
109+ Magento:: api('cartItems')->addItem($cartId, $sku, $quantity);
111110```
112111
113112#### Cart Totals (quoteCartTotalRepositoryV1)
@@ -116,7 +115,7 @@ $magento->api('cartItems')->addItem($cartId, $sku, $quantity);
116115
117116Returns information for the cart totals for the authenticated customer. Must use a single store code.
118117``` php
119- $magento-> api('cartTotals')->mine();
118+ Magento:: api('cartTotals')->mine();
120119```
121120
122121<a id =" categories " ></a >
@@ -126,7 +125,7 @@ $magento->api('cartTotals')->mine();
126125
127126Get a list of all categories:
128127``` php
129- $magento-> api('categories')->all($pageSize = 50, $currentPage = 1, $filters = []);
128+ Magento:: api('categories')->all($pageSize = 50, $currentPage = 1, $filters = []);
130129```
131130
132131<a id =" customer-token " ></a >
@@ -136,7 +135,7 @@ $magento->api('categories')->all($pageSize = 50, $currentPage = 1, $filters = []
136135
137136Generate a customer token:
138137``` php
139- $magento-> api('integration')->customerToken($username, $password);
138+ Magento:: api('integration')->customerToken($username, $password);
140139```
141140
142141<a id =" customers " ></a >
@@ -146,7 +145,7 @@ $magento->api('integration')->customerToken($username, $password);
146145
147146Get a list of customers:
148147``` php
149- $magento-> api('customers')->all($pageSize = 50, $currentPage = 1, $filters = []);
148+ Magento:: api('customers')->all($pageSize = 50, $currentPage = 1, $filters = []);
150149```
151150
152151<a id =" guest-cart " ></a >
@@ -156,35 +155,35 @@ $magento->api('customers')->all($pageSize = 50, $currentPage = 1, $filters = [])
156155
157156Enable customer or guest user to create an empty cart and quote for an anonymous customer.
158157``` php
159- $magento-> api('guestCarts')->create();
158+ Magento:: api('guestCarts')->create();
160159```
161160
162161` /V1/guest-carts/{cartId} `
163162
164163Return information for a specified cart.
165164``` php
166- $magento-> api('guestCarts')->cart($cartId);
165+ Magento:: api('guestCarts')->cart($cartId);
167166```
168167
169168` /V1/guest-carts/{cartId}/items `
170169
171170List items that are assigned to a specified cart.
172171``` php
173- $magento-> api('guestCarts')->items($cartId);
172+ Magento:: api('guestCarts')->items($cartId);
174173```
175174
176175` /V1/guest-carts/{cartId}/items `
177176
178177Add/update the specified cart item.
179178``` php
180- $magento-> api('guestCarts')->addItem($cartId, $sku, $quantity);
179+ Magento:: api('guestCarts')->addItem($cartId, $sku, $quantity);
181180```
182181
183182` /V1/guest-carts/{cartId}/estimate-shipping-methods `
184183
185184Estimate shipping by address and return list of available shipping methods.
186185``` php
187- $magento-> api('guestCarts')->estimateShippingMethods($cartId);
186+ Magento:: api('guestCarts')->estimateShippingMethods($cartId);
188187```
189188
190189<a id =" product-attributes " ></a >
@@ -194,7 +193,7 @@ $magento->api('guestCarts')->estimateShippingMethods($cartId);
194193
195194Retrieve specific product attribute information:
196195``` php
197- $magento-> api('productAttributes')->show($attributeCode);
196+ Magento:: api('productAttributes')->show($attributeCode);
198197```
199198
200199<a id =" product-link-types " ></a >
@@ -204,7 +203,7 @@ $magento->api('productAttributes')->show($attributeCode);
204203
205204Retrieve information about available product link types:
206205``` php
207- $magento-> api('productLinkType')->types();
206+ Magento:: api('productLinkType')->types();
208207```
209208
210209<a id =" products " ></a >
@@ -214,14 +213,14 @@ $magento->api('productLinkType')->types();
214213
215214Get a list of products:
216215``` php
217- $magento-> api('products')->all($pageSize = 50, $currentPage = 1, $filters = []);
216+ Magento:: api('products')->all($pageSize = 50, $currentPage = 1, $filters = []);
218217```
219218
220219` /V1/products/{sku} `
221220
222221Get info about a product by the product SKU:
223222``` php
224- $magento-> api('products')->show($sku);
223+ Magento:: api('products')->show($sku);
225224```
226225
227226### Custom modules
@@ -237,18 +236,18 @@ For example:
237236```
238237To use these you can directly use get/post methods:
239238``` php
240- $magento-> api('my-custom-endpoint')->post('save', [...]);
239+ Magento:: api('my-custom-endpoint')->post('save', [...]);
241240```
242241``` php
243- $magento-> api('my-custom-endpoint')->get('get/1');
242+ Magento:: api('my-custom-endpoint')->get('get/1');
244243```
245244
246245<a id =" schema " ></a >
247246### Schema
248247
249248Get a schema blueprint of the Magento 2 REST API:
250249``` php
251- $magento-> api('schema')->show();
250+ Magento:: api('schema')->show();
252251```
253252
254253### Source Items (inventoryApiSourceItemRepositoryV1)
@@ -257,7 +256,7 @@ $magento->api('schema')->show();
257256
258257Get a list of paginated sort items (typically used for quantity retrieval):
259258``` php
260- $magento-> api('sourceItems')->all($pageSize = 50, $currentPage = 1, $filters = []);
259+ Magento:: api('sourceItems')->all($pageSize = 50, $currentPage = 1, $filters = []);
261260```
262261
263262## Testing
0 commit comments