OrderlineInterface.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php
  2. /**
  3. * This file is part of the Klarna KP module
  4. *
  5. * (c) Klarna Bank AB (publ)
  6. *
  7. * For the full copyright and license information, please view the NOTICE
  8. * and LICENSE files that were distributed with this source code.
  9. */
  10. namespace Klarna\Kp\Api\Data;
  11. /**
  12. * Interface OrderlineInterface
  13. *
  14. * @package Klarna\Kp\Api\Data
  15. */
  16. interface OrderlineInterface extends ApiObjectInterface
  17. {
  18. /**
  19. * Orderline type
  20. *
  21. * Possible values:
  22. *
  23. * * physical (default)
  24. * * discount
  25. * * shipping_fee
  26. *
  27. * @param string $type
  28. */
  29. public function setType($type);
  30. /**
  31. * Descriptive item name.
  32. *
  33. * @param string $name
  34. */
  35. public function setName($name);
  36. /**
  37. * @param string $product_url
  38. */
  39. public function setProductUrl($product_url);
  40. /**
  41. * @param string $image_url
  42. */
  43. public function setImageUrl($image_url);
  44. /**
  45. * The item quantity.
  46. *
  47. * @param int $quantity
  48. */
  49. public function setQuantity($quantity);
  50. /**
  51. * Descriptive unit, e.g. kg, pcs.
  52. *
  53. * @param string $quantity_unit
  54. */
  55. public function setQuantityUnit($quantity_unit);
  56. /**
  57. * Includes tax, excludes discount. Implicit decimal (eg 1000 instead of 10.00)
  58. *
  59. * @param int $unit_price
  60. */
  61. public function setUnitPrice($unit_price);
  62. /**
  63. * In percent, two implicit decimals, i.e. 2500 = 25%.
  64. *
  65. * @param int $tax_rate
  66. */
  67. public function setTaxRate($tax_rate);
  68. /**
  69. * Must be within ±1 of total_amount - total_amount 10000 / (10000 + tax_rate). Negative when type is discount.
  70. *
  71. * @param int $total_tax_amount
  72. */
  73. public function setTotalTaxAmount($total_tax_amount);
  74. /**
  75. * Includes tax. Implicit decimal (eg 1000 instead of 10.00)
  76. *
  77. * @param int $total_discount_amount
  78. */
  79. public function setTotalDiscountAmount($total_discount_amount);
  80. /**
  81. * Includes tax and discount. Must match (quantity * unit_price) + total discount amount within ±quantity.
  82. *
  83. * @param int $total_amount
  84. */
  85. public function setTotalAmount($total_amount);
  86. /**
  87. * Article number, SKU or similar.
  88. *
  89. * @param string $reference
  90. */
  91. public function setReference($reference);
  92. /**
  93. * @return int
  94. */
  95. public function getTotal();
  96. }