Hello! I know that this question has been asked be...
# suitetalkapi
m
Hello! I know that this question has been asked before but I coulndn't find an exhaustive answer. I am trying to create a Payment for an Invoice by using REST Api. This is my payload:
Copy code
{
  "apply": {
    "items": [
      {
        "apply": true,
        "doc": {
          "id": "6791"
        },
        "line": 0,
        "amount": 0.01
      }
    ]
  },
  "currency": {
    "id": "1"
  },
  "customer": {
    "id": "1730"
  },
  "toBeEmailed": false,
  "tranDate": "2024-02-21",
  "tranId": "PYMT10"
}
The result is always:
Copy code
{
  "type": "<https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.1>",
  "title": "Bad Request",
  "status": 400,
  "o:errorDetails": [
    {
      "detail": "Error while accessing a resource. You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.",
      "o:errorPath": "apply",
      "o:errorCode": "USER_ERROR"
    }
  ]
}
I tried many variants but the result is always the same. The invoice id "6791" is correct and it has only one line. Does anybody knows where the problem is? Thanks in advance!