Hello I want to ask how to apply invoice in credit...
# suitetalkapi
m
Hello I want to ask how to apply invoice in credit memo using rest web ?
Copy code
{
  "entity": {
    "id": "3872"
  },
  "location": {
    "id": "6"
  },
  "memo": "TEST",
  "tranDate": "2023-07-12",
  "item": {
    "items": [
      {
        "item": {
          "id": "634"
        },
        "apply": true,
        "quantity": 1,
        "rate": 15000000
      }
    ]
  },
  "apply": {
    "apply": [
      {
        "doc": {
          "id": "32795"
        },
        "apply": true,
        "quantity": 1,
        "rate": 15000000
      }
    ]
  }
}
I try using that but get an error :
Copy code
"detail": "Invalid content in the request body.",
            "o:errorCode": "INVALID_CONTENT"
b
this attempt had little chance of working, both the credit memo metadata and the credit memo api browser dont list an apply key to set
your best chance is to transform the invoice into a credit memo
m
I try using transform, but instead of apply the credit memo that I created before, it created new credit memo and now my invoice is paid in full
b
transform creates a new credit memo, it doesnt edit an existing one
m
Can we set how many credit memo that apply to the invoice?
b
you would use the customer payment record to apply multiple credit memos to an invoice in the ui
i dont think the rest version of the customer payment supports that
m
For example if the invoice has 15000 amount and I want to apply credit memo with the amount 10000, can I do that in the rest web?
b
no
m
Ok, thank you