Steinar Møller
PARTNER

Problem with posting startDate and endDate on Customer Invoice

by Steinar Møller

Hi,

We are posting following to CustomerInvoice
},
"startDate": {
"value": "2021-09-14T00:00:00"
},
"endDate": {
"value": "2022-03-13T00:00:00"
},
"deferralCode": {
"value": "Zuora"
}

Getting error:
{
"message": "Error: Inserting 'Customer transactions' record raised at least one error. Please review the errors.\r\nUnit price has been set to zero because no effective unit price was found.\r\nError: 'Term start date' cannot be empty.\r\nError: 'Term end date' cannot be empty.\r\n"
}

 

Testing with another defferialCode without startDate and endDate gives no error.
Posting exact same data in UI gives no error and working as expected.
Testing with v1 gives same error. ref https://community.visma.com/t5/Forum-in-Developers-Visma-net/Using-start-end-date-in-the-API-when-cr...

Is there a way to solve this?

Brgds Steinar 

4 REPLIES 4

by Magnus Johnsen

Hi Steinar,

The fields you want to use are "termStartDate" & "termEndDate" as opposed to "startDate" & "endDate".

 

Example:

{
    "customerNumber": {
        "value"10000
    },
    "documentDate": {
        "value""/Date(1573171200000)/"
    },
    "hold": {
        "value"false
    },
    "invoiceLines": [
        {
            "operation""Insert",
            "lineNumber": {
                "value"0
            },
            "inventory": {
                "value""nonstocktest"
            },
            "quantity": {
                "value"1
            },
            "manualAmountInCurrency": {
                "value"10
            },
            "description": {
                "value""string"
            },
            "deferralCode": {
                "value""test2"
            },
            "termStartDate": {
                "value""2021-09-27T11:49:03.928Z"
            },
            "termEndDate": {
                "value""2021-11-27T11:49:03.928Z"
            },
            "sub": [
                {
                    "segmentId"1,
                    "segmentValue""01"
                },
                {
                    "segmentId"2,
                    "segmentValue""001"
                },
                {
                    "segmentId"3,
                    "segmentValue""1"
                }
            ],
            "UOM": {
                "value""STK"
            },
            "project": {
                "value""X"
            }
        }
    ]
}
Accepted solution
Steinar Møller
PARTNER

Hi Magnus
Thanks, this solved the problem 🙂 We used the same field name as from GET, and did not realize that it was different from POST. 

 

Steinar

by Magnus Johnsen

Hi,

Could you please send us a screen shot of a deferral code that works for you as well as the one that does not work(ScreenId=DR202000)?

Thank you.  

Steinar Møller
PARTNER

Attached screen shot