Updating a token

In order to update a payment method, you must create a new token and add the existing alias to the alias_to_update attribute of the POST TOKEN request.

Updating a token using the payment page:

Example of a POST TOKEN call:

POST https://secure.lyra.com/marketplace/tokens/

{
	"marketplace": "9537e049-8862-400a-ae8d-da2ec9ca6051",
	"alias_to_update": "1144951ea7ab42989c97159b3dfc0382",
	"url_return": "http://www.my-website.com/",
	"buyer": {
		"type": "PRIVATE",
		"first_name": "John",
		"last_name": "Smith",
		"email": "john.smith@lyra.fr",
		"phone_number": "1234",
		"reference": "Buyer_1",
		"address": {
			"zipcode": "59259",
			"street_number": "37",
			"country": "FR",
			"street": "rue Marcel Philippe",
			"city": "Vignoux"
		}
	}
}

Example of a POST TOKEN response:

{
	"token": "62a52e50-ce29-409a-9cec-9ea6ee36ab41",
	"payment_url": "https://secure.lyra.com/vads-payment/exec.refresh.a;jsessionid=335D2aDb5eF8356Aed2cf3dF.vadpayment02inte01lbg?cacheId=913355311811276000040"
}

In order to proceed to payment update, you must redirect the Buyer to the URL transmitted in payment_url.

You will receive a webhook notification at the end of the operation.

To create a token using the embedded form:

Example of a POST TOKEN call:

POST https://secure.lyra.com/marketplace/tokens/embedded/

{
	"marketplace": "9537e049-8862-400a-ae8d-da2ec9ca6051",
	"alias_to_update": "1144951ea7ab42989c97159b3dfc0382",
	"url_return": "http://www.my-website.com/",
	"buyer": {
		"type": "PRIVATE",
		"first_name": "John",
		"last_name": "Smith",
		"email": "john.smith@lyra.fr",
		"phone_number": "1234",
		"reference": "Buyer_1",
		"address": {
			"zipcode": "59259",
			"street_number": "37",
			"country": "FR",
			"street": "rue Marcel Philippe",
			"city": "Vignoux"
		}
	}
}

Example of a POST TOKEN response:

{
	"token": "62a52e50-ce29-409a-9cec-9ea6ee36ab41",
	"form_token":"fa0yfV2FQuR3aak1SwsgcuZg195eyJhbW91bnQiOjEwOTAwLCJjdXJyZW5jeSI6IkVVUiIsIm
				1vZGUiOiJURVNUIiwidmVyc2lvbiI6Mywib3JkZXJJZCI6IjVjNDk1N2E5LWNkOGEtNGJhZC1hMGNiLTgxMT
				ZiMWE3ZDdmNiIsInNob3BOYW1lIjoiTHlyYSBTTVMiLCJicmFuZFByaW9yaXR5IjpbIkJBTkNPTlRBQ1QiL
				CJDQiIsIkUtQ0FSVEVCTEVVRSIsIk1BU1RFUkNBUkQiLCVGQVVMVCJ9fX0a702"
}

In order to proceed to payment method update, the form_token must be inserted in the form (kr-form-token attribute).