POST api/apbill

Creates an APBill record for a specified vendor

Request Information

URI Parameters

None.

Body Parameters

APBill
NameDescriptionTypeAdditional information
InvoiceID

Autonumber from AP_Invoice

integer

None.

VendorCode

Vendor_Code from AP_Vendor

string

Required

String length: inclusive between 0 and 50

InvoiceNumber

Vendor's invoice number

string

None.

InvoiceDate

defaults to current date if not supplied

string

None.

PostingDate

defaults to current date if not supplied

string

None.

DueDate

defaults to 30 days from current date if not supplied

string

None.

TermCode

Value from AR_Term table (Payment terms); list of valid options can be retrieved from GET: api/term

string

Required

String length: inclusive between 0 and 25

CategoryCode

Category from AR_Category table

string

Required

Amount

decimal number

Required

NetDue

set automatically on post

decimal number

None.

Memo

string

String length: inclusive between 0 and 255

BranchCode

Value from AR_Branch table; defaults to config setting for branchCode if not supplied; list of valid options can be retrieved from GET: api/branch

string

Required

String length: inclusive between 0 and 25

WarehouseCode

value from IN_Warehouse; defaults to N/A if not supplied

string

None.

JobCode

value from OE_Job; defaults to 000 if not supplied

string

None.

ServiceTicketId

Service Ticket ID; defaults to 1 if not supplied

integer

None.

ReceivedBy

the user making this change; defaults to UserCode value from config file if not set explicitly

string

String length: inclusive between 0 and 25

BillReceivedBy

the user making this change; defaults to UserCode value from config file if not set explicitly

string

String length: inclusive between 0 and 25

APBillExpenses

list of Invoice Items

Collection of APBillExpense

None.

Request Formats

application/json, text/json

Sample:
{
  "InvoiceID": 1,
  "VendorCode": "sample string 2",
  "InvoiceNumber": "sample string 3",
  "InvoiceDate": "sample string 4",
  "PostingDate": "sample string 5",
  "DueDate": "sample string 6",
  "TermCode": "sample string 7",
  "CategoryCode": "sample string 8",
  "Amount": 9.0,
  "NetDue": 10.0,
  "Memo": "sample string 11",
  "BranchCode": "sample string 12",
  "WarehouseCode": "sample string 13",
  "JobCode": "sample string 14",
  "ServiceTicketId": 15,
  "ReceivedBy": "sample string 16",
  "BillReceivedBy": "sample string 17",
  "APBillExpenses": [
    {
      "ExpenseAccountCode": "sample string 1",
      "Quantity": 1,
      "Rate": 1.0,
      "Amount": 2.0,
      "Description": "sample string 3",
      "CustomerNumber": "sample string 4",
      "JobCode": "sample string 5",
      "ServiceTicketNumber": 6,
      "CategoryCode": "sample string 7",
      "BranchCode": "sample string 8",
      "ExpenseTypeCode": "sample string 9"
    },
    {
      "ExpenseAccountCode": "sample string 1",
      "Quantity": 1,
      "Rate": 1.0,
      "Amount": 2.0,
      "Description": "sample string 3",
      "CustomerNumber": "sample string 4",
      "JobCode": "sample string 5",
      "ServiceTicketNumber": 6,
      "CategoryCode": "sample string 7",
      "BranchCode": "sample string 8",
      "ExpenseTypeCode": "sample string 9"
    }
  ]
}

application/xml, text/xml

Sample:
<APBill xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SedonaServices.Models">
  <APBillExpenses>
    <APBillExpense>
      <Amount>2</Amount>
      <BranchCode>sample string 8</BranchCode>
      <CategoryCode>sample string 7</CategoryCode>
      <CustomerNumber>sample string 4</CustomerNumber>
      <Description>sample string 3</Description>
      <ExpenseAccountCode>sample string 1</ExpenseAccountCode>
      <ExpenseTypeCode>sample string 9</ExpenseTypeCode>
      <JobCode>sample string 5</JobCode>
      <Quantity>1</Quantity>
      <Rate>1</Rate>
      <ServiceTicketNumber>6</ServiceTicketNumber>
    </APBillExpense>
    <APBillExpense>
      <Amount>2</Amount>
      <BranchCode>sample string 8</BranchCode>
      <CategoryCode>sample string 7</CategoryCode>
      <CustomerNumber>sample string 4</CustomerNumber>
      <Description>sample string 3</Description>
      <ExpenseAccountCode>sample string 1</ExpenseAccountCode>
      <ExpenseTypeCode>sample string 9</ExpenseTypeCode>
      <JobCode>sample string 5</JobCode>
      <Quantity>1</Quantity>
      <Rate>1</Rate>
      <ServiceTicketNumber>6</ServiceTicketNumber>
    </APBillExpense>
  </APBillExpenses>
  <Amount>9</Amount>
  <BillReceivedBy>sample string 17</BillReceivedBy>
  <BranchCode>sample string 12</BranchCode>
  <CategoryCode>sample string 8</CategoryCode>
  <DueDate>sample string 6</DueDate>
  <InvoiceDate>sample string 4</InvoiceDate>
  <InvoiceID>1</InvoiceID>
  <InvoiceNumber>sample string 3</InvoiceNumber>
  <JobCode>sample string 14</JobCode>
  <Memo>sample string 11</Memo>
  <NetDue>10</NetDue>
  <PostingDate>sample string 5</PostingDate>
  <ReceivedBy>sample string 16</ReceivedBy>
  <ServiceTicketId>15</ServiceTicketId>
  <TermCode>sample string 7</TermCode>
  <VendorCode>sample string 2</VendorCode>
  <WarehouseCode>sample string 13</WarehouseCode>
