Without a redirect, skip step 3 and send the buyer to the link URL with no
sessionKey. The payment page creates its own 15-minute session.Why two sessions
You put the buyer session key in the URL you send the buyer to. That puts it in the buyer’s browser, so Meridian limits what it can do:- It pays one link only. The session is tied to the
paymentLinkIdyou set. It cannot create payment links or pay a different link. - It expires after 15 minutes. The buyer must pay within that time. A copied or leaked key stops working soon after.
redirectUrl cannot go on the creation session. redirectUrl requires paymentLinkId, and the link does not exist until you create it.
Create and send a link
1
Create a session
Call Create a Session with your operator details only.The key lasts 15 minutes. You can create more than one link with it before it expires.
2
Create the link
Call Create a Payment Link with the creation session’s Store the link’s
sessionKey in the body.id and linkToken. You need both in the next steps.Create a Payment Link does not take
redirectUrl. You set it on the buyer session in the next step.3
Create a buyer session (optional)
Skip this step if you do not need a redirect.When the buyer clicks Pay on your site, call Create a Session again. Set
paymentLinkId to the link’s id, and redirectUrl to the page the buyer returns to.redirectUrl must be an https URL of at most 2048 characters. It is optional.Meridian checks paymentLinkId only when the buyer opens the payment page. A wrong or inactive link ID still returns 201, and the payment page then rejects the session.Create the buyer session at the moment the buyer clicks Pay, not when you create the link. The 15 minutes start when you create the session.4
Send the buyer to pay
Build the payment URL from your payment domain and the link’s
linkToken. Your Solutions Engineer gives you the payment domain for Sandbox and production.- Without a redirect
- With a redirect
5
Confirm the payment
The redirect does not mean the payment completed. Wait for the
payment_link_transaction_succeeded webhook before you mark the order paid. See Track payments.