• France
status page
Demo shops
assistance
FAQContact support
Search
Categories
Tags
docs.
France
Spain
Europe (English)
India
Homepage
Use cases
Create a payment
Create an installment payment
Create a multi-card (split) payment
Create a payment by Alias (Token)
Create a payment link
Create a recurring payment
Manage subscriptions
Manage your transactions (refund, cancel...)
Analyze your reports
API docs
Embedded Form
REST API
Hosted payment
Mobile payment
File exchange
SDD mandates by REST API
Snippets
Payment methods
Plugins
Marketplace
Guides
Merchant Back Office
Back Office Expert
Functional guides

Initiating a payment request via Apple Pay

The merchant website initiates a payment request via a call to the Charge/CreatePayment Web Service.

POSThttps://api.lyra.com/api-payment/V4/Charge/CreatePayment

In response, the merchant server retrieves a formToken, an encrypted object allowing to initialize the SmartForm with the transaction details and the details corresponding to the shop configuration.

 

Prerequisite if you were already a user of the embedded form

You need to migrate from the embedded form (cards) to the smartForm. It is very easy :
  • In embedded mode, use the class kr-smart-form instead of the class kr-embedded.
    Example
    <body>
      <!-- new class kr-smart-form to replace the class kr-embedded -->
    <div class="kr-smart-form" kr-form-token="[GENERATED FORMTOKEN]">  
       (...)
    </div>
    </body>
  • In pop-in mode, use the kr-smart-form class with the kr-popin parameter.
    Example
    <body>
      <!-- new class kr-smart-form with a kr-popin -->
    <div class="kr-smart-form" kr-popin kr-form-token="[GENERATED FORMTOKEN]">   
       (...)
    </div>
    </body>

 

Internet Explorer 11 is obsolete according to Microsoft since June 2022.

The SmartForm integration is not supported by this browser.

Use the fields below to build your request:

Field name Description Required
formAction Type of desired behavior when a transaction is being created.

Must be set to PAYMENT.

 Warning: for the moment, SmartForm is not yet compatible with adding the card in a wallet via the CUSTOMER_WALLET value.
No
amount Amount to be paid, expressed in the smallest currency unit (cents for euro). Yes
currency Payment currency. ISO 4217 alpha-3 code. E.g.: “EUR” for euro Yes
orderId Order reference.

This field is recommended.

No
ipnTargetUrl Allows to override the instant payment notification (IPN) in the form. No
customer.email

E-mail address that will be used for sending the payment receipt to the buyer.

This field is recommended.

No
customer.reference Buyer ID on the merchant website.

This field is recommended.

No
customer.billingDetails Object containing details of the billing address.

This field and its attributes are recommended.

No
customer.shippingDetails Object containing the details of the billing address.

This field and its attributes are recommended.

No
customer.shoppingCart Object containing the details of the shopping cart.

This field and its attributes are recommended.

No
transactionOptions.cardOptions.manualValidation Payment validation mode. No
transactionOptions.cardOptions.captureDelay Capture delay. No

 

In order to obtain a more detailed description of the fields to use, test the Charge/CreatePayment Web Service using our playground.

Example of a request:

https://api.lyra.com/api-payment/V4/Charge/CreatePayment

{
    "amount": "100",
    "currency": "EUR",
    "orderId": "demo-6336a0db503c6",
    "customer": {
        "reference": "My-Reference",
        "email": "main@example.com",
        "billingDetails": {
             "title": "Mr",
      		"category": “PRIVATE",
      		"firstName": “ALFRED",
      		"lastName": "DUBOIS",
      		"phoneNumber": "0673567800",
      		"streetNumber": "3",
      		"address": "rue du Gorp",
      		"district": "Saint-Michel",
      		"zipCode": "31000",
      		"city": "Toulouse"
        },
        "shippingDetails": {
            "address": "rue du Gorp",
            "address2": "110 Apt B",
            "city": “Toulouse",
            "country": "FR",
            "deliveryCompanyName": "DeliveryCompany",
            "district": "Saint-Michel",
            "firstName": "ALFRED",
            "lastName": "DUBOIS",
            "legalName": "My legal name ship",
            "shippingSpeed": "EXPRESS",
            "shippingMethod": "ETICKET",
            "state": "Ok",
            "streetNumber": "3",
            "category": "COMPANY",
            "zipCode": "31000"
        }
    },
    "formTokenVersion": 4
}

Example of a response
{
"shopId": "91335531",
        "orderCycle": "CLOSED",
        "orderStatus": "RUNNING",
        "serverDate": "2022-10-21T15:30:18+00:00",
        "orderDetails": {
            "orderTotalAmount": 100,
            "orderEffectiveAmount": 100,
            "orderCurrency": "EUR",
            "mode": "PRODUCTION",
            "orderId": "demo-6352bae7585b3",
            "metadata": null,
            "_type": "V4\/OrderDetails"
  },
  "customer": {
    "billingDetails": {
      "address": "rue du Gorp",
      "category": "PRIVATE",
      "cellPhoneNumber": null,
      "city": "Toulouse",
      "country": null,
      "district": "Saint-Michel",
      "firstName": "ALFRED",
      "identityCode": null,
      "identityType": null,
      "language": "FR",
      "lastName": "DUBOIS",
      "phoneNumber": "0673567800",
      "state": null,
      "streetNumber": "3",
      "title": "M.",
      "zipCode": "31000",
      "legalName": null,
      "_type": "V4/Customer/BillingDetails"
    },
 "extraDetails": {
                "browserAccept": null,
                "fingerPrintId": null,
                "ipAddress": "185.244.73.2",
                "browserUserAgent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/605.1.15 (KHTML, like Gecko) Version\/16.0 Safari\/605.1.15",
                "_type": "V4\/Customer\/ExtraDetails"
},
 "transactions": [
            {
                "shopId": "91335531",
                "uuid": "6a0688428ec3490591abce6e1e08d8fe",
                "amount": 100,
                "currency": "EUR",
                "paymentMethodType": "CARD",
                "status": "RUNNING",
                "detailedStatus": "AUTHORISED_TO_VALIDATE",
                "operationType": "DEBIT",
                "effectiveStrongAuthentication": "DISABLED",
                "creationDate": "2022-10-21T15:30:15+00:00",
                "transactionDetails": {
                    "liabilityShift": "YES",
                    "effectiveAmount": 100,
                    "effectiveCurrency": "EUR",
                    "creationContext": "CHARGE",
                    "cardDetails": {
                        "paymentSource": "EC",
                        "manualValidation": "YES",
                        "expectedCaptureDate": "2022-10-21T15:30:15+00:00",
                        "effectiveBrand": "VISA",
                        "pan": "XXXXXXXXXXXX4187",
                        "expiryMonth": 12,
                        "expiryYear": 2023,
                        "country": "FR",
                        "effectiveProductCode": "F",
                        "legacyTransId": "934329",
                        "legacyTransDate": "2022-10-21T15:30:15+00:00",
                        "paymentMethodSource": "NEW",
                        "authorizationResponse": {
                            "amount": 100,
                            "currency": "EUR",
                            "authorizationDate": "2022-10-21T15:30:15+00:00",
                            "authorizationNumber": "510231",
                            "authorizationResult": "0",
                            "authorizationMode": "FULL",
                            "_type": "V4\/PaymentMethod\/Details\/Cards\/CardAuthorizationResponse"
                        },
Jobs
Legal
GDPR
25.20-1.11