</APBill>

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 'APBill'.

Response Information

Resource Description

APBill
NameDescriptionTypeAdditional information
InvoiceID

Autonumber from AP_Invoice

integer

None.

VendorCode

Vendor_Code from AP_Vendor

string

Required

String length: inclusive between 0 and 50

InvoiceNumber

Vendor's invoice number

string

None.

InvoiceDate

defaults to current date if not supplied

string

None.

PostingDate

defaults to current date if not supplied

string

None.

DueDate

defaults to 30 days from current date if not supplied

string

None.

TermCode

Value from AR_Term table (Payment terms); list of valid options can be retrieved from GET: api/term

string

Required

String length: inclusive between 0 and 25

CategoryCode

Category from AR_Category table

string

Required

Amount

decimal number

Required

NetDue

set automatically on post

decimal number

None.

Memo

string

String length: inclusive between 0 and 255

BranchCode

Value from AR_Branch table; defaults to config setting for branchCode if not supplied; list of valid options can be retrieved from GET: api/branch

string

Required

String length: inclusive between 0 and 25

WarehouseCode

value from IN_Warehouse; defaults to N/A if not supplied

string

None.

JobCode

value from OE_Job; defaults to 000 if not supplied

string

None.

ServiceTicketId

Service Ticket ID; defaults to 1 if not supplied

integer

None.

ReceivedBy

the user making this change; defaults to UserCode value from config file if not set explicitly

string

String length: inclusive between 0 and 25

BillReceivedBy

the user making this change; defaults to UserCode value from config file if not set explicitly

string

String length: inclusive between 0 and 25

APBillExpenses

list of Invoice Items

Collection of APBillExpense

None.

Response Formats

application/json, text/json

Sample:
{
  "InvoiceID": 1,
  "VendorCode": "sample string 2",
  "InvoiceNumber": "sample string 3",
  "InvoiceDate": "sample string 4",
  "PostingDate": "sample string 5",
  "DueDate": "sample string 6",
  "TermCode": "sample string 7",
  "CategoryCode": "sample string 8",
  "Amount": 9.0,
  "NetDue": 10.0,
  "Memo": "sample string 11",
  "BranchCode": "sample string 12",
  "WarehouseCode": "sample string 13",
  "JobCode": "sample string 14",
  "ServiceTicketId": 15,
  "ReceivedBy": "sample string 16",
  "BillReceivedBy": "sample string 17",
  "APBillExpenses": [
    {
      "ExpenseAccountCode": "sample string 1",
      "Quantity": 1,
      "Rate": 1.0,
      "Amount": 2.0,
      "Description": "sample string 3",
      "CustomerNumber": "sample string 4",
      "JobCode": "sample string 5",
      "ServiceTicketNumber": 6,
      "CategoryCode": "sample string 7",
      "BranchCode": "sample string 8",
      "ExpenseTypeCode": "sample string 9"
    },
    {
      "ExpenseAccountCode": "sample string 1",
      "Quantity": 1,
      "Rate": 1.0,
      "Amount": 2.0,
      "Description": "sample string 3",
      "CustomerNumber": "sample string 4",
      "JobCode": "sample string 5",
      "ServiceTicketNumber": 6,
      "CategoryCode": "sample string 7",
      "BranchCode": "sample string 8",
      "ExpenseTypeCode": "sample string 9"
    }
  ]
}

application/xml, text/xml

Sample:
<APBill xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SedonaServices.Models">
  <APBillExpenses>
    <APBillExpense>
      <Amount>2</Amount>
      <BranchCode>sample string 8</BranchCode>
      <CategoryCode>sample string 7</CategoryCode>
      <CustomerNumber>sample string 4</CustomerNumber>
      <Description>sample string 3</Description>
      <ExpenseAccountCode>sample string 1</ExpenseAccountCode>
      <ExpenseTypeCode>sample string 9</ExpenseTypeCode>
      <JobCode>sample string 5</JobCode>
      <Quantity>1</Quantity>
      <Rate>1</Rate>
      <ServiceTicketNumber>6</ServiceTicketNumber>
    </APBillExpense>
    <APBillExpense>
      <Amount>2</Amount>
      <BranchCode>sample string 8</BranchCode>
      <CategoryCode>sample string 7</CategoryCode>
      <CustomerNumber>sample string 4</CustomerNumber>
      <Description>sample string 3</Description>
      <ExpenseAccountCode>sample string 1</ExpenseAccountCode>
      <ExpenseTypeCode>sample string 9</ExpenseTypeCode>
      <JobCode>sample string 5</JobCode>
      <Quantity>1</Quantity>
      <Rate>1</Rate>
      <ServiceTicketNumber>6</ServiceTicketNumber>
    </APBillExpense>
  </APBillExpenses>
  <Amount>9</Amount>
  <BillReceivedBy>sample string 17</BillReceivedBy>
  <BranchCode>sample string 12</BranchCode>
  <CategoryCode>sample string 8</CategoryCode>
  <DueDate>sample string 6</DueDate>
  <InvoiceDate>sample string 4</InvoiceDate>
  <InvoiceID>1</InvoiceID>
  <InvoiceNumber>sample string 3</InvoiceNumber>
  <JobCode>sample string 14</JobCode>
  <Memo>sample string 11</Memo>
  <NetDue>10</NetDue>
  <PostingDate>sample string 5</PostingDate>
  <ReceivedBy>sample string 16</ReceivedBy>
  <ServiceTicketId>15</ServiceTicketId>
  <TermCode>sample string 7</TermCode>
  <VendorCode>sample string 2</VendorCode>
  <WarehouseCode>sample string 13</WarehouseCode>
</APBill>