worldline Direct
Sign up

Introduction

One of the most valuable currencies in online business is trust: Your customers' trust in you!
Trust comes from transparency, especially in regards to what you charge your customers. We want to help you create this transparency with our Discount and taxes feature.

By adding just a few properties to your CreateHostedCheckout/CreatePayment request, you can display:

  • Quantity of goods/services
  • Net product prices
  • Shipping costs (or any other services/type of cost)
  • VAT tax portion

on our/third-party provider checkout pages.

This feature is currently available for:

Credit Cards (Hosted Checkout Page)
Paypal 
Klarna

Understand discount and taxes feature

The following properties define the individual cost-related items of your order in a CreateHostedCheckout/CreatePayment request:

Properties Remarks
order.amountOfMoney.amount

The total amount of the complete order, including

  • Final price of all products
    shoppingCart.items.amountOfMoney.amount

  • Full VAT amount per product
    shoppingCart.items.orderLineDetails.taxAmount

  • Full discount amount per product
    shoppingCart.items.amountOfMoney.orderLineDetails.taxAmount
shoppingCart.items.amountOfMoney.amount

The total amount of the complete order.

Identical to order.amountOfMoney.amount

shoppingCart.items.
amountOfMoney.orderLineDetails

  • discountAmount
  • lineAmountTotal
  • productPrice
  • quantity
  • taxAmount

Price details of all items of the complete order in object orderLineDetails

  • discountAmount: Amount to deduct from productPrice. This is done automatically by our platform/the third-party provider
  • lineAmountTotal: Full amount to pay of all items in orderLineDetails (quantity * productPrice). This includes the VAT per item (taxAmount) but without discountAmount
  • productPrice: Price per item excluding VAT (taxAmount)/ discount (discountAmount)
  • quantity: Indicates the number of items in orderLineDetails and defines the full amount to pay of all items including discount/excluding VAT (quantity * (productPricediscountAmount))
  • taxAmount: VAT to add per item (21% of productPrice)

Apply taxes and discounts

To get a full understanding how this feature works, we have created two examples:

Use these hands-on scenarios to apply taxes and discounts in your next payment requests.

A) Order with shipping costs

This example takes:

  • A laptop for a net price of 500,00€
  • A 50,00€ discount on the laptop
  • 94,5€ VAT of 21% on the laptop
  • 12,10€ shipping costs

Follow these steps to create this minimal CreateHostedCheckout/CreatePayment request for this order:

  1. Create an object of orderLineDetails for the laptop. Set the original net product price for the laptop: productPrice=50000. Set quantity=1 to charge one laptop.

  2. Define a discount of 50,00€ by setting discountAmount=5000. Do not change productPrice: This discount will be taken into account on our/the third-party provider’s checkout page. Nevertheless, makes sure to set the correct amount in properties
    order.amountOfMoney.amount
    shoppingCart.items.amountOfMoney.amount
    lineAmountTotal

  3. Calculate 21% VAT based on the net amount, including the discount:
    Get the net amount including the discount: 500,00€ - 50,00€ = 450,00€
    Get the VAT of this amount (450,00€ * 0.21 = 94.50€) and set taxAmount=9450 accordingly.

  4. Get the final gross price (including discount/VAT) for the laptop
    450,00€ + 94,50€ = 544,50€
    and set shoppingCart.orderLineDetails.lineAmountTotal=54450 accordingly.

  5. Create an object of orderLineDetails for the shipping costs.
    Set the original net product price (10,00€) for shipping costs (productPrice=1000)
    Set quantity=1 to charge it only once.

  6. Calculate 21% VAT based on the net shipping cost:
    10,00€ * 0.21 = 2,10€ and set taxAmount=210 accordingly.

  7. Get the final gross price (including VAT) for the shipping costs.

    10,00€ + (10,00€ * 0.21) = 12,10€

    and set shoppingCart.orderLineDetails.lineAmountTotal=1210

  8. Calculate the full amount of the whole shopping cart, consisting of orderLineDetails.lineAmountTotal for both the laptop and the shipping cost

    orderLineDetails.lineAmountTotal=54450 (Laptop)
    orderLineDetails.lineAmountTotal=1210 (Shipping costs)

    and set shoppingCart.items.amountOfMoney.amount=55660 accordingly

The full request looks like this:


{
 "order": {
  "amountOfMoney": {
   "currencyCode": "EUR",
   "amount": 55660
  },
  "shoppingCart": {
   "items": [
   {
    "amountOfMoney": {
      "currencyCode": "EUR",
      "amount":  54450
    },
    "orderLineDetails": {
      "productName": "Laptop",
      "discountAmount":5000,
      "lineAmountTotal": 54450,
      "productCode": "TEST01",
      "productPrice": 50000,
      "productType": "",
      "quantity": 1,
      "taxAmount": 9450,
      "unit": "piece"
    }
  },
    {
   "amountOfMoney": {
     "currencyCode": "EUR",
     "amount": 1210
   },

   "orderLineDetails": {
     "productName": "Shipping cost",
     "lineAmountTotal": 1210,
     "productCode": "TEST02",
     "productPrice": 1000,
     "productType": "",
     "quantity": 1,
     "taxAmount": 210, 
     "unit": "piece"
   }
  }]
  }
 }
}


