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

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.