Created with Sketch.
Created with Sketch.
Checkout 3.0

Finalize purchase

On this page, you will find information about how to charge for Delivery, how to handle Returns and Refunds. or how to cancel an order.

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 the 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) values 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 representing 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 identifies the HTTP request. Although the property is not strictly required, we recommend generating a new random GUID and passing it.
TrackingCodestringAn empty string Generated code by the 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,
      "Quantity": 2
    },
    {
      "Description": "Lester-matkakassi, sininen",
      "Notes": "HH1001863",
      "Amount": 29.97,
      "TaxCode": "24.0000",
      "TaxAmount": 5.8,
      "Quantity": 2
    },
 {
      "Description": "Discount",
      "Notes": "HH1001863",
      "Amount": -2.97,
      "TaxCode": "24.0000",
      "TaxAmount": -0.41,
      "Quantity": 2
    }
  ]
}

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 by 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 representing 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 identifies the HTTP request. Although the property is not strictly required, we recommend generating a new random GUID and pass it.
TrackingCodestringAn empty string Generated code by the 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.
{
 "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 the merchant to 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).

Cancel an order

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

This method allows you to cancel an order. A call to this method can be performed after the customer has completed the checkout and the goods have not yet been shipped to the customer. For Invoices and loans, the reserved credit amount will be removed and any pre-paid purchases (such as cards or bank transfers) will be refunded automatically.

Input Parameters

NameData TypeDefault ValueDescription
reasonStringNone. Must be specified.Reason for canceling payment.

Example request

{
  "reason": "Cancelling order upon customer request."
}

Return Value

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

Not successful, the method returns a HTTP status code 400 with an error description in the body.

[
  {
    "ErrorCode": "10005",
    "ErrorMessage": "Invalid or missing external ID."
  }
]