Logo Logo
Loading...
Skip to content
Phone: +966 11 555 0100 · Email: support@manaracore.com

Hosted checkout explained: payment sessions from start to finish

How a ManaraCore payment session works, from the server call that creates it to the webhook that confirms it.

ManaraCore Team ยท 1 min read

A hosted checkout keeps card data off your servers. Your backend creates a payment session, the customer pays on the ManaraCore payment page, and you are told the result. Here is each step.

1. Create the session

From your server, call POST /api/payments/sessions with your merchant token as a bearer token. Send the amount, currency, your own order reference, the customer's contact details, and where to send the customer and the result:

{
  "amount": 49.99,
  "currency": "USD",
  "merchantReferenceId": "ORDER-1042",
  "customerEmail": "customer@example.com",
  "returnUrl": "https://shop.example.com/payment/success",
  "cancelUrl": "https://shop.example.com/payment/cancel",
  "webhookUrl": "https://shop.example.com/webhooks/payments"
}

The response contains a paymentSessionId, a hostedPaymentUrl, an iframeUrl and the payment methods available for this payment.

2. Send the customer to pay

Either redirect to hostedPaymentUrl or embed iframeUrl in your checkout page. The customer picks a method and pays with the provider.

3. Confirm the result

When the provider reports the payment, ManaraCore updates the session and calls your webhookUrl. Mark the order as paid from the webhook, not from the return URL: customers close tabs, and a return visit is not proof of payment.

The Payment playground lets you run a full session end to end before you write any integration code.

Related articles