PayTraq Connect

Overview

The PayTraq Connect is a webhook call that can be used by any self-hosted e-commerce platform extensions to push all orders straight to PayTraq Sales Inbox for further processing.

The general use case is to use a webhook to trigger a POST request every time a new order is created. This web service can be used only as a simple, straightforward solution to integrate an e-commerce platform with PayTraq. If you need something more complicated please look at our API.

API Call

Request

POST https://go.paytraq.com/ext/webhooks/inbox/{ChannelID}

To get an actual Request URI, a user should activate the PayTraq Connect channel in Sales Inbox
This request should be made in XML format with "Content-Type: application/xml" header.
Every successful request should always return HTTP 200 OK code.

Payload


<Sale>
   <Header>
      <Document>
         <DocumentDate></DocumentDate>
         <DocumentRef></DocumentRef>
         <Client>
            <ClientName></ClientName>
            <ClientRegNumber></ClientRegNumber>
            <ClientTaxNumber></ClientTaxNumber>
            <ClientEmail></ClientEmail>
            <BillingAddress>
              <Address></Address>
              <Zip></Zip>
              <Country></Country>
            </BillingAddress>
            <IsCompany></IsCompany>
         </Client>
      </Document>
      <Total></Total>
      <Taxes></Taxes>
      <Currency></Currency>
      <IncludeTax></IncludeTax>
      <Comment />
      <ShippingData>
         <ShippingAddress>
            <ShipTo></ShipTo>
            <Address></Address>
            <Zip></Zip>
            <Country></Country>
         </ShippingAddress>
      </ShippingData>
   </Header>
   <LineItems>
      <LineItem>
         <Item>
            <ItemCode></ItemCode>
            <ItemBarCode></ItemBarCode>
            <ItemName></ItemName>
         </Item>
         <Qty></Qty>
         <Price></Price>
         <LineDiscount></LineDiscount>
         <Unit>
            <UnitName></UnitName>
         </Unit>
         <TaxKey>
            <TaxKeyID></TaxKeyID>
         </TaxKey>
      </LineItem>
      ...
   </LineItems>
   <Adjustments>
      <Adjustment>
         <Amount></Amount>
         <Description />
         <TypeID></TypeID>
         <PctOrAmount></PctOrAmount>
      </Adjustment>
      ...
   </Adjustments>
   <ShippingCharge>
      <Amount></Amount>
      <TaxKey>
         <TaxKeyID></TaxKeyID>
      </TaxKey>
   </ShippingCharge>
   <AutoProcessing>
      <Process></Process>
      <Approve></Approve>
      <Send></Send>
      <AddPayment>
         <MoneyAccountID></MoneyAccountID>
         <DatePaid></DatePaid>
      </AddPayment>
   </AutoProcessing>
</Sale>
   

No tags are required.

Tag Description
<DocumentDate> Order date.
Should be passed in the following format YYYY-MM-DD e.g. 2014-01-30
<DocumentRef> Order number
<ClientName> Client name
<BillingAddress> Client billing address
<Country> 2-letter ISO country code
<IsCompany> Boolean value (false | true)
<Total> Total order amount.
If <IncludeTax> is true <Total> includes <Taxes>.
If <IncludeTax> is false <Total> excludes <Taxes>.
<Taxes> Total tax amount
<Currency> Currency code
<IncludeTax> Boolean value (false | true)
Shows that amounts are tax inclusive
<ShippingAddress> Client shipping address
<ItemCode> Product SKU
<ItemName> Product name
<LineDiscount> Line discount in %
<TaxKeyID> Unique system identifier for tax key. See Get Tax Key
<TypeID> Possible values:
  • charge - Charge
  • discount - Discount
<PctOrAmount> Possible values:
  • pct - Percent
  • amount - Amount

Auto Processing


For automatic processing of each order received in Sales Inbox, the <Process> tag should be enabled. In this case, when an order is received in Sales Inbox, a sales document will be immediately created from it based on the selected document and operation types.
For automatic confirmation or posting of the created sales document the <Approve> tag should be enabled.
To add payments automatically, you need to activate the "Add a Payment" option by providing the valid <MoneyAccountID> (Money Account ID). In case of a document with the type "Sales Order" a new payment will be added as an overpayment.
For automatic sending of the created document to the client the <Send> tag should be enabled.
For the correct application of tax keys when creating sales documents, it is necessary to provide the valid and correct <TaxKeyID> (Tax Key ID) in the request.
In case of discrepancy between the total order amount (if amounts are tax inclusive it is <Total>, if not it is <Total>+<Taxes>) and the total amount of the created sales document in PayTraq, the sales document in PayTraq will remain in the "Draft" status. Automatic addition of payment will not happen either.


<Process> Boolean value (false | true)
<Approve> Boolean value (false | true)
<Send> Boolean value (false | true)
<MoneyAccountID> Unique system identifier for bank or cash account. See Get Bank Accounts and Get Cash Accounts
<DatePaid> Date of the payment.
Should be passed in the following format YYYY-MM-DD e.g. 2014-01-30