SCAPI Schema API

The SCAPI Schema API provides developers with programmatic access to OpenAPI Specification (OAS) definitions for both System and Custom APIs. This powerful tool enables:

  • API discovery: Find available APIs, their versions, and endpoints in a structured format.
  • Schema validation: Validate API requests and responses against defined schemas.
  • Client generation: Generate client libraries and stubs for faster integration.
  • Documentation: Create interactive API documentation from schema definitions.
  • Data model introspection: Understand data structures across APIs for transformations and migrations.

The SCAPI Schema API provides two main endpoints:

  1. List endpoint: Returns a directory of available API schemas with filtering options
  2. Detail endpoint: Returns the complete OpenAPI schema for a specific API

These endpoints allow you to access schema information for both System APIs (built-in SCAPI endpoints) and Custom APIs (your own API implementations).

For resource access, you must use a client ID and client secret from Account Manager to request an access token. The access token is used as a bearer token and added to the Authorization header of your API request.

The SCAPI Schema API requires authentication using the Account Manager OAuth 2.0 flow with the required scope: sfcc.scapi-schemas (read-only). You must include the relevant scope(s) in the client ID used to generate the token. For details, see the Authorization Scopes Catalog.

For detailed setup instructions, see the Authorization for Admin APIs guide.

Use this endpoint to discover available API schemas and filter by various criteria.

ParameterTypeRequiredDescription
shortCodePathYesAn eight-character string assigned to a realm for routing purposes, for example: kv7kzm78
organizationIdPathYesA short string that identifies your B2C Commerce instance, for example: f_ecom_zzte_053
apiFamilyQueryNoFilter by API family, for example: checkout
apiNameQueryNoFilter by API name, for example: shopper-baskets
apiVersionQueryNoFilter by API version, for example: v1
statusQueryNoFilter by status: current or deprecated

The endpoint returns a JSON object containing:

  • total: Total number of schemas available in the system
  • limit: Number of schemas included in this response (after filtering)
  • filter: Object containing applied filters (only present when filters are used)
  • data: Array of schema objects with summary information

Each schema object in the list includes:

FieldDescription
schemaVersionVersion of the schema specification, for example: 1.0.25
apiFamilyAPI family name, for example: checkout
apiNameAPI name, for example: shopper-baskets
apiVersionAPI version, for example: v1
statusSchema status: current or deprecated
linkURL to access the complete schema definition

Use this endpoint to retrieve the complete OpenAPI schema for a specific API.

ParameterTypeRequiredDescription
shortCodePathYesAn eight-character string assigned to a realm for routing purposes, for example: kv7kzm78
organizationIdPathYesA short string that identifies your B2C Commerce instance, for example: f_ecom_zzte_053
apiFamilyPathYesAPI family name, for example: checkout
apiNamePathYesAPI name, for example: shopper-baskets
apiVersionPathYesAPI version, for example: v1
expandQueryNoControls which metadata fields are included in the schema response. Accepts multiple comma-separated values. See "Expansion Parameters" section below for details.

The endpoint returns the complete OpenAPI schema definition in JSON format, including:

  • API information (title, version, description)
  • Server configurations
  • Path definitions
  • Operation details
  • Parameter specifications
  • Request/response schemas
  • Security requirements

The expand query parameter allows you to include additional metadata and information in the OpenAPI schema response. By default, the API returns a streamlined schema optimized for code generation and validation. Use expansions to add documentation, examples, and other metadata fields.

Supported Expansion Values:

ValueDescriptionWhat It Adds
allComplete schema with all available metadataIncludes all metadata fields - descriptions, examples, summaries, titles, tags, and external documentation links.
descriptionsDetailed field descriptionsAdds description properties throughout the schema to document fields, operations, and parameters.
examplesExample values and dataAdds example and examples properties to illustrate expected values and request/response structures.
external_docsExternal documentation linksAdds externalDocs properties with links to additional documentation resources.
summariesOperation summariesAdds summary properties to operations providing brief descriptions of what they do.
tagsAPI organization tagsAdds tags properties to categorize and organize operations.
titlesHuman-readable titlesAdds title properties throughout the schema for better readability.
custom_propertiesCustom attribute definitionsAdds custom attribute definitions (properties prefixed with c_) for System APIs - enables validation of custom fields.

Using Multiple Expansions:

Combine multiple expansion values by separating them with commas to customize exactly which metadata you need:

Important Notes:

  • Default response: Returns a streamlined schema with core structure and data types, optimized for validation and code generation
  • all expansion: Convenient way to get the complete schema with all available metadata
  • custom_properties expansion: Only applicable to System APIs; adds custom attribute definitions to component schemas
  • Invalid values: Result in a 400 Bad Request error with details about the invalid parameter

Examples:

  • expand=all - Returns schema with all metadata fields included.
  • expand=descriptions,examples - Returns schema with descriptions and examples only.
  • expand=custom_properties - Returns schema enriched with custom attribute definitions.
  • expand=descriptions,custom_properties - Returns schema with descriptions and custom attributes.

Get information about all available API schemas:

Response:

Get schemas for a specific API family:

Response:

Retrieve the complete OpenAPI schema for a specific API:

Response:

Retrieve a schema with custom properties:

Retrieve a schema with multiple metadata fields:

Retrieve a schema with all metadata fields included:

Combine custom attribute enrichment with descriptive metadata:

If you provide an invalid expansion parameter, the API returns a detailed error:

Response:

The API returns these standard HTTP status codes:

  • 200: Successful request
  • 400: Invalid filter parameter or invalid expansion parameter
  • 401: Authentication required
  • 403: Insufficient permissions (missing required scope)
  • 404: Schema not found

Generate interactive API documentation:

  1. Retrieve schema definitions using the SCAPI Schema API.
  2. Feed the schema into documentation tools like Swagger UI or Redocly.
  3. Host the documentation for your development team.

Generate client libraries for your APIs:

  1. Retrieve schema definitions using the SCAPI Schema API.
  2. Use OpenAPI code generators to create client SDKs in languages like JavaScript, Java, or Python.
  3. Distribute these SDKs to your development teams.

Implement robust API testing:

  1. Retrieve schema definitions using the SCAPI Schema API.
  2. Import schemas into testing tools like Postman or SoapUI.
  3. Validate requests and responses against the schema definitions.

Build an API catalog for your organization:

  1. Retrieve all schema definitions using the SCAPI Schema API.
  2. Index the APIs by family, name, version, and endpoints.
  3. Create a searchable registry for developers to discover available APIs.