Copy Purchase Order Line Item Segments To An Invoice

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

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

Request Information

Parameters
Name Type Required Description
source String Yes. Value should be 'segmentids' action identifier
invoiceid Integer Yes The unique id assigned to the invoice.
DtoPOLineSegmentCopyToInvoice Poline segment Information Yes Define this parameter in the request body.
DtoPOLineSegmentCopyToInvoice
Property Type Nullable Description
POLineSegmentIDs List Yes List of po line item segment ids to be added.
POLineItemID Integer Yes The unique id assigned to the purchase order line item.
Example
application/json, text/json
{
    "POLineItemID":23161, 
    "POLineSegmentIDs":[25160, 25161]
}

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 segment identifier.
Succeeded Boolean Indicates if the item is copied successfully.
ErrorMessage String Description of error
ErrorCode Integer Error code
AdditionalInfo String Segment line number
Example
application/json, text/json
{
  "RecordsAffected": 2,
  "Message": "Copying was completed successfully.",
  "Details": [
    {
      "Id": 25160,
      "Succeeded": true,
      "ErrorMessage": null,
      "ErrorCode": 0,
      "AdditionalInfo": "33"
    },
    {
      "Id": 25161,
      "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 ()