The checkout page will then break down the prices, types of costs and the full tax amount as defined in the request.

DiscountAndTaxes-2.png


The image above shows how Paypal breaks down prices, types of costs and the full tax amount on their checkout page.

B) Order with free shipping

This example takes:

  • Two gaming consoles each for a net price of 110,00€
  • A 10,00€ discount on each console
  • 21,00€ VAT of 21% on each console
  • Free shipping costs

Follow these steps to create this minimal CreateHostedCheckout/CreatePayment request for this order:

  1. Create an object of orderLineDetails for the gaming consoles. Set the original net product price for one gaming console: productPrice=11000. Set quantity=2 to charge two of them.

  2. Define a discount of 10,00€ for each console by setting discountAmount=1000. Do not change productPrice: This discount will be taken into account on our/the third-party provider’s checkout page. Nevertheless, makes sure to set the correct amount in properties
    order.amountOfMoney.amount
    shoppingCart.items.amountOfMoney.amount
    lineAmountTotal

  3. Calculate 21% VAT based on the net amount of both consoles, including the discount:
    Get the full amount of both consoles: (110,00€ - 10,00€) * 2 = 200,00€
    Get the VAT of this full amount: 200,00€ * 0.21 = 42,00€
    Get the VAT per console (42,00€ / 2 = 21,00€) and set taxAmount=2100 accordingly

  4. Get the final gross price (including discount/VAT) for both consoles

    (110,00€ - 10,00€) * 2 + 21,00€ * 2 = 242,00€

    and set shoppingCart.orderLineDetails.lineAmountTotal=24200 accordingly

  5. Create an object of orderLineDetails for the shipping costs.
    Set the original net product price (i.e. 4,13€) for shipping costs (productPrice=413)
    Set quantity=1 to charge it only once

  6. Define a discount that nullifies the net shipping costs(4,13€), resulting in discountAmount = productPrice.
    Do not change productPrice: This discount will be taken into account on our/the third-party provider’s checkout page. Nevertheless, makes sure to set the correct amount in properties
    order.amountOfMoney.amount
    shoppingCart.items.amountOfMoney.amount
    lineAmountTotal

  7. Calculate 21% VAT based on the net amount of the shipping cost, including the discount.
    Get the full amount of the shipping costs. As the discount is equal to the original price, the full amount is 0,00€:
    4,13€ – 4,13€ = 0,00€
    Get the VAT of this full amount: (0,00€ * 0.21 = 0,00€) and set taxAmount=0 accordingly

  8. Get the final gross price (including VAT/discount) for the shipping costs

    (4,13€ – 4,13€) + 0,00€ = 0,00€

    and set shoppingCart.orderLineDetails.lineAmountTotal=0

  9. Calculate the full amount of the whole shopping cart, consisting of orderLineDetails.lineAmountTotal for both the consoles and the shipping cost

    orderLineDetails.lineAmountTotal=24200 (Gaming consoles)
    orderLineDetails.lineAmountTotal=0 (Free shipping costs)

    and set shoppingCart.items.amountOfMoney.amount=24200 accordingly.

The full request looks like this:


{
 "order": {
  "amountOfMoney": {
   "currencyCode": "EUR",
   "amount": 24200
  },
  "shoppingCart": {
   "items": [
   {
    "amountOfMoney": {
      "currencyCode": "EUR",
      "amount":  24200
    },
    "orderLineDetails": {
      "productName": "Gaming console",
      "discountAmount":1000,
      "lineAmountTotal": 24200,
      "productCode": "TEST01",
      "productPrice": 11000,
      "productType": "",
      "quantity": 2,
      "taxAmount": 2100,
      "unit": "piece"
    }
  },
    {
   "amountOfMoney": {
     "currencyCode": "EUR",
     "amount": 0 
   },

   "orderLineDetails": {
     "productName": "Shipping (Free)",
     "discountAmount":413,
     "lineAmountTotal": 0,
     "productCode": "TEST02",
     "productPrice":413,
     "productType": "",
     "quantity": 1,
     "taxAmount": 0, 
     "unit": "piece"
   }
  }]
  }
 }
}    


The checkout page will then break down the prices, types of costs and the full tax amount as defined in the request.

DiscountAndTaxes-1.png


The image above shows how Paypal breaks down prices, types of costs and the full tax amount on their checkout page.

Was this page helpful?

Do you have any comments?

Thank you for your response.