Jonathan Talmi
01/17/2021, 7:20 PMPOST {{REST_SERVICES}}/record/v1/invoice/1/!transform/creditmemo
or create a new credit memo:
POST {{REST_SERVICES}}/record/v1/creditmemo
with the following payload, e.g.
{
"externalId": "CM-test",
"tranDate": "2021-01-01",
"item": {
"items": [
{
"amount": 0.01,
"item": {
"id": "1"
}
}
]
}
and then auto-apply the amount to that specific invoice. however it’s unclear to me how to do this. for a few reasons:
1. when transforming, item + apply are automatically set to the full amount.
2. i can’t set or patch the record to apply: null
3. i can’t modify the apply sublist at all
any help would be much appreciated!battk
01/17/2021, 9:02 PMJonathan Talmi
01/17/2021, 9:07 PM{
"apply": {
"items": null
}
}
or
{
"apply": null
}
i get this error:
Invalid value for the resource or sub-resource field 'apply'. Provide a valid value.
for the latter, i receive the header back:
Unknown field name apply. Field does not exist on this record instance.
Jonathan Talmi
01/17/2021, 9:10 PM{
"apply": {
"items": [
{
"line": 0,
"apply": false
}
]
}
}
and i receive:
"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."
battk
01/17/2021, 9:12 PMbattk
01/17/2021, 9:13 PMbattk
01/17/2021, 9:13 PMJonathan Talmi
01/17/2021, 9:16 PMOperations 2.a, 2.b, 2.c, 3.a, 3.b, and 4 are not possible on non-keyed sublists
so this would not be possible. i would have to replace the apply sublist wholesalebattk
01/17/2021, 9:18 PMbattk
01/17/2021, 9:18 PMbattk
01/17/2021, 9:18 PMbattk
01/17/2021, 9:19 PMJonathan Talmi
01/17/2021, 9:43 PM{
"apply": {
"items": [
{
"amount": 0.01,
"apply": false,
"applyDate": "2020-04-03",
"createdFrom": "1",
"currency": "US Dollar",
"due": 0.01,
"line": 0,
"refNum": "INV1",
"total": 0.01,
"type": "Invoice"
}
]
}
}
but received the same invalid sublist operation. not sure if the documentation implies only one field can be replaced at a timeJonathan Talmi
01/17/2021, 9:45 PM{{REST_SERVICES}}/record/v1/creditmemo/eid:CM-test/apply?expandSubResources=true
returns "links": []
, while the item sublist:
{{REST_SERVICES}}/record/v1/creditmemo/eid:CM-test/item?expandSubResources=true
contains links to each item. i’m wondering if that suggests one can’t update individual line items on the apply sublistbattk
01/17/2021, 9:50 PMbattk
01/17/2021, 9:50 PMbattk
01/17/2021, 9:50 PMbattk
01/17/2021, 9:51 PMbattk
01/17/2021, 9:51 PMJonathan Talmi
01/17/2021, 9:51 PMJonathan Talmi
01/17/2021, 10:16 PMJonathan Talmi
01/17/2021, 10:23 PM"amount": 0.01,
"createdFrom": 1,
"refNum": "INV1",
"type": "Invoice",
"apply": true,
"doc": {
"id": 1
}
to no avail. i’m also aware that the api is buggy and it’s possible some calls may not workbattk
01/17/2021, 10:31 PMbattk
01/17/2021, 10:32 PMJonathan Talmi
01/17/2021, 10:33 PMJonathan Talmi
01/17/2021, 10:34 PM