Created with Sketch.
Created with Sketch.

Finalize purchase

On this page you will find information about How to charge for Delivery, How to handle Returns and Refunds.

Delivery – Send information about delivered items to Avarda

On delivery Merchant sends delivered items to Avarda via Order.

Order

POST: {api_url}/api/partner/payments/{purchaseid}/order
Authorization: Bearer {partner_access_token} 

The method allows partners to invoice a customer. A call to this method should be performed on delivery of the purchased items. The items submitted in the call will be enlisted on the invoice as individual invoice lines. Items with both positive and negative (rebates) value are supported as long the total amount is positive. The Reseller order ID passed in a request will be used to identify the transaction.

NameData TypeDefault valueDescription
ItemsCollection of ItemNoneA list of items represnting the individual rows on an invoice.
OrderReferencestringAn empty string An ID that identifies the order for which the purchase is to be made
TranIdstringAn empty stringA random unique ID generated by the calling party that identifies the HTTP request. Although the property is not strictly required, we recommend to generate a new random GUID and pass it.
TrackingCodestringAn empty string Generated code by delivery company
PosIdstringAn empty string POS ID is the device number. It is visible on every printout from the POS terminal in the left top corner of the receipt below your contact detaild or on a sticker on the POS terminal.
Example request body
{
  "TranId": "DD9ACDB9DE28424083BA",
  "OrderReference": "4000124352",
  "TrackingCode": "",
  "Items": [
    {
      "Description": "Carrey-hybriditakki, naisten, punai",
      "Notes": "HH854765",
      "Amount": 20.97,
      "TaxCode": "24.0000",
      "TaxAmount": 4.06
    },
    {
      "Description": "Lester-matkakassi, sininen",
      "Notes": "HH1001863",
      "Amount": 29.97,
      "TaxCode": "24.0000",
      "TaxAmount": 5.8
    },
 {
      "Description": "Discount",
      "Notes": "HH1001863",
      "Amount": -2.97,
      "TaxCode": "24.0000",
      "TaxAmount": -0.41
    }
  ]
}
Return Value

If successful, the method returns a HTTP status code 204 (OK with no content).

Returns

POST: {api_url}/api/partner/payments/{purchaseid}/return
Authorization: Bearer {partner_access_token} 

The method allows to submit a return or to make a price adjustment of goods purchased by a customer. The call is performed when the returned goods are received to the reseller or if some amount needs to be credited. All items submitted in the return call will be printed as negative invoice rows at the invoice.

NameData TypeDefault valueDescription
ItemsCollection of ItemNoneA list of items represnting the individual rows on an invoice.
OrderReferencestringAn empty string An ID that identifies the order for which the purchase is to be made
TranIdstringAn empty stringA random unique ID generated by the calling party that identifies the HTTP request. Although the property is not strictly required, we recommend to generate a new random GUID and pass it.
TrackingCodestringAn empty string Generated code by delivery company
PosIdstringAn empty string POS ID is the device number. It is visible on every printout from the POS terminal in the left top corner of the receipt below your contact detaild or on a sticker on the POS terminal.
{
 "ExternalId": "19ac0d1ee909c302d212b4324d9194b5",
 "Items": [
 {
 "Description": "Description",
 "Notes": "Notes",
 "Amount": 1
 }
 ],
 "OrderReference": "ue12345",
 "TranId": "123456",
 "TrackingCode": "123456",
 "PosId": "Id123456"
} 
Return Value

If successful, the method returns a HTTP status code 204 (OK with no content).

Refund

POST: {api_url}/api/partner/payments/{purchaseid}/refund
Authorization: Bearer {partner_access_token} 

The method allows to merchant refund money.

NameData TypeDefault valueDescription
AmountdecimalNoneThe item amount
Example request
{
 "Amount": 10.0
} 
Return Value

If successful, the method returns a HTTP status code 204 (OK with no content).