---
schema_version: "1"
id: d8687ce2c58f2d5d1e4c0af0cc4aef7c9e42ce63a3a9f6d1bbbddb0f5d8d211e
title: Encode URL Special Characters
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/commerce-api/guides/url-encode.md
canonical_url: https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/url-encode.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0ec376d2b6d98fb017192bb104cfa2ef5a47f3ef36f9e5e0f5475d3cc2f4c05d
products:
  - Composable Storefront
  - Salesforce APIs
---
# Encode URL Special Characters

In SCAPI, the comma (,) is used as a value separator and percent sign (%) is used for URL encoding.

These characters are treated as reserved characters and must be additionally URL encoded in UTF-8 when used within the following resource identifiers for SCAPI requests:

- Request path parameters
- Query parameters

for example: `productID`, `categoryID`, and `promotionID`.

## Request Path Parameter Encoding

If a comma (,) or percent sign (%) is contained within resource identifiers in request path parameter values, the values must be additionally URL encoded in UTF-8. The following example shows a request for the `productId` resource identifier: "Flour,1KG":

```sh
`curl "https://{shortCode}.api.commercecloud.salesforce.com/product/products/v1/organizations/{organizationId}/products/Flour%2C1KG"`
```

When the client submits the request, the request is usually automatically encoded one more time by the HTTP library and sent to SCAPI:

```text
https://{shortCode}.api.commercecloud.salesforce.com/product/products/v1/organizations/{organizationId}/products/Flour%252C1KG
```

SCAPI decodes the resource identifier in the request:

```text
ProductId -> "Flour,1KG"
```

## Query Parameter Encoding

If a comma (,) or percent sign (%) is contained within resource identifiers in query parameter values, the values must be additionally URL encoded in UTF-8. The following example shows a request for the `productId` resource identifier: "Flour,1KG" and "1%Milk":

```sh
`curl "https://{shortCode}.api.commercecloud.salesforce.com/product/products/v1/organizations/{organizationId}/products?ids=Flour%2C1KG,1%25Milk`
```

When the client submits the request, the request is usually automatically encoded one more time by the HTTP library and sent to SCAPI:

```text
https://{shortCode}.api.commercecloud.salesforce.com/product/products/v1/organizations/{organizationId}/products?ids=Flour%252C1KG%2C1%2525Milk
```

SCAPI decodes the resource identifier in the request:

```text
ProductIds -> "Flour,1KG"
           -> "1%Milk"
```

**note:** We generally recommend NOT using special characters like commas (,) or percent signs (%) within resource identifiers.
