POST Credits through API Fails with Error Accounting Period Not Open

Issue:

We need to create Credit Memos using the API. When we send the request the credit memo with CreditDetails, it is not created. The error comes up for the accounting period not being open.

{

    "validationError": [

        "The accounting period for this transaction is NOT open!\r\nThe accounting period for this transaction is NOT open!"

    ]

}

 
 

Resolution:

One reason this can happen is if the Date parameter is not being sent in the CreditDetails section of the payload.

This is required so the application can validate the dates against the accounting periods.

Below is sample JSON that will create a credit memo and apply it to an invoice.

POST to /api/credit

{

    "TypeJSCO":"C",

    "CustomerId":52554,

    "CustomerSiteId":59913,

    "CategoryCode":"Admin G & A",

    "Amount":"85.0000",

    "InvoiceDescriptionCode":"Recurring",

    "ServiceStartDate":"2024-06-24",

    "ServiceEndDate":"2024-07-24",

    "Memo":"Converted but already Paid",

    "CustomerBillId":53601,

    "Branchid":2,

    "BranchCode":"OH",

    "CreditReasonId":5,

    "CreditReasonCode":"Invoiced in Error",

    "Complete":true,

    "UserCode":"pete.cava",

    "CreditItems":

    [

        {

        "CustomerSiteId":59913,

        "ItemId":157,

        "ItemCode":"Time & Material 85",

        "PartId":1,

        "PartCode":"N\/A",

        "Description":"Credit for Invoice :497818",

        "Quantity":1,

        "UnitOfMeasureCode":"EA",

        "Rate":"85.0000",

        "Amount":"85.0000",

        "ServiceStartDate":"2024-06-24",

        "ServiceEndDate":"2024-07-24",

        "Memo":"Converted but already Paid",

        "InterBranchRegisterId":1,

        "BillCycle":"N",

        "ServiceTicketId":1

        }

    ],

    "CreditDetails":

    [

        {

        "Date":"2024-06-24",

        "TypeIM":"I",

        "InvoiceNumber":"497818",

        "Amount":"85.0000",

        "BranchId":2,

        "BranchCode":"OH",

        "CategoryCode":"Admin G & A",

        "UserCode":"joe.white"

        }

    ]

}