Skip to main content

Update an existing token

This method allows you to update specific parameter(s) of an existing token.

Note: This method is only relevant for Hospitality business.

  • URL syntax: /api/v2/merchant/token/{token_id}
  • Method: POST

URL parameter

NameTypeMandatoryDescription
token_idintYThe reference id of the token to be updated.

Request parameters

NameTypeDetailsMandatoryDescription
booking_detailsarrayBooking detailsNThe 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.

Note: At least one of these parameters should be provided.

Example request

/api/v2/merchant/token/83377
{
"expiration_date": "1712489805",
"booking_details": {
"type": "HOTEL",
"check_in_date": "2024-03-31",
"check_out_date": "2024-04-07",
"booking_id": "65eaf84d2694e",
"total_booking_amount": 100000,
"booking_currency": "EUR"
}
}

Response parameters

The response in this case is a Token object.

Example response

{
"class": "token",
"id": "83377",
"status": "ACTIVE",
"action_url": null,
"booking_id": "65eaf84d2694e",
"check_in_date": "2024-03-31",
"check_out_date": "2024-04-07",
"booking_details": {
"class": "booking_details",
"type": "HOTEL",
"booking_id": "65eaf84d2694e",
"check_in_date": "2024-03-31",
"check_out_date": "2024-04-07",
"total_booking_amount": "100000",
"booking_currency": "EUR"
},
"creation_date": "1709847486",
"expiration_date": "1712489805",
"description": "Booking 65ea33bc7446e from 2024-03-30 to 2024-04-06.",
"extra": "Array",
"customer": {
"class": "customer",
"email": "john.doe+65ea33bc72e00@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": "4491-70xx-xxxx-4007",
"details": {
"class": "payment_method_details",
"fingerprint": "1c2cd558-d343-49c4-ac98-0bee7846c0c4",
"holder": "Card Holder Name",
"scheme": null,
"exp_month": "01",
"exp_year": "2025"
}
},
"moto_instance_id": null,
"mandate": {
"class": "mandate",
"status": "ACTIVE",
"currency": "EUR",
"end_reason": null,
"start_date": 1709847486,
"end_date": null
},
"payment": null
}