Selecting MIDs upon order execution
For each order, only one merchant can be paid by one of the MID types. Thus, if you indicate a CONECS MID for several sub-merchants, only one of them can be paid by this payment method.
How does it work? When the order is executed, the API calculates the total amount per MID of the amounts payable by voucher and then, for each MID, selects the merchant with the highest amount.
... "items":[ { "external_ref":"seller1", "ref":"Seller 1 Item 1", "amount":2000, "voucher":[ { "contract_type":"CONECS", "eligible_amount":900 } ] }, { "external_ref":"seller1", "ref":"Seller 1 Item 2", "amount":4000, "voucher":[ { "contract_type":"CONECS", "eligible_amount":500 } ] }, { "external_ref":"seller2", "ref":"Seller 2 Item 1", "amount":2000, "voucher":[ { "contract_type":"CONECS", "eligible_amount":1900 } ] } ]
Seller 2 will be selected, as their eligible amount is €19 versus €14 (= 9 + 5) for Seller 1.
The principle is the same for CVCONNECT MIDs.
The selection is independent from one MID to another, i.e. one sub-merchant can be selected for a CONECS MID and another can be selected for the CVCONNECT MID, while both offer the two MIDs.
At the end of the execution, each “voucher” object of the concerned articles receives the is_selected attribute that is populated depending on the selection.
... "status":"CREATED", "amount":8000, "items":[ { "uuid":"fc300ee2-fd43-46e0-9314-770f05a5b338", ... "reference":"Buffet1", "description":"Buffet 1", "type":"FOOD", "amount":8000, ... "vouchers":[ { "contract_type":"CVCONNECT", "is_selected":true }, { "contract_type":"CONECS", "eligible_amount":1400, "is_selected":true } ] } ]