pronamic / wp-mollie

Mollie API client for WordPress.
GNU General Public License v2.0
2 stars 0 forks source link

πŸ†• Line items for the Payments API #6

Open remcotolsma opened 6 months ago

remcotolsma commented 6 months ago

πŸ†• Line items for the Payments APIπŸ†•

The Orders API already had the capability of adding line item information to the Order. Now it is also possible to add this information when you are using the Payments API.

Why are we doing this? At Mollie we always try to improve and make things easier. One way we want to do that, is to remove the dependency on the Orders API. We want to do this by having the Payments API support all use cases and payment methods. This means that later this year you will be able to use the Payments API for Klarna, Billie and Vouchers too! Additionally, we have some awesome plans for other features that will be leveraging line item information.

How does it differ from the Orders API? It is good to know that on the Payments API, the lines are simply meta-data. In contrast to the Orders API, line items do not have any business logic related to it (like a status). You also cannot create a refund via the API only referencing a line item, you simply send in an amount. This is on purpose since we realised from the Orders API that building logic on line items is actually making things more complex and less flexible.

All the details can be found in our API Documentation and we are looking forward to your feedback! https://docs.mollie.com/reference/v2/payments-api/create-payment

Source: https://discord.com/channels/1037712581407817839/1037752322585018368/1243549435514851380

remcotolsma commented 5 months ago

Did a quick compare:

Property Orders API Payments API Β 
Β  https://docs.mollie.com/reference/v2/orders-api/create-order https://docs.mollie.com/reference/v2/payments-api/create-payment Β 
lines Required Optional Β 
type Optional Optional Line
category Optional N/A OrderLine
description N/A Required PaymentLine
name Required N/A OrderLine
quantity Required Required Line
quantityUnit N/A Optional PaymentLine
unitPrice Required Required Line
discountAmount Optional Optional Line
totalAmount Required Required Line
vatRate Required Optional OrderLine, PaymentLine
vatAmount Required Optional OrderLine, PaymentLine
sku Optional Optional Line
imageUrl Optional Optional Line
productUrl Optional Optional Line
metadata Optional N/A OrderLine

https://docs.google.com/spreadsheets/d/1NW-bOFT7ON3mBK95Fd-8FnvQouXxsE8qKNthv-_2PNU/edit?usp=sharing