Use SCAPI to set custom properties of business objects in input documents and to read custom properties in output documents. Whether a business object supports custom properties can be found in the following tables.
Custom properties are always marked with the prefix c_ and have therefore their own namespace.
Custom Properties Example
The following example shows a document response including some custom properties:
REQUEST: GET /product/shopper-products/v1/organizations/ORG_ID/products/creative-zen-v HTTP/1.1
Host: SHORTCODE.api.commercecloud.salesforce.com
Accept: application/json
RESPONSE: HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Cache-Control: max-age=900,must-revalidate
{
...
"c_mediaFormat" : [ "0010", "0020", "0030", "0040" ],
"c_memorySize" : "1GB",
"c_tabDescription" : "The ZEN V player was designed for people like you those who walk a step or two ahead of the pack."
}
Custom Properties Value Types
SCAPI supports the following value types for input and output of custom properties:
- Text
- String
- Enum of Strings
- Set of Strings
- Integer
- Enum of Integers
- Set of Integers
- Double
- Set of Doubles
- Boolean
- Password
- Date
- Date+Time
note: The value types HTML and Image are only supported as output, but not as input value type for custom properties in SCAPI.
Document Types Supporting Custom Properties
The following tables list the document types that support custom properties. Hooks (modify...) that use the referenced document types can
add custom properties using the c_ prefix. See Customization With Hooks for more information.
Shopper API
The following Shopper API documents support custom properties.
| Document Type | Reference |
|---|---|
| Basket v1 | Basket v1 |
| Basket v2 | Basket v2 |
| BasketPaymentInstrumentRequest | BasketPaymentInstrumentRequest |
| BonusDiscountLineItem | BonusDiscountLineItem |
| Category | Category |
| CouponItem | CouponItem |
| CustomObject | customObject |
| Customer | Customer |
| CustomerAddress | CustomerAddress |
| CustomerInfo | CustomerInfo |
| CustomerPaymentInstrument | CustomerPaymentInstrument |
| CustomerPaymentInstrumentRequest | CustomerPaymentInstrumentRequest |
| CustomerProductList | CustomerProductList |
| CustomerProductListItem | CustomerProductListItem |
| CustomerProductListItemPurchase | CustomerProductListItemPurchase |
| GiftCertificate | GiftCertificate |
| GiftCertificateItem | GiftCertificateItem |
| OptionItem | OptionItem |
| Order | Order |
| OrderAddress | OrderAddress |
| OrderPaymentInstrument | OrderPaymentInstrument |
| OrderPaymentInstrumentRequest | OrderPaymentInstrumentRequest |
| PathRecord | PathRecord |
| PaymentCardSpec | PaymentCardSpec |
| PaymentMethod | PaymentMethod) |
| PriceAdjustment | PriceAdjustment |
| PriceAdjustmentRequest | PriceAdjustmentRequest |
| Product | Product |
| ProductItem | ProductItem |
| ProductListItem | CustomerProductListItem |
| ProductListItemReference | ProductListItemReference |
| ProductListLink | ProductListLink |
| ProductSearchHit | ProductSearchHit |
| Promotion | Promotion |
| PublicProductList | PublicProductList |
| PublicProductListItem | PublicProductListItem |
| PublicProductListLink | ProductListLink |
| Recommendation | Recommendation |
| Shipment | Shipment |
| ShippingItem | ShippingItem |
| ShippingMethod | ShippingMethod |
| ShippingPromotion | ShippingPromotion |
| Store | Store |
| SuggestedCategory | SuggestedCategory |
| SuggestedPhrase | SuggestedPhrase |
| SuggestedProduct | SuggestedProduct |
| Suggestion | Suggestion |