commercetools-sdk-java-v2 icon indicating copy to clipboard operation
commercetools-sdk-java-v2 copied to clipboard

Backend does not support store references

Open zeljkot opened this issue 3 years ago • 1 comments

Describe the bug A clear and concise description of what the bug is.

If I try to create custom type that contains set of store references, backend complains that it does not support store references.

Code that creates field:

FieldDefinition.of().apply {
    name = "marketplaces"
    label = LocalizedString.of().apply { setValue("en", "Marketplaces") }
    required = true
    type = CustomFieldSetTypeBuilder.of()
        .elementType(CustomFieldReferenceType.of().apply { referenceTypeId = ReferenceTypeId.STORE })
        .build()
},

Error:

io.vrap.rmf.base.client.error.BadRequestException: detailMessage: Client error response [url] https://api.europe-west1.gcp.commercetools.com/slppecomm-devel/types [status code] 400 [reason phrase] Bad Request
summary: POST https://api.europe-west1.gcp.commercetools.com/slppecomm-devel/types failed  with response code 400 with X-Correlation-ID `{key=x-correlation-id, value=projects-b447710a-5ecf-4c8e-b0f5-d5891be9c882}` on 2021-10-08T13:12:38.821832100Z
http response formatted body: {
  "statusCode" : 400,
  "message" : "The field with name 'marketplaces' of reference type has unsupported reference type ID 'store'. Supported type IDs are: product, product-type, channel, state, zone, shipping-method, category, review, key-value-document, customer, cart, order, cart-discount.",
  "errors" : [ {
    "code" : "InvalidOperation",
    "message" : "The field with name 'marketplaces' of reference type has unsupported reference type ID 'store'. Supported type IDs are: product, product-type, channel, state, zone, shipping-method, category, review, key-value-document, customer, cart, order, cart-discount."
  } ]
}

To Reproduce Steps to reproduce the behavior

Expected behavior A clear and concise description of what you expected to happen.

Custom type with a set of store references should be created.

Screenshots/Code snippet If applicable, add screenshots or code samples to help explain your problem.

Stack information (please complete the following information):

  • Java: [e.g. 11] correto-11
  • SDK: [e.g. v2.2] 6.1.0

Additional context Add any other context about the problem here.

zeljkot avatar Oct 08 '21 13:10 zeljkot

Could you please open a support request (http://support.commercetools.com) for this as it does not relate to the sdk itself.

jenschude avatar Oct 08 '21 13:10 jenschude