Custom integration
Build your own payments integration using our API, payment components, include QR codes and set up webhooks.
This tutorial explains how to build your own integration using our API, and how to create orders and track their progress via our webhook.
Prerequisites
You must first:
To authenticate requests, you must include your API key as a query parameter in the request URL.
flowchart LR
API[<div style="width:220px;height:64px;display:flex;align-items:center;justify-content:center">Integrate our API</div>]
CHECKOUT[<div style="width:220px;height:64px;display:flex;align-items:center;justify-content:center">Customize your checkout</div>]
TEST[<div style="width:220px;height:64px;display:flex;align-items:center;justify-content:center">Run a test payment</div>]
LIVE[<div style="width:220px;height:64px;display:flex;align-items:center;justify-content:center">Go live</div>]
API --> CHECKOUT --> TEST --> LIVE
classDef big fill:#3B82F6,stroke:#3B82F6,color:#ffffff,padding:6px,ry:6px,font-size:25px;
class API,CHECKOUT,TEST,LIVE big;
Customize your checkout
When integrating our API, you can fully customize your checkout solution:
- Use our payment components, allowing you to fully embed payment methods into your checkout.
- Integrate QR payment into the checkout.
- Create payment links via API, redirecting your customers directly to the payment page.
All integrations support direct or redirect solutions:
- Direct requests connect directly to the payment methods environment. When type is
direct, setting a gateway is required. Not setting a gateway will return an error in the response. - Redirect requests first send the customer to our payment page before connecting to the payment method. If you include the gateway of a payment method, only that payment method will be displayed. Not adding any gateways will display all payment methods activated for your account.
For more information, see request types.
Follow these steps before starting to process payments:
1. Create a test order
MultiSafepay provides a RESTful API you can access with HTTP requests to manage your data. We support data in JSON format only.
The most important data element in our API is the order, which can be linked to multiple transactions.
For our test environment, make use of our TEST API, and use your API key from your TEST account:
https://testapi.multisafepay.com/v1/json/orders?api_key={your-test-api-key}
To create a test order, follow these steps:
-
Make a create an order request. Enter the required fields:
- Specify the payment flow. Set the order
typeto direct or redirect. - Enter the gateway ID to test a specific payment method, or leave the field empty to display all payment methods activated for your TEST account.
- Set an
order_id. This value must be unique. - Set your preferred
currency. Check each payment method to learn what currencies are supported. - Set an
amount. - Give the order a
description.
- Specify the payment flow. Set the order
-
Check that you receive a response with
successset totrue. -
Open the
payment_urlto complete payment on the payment page.
If you receive an error in the response, see Troubleshooting.
Testing payment methods
To test each payment method, see Testing payment methods - Test payment details. If this is your first time, we recommend following the steps for iDEAL.
2. Set up a webhook
You can set up a webhook for your orders to track the order status(the order status) and financial_status (the transaction status).
To understand how orders are progressing, we recommend tracking their status. This way, you don't have to continually poll our server to check for updates to your orders. We provide a webhook to send you notifications automatically.
To learn how to configure your webhook endpoint and handle notifications, see Webhook.
For information about all possible statuses, see Payment statuses.
3. Go live
Once you're done testing your integration, change your API URL and key from your TEST account to your LIVE account.
https://api.multisafepay.com/v1/json/
API endpoints
Check our API reference page to access our API endpoint collection.
Basic endpoints:
- Create order - Create orders using payment methods activated for your account.
- Get order - Retrieve information about a completed transaction.
- Refund order - Process a refund for a transaction.
- List transactions - Retrieve a list of transactions processed with your account.
Check out our resources for your integration:
Support
Email [email protected]
Updated 1 day ago