Event notifications
Subscribe to event notifications to receive order payments updates when, e.g.,
- A customer completes the payment.
- The payment has been cancelled or declined.
Prerequisites
- SmartPOS terminal must be activated in your MultiSafepay account.
- Payments must be initiated via cloud POS payment.
In other scenarios, you can make use of our webhook notifications.
1. Initiate payments
- Create an order, and set
terminal_id
in your request. See Recipe - Cloud POS payment . - In response to the API request you made, you receive the
events_token
.
ā ļø Note: You cannot initiate another payment until the current payment is Cancelled or Completed.
2. Subscribe to the event notifications
To subscribe to event notifications make a GET request, using the events_token
from your response.
curl -H 'Authorization: events_token' 'https://api.multisafepay.com/events/stream/'
Example requests
curl -H 'Authorization: eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2OTQwNzEyMDcsImdydtdfI6WyJtYnVzOnNlc3Npb24ub3JkZXIiLCJtYnVzOnNlc3Npb24ucXIiXSwicGlkIjoiNTk5TWM0VWhOWDhYczNmNU55b3JnaVZZMlhab1BsVVkxa28iLCJzdWIiOiJwciJ9.p1txKa0wlR6Pn-DvQW8oYmYcesU49GgZsPebME_EvYs' \
'https://api.multisafepay.com/events/stream/'
Example response
event: session.order
data: {"financial_status":"initialized","order_id":"ExampleOrderID1234567","session_id":"1025J8hXqtM9dLcilPp3gqkXi8Res3tvZZZ","status":"initialized","transaction_id":"89000000"}
event: session.order
data: {"financial_status":"completed","order_id":"ExampleOrderID1234567","session_id":"1025J8hXqtM9dLcilPp3gqkXi8Res3tvZZZ","status":"completed","transaction_id":"890000000"}
3. Payment statuses
The table below sets out possible payment statuses and what they commonly mean.
Description | Payment status |
---|---|
The card scheme is processing your payment request. | Initialized |
The payment has been cancelled on the terminal or via API. For more information - see Cancellation. Note: You can now initiate another cloud POS payment. | Cancelled. |
The customer has completed the payment. Note: You can now initiate another cloud POS payment. | Completed |
The card scheme has declined the payment. The customer will be redirected to the payment screen to retry the payment. | Declined. |
Updated about 19 hours ago