Skip to content

Commit 82de303

Browse files
authored
Merge pull request #60 from aligent/feature/channel-currency-assignments-api
Feature/channel currency assignments api
2 parents 3235bec + 14ae439 commit 82de303

File tree

82 files changed

+15321
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+15321
-133
lines changed

RELEASE_NOTES.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
### New Features
22

3-
- Implement the missing _create_ and _update_ endpoints for Brands.
4-
- Implement [Channels APIs](https://developer.bigcommerce.com/api-reference/store-management/channels):
5-
- [Channels](https://developer.bigcommerce.com/api-reference/store-management/channels/channels/listchannels)
6-
- [Active Theme](https://developer.bigcommerce.com/api-reference/store-management/channels/channel-active-theme/get-channel-active-theme)
7-
- [Listings](https://developer.bigcommerce.com/api-reference/store-management/channels/channel-listings/listchannellistings)
8-
- [Site](https://developer.bigcommerce.com/api-reference/store-management/channels/channel-site/get-channel-site)
3+
- Implement the [Channel Currency Assignments API](https://developer.bigcommerce.com/api-reference/store-management/channels/channel-currency-assignments/post-channels-currency-assignments)
94

105
### Fixed Issues
116

12-
- Fixed 404 errors on scripts api (#55), thanks to @kishan93
13-
- Fixed issue where subscribers API was not accessible
14-
- Fixed issue where Widget Template endpoints were incorrect
157

docs/classes/BigCommerce-ApiV3-Api-Carts-CartItemsApi.html

+22-11
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,24 @@ <h2 class="phpdocumentor-content__title">
9797
<aside class="phpdocumentor-element-found-in">
9898
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartItemsApi.php"><a href="files/bigcommerce-api-carts-cartitemsapi.html"><abbr title="BigCommerce/Api/Carts/CartItemsApi.php">CartItemsApi.php</abbr></a></abbr>
9999
:
100-
<span class="phpdocumentor-element-found-in__line">11</span>
100+
<span class="phpdocumentor-element-found-in__line">32</span>
101101
</aside>
102102

103-
<p class="phpdocumentor-summary">V3ApiBase</p>
103+
<p class="phpdocumentor-summary">Cart Items API</p>
104104

105-
<section class="phpdocumentor-description"><p>Add constructors and some basic scaffolding that will work for all API classes
106-
regardless of which endpoints they implement</p>
105+
<section class="phpdocumentor-description"><p>Example for adding a line item to a cart:</p>
106+
<pre class="prettyprint"><code class="language-php">$api = new BigCommerce\ApiV3\Client($_ENV['hash'], $_ENV['CLIENT_ID'], $_ENV['ACCESS_TOKEN']);
107+
108+
$lineItem = new CartItem();
109+
$lineItem-&gt;line_items[] = [
110+
&quot;sku&quot; =&gt; &quot;made-up&quot;,
111+
&quot;name&quot; =&gt; &quot;My product&quot;,
112+
&quot;quantity&quot; =&gt; 33,
113+
&quot;list_price&quot; =&gt; 55
114+
];
115+
116+
$api()-&gt;cart($id)-&gt;items()-&gt;add($lineItem, CartItemsApi::INCLUDE_REDIRECT_URLS);
117+
</code></pre>
107118
</section>
108119

109120

@@ -243,7 +254,7 @@ <h4 class="phpdocumentor-element__name" id="constant_INCLUDE_DIGITAL_ITEMS">
243254
<aside class="phpdocumentor-element-found-in">
244255
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartItemsApi.php"><a href="files/bigcommerce-api-carts-cartitemsapi.html"><abbr title="BigCommerce/Api/Carts/CartItemsApi.php">CartItemsApi.php</abbr></a></abbr>
245256
:
246-
<span class="phpdocumentor-element-found-in__line">31</span>
257+
<span class="phpdocumentor-element-found-in__line">52</span>
247258
</aside>
248259

249260
<p class="phpdocumentor-summary">The Cart returns an abbreviated result. Use this to return digital items product options.</p>
@@ -270,7 +281,7 @@ <h4 class="phpdocumentor-element__name" id="constant_INCLUDE_PHYSICAL_ITEMS">
270281
<aside class="phpdocumentor-element-found-in">
271282
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartItemsApi.php"><a href="files/bigcommerce-api-carts-cartitemsapi.html"><abbr title="BigCommerce/Api/Carts/CartItemsApi.php">CartItemsApi.php</abbr></a></abbr>
272283
:
273-
<span class="phpdocumentor-element-found-in__line">26</span>
284+
<span class="phpdocumentor-element-found-in__line">47</span>
274285
</aside>
275286

276287
<p class="phpdocumentor-summary">The Cart returns an abbreviated result. Use this to return physical items product options.</p>
@@ -297,7 +308,7 @@ <h4 class="phpdocumentor-element__name" id="constant_INCLUDE_REDIRECT_URLS">
297308
<aside class="phpdocumentor-element-found-in">
298309
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartItemsApi.php"><a href="files/bigcommerce-api-carts-cartitemsapi.html"><abbr title="BigCommerce/Api/Carts/CartItemsApi.php">CartItemsApi.php</abbr></a></abbr>
299310
:
300-
<span class="phpdocumentor-element-found-in__line">21</span>
311+
<span class="phpdocumentor-element-found-in__line">42</span>
301312
</aside>
302313

303314
<p class="phpdocumentor-summary">Create a direct link to a Cart.</p>
@@ -393,7 +404,7 @@ <h4 class="phpdocumentor-element__name" id="method_add">
393404
<aside class="phpdocumentor-element-found-in">
394405
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartItemsApi.php"><a href="files/bigcommerce-api-carts-cartitemsapi.html"><abbr title="BigCommerce/Api/Carts/CartItemsApi.php">CartItemsApi.php</abbr></a></abbr>
395406
:
396-
<span class="phpdocumentor-element-found-in__line">33</span>
407+
<span class="phpdocumentor-element-found-in__line">54</span>
397408
</aside>
398409

399410

@@ -602,7 +613,7 @@ <h4 class="phpdocumentor-element__name" id="method_multipleResourceUrl">
602613
<aside class="phpdocumentor-element-found-in">
603614
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartItemsApi.php"><a href="files/bigcommerce-api-carts-cartitemsapi.html"><abbr title="BigCommerce/Api/Carts/CartItemsApi.php">CartItemsApi.php</abbr></a></abbr>
604615
:
605-
<span class="phpdocumentor-element-found-in__line">61</span>
616+
<span class="phpdocumentor-element-found-in__line">82</span>
606617
</aside>
607618

608619

@@ -718,7 +729,7 @@ <h4 class="phpdocumentor-element__name" id="method_singleResourceUrl">
718729
<aside class="phpdocumentor-element-found-in">
719730
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartItemsApi.php"><a href="files/bigcommerce-api-carts-cartitemsapi.html"><abbr title="BigCommerce/Api/Carts/CartItemsApi.php">CartItemsApi.php</abbr></a></abbr>
720731
:
721-
<span class="phpdocumentor-element-found-in__line">66</span>
732+
<span class="phpdocumentor-element-found-in__line">87</span>
722733
</aside>
723734

724735

@@ -750,7 +761,7 @@ <h4 class="phpdocumentor-element__name" id="method_update">
750761
<aside class="phpdocumentor-element-found-in">
751762
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartItemsApi.php"><a href="files/bigcommerce-api-carts-cartitemsapi.html"><abbr title="BigCommerce/Api/Carts/CartItemsApi.php">CartItemsApi.php</abbr></a></abbr>
752763
:
753-
<span class="phpdocumentor-element-found-in__line">47</span>
764+
<span class="phpdocumentor-element-found-in__line">68</span>
754765
</aside>
755766

756767

docs/classes/BigCommerce-ApiV3-Api-Carts-CartRedirectUrlsApi.html

+21-6
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,28 @@ <h2 class="phpdocumentor-content__title">
9797
<aside class="phpdocumentor-element-found-in">
9898
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartRedirectUrlsApi.php"><a href="files/bigcommerce-api-carts-cartredirecturlsapi.html"><abbr title="BigCommerce/Api/Carts/CartRedirectUrlsApi.php">CartRedirectUrlsApi.php</abbr></a></abbr>
9999
:
100-
<span class="phpdocumentor-element-found-in__line">8</span>
100+
<span class="phpdocumentor-element-found-in__line">32</span>
101101
</aside>
102102

103-
<p class="phpdocumentor-summary">V3ApiBase</p>
104-
105-
<section class="phpdocumentor-description"><p>Add constructors and some basic scaffolding that will work for all API classes
106-
regardless of which endpoints they implement</p>
103+
<p class="phpdocumentor-summary">Cart Redirect URLS</p>
104+
105+
<section class="phpdocumentor-description"><p>Creates a Cart redirect URL for redirecting a shopper to an already created cart using the cartId.</p>
106+
<h4>Usage Notes</h4>
107+
<ul>
108+
<li>Redirect URLs can also be created via Create a Cart requests by appending include=redirect_urls.</li>
109+
<li>A Carts redirect URLs may only be used once.</li>
110+
<li>Once a redirect URL has been visited, it will be invalidated and cannot be used again.</li>
111+
<li>If your application requires URLs to be visited more than once, consider generating a fresh one each time you need
112+
to restore a cart, and redirecting to the URL from your own application.</li>
113+
<li>Redirect URLs can be generated only from carts created using the Server to Server Cart API.</li>
114+
<li>To restore a cart that was created on the storefront, either by a shopper or the Storefront Cart API, first
115+
recreate the cart using the Server to Server Cart API.</li>
116+
</ul>
117+
<p>Example:</p>
118+
<code class="prettyprint">
119+
$api = new BigCommerce\ApiV3\Client($_ENV['hash'], $_ENV['CLIENT_ID'], $_ENV['ACCESS_TOKEN']);
120+
<p>$urls = $api-&gt;cart('sadfghj')-&gt;redirectUrls()-&gt;getRedirectUrls();
121+
</code></p>
107122
</section>
108123

109124

@@ -264,7 +279,7 @@ <h4 class="phpdocumentor-element__name" id="method_create">
264279
<aside class="phpdocumentor-element-found-in">
265280
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartRedirectUrlsApi.php"><a href="files/bigcommerce-api-carts-cartredirecturlsapi.html"><abbr title="BigCommerce/Api/Carts/CartRedirectUrlsApi.php">CartRedirectUrlsApi.php</abbr></a></abbr>
266281
:
267-
<span class="phpdocumentor-element-found-in__line">12</span>
282+
<span class="phpdocumentor-element-found-in__line">36</span>
268283
</aside>
269284

270285

docs/classes/BigCommerce-ApiV3-Api-Carts-CartsApi.html

+16-12
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,17 @@ <h2 class="phpdocumentor-content__title">
9797
<aside class="phpdocumentor-element-found-in">
9898
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartsApi.php"><a href="files/bigcommerce-api-carts-cartsapi.html"><abbr title="BigCommerce/Api/Carts/CartsApi.php">CartsApi.php</abbr></a></abbr>
9999
:
100-
<span class="phpdocumentor-element-found-in__line">13</span>
100+
<span class="phpdocumentor-element-found-in__line">27</span>
101101
</aside>
102102

103-
<p class="phpdocumentor-summary">V3ApiBase</p>
103+
<p class="phpdocumentor-summary">Carts API</p>
104104

105-
<section class="phpdocumentor-description"><p>Add constructors and some basic scaffolding that will work for all API classes
106-
regardless of which endpoints they implement</p>
105+
<section class="phpdocumentor-description"><p>The is the store management access for creating and viewing carts (not for customers to access carts)</p>
106+
<p>Example fetching the contents of a cart:</p>
107+
<code class="prettyprint">
108+
$api = new BigCommerce\ApiV3\Client($_ENV['hash'], $_ENV['CLIENT_ID'], $_ENV['ACCESS_TOKEN']);
109+
<p>$cart = $api-&gt;carts('abcdefg;)-&gt;get()-&gt;getCart();
110+
</code></p>
107111
</section>
108112

109113

@@ -299,7 +303,7 @@ <h4 class="phpdocumentor-element__name" id="method_create">
299303
<aside class="phpdocumentor-element-found-in">
300304
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartsApi.php"><a href="files/bigcommerce-api-carts-cartsapi.html"><abbr title="BigCommerce/Api/Carts/CartsApi.php">CartsApi.php</abbr></a></abbr>
301305
:
302-
<span class="phpdocumentor-element-found-in__line">27</span>
306+
<span class="phpdocumentor-element-found-in__line">41</span>
303307
</aside>
304308

305309

@@ -341,7 +345,7 @@ <h4 class="phpdocumentor-element__name" id="method_get">
341345
<aside class="phpdocumentor-element-found-in">
342346
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartsApi.php"><a href="files/bigcommerce-api-carts-cartsapi.html"><abbr title="BigCommerce/Api/Carts/CartsApi.php">CartsApi.php</abbr></a></abbr>
343347
:
344-
<span class="phpdocumentor-element-found-in__line">22</span>
348+
<span class="phpdocumentor-element-found-in__line">36</span>
345349
</aside>
346350

347351

@@ -501,7 +505,7 @@ <h4 class="phpdocumentor-element__name" id="method_item">
501505
<aside class="phpdocumentor-element-found-in">
502506
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartsApi.php"><a href="files/bigcommerce-api-carts-cartsapi.html"><abbr title="BigCommerce/Api/Carts/CartsApi.php">CartsApi.php</abbr></a></abbr>
503507
:
504-
<span class="phpdocumentor-element-found-in__line">54</span>
508+
<span class="phpdocumentor-element-found-in__line">68</span>
505509
</aside>
506510

507511

@@ -543,7 +547,7 @@ <h4 class="phpdocumentor-element__name" id="method_items">
543547
<aside class="phpdocumentor-element-found-in">
544548
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartsApi.php"><a href="files/bigcommerce-api-carts-cartsapi.html"><abbr title="BigCommerce/Api/Carts/CartsApi.php">CartsApi.php</abbr></a></abbr>
545549
:
546-
<span class="phpdocumentor-element-found-in__line">62</span>
550+
<span class="phpdocumentor-element-found-in__line">76</span>
547551
</aside>
548552

549553

@@ -575,7 +579,7 @@ <h4 class="phpdocumentor-element__name" id="method_multipleResourceUrl">
575579
<aside class="phpdocumentor-element-found-in">
576580
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartsApi.php"><a href="files/bigcommerce-api-carts-cartsapi.html"><abbr title="BigCommerce/Api/Carts/CartsApi.php">CartsApi.php</abbr></a></abbr>
577581
:
578-
<span class="phpdocumentor-element-found-in__line">49</span>
582+
<span class="phpdocumentor-element-found-in__line">63</span>
579583
</aside>
580584

581585

@@ -607,7 +611,7 @@ <h4 class="phpdocumentor-element__name" id="method_redirectUrls">
607611
<aside class="phpdocumentor-element-found-in">
608612
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartsApi.php"><a href="files/bigcommerce-api-carts-cartsapi.html"><abbr title="BigCommerce/Api/Carts/CartsApi.php">CartsApi.php</abbr></a></abbr>
609613
:
610-
<span class="phpdocumentor-element-found-in__line">70</span>
614+
<span class="phpdocumentor-element-found-in__line">84</span>
611615
</aside>
612616

613617

@@ -681,7 +685,7 @@ <h4 class="phpdocumentor-element__name" id="method_singleResourceUrl">
681685
<aside class="phpdocumentor-element-found-in">
682686
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartsApi.php"><a href="files/bigcommerce-api-carts-cartsapi.html"><abbr title="BigCommerce/Api/Carts/CartsApi.php">CartsApi.php</abbr></a></abbr>
683687
:
684-
<span class="phpdocumentor-element-found-in__line">44</span>
688+
<span class="phpdocumentor-element-found-in__line">58</span>
685689
</aside>
686690

687691

@@ -713,7 +717,7 @@ <h4 class="phpdocumentor-element__name" id="method_updateCustomerId">
713717
<aside class="phpdocumentor-element-found-in">
714718
<abbr class="phpdocumentor-element-found-in__file" title="BigCommerce/Api/Carts/CartsApi.php"><a href="files/bigcommerce-api-carts-cartsapi.html"><abbr title="BigCommerce/Api/Carts/CartsApi.php">CartsApi.php</abbr></a></abbr>
715719
:
716-
<span class="phpdocumentor-element-found-in__line">32</span>
720+
<span class="phpdocumentor-element-found-in__line">46</span>
717721
</aside>
718722

719723

0 commit comments

Comments
 (0)