Skip to main content

Payment creation. 'Post Period' cannot be empty.","exceptionType"

  • February 13, 2021
  • 7 replies
  • 847 views

Forum|alt.badge.img

Hello Team,

Could you help me with the following question?

I try to create a payment.
But receive the following error:

Response: {"message":"The request is invalid.","modelState":{"entity":["The Entity field is required."]}}
An error has occurred.","exceptionMessage":"Inserting  'CA Transaction' record raised at least one error. Please review the errors.\nFinPeriodID: 'Post Period' cannot be empty.","exceptionType"

Could you provide a correct example of the request?

7 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • February 13, 2021

Hi Andrew,

Can you please share the REST API json, which you are using for payment creation?

 


Forum|alt.badge.img
  • Author
  • Freshman I
  • February 13, 2021

Naveen,

Currently, I cannot share. I should ask my dev team to provide an example.
It is not fast. I received only an example of the error.
Maybe you could provide an example of how correctly send a request to create a payment?

Thank you!


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • February 13, 2021

Andrew,

Below is the simple REST API JSON to create a payment for an order and it is working as expected. I’m NOT sure about the above issue, which you are getting. 

Please cross verify and do changes if required.

 

Method: PUT

 https: //InstanceURl/entity/EndpointName/EndpointVersion/CreatePayments/createPayment

Request:

{
    "entity": {},
    "parameters": {
         
        "OrderNbr": {
            "value": "OrderNbr"
        },
        "OrderType": {
            "value": "OrderType"
        },
        "PaymentMethod": {
            "value": "PaymentMethod"
        },
        "BranchID": {
            "value": "BranchID"
        },
        "PaymentRefNbr": {
            "value": "PaymentRefNbr"
        },
        "PaymentTotal": {
            "value": "100"
        }
    }
}

 

Hope this helps!!


Forum|alt.badge.img
  • Author
  • Freshman I
  • February 13, 2021

As I understood I should add to this request the Post Period.
An the request should have the following view:

 

Method: PUT

 https: //InstanceURl/entity/EndpointName/EndpointVersion/CreatePayments/createPayment

Request:

{
    "entity": {},
    "parameters": {
         
        "OrderNbr": {
            "value": "OrderNbr"
        },
        "OrderType": {
            "value": "OrderType"
        },
        "PaymentMethod": {
            "value": "PaymentMethod"
        },
        "BranchID": {
            "value": "BranchID"
        },
        "PaymentRefNbr": {
            "value": "PaymentRefNbr"
        },
        "PaymentTotal": {
            "value": "100"
        },

       "PostPeriod": {
            "value": "02/2021"
        },

    }
}

Is it correct?


Forum|alt.badge.img
  • Author
  • Freshman I
  • February 13, 2021

Or should the PostPeriod value embed somehow differently?


Forum|alt.badge.img
  • Author
  • Freshman I
  • February 13, 2021

Maybe like this?

 

{
    "entity": {},
    "parameters": {
         
        "OrderNbr": {
            "value": "OrderNbr"
        },
        "OrderType": {
            "value": "OrderType"
        },
        "PaymentMethod": {
            "value": "PaymentMethod"
        },
        "BranchID": {
            "value": "BranchID"
        },
        "PaymentRefNbr": {
            "value": "PaymentRefNbr"
        },
        "PaymentTotal": {
            "value": "100"
        },

        "ApplicationHistory": {
            "PostPeriod": {
               "value": 02/2021
        }
        },     

    }
}


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • February 14, 2021

Andrew,

Can you check with this?

 

  "ApplicationPeriod": {
            "value": "8-2021"
        },