Loading

scapi admin api encoding of special character "+" to avoid silent failures

Дата публикации: Nov 4, 2026
Описание

The user could not delete a custom object through the SCAPI Custom Objects API when the object key contained a + character.

when running the DELETE request without encoding the key in the endpoint path, for example: https://{{shortcode}}.api.commercecloud.salesforce.com/custom-object/custom-objects/v1/organizations/{{orgID}}/sites/{{siteId}}/custom-objects/NewsletterSubscription/user-testing+1@emailtest-domain.com.

The API returns 204 No Content, but the object remained present, making it unclear whether the key had been resolved correctly. In addition, when reviewing the custom object in the business manager it further confirms the key is not deleted meaning silent failure of 204 no content did not effect any delete.

Further tested below encodings for the key path parameter. Each request returned 204, and the object was still present afterwards:
user-testing%2B1%40emailtest-domain.com.
user-testing%2B1@emailtest-domain.com.
user-testing%252B1@emailtest-domain.com.
user-testing%252B1%2540emailtest-domain.com.

There was some guidance on what special characters covers “,” and “%” (the “Encode Special Characters” guide and the encodeSCAPISpecialCharacters helper in commerce-sdk). However it does not cover  how other characters such as “+” should be encoded in path parameters.

Решение

1. Encode the + character in the custom object key path parameter using triple encoding as %25252B before sending the SCAPI Custom Objects API DELETE request.

2. Run the DELETE request with the correctly encoded key in the endpoint path, for example: https://{{shortcode}}.api.commercecloud.salesforce.com/custom-object/custom-objects/v1/organizations/{{orgID}}/sites/{{siteId}}/custom-objects/NewsletterSubscription/user-testing%25252B1@emailtest-domain.com.

3. Confirm the result after applying the triple encoding. You should see that custom object is deleted by reviewing it through business manager interface.

Номер статьи базы знаний

005466044

 
Загрузка
Salesforce Help | Article