You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.html
+66-2Lines changed: 66 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,13 @@ <h3>Shopper Login (SLAS)</h3>
86
86
<li>For customers using the SLAS helpers with a public client, it is recommended to upgrade to at least <code>v1.8.0</code> of the <code>commerce-sdk-isomorphic</code>.</li>
87
87
<li>For customers using the SLAS helpers with a private client, it is recommended to upgrade to <code>v3.0.0</code> of the <code>commerce-sdk-isomorphic</code>.</li>
<p>In the next major version release, the SDK will encode special characters (UTF-8 based on SCAPI guidelines) in path parameters by default. Please see the <ahref="#encoding-special-characters">Encoding special characters</a> section for more details.</p>
<p>You can pass custom query parameters through the SDK to be used in <ahref="https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html">B2C Commerce API Hooks</a>. Custom query parameters must begin with <code>c_</code>:</p>
<p>Invalid query parameters that are not a part of the API and do not follow the <code>c_</code> custom query parameter convention are filtered from the request with a warning.</p>
<p>For more documentation about this helper function, please refer to the <ahref="https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/modules/helpers.html">commerce-sdk-isomorphic docs</a>.</p>
<p>The SDK currently single encodes special characters for query parameters in UTF-8 format based on SCAPI guidelines. However, the SDK does NOT encode path parameters, and will require the developer to encode any path parameters with special characters.</p>
260
+
<p>Additionally, SCAPI has special characters that should be double encoded, specifically <code>%</code> and <code>,</code>:</p>
261
+
<ul>
262
+
<li><code>%</code> should always be double encoded</li>
263
+
<li><code>,</code> should be double encoded when used as part of an ID/parameter string, and single encoded when used to differentiate items in a list </li>
264
+
</ul>
265
+
<p>There is a helper function called <code>encodeSCAPISpecialCharacters</code> that can be utilized to single encode the SCAPI special characters and no other special characters.</p>
266
+
<p>Here's an example where the <code>getCategory/getCategories</code> endpoints are called with a <code>categoryID</code> with special characters:</p>
0 commit comments