Copy Purchase Order Line Items To An Invoice

POST /api/.../invlineitems?source=polineids&invoiceid={invoiceid}

Copy one or more purchase order line items to an exisiting invoice.

Request Information

Parameters
Name Type Required Description
source String Yes. Value should be 'polineids' action identifier
invoiceid Integer Yes The unique id assigned to the invoice.
Request Body

A JSON array of purchase order line item identifiers represented as numbers.

Property Type Nullable Description
POLineItemID Integer No PO line item identifier.
Example
application/json, text/json
[154476,154477]

Response Information

Returns a result object with how many records are succeeded (RecordsAffected), a success or failure message (Message) and list of JSON objects (Details)

Property Type Description
ID Integer PO line item identifier.
Succeeded Boolean Indicates if the item is copied successfully.
ErrorMessage String Description of error
ErrorCode Integer Error code
AdditionalInfo String PO line item's line number
Example
application/json, text/json
{
  "RecordsAffected": 2,
  "Message": "Copying was completed successfully.",
  "Details": [
    {
      "Id": 154476,
      "Succeeded": true,
      "ErrorMessage": null,
      "ErrorCode": 0,
      "AdditionalInfo": "33"
    },
    {
      "Id": 154478,
      "Succeeded": true,
      "ErrorMessage": null,
      "ErrorCode": 0,
      "AdditionalInfo": "31"
    }
  ]
}

HTTP Response Codes

Code Description
200 OK. Success
400 FAILURE.
  • Bad request
  • Invalid invoice ID
  • Invalid poline item ID
404 FAILURE.
  • Invoice not found
  • Purchase order line item not found

Required Permissions

Permission IDs found here.

    CR_AccessAcquisitions_Allow (),
    CR_Invoices_Access (based on owner ID),
    CR_Invoices_Modify ()