RE: Create Invoice with REST API

Hi all,

 

Has anyone successfully created an invoice using the REST API? The documentation is pretty sparse on payload examples and the closest approximation in the postman collection is Create Sales Order. Using the schema of the postman Create Sales Order as a starting point for invoices isn’t working, I’m just getting a 400 “Invalid content in the request body.” error.

 

My current test payload (with id’s redacted) is:

{
    “account”: [
        { “id”: <accountID> }
    ],
    “currency”: [
        { “id”: <currencyID> }
    ],
    “entity”: [
        { “id”: <entityID> }
    ],
    “item”: {
        “items”: [
            {
                “item”: {  “id”: <itemID>  },
                “rate”: 10,
                “quantity”: 1
            }
        ]
    },
    “salesRep”: [
        { “id”: <salesRepID> }
    ],
    “subsidiary”: [
        { “id”: <subsidiaryID> }
    ],
    “terms”: [
        { “id”: <termID> }
    ],
    “billaddressee”: “John Doe”,
    “billAddr1”: “123 Test Street”,
    “billCity”: “London”,
    “billZip”: “ab1 3cd”,
    “billCountry”: “GB”,
    “amountpaid “: 10,
    “subtotal”: 8,
    “taxRate”: 2,
    “total”: 10
}
Thanks!
devmatt Rookie Asked on November 10, 2020 in SuiteTalk.
Add Comment
3 Answers
using  above method it is not working

RE: Create Invoice with REST API

{
    “type”: “https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1”,
    “title”: “Internal Server Error”,
    “status”: 500,
    “o:errorDetails”: [
        {
            “detail”: “An unexpected error occurred. Error ID: l7gfaanu1h3cqhvp1whb5”,
            “o:errorCode”: “UNEXPECTED_ERROR”
        }
    ]
}
Rookie Answered on August 30, 2022.
Add Comment

Your Answer

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