Ongoing Warehouse logo
Ongoing Warehouse Developer

Charge

This function allows you to add a charge to an invoice.

Tags: Charge, InvoiceCharge, Invoice, InvoiceArticle, OrderContext, InOrderContext, ChargeResult

Request XML

POST /xxx/automation.asmx HTTP/1.1
Host: api.ongoingsystems.se
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://ongoingsystems.se/Automation/Charge"

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Charge xmlns="http://ongoingsystems.se/Automation">
      <UserName>string</UserName>
      <Password>string</Password>
      <InvoiceCharge>
        <Invoice>
          <Identification>InvoiceId or ActiveInvoice or ExistingOrNewInvoice</Identification>
          <InvoiceId>int</InvoiceId>
          <GoodsOwnerId>int</GoodsOwnerId>
        </Invoice>
        <InvoiceArticle>
          <InvoiceArticleIdentification>InvoiceArticleId</InvoiceArticleIdentification>
          <InvoiceArticleId>int</InvoiceArticleId>
        </InvoiceArticle>
        <OrderContext>
          <OrderId>int</OrderId>
        </OrderContext>
        <InOrderContext>
          <InOrderId>int</InOrderId>
        </InOrderContext>
        <NumberOfItems>decimal</NumberOfItems>
        <Price>decimal</Price>
        <Comment>string</Comment>
        <ActionDate>dateTime</ActionDate>
      </InvoiceCharge>
    </Charge>
  </soap:Body>
</soap:Envelope>
+

Request specification

Charge
UserName str(50) Req. Your username
Password str(50) Req. Your password
InvoiceCharge object Req. An InvoiceCharge object
InvoiceCharge
Invoice object Req. An element of Invoice. Defines which invoice you wish to add the charge to.
InvoiceArticle object Req. An element of InvoiceArticle. Defines which invoice article you wish charge. You can use GetPriceListByQuery to get a list of all invoice articles which have been set up for a goods owner.
OrderContext object An element of OrderContext. Use this if you wish the charge to be connected to a particular order.
InOrderContext object An element of InOrderContext. Use this if you wish the charge to be connected to a particular inorder.
NumberOfItems dec Req. The number of charges you wish to add to the invoice.
Price dec Req. The total price of the charges.
Comment str(1000) A comment for the charge.
ActionDate datetime The time when the charge was made
Invoice
Identification enum Req. Defines what you want to identify the invoice by:
 - InvoiceId
 - ActiveInvoice
 - ExistingOrNewInvoice
If ActiveInvoice is used, the system will apply the charge to the currently active invoice for the goods owner. If there is no active invoice, an error message is returned.
If ExistingOrNewInvoice is used, the system will apply the charge to an existing invoice where the invoice period matches the provided ActionDate (today's date if none provided). If no matching invoice exists, a new invoice will be automatically created.
InvoiceId int Req.* The system id of the invoice which you want to apply the charge to. Required if Identification = InvoiceId.
GoodsOwnerId int Req. The system id of the goods owner.
InvoiceArticle
InvoiceArticleIdentification enum Req. Defines what you want to identify the invoice article by:
 - InvoiceArticleId (currently this is the only choice available)
InvoiceArticleId int Req. The system id of the invoice article of the charge you wish to add.
OrderContext
OrderId int Req. The internal system id of the order which you wish the charge to be connected to
InOrderContext
InOrderId int Req. The internal system id of the inorder which you wish the charge to be connected to

Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ChargeResponse xmlns="http://ongoingsystems.se/Automation">
      <ChargeResult>
        <Success>boolean</Success>
        <Message>string</Message>
        <ChargeId>int</ChargeId>
        <InvoiceId>int</InvoiceId>
      </ChargeResult>
    </ChargeResponse>
  </soap:Body>
</soap:Envelope>
+

Response specification

ChargeResult
Success bool True if successful, false otherwise
Message str(*) Error message, if the call was unsuccessful
ChargeId int The id of the charge which was added
Invoice int The id of invoice to which the charge was added