Scripts

GET Get a list of code versions.

GET /organizations/{organizationId}/code-versions

Operation ID: getCodeVersions. Security: AmOAuth2 (sfcc.scripts, sfcc.scripts.rw).

Retrieves a list of all code versions available on the instance.

Parameters

  • organizationId (path, OrganizationId, required) An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character realm identifier and a 3-character instance type identifier.

    Example

    f_ecom_zzxy_prd
  • expand (query, array of string, style: form, explode: false) Specifies which related resources to include in the response. Use size to include the total size of the code version.
    Items: Allowed values: size. Example: size.

    Example

    [
      "size"
    ]

Responses

  • 200 List of code versions successfully retrieved.

    Media type: application/json. Schema: CodeVersionResult.

    Example: CodeVersionListSuccess Successful code version list result

    Example of a successful response returning a list of all code versions on the instance.

    {
      "limit": 2,
      "total": 2,
      "data": [
        {
          "id": "version1",
          "active": true,
          "cartridges": [
            "app_storefront_base",
            "app_storefront_controllers"
          ],
          "compatibilityMode": "25.6",
          "lastModificationTime": "2025-01-15T10:30:00.000Z",
          "rollback": false,
          "webDavUrl": "https://example.com/on/demandware.servlet/webdav/Sites/Cartridges/version1"
        },
        {
          "id": "version2",
          "active": false,
          "cartridges": [
            "app_storefront_base"
          ],
          "compatibilityMode": "25.6",
          "lastModificationTime": "2025-01-10T08:00:00.000Z",
          "rollback": true,
          "webDavUrl": "https://example.com/on/demandware.servlet/webdav/Sites/Cartridges/version2"
        }
      ]
    }
  • 401 Your access token is invalid or expired and can’t be used to identify a user.

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: UnauthorizedExample

    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/unauthorized",
      "title": "Unauthorized",
      "detail": "Unauthorized request"
    }
  • 403 Forbidden. Your access token is valid, but you don’t have the required permissions to access the resource.

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: ForbiddenExample

    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/forbidden",
      "title": "Forbidden",
      "detail": "Access to requested resource forbidden"
    }