Importing several existing mandates at once

It is possible to import several mandates for several stores at once, provided that you have:

  • the same debtor
  • the same IBAN

As opposed to importing a single mandate, the data is:

  • a new access point: POST https://secure.lyra.com/sdd/multimandates
  • a complementary parameter sites: [ Shop ID ]

The response will contain:

  • a mandate per shop
  • a JSON table per shop

In order to import several mandates:

  1. Specify the desired action on the first line: https://secure.lyra.com/sdd/multimandates'
  2. Build your HTTP header (see chapter Identifying yourself when exchanging with the payment gateway).
  3. Add the fields iban, last_name, first_name, email, payment_type, locale and sites, required for importing mandates.
    Table 1. Required fields
    Field Format Description Required Example
    iban string IBAN for International Bank Account Number: Debtor’s bank account identifier
    "iban":"FR7630002005701234567890158"
    last_name string Debtor’s last name
    "last_name":"Smith"
    first_name string Debtor’s first name
    "first_name":"John"
    email string Debtor’s e-mail address
    "email":firstname.lastname@example.com
    payment_type string
    • RECURR
    • ONEOFF

    Type of mandate:
    • Recurring
      The signed mandate applies to a series of direct debits.
    • One-off
      The signed mandate applies to a single direct debit.

    "payment_type":"RECURR"

    or

    "payment_type":"ONEOFF"

    locale string
    • FR for French
    • DE for German
    • EN for English
    • ES for Spanish
    • IT for Italian
    • NL for Dutch
    • PL for Polish
    • PT for Portuguese
    • SV for Swedish
    Language of mandate generation

    "locale":"FR"

    sites n8 Shop ID(s)
    "sites":["11111111", "22222222"]
  4. Add the address object to transmit the debtor address details. Some banks check whether this information is present before accepting a direct debit request. The address is required if the client has a bank account in the following departments, territories or countries: Switzerland, Monaco, San Marino, Mayotte, St. Pierre and Miquelon, Guernsey, Jersey, Isle of Man.
    Attribute of the address object Format Description Example
    city string City Labège
    country string Country code in compliance with the ISO 3166 alpha-2 standard FR
    district string District Labège-Innopole
    state string State / Region Occitanie
    street string Postal address Rue de l’Innovation
    street_number string Street number 109
    street2 string Address line 2 Bat 1
    zip string Zip code 31670
  5. Add the optional fields bic, title, callback_url, send_mails and fetch_address, if necessary.
    Field name Format Description Example
    bic string BIC for Bank Identifier Code: International identifier of the debtor’s bank "bic":"CRLYFRPP"
    title string Debtor’s title "title":"Mr"
    callback_url string URL https://.../
    send_mails boolean

    Default value: False

    If the field is set to True, the Lyra Collect PDF will send the mandate registration e-mails to the buyer and to the merchant once a mandate is created or updated.

     
    fetch_address boolean

    Allows to indicate whether the address object is sent in return after the WS response.

    Default value: false.

     

Example of a cURL request:
$ curl 'https://..../multimandates' -H
'Authorization: Basic MTIzNDU2Nzg6MTIzNDU2Nzg5MDEyMzQ1Ng==' -H'
Content-Type:application/json' -H 
'Accept: application/json' 
--data
'{"iban":"FR7630002005701234567890158","title":"Mr","last_name":"Smith","first_name":"John",
"email":"jsmith@ymail.com","payment_type":"RECURR","locale":"FR","address":{"street_number":"109",
"street":"rue de l'Innovation","street2":"Bat 1","district":"Labège-Innopole","zip":"31670",
"city":"Labège","country":"FR","state":"Occitanie"},"fetch_address":false,
"sites":["11111111","22222222","33333333"]}' -i

Response:

HTTP/1.1 200 OK
Date: Wed, 27 Aug 2014 10:41:42 GMT
Content-Type:application/json
Connection: close
Transfer-Encoding:chunked

[
{
	"bic":"CRLYFRPP",
	"iban":"FR7630002005701234567890158",
	"title":"Mr",
	"email":"jsmith@ymail.com",
	"locale":"FR",
	"identifier":"FR08ZZZ482829-20140827vzP6s8",
	"rum":"FR08ZZZ482829-20140827vzP6s8",
	"id":"11111111-FR08ZZZ482829-20140827vzP6s8",
	"site":"11111111",
	"first_name":"John",
	"last_name":"Smith",
	"payment_type":"RECURR",
	"callback_url":null,
	"created_at":1409136103000,
	"updated_at":null,
	"fetch_adress":"false"
},
{
	"bic":"CRLYFRPP",
	"iban":"FR7630002005701234567890158",
	"title":"Mr",
	"email":"jsmith@ymail.com",
	"locale":"FR",
	"identifier":"FR78ZZZ472548-20140827TotVyn",
	"rum":"FR78ZZZ472548-20140827TotVyn",
	"id":"22222222-FR78ZZZ472548-20140827TotVyn",
	"site":"22222222",
	"first_name":"John",
	"last_name":"Smith",
	"payment_type":"RECURR",
	"callback_url":null,
	"created_at":1409136105000,
	"updated_at":null,
	"fetch_adress":"false"
},
{
	"bic":"CRLYFRPP",
	"iban":"FR7630002005701234567890158",
	"title":"Mr",
	"email":"jsmith@ymail.com",
	"locale":"FR",
	"identifier":"FR78ZZZ472548-20140827iliSfW",
	"rum":"FR78ZZZ472548-20140827iliSfW",
	"id":"33333333-FR78ZZZ472548-20140827iliSfW",
	"site":"33333333",
	"first_name":"John",
	"last_name":"Smith",
	"payment_type":"RECURR",
	"callback_url":null,
	"created_at":1409136108000,
	"updated_at":null,
	"fetch_adress":"false"
}
]

Note

If an error occurs during a mandate import, then all mandates will show an error.