question

bassem avatar image
bassem asked brandin commented

The operation could not be completed due to a data validation error.

The operation could not be completed due to a data validation error.

when i m sending an atomic order


{

"orderCart": {

"lineItems": [

{

"item": {

"id": "HSC0F3T5JTM02"

},

"modifications": [

{

"modifier": {

"id":"G46030SW284F0"

}

}

]

}

]

}

}

REST API
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

That request looks right to me. What endpoint are you hitting? Can you provide the complete response?

4 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

bassem avatar image bassem commented ·

v3/merchants/merchantId/atomic_order/orders

this error happpens only when i send modifiers with items


0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ bassem commented ·

What is the full response you are receiving?

0 Likes 0 ·
bassem avatar image bassem David Marginian ♦♦ commented ·

only this message :The operation could not be completed due to a data validation error.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ bassem commented ·

Works fine for me. You may want to verify you are passing a valid modifier id (even if I don't, I don't get the error you are seeing).

0 Likes 0 ·
bassem avatar image
bassem answered

i only get this message :

The operation could not be completed due to a data validation error.


capture.png


capture.png (26.2 KiB)
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

TorchFi avatar image
TorchFi answered

I was facing the same error. I added the "amount" element with value 0 to the modifier and then it worked.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jeffreylin98 avatar image
jeffreylin98 answered brandin commented

Same issue here (v3/merchants/merchantId/atomic_order/orders). Adding the "amount" element with a value of 0 would not work too. 截圖-2021-07-19-上午120226.png


4 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·
0 Likes 0 ·
brandin avatar image brandin David Marginian ♦♦ commented ·

I'm having the same error, even after adding both the name and amount fields. If I don't include the modifier, the request appears to work correctly:

screen-shot-2021-10-12-at-51831-pm.png

POST /v3/merchants/xxxxxxxx/atomic_order/orders
{
  "orderCart": {
    "title": "brandin chiu",
    "note": null,
    "orderType": {
      "id": "PC66JYJBJJKA6"
    },
    "lineItems": [{
      "item": {
        "id": "5RXHF0DRR2YZY"
      },
      "modifications": [{
        "modifier": {
          "id": "NT8HTP2A923DG",
          "amount": 0,
          "name": "test"
        }
      }]
    }]
  }
}
0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ brandin commented ·
Please see the link I posted above, that request isn't right. You have amount and name nested under the modifier.
1 Like 1 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community