RE: Rest API – Always return error when calling customerPayment

Hi,

I try to create the  customerPayment record using the Rest API, and it always gives error , looks like I am not able to create the JSON request body correctly for customerpayment

Please help me on this to create correct JSON body for customerPayment end point

Error : “Please enter value(s) for: Payment Method.”,”

Request

POST: https://123456-sb2.suitetalk.api.netsuite.com/services/rest/record/v1/customerPayment

Request body

{
    “memo”: “10”,
    “payment”: 250,
    “paymentMethod”: {
        “id”: “1”
    },
    “customer”: {
        “id”: “10605”
    },
    “applyList”: {
        “apply”: true,
        “invoice”: {
            “id”: 20119
        },
        “line”: {
            “id”: 1 // The line ID of the invoice to apply payment to, usually “1” for the first line
        },
        “amount”: 100.0
    }
}
Response
{
    “type”: “https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.1”,
    “title”: “Bad Request”,
    “status”: 400,
    “o:errorDetails”: [
        {
            “detail”: “Error while accessing a resource. Please enter value(s) for: Payment Method.”,
            “o:errorCode”: “USER_ERROR”
        }
    ]
}

 

ritesh Rookie Asked on November 7, 2024 in SuiteCloud.
Add Comment
1 Answers

Hi,

Have you tried setting “paymentmethod” field? It appears this may be mandatory in your instance. Do you see it as mandatory in the UI?

Thanks,

Chris

Advanced Answered on November 15, 2024.

Thanks for reply.

Yes i tried setting the “paymentmethod” field, it’s part of the JSON payload, as you can see above JSON payload. but still getting the same error
yes, its a mandatory field.

Just want to confirm the way we provide “paymentmethod” data to rest API is good.  or any other setup /configuration also we need to do?

on November 21, 2024.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.