Pre-authorized payments (manual validation)

By default, Orders are validated automatically during step 2 of the payment (during GET <url>/execute).

It is also possible to dissociate the steps of payment authorization from those of a transaction capture.

This allows to make authorizations while the final transfer of cart items between the seller amount and the Marketplace fee amount is not yet known.

Step 1

In order to enable this feature, all you need to do is add the awaiting_validation field when creating the Order and assigning it the true value.

Example of a POST ORDER creation call in manual validation mode:

{
  "marketplace": "ebfb36ab-2d30-4326-adb9-e16b0c9a89f3",
  "reference": "MKP BURO example",
  "description": "Office supplies order",
  "currency": "EUR",
  "url_return": "https://URLreturn.com",
  "awaiting_validation" : true,
  "items": [
    {
      "seller": "5d0ef88c-3345-4b33-948e-80e23d553b73",
      "reference": "STB1",
      "description": "blue pens
      "amount": 1150,
      "is_commission": false
    }
  ], 
  "buyer": 
    {
      "type": "PRIVATE",
      "email": "jean.dupont@buyer.fr",
      "phone_number": "33 (0)1 11 22 33 44",
      "reference": "ZhIsYM"
    },
  "shipping": 
    {
      "shipping_method": "RELAY_POINT"
    }
}

In this example, the amount of the item (buyer amount) is known, but not the percentage of the sub-merchant and the operator fee (Marketplace).

Note: Please note that operator fees can already be specified in this step. If needed, they can be updated in step 4.

Step 2

Step 2 is executed in the same way as in case of standard payment and the redirection URL for proceeding to the payment is returned.

Example of a GET call to fix the order:

GET https://secure.lyra.com/marketplaces/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427/execute

Since the Order is waiting for validation, the verification steps of the minimum fee amount are not executed.

Step 3

Once the payment has been successfully made, the Order status changes to PENDING and the status of the corresponding transactions changes to TO_VALIDATE.

Step 4

This optional step allows to the amount of the operator fees if they were not provided in step 1.

It is also possible to add:
  • a fee item
  • and/or fees for items (see corresponding paragraph).

One or several items can also be deleted (standard function).

The total amount of the Order can be decreased but not increased.

On the other hand, the awaiting_validation field cannot be modified.

Step 5

The process is finalized with the validation of the Order. During this step one can make sure that the amount of the fee is sufficient.

In order to validate an Order, make a POST to the URL of the Order, attribute: validate.

Example of a POST ORDER call for manually validating it:

POST https://secure.lyra.com/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427/validate

Example of the validate POST ORDER response:

The Order details are returned. The awaiting_validation attribute of the Order then takes the false value and the status of the corresponding transactions changes from TO_VALIDATE to PENDING.

{
  "uuid": "7fac13b0-7ab9-4382-9073-11ddb38d4427",
  "href": "https://secure.lyra.com/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427",
  "created_at": "2019-05-27T09:30:24.434556Z",
  "updated_at": "2019-05-27T09:36:06.500936Z",
  "marketplace": "ebfb36ab-2d30-4326-adb9-e16b0c9a89f3",
  "reference": “MKP BURO 2 Example",
  "description": “Order of supplies",
  "alias": null,
  "awaiting_validation": false,
  "buyer": [ 
    { 
      "reference": "ZhIsYM",
      "title": null,
      "type": "PRIVATE",
      "first_name": null,
      "last_name": null,
      "legal_name": null,
      "phone_number": "33 (0)1 11 22 33 44",
      "email": "jean.dupont@buyer.fr",
      "address": null 
    } 
  ], 
  "shipping": [ 
    { 
      "shipping_method": "RELAY_POINT",
      "delivery_company_name": null,
      "shipping_speed": null,
      "shipping_delay": null,
      "type": null,
      "first_name": null,
      "last_name": null,
      "legal_name": null,
      "phone_number": null,
      "address": 
            { 
                  "street_number": "37",
                  "street": "rue Marcel Philippe",
                  "district": "Wallis and Futuna",
                  "zipcode": "59259",
                  "city": "Dupont",
                  "state": "Meurthe-et-Moselle",
                  "country": "FR"
            }
    } 
  ], 
  "payment_config": "SINGLE",
  "amount": 1150,
  "initial_amount": 1150,
  "currency": "EUR", 
  "status": "PENDING",
  "webhook_result": null,
  "url_return": "https://URLreturn.com",
  "links": 
    { 
      "items": 
        {
            "href": "https://secure.lyra.com/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427/items" },
      "transactions": 
        {
            "href": "https://secure.lyra.com/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427/transactions" },
      "refunds": 
        { 
            "href": "https://secure.lyra.com/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427/refunds" }
     },
  "vads_transaction_id": 600001,
  "vads_transaction_date": "20190527093234", 
  "expected_capture_date": "20190530093235",
  "capture_delay": 3
}

Important: The Order can be validated as long as the expiration date of the authorization request has not passed. If this date has passed, the payment takes the definitive EXPIRED status.