Click or drag to resize
Infosoft Logo

Retailer Returns

The concept of registering retailer returns is that each retailer should only pay for the newspapers they actually sell each day. If a retailer has ordered 10 newspapers and sell only 7 one day, they can register that 3 newspapers is to be returned to the distributor. There are two webservice methods for dealing with retailer returns which we will explain further, GetDeliveries and RegisterReturns.

How to get retailer return details for deliveries

The method GetDeliveries will return a deliveryDay object for each day requested, with information about the delivery such as price,amount ordered, amount returned and so on.

Note  Note

The most relevant properties are probably delivered, sold and returned.

Example Request to GetDeliveries
<ns:GetRetailerDeliveriesForReturnRequest>
   <ns:RetailerNumber>1</ns:RetailerNumber>
   <ns:TitleCode>TEST</ns:TitleCode>
   <ns:RetailEditionCodes>
      <arr:string>1</arr:string>
   </ns:RetailEditionCodes>
   <ns:StartDate>2015-06-01</ns:StartDate>
   <ns:EndDate>2015-06-05</ns:EndDate>
</ns:GetRetailerDeliveriesForReturnRequest>
It is also possible to get the return details for different editions in the same interval, as can be seen below:
<ns:GetRetailerDeliveriesForReturnRequest>
   <ns:RetailerNumber>1</ns:RetailerNumber>
   <ns:TitleCode>TEST</ns:TitleCode>
   <ns:RetailEditionCodes>
      <arr:string>1</arr:string>
      <arr:string>2</arr:string>
   </ns:RetailEditionCodes>
   <ns:StartDate>2015-06-01</ns:StartDate>
   <ns:EndDate>2015-06-05</ns:EndDate>
</ns:GetRetailerDeliveriesForReturnRequest>
The response contains one or several DeliveryDay objects containing the following properties for each delivery
   <RetailerDeliveriesForReturnResponse xmlns="http://tech.infosoft.no/schemas/2012/08">
   <Days xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
   <DeliveryDay>
         <Date>2015-06-02</Date>
         <RetailEditionCode>2</RetailEditionCode>
         <Price>8</Price>
         <Commission>0</Commission>
         <Ordered>15</Ordered>
         <Added>0</Added>
         <Subtracted>0</Subtracted>
         <Regulated>0</Regulated>
         <Returned>1</Returned>
         <InvoicedReturned>0</InvoicedReturned>
         <Delivered>15</Delivered>
         <Sold>14</Sold>
      </DeliveryDay>
      <DeliveryDay>
         <Date>2015-06-03</Date>
         <RetailEditionCode>1</RetailEditionCode>
         <Price>4.5</Price>
         <Commission>0</Commission>
         <Ordered>10</Ordered>
         <Added>0</Added>
         <Subtracted>0</Subtracted>
         <Regulated>0</Regulated>
         <Returned>3</Returned>
         <InvoicedReturned>0</InvoicedReturned>
         <Delivered>10</Delivered>
         <Sold>7</Sold>
      </DeliveryDay>
   </Days>
</RetailerDeliveriesForReturnResponse>

Registering a retailer return

When registering a return the retailer must first supply a valid retail number and title code. A ReturnDay object is used representing each delivery to register a return for. This object contains a date, a retail edition code and the amount returned. There are some limitations to be aware of when registering returns; One can only register returns for a maximum number of days back in time, and, the amount returned cannot exceed the amount delivered if the system wont allow it.

Note  Note

It is normally a limit on how far back in time a retailer can register returns. This limit is optional but would usually be around a week or so. The maximum number of days back in time a return can be registered is determined by configuration value "RETGRENSWEB".

In most cases it would be wrong for a retailer to register a higher amount returned than the amount delivered. Though sometimes it might be necessary or allowed, for example to correct an erronous registration. Whether it is allowed to have a higher number returned than delivered is determined by the configuration value "RRFORHOY".

An example of how a XML request to RegisterReturns might look like:
<ns:RegisterRetailerReturnsRequest>
  <ns:RetailerNumber>1</ns:RetailerNumber>
  <ns:TitleCode>TEST</ns:TitleCode>
  <ns:Days>
    <ns:ReturnDay>
      <ns:Date>2015-06-03</ns:Date>
      <ns:RetailEditionCode>2</ns:RetailEditionCode>
      <ns:Returned>3</ns:Returned>
  </ns:ReturnDay>
  </ns:Days>
</ns:RegisterRetailerReturnsRequest>
It is possible to register returns for several days with different retail editions:
<ns:RegisterRetailerReturnsRequest>
  <ns:RetailerNumber>1</ns:RetailerNumber>
  <ns:TitleCode>TEST</ns:TitleCode>
  <ns:Days>
    <ns:ReturnDay>
      <ns:Date>2015-06-03</ns:Date>
      <ns:RetailEditionCode>2</ns:RetailEditionCode>
      <ns:Returned>3</ns:Returned>
  </ns:ReturnDay>
  <ns:ReturnDay>
      <ns:Date>2015-06-03</ns:Date>
      <ns:RetailEditionCode>1</ns:RetailEditionCode>
      <ns:Returned>6</ns:Returned>
  </ns:ReturnDay>
  <ns:ReturnDay>
      <ns:Date>2015-06-03</ns:Date>
      <ns:RetailEditionCode>2</ns:RetailEditionCode>
      <ns:Returned>3</ns:Returned>
  </ns:ReturnDay>
  <ns:ReturnDay>
      <ns:Date>2015-06-04</ns:Date>
      <ns:RetailEditionCode>2</ns:RetailEditionCode>
      <ns:Returned>7</ns:Returned>
  </ns:ReturnDay>
  </ns:Days>
</ns:RegisterRetailerReturnsRequest>

Error Handling

RegisterReturns Faults

Fault

Cause

SystemFault

Usually caused by connection issues between the InfoSystems API and the database.

ConcurrencyFault

This may happen in rare cases where the invoice is being modified elsewhere at the same time that the payment is being performed.

TitleNotFoundFault

No title was found with the given code.

RetailEditionNotFoundFault

No retail edition was found with the given code.

EntityValidationFault

The end date is before the start date.

InvalidRetailerReturnDateFault

One or more days exceeds the allowed limit for registering returns.

InvalidRetailerReturnAmountFault

One or more days in the input had a returned value that exceeded the amount delivered.