POST PurchaseInvoice/PostPurchaseInvoice

Creates a new purchase invoice.

Request Information

URI Parameters

Body Parameters

Purchase Invoice object used to create a new purchase invoice.

clsPurInv
NameDescriptionTypeAdditional Information
VendorID

string

Required

Max length: 10

InvoiceNumber

string

Required

Max length: 15

Must not contain a space or a tic (')

InvoiceDate

string

Required

Data type: DateTime

Format must be MM/dd/yyyy

DueDate

string

Required

Data type: DateTime

Format must be MM/dd/yyyy

Notes

string

Max length: 40

FreightType

string

Max length: 2

Only used when applying freight. Valid options: AD for Actual Total Dollars, ED for Estimated Total Dollars.

FreightVendorID

string

Max length: 10

Only used when applying freight.

EstimatedFreight

decimal number

Max length: 10

Max of 2 decimal places

Must be numeric

Only used when applying freight. If EstimatedFreight is filled out ActualFreight must be zero.

ActualFreight

decimal number

Max length: 10

Max of 2 decimal places

Must be numeric

Only used when applying freight. If ActualFreight is filled out EstimatedFreight must be zero.

DiscountGL

string

Max length: 10

InvoiceDetail

Collection of clsPurInvDt

List cannot be empty

InvoiceAddOn

Collection of clsPurInvAdd
InvoicePayTerms

List of Payment Terms to be applied to the Purchase Invoice

Collection of clsPurInvPayTerms

Maximum of 5 allowed

Request Formats

application/json, text/json

Sample:
{
  "VendorID": "sample string 1",
  "InvoiceNumber": "sample string 2",
  "InvoiceDate": "sample string 3",
  "DueDate": "sample string 4",
  "Notes": "sample string 5",
  "FreightType": "sample string 7",
  "FreightVendorID": "sample string 8",
  "EstimatedFreight": 9.1,
  "ActualFreight": 10.1,
  "DiscountGL": "sample string 29",
  "InvoiceDetail": [
    {
      "PONumber": "sample string 5",
      "POLineItem": 6,
      "PRNumber": "sample string 7",
      "PRLineItem": 8,
      "DepartmentID": "sample string 10",
      "ProductID": "sample string 11",
      "ProductDescription": "sample string 12",
      "Quantity": 13.1,
      "UnitCost": 15.1,
      "Total": 17.1
    },
    {
      "PONumber": "sample string 5",
      "POLineItem": 6,
      "PRNumber": "sample string 7",
      "PRLineItem": 8,
      "DepartmentID": "sample string 10",
      "ProductID": "sample string 11",
      "ProductDescription": "sample string 12",
      "Quantity": 13.1,
      "UnitCost": 15.1,
      "Total": 17.1
    }
  ],
  "InvoiceAddOn": [
    {
      "LineItem": 4,
      "DirectYN": "sample string 5",
      "Rate": 8.1,
      "CalculateAs": "sample string 9",
      "ApplyTo": "sample string 11",
      "GLAccount": "sample string 12",
      "Vendor": "sample string 13",
      "PrePaid": true,
      "ChargeID": "sample string 19"
    },
    {
      "LineItem": 4,
      "DirectYN": "sample string 5",
      "Rate": 8.1,
      "CalculateAs": "sample string 9",
      "ApplyTo": "sample string 11",
      "GLAccount": "sample string 12",
      "Vendor": "sample string 13",
      "PrePaid": true,
      "ChargeID": "sample string 19"
    }
  ],
  "InvoicePayTerms": [
    {
      "IfPaidBy": "sample string 1",
      "DiscountPercent": 2.1,
      "DiscountDollars": 3.1
    },
    {
      "IfPaidBy": "sample string 1",
      "DiscountPercent": 2.1,
      "DiscountDollars": 3.1
    }
  ]
}

application/xml, text/xml

Sample:
<PurchaseInvoice xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SSI.Inv">
  <ActualFreight>10.1</ActualFreight>
  <DiscountGL>sample string 29</DiscountGL>
  <DueDate>sample string 4</DueDate>
  <EstimatedFreight>9.1</EstimatedFreight>
  <FreightType>sample string 7</FreightType>
  <FreightVendorID>sample string 8</FreightVendorID>
  <InvoiceAddOn>
    <InvoiceAddOn>
      <ApplyTo>sample string 11</ApplyTo>
      <CalculateAs>sample string 9</CalculateAs>
      <ChargeID>sample string 19</ChargeID>
      <DirectYN>sample string 5</DirectYN>
      <GLAccount>sample string 12</GLAccount>
      <LineItem>4</LineItem>
      <PrePaid>true</PrePaid>
      <Rate>8.1</Rate>
      <Vendor>sample string 13</Vendor>
    </InvoiceAddOn>
    <InvoiceAddOn>
      <ApplyTo>sample string 11</ApplyTo>
      <CalculateAs>sample string 9</CalculateAs>
      <ChargeID>sample string 19</ChargeID>
      <DirectYN>sample string 5</DirectYN>
      <GLAccount>sample string 12</GLAccount>
      <LineItem>4</LineItem>
      <PrePaid>true</PrePaid>
      <Rate>8.1</Rate>
      <Vendor>sample string 13</Vendor>
    </InvoiceAddOn>
  </InvoiceAddOn>
  <InvoiceDate>sample string 3</InvoiceDate>
  <InvoiceDetail>
    <InvoiceDetail>
      <DepartmentID>sample string 10</DepartmentID>
      <POLineItem>6</POLineItem>
      <PONumber>sample string 5</PONumber>
      <PRLineItem>8</PRLineItem>
      <PRNumber>sample string 7</PRNumber>
      <ProductDescription>sample string 12</ProductDescription>
      <ProductID>sample string 11</ProductID>
      <Quantity>13.1</Quantity>
      <Total>17.1</Total>
      <UnitCost>15.1</UnitCost>
    </InvoiceDetail>
    <InvoiceDetail>
      <DepartmentID>sample string 10</DepartmentID>
      <POLineItem>6</POLineItem>
      <PONumber>sample string 5</PONumber>
      <PRLineItem>8</PRLineItem>
      <PRNumber>sample string 7</PRNumber>
      <ProductDescription>sample string 12</ProductDescription>
      <ProductID>sample string 11</ProductID>
      <Quantity>13.1</Quantity>
      <Total>17.1</Total>
      <UnitCost>15.1</UnitCost>
    </InvoiceDetail>
  </InvoiceDetail>
  <InvoiceNumber>sample string 2</InvoiceNumber>
  <InvoicePayTerms>
    <InvoicePayTerms>
      <DiscountDollars>3.1</DiscountDollars>
      <DiscountPercent>2.1</DiscountPercent>
      <IfPaidBy>sample string 1</IfPaidBy>
    </InvoicePayTerms>
    <InvoicePayTerms>
      <DiscountDollars>3.1</DiscountDollars>
      <DiscountPercent>2.1</DiscountPercent>
      <IfPaidBy>sample string 1</IfPaidBy>
    </InvoicePayTerms>
  </InvoicePayTerms>
  <Notes>sample string 5</Notes>
  <VendorID>sample string 1</VendorID>
</PurchaseInvoice>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'clsPurInv'.

Response Information

Resource Description

Creates a new purchase invoice.

AgvPurchaseInvoiceCreate
NameDescriptionTypeAdditional Information
Status

Status of the API call.

string
Message

Message of the API call.

string

Response Formats

application/json, text/json

Sample:
{
  "Status": "sample string 1",
  "Message": "sample string 2"
}

application/xml, text/xml

Sample:
<AgvPurchaseInvoiceCreate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AgvWebAPICSharp.Models.Vendor">
  <Message>sample string 2</Message>
  <Status>sample string 1</Status>
</AgvPurchaseInvoiceCreate>