Skip to main content

Import a token request

This method allows you to create a token directly by providing the payment method details within the request. This method will just store the payment method within our system for future use.

Note: This method is mainly used as for importing of payment method details previously stored into our system and only relevant for Hospitality business.

  • URL syntax: /api/v2/merchant/token/import
  • Method: POST

Request parameters

NameTypeDetailsMandatoryDescription
sourceintNThe ID reference for which this request is. This data is provided by SysPay.
descriptionstringmax length 300NThe product/service description.
ems_urlstringNThis parameter overrides the default ems_url configuration in your SysPay settings.
extrastringMax length 300NAn extra parameter that is passed back to you when sending a redirect or event message.
customerarrayCustomerYThe customer’s details.
payment_methodarrayYPayment method details. See section below.

Parameters relative to Hospitality business

NameTypeDetailsMandatoryDescription
booking_detailsarrayBooking detailsYThe booking details.
expiration_dateunix timestampNThis unix timestamp determines the token expiration date. After this date, the payment method details will not be anymore visible on SysPay interfaces. If no expiration_date is provided, the booking_details.check_out_date plus an interval amount will be used as the expiration date of the token. If set as null, the payment method details will not be visible at all.

payment_method parameter

NameTypeDetailsMandatoryDescription
typestringCREDITCARDYThe type of payment object to be passed in the api call.
cardholderstringMax length 100YCardholder name. Please note that non-alphabetic characters other than @ . - _ ‘ will be stripped out. Names containing digits will be rejected by validation.
numberstring[0-9]19YValid credit card number, only digits.
exp_monthstring[0-9]2YCredit card expire month (ex: 05).
exp_yearstring[0-9]4YCredit card expire year (ex: 2015).
cvcint[0-9]4N*Credit card verification code. * Strongly recommended.

Example request

{
"source": null,
"customer": {
"reference": "ref-65eafea61fd6f",
"email": "john.doe+65eafea61fd6f@gmail.com",
"firstname": "John",
"lastname": "Doe",
"language": "en",
"ip": "13.158.109.147",
"billing_address": {
"address1": "55 rue du Faubourg Saint-Honoré",
"postal_code": "75008",
"city": "Paris",
"country": "FR"
}
},
"ems_url": "http://www.mysite.com/ems.php",
"description": "Booking 65eafea620d94 from 2024-03-31 to 2024-04-07.",
"extra": {
"internalKey1": "internalValue1",
"internalKey2": "internalValue2"
},
"expiration_date": "1712491430",
"booking_details": {
"type": "HOTEL",
"check_in_date": "2024-03-31",
"check_out_date": "2024-04-07",
"booking_id": "65eafea620d94",
"total_booking_amount": 100000,
"booking_currency": "EUR"
},
"payment_method": {
"type": "CREDITCARD",
"number": "4131709899430003",
"cardholder": "Card Holder Name",
"exp_month": "01",
"exp_year": "2025",
"cvc": "123"
}
}

Response parameters

The response in this case is a Token object.

In this case since the token is being imported no VALIDATION or MANDATE processing will be performed.

Example response

{
"class": "token",
"id": "83392",
"status": "ACTIVE",
"action_url": null,
"booking_id": "65eafea620d94",
"check_in_date": "2024-03-31",
"check_out_date": "2024-04-07",
"booking_details": {
"class": "booking_details",
"type": "HOTEL",
"booking_id": "65eafea620d94",
"check_in_date": "2024-03-31",
"check_out_date": "2024-04-07",
"total_booking_amount": "100000",
"booking_currency": "EUR"
},
"creation_date": "1709899430",
"expiration_date": "1712491430",
"description": "Booking 65eafea620d94 from 2024-03-31 to 2024-04-07.",
"extra": "Array",
"customer": {
"class": "customer",
"email": "john.doe+65eafea61fd6f@gmail.com",
"language": "en",
"firstname": "John",
"lastname": "Doe",
"billing_address": {
"class": "billing_address",
"address1": "55 rue du Faubourg Saint-Honoré",
"address2": null,
"address3": null,
"city": "Paris",
"country": "FR",
"postal_code": "75008"
}
},
"payment_method": {
"class": "payment_method",
"type": "CREDITCARD",
"validation_status": "NOT_VALIDATED",
"validation_date": null,
"invalid_reason": null,
"display": "4131-70xx-xxxx-0003",
"details": {
"class": "payment_method_details",
"fingerprint": "47371d35-44ef-4260-9b46-4c9f85cfabd1",
"holder": "Card Holder Name",
"scheme": null,
"exp_month": "01",
"exp_year": "2025"
}
},
"moto_instance_id": null,
"mandate": {
"class": "mandate",
"status": "NOT_REQUESTED",
"currency": "EUR",
"end_reason": null,
"start_date": 1709899430,
"end_date": null
},
"payment": null
}