Custom Objects

GET Read a global custom object by its object type ID and key.

GET /organizations/{organizationId}/custom-objects/{objectType}/{key}

Operation ID: getCustomObject. Security: AmOAuth2 (sfcc.custom-objects, sfcc.custom-objects.rw).

Reads a global custom object with a given object type ID and a value for the key attribute of the object which represents its unique identifier.

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
  • objectType (path, string, required) The ID of the custom object type.
    Minimum length: 1. Maximum length: 256. Example: MyCustomType.
  • key (path, string, required) The key attribute value that identifies the custom object.
    Minimum length: 1. Maximum length: 256. Example: my-key-value.

Responses

  • 200 Custom object retrieved successfully.

    Media type: application/json. Schema: CustomObject.

    Example: CustomObjectResultExample

    {
      "keyProperty": "global_key",
      "keyValueString": "my-key-value",
      "objectType": "MyCustomType",
      "c_textField": "some text value",
      "c_numberField": 42,
      "c_booleanField": true
    }
  • 400 Bad request.

    Media type: application/json. Schema: ErrorResponse.

    Example: MalformedKeyParameter

    {
      "title": "Malformed Key Parameter",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/malformed-key-parameter",
      "detail": "The format of path parameter 'abc' for data type 'integer' is invalid."
    }
  • 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": "Your access token is invalid or expired and can’t be used to identify a user."
    }
  • 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": "Your access token is valid, but you don’t have the required permissions to access the resource."
    }
  • 404 Not found.

    Media type: application/json. Schema: ErrorResponse.

    Example: CustomObjectNotFound

    {
      "title": "Custom Object Not Found",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/custom-object-not-found",
      "detail": "No custom object with key 'nonexistent' for object type 'MyCustomType' could be found."
    }

    Example: ObjectTypeNotFound

    {
      "title": "Object Type Not Found",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/object-type-not-found",
      "detail": "No object type with ID 'NonExistentType' could be found."
    }