Create a Payin
This endpoint will allow you to create a payin. In order to complete a payin, it must first be created, then the user must be directed to the Airtm website to confirm/checkout the payin, at which time they will be redirected to a URL of your choosing. See “Usage” below.
We will redirect the user to either confirmationUri or cancelUri with code as a query parameter so you can process the payin as being either confirmed or cancelled.
Usage
- Create a payin.
- Extract the id from the response and redirect the user to: https://<API Host>/payin/:id User will be redirected for authentication as necessary.
- User will confirm or cancel payin from Airtm’s website.
- If confirmed, money will be transferred from the user’s Airtm wallet, to your account, and the user will be redirected to the provided confirmationUri. If canceled, no money will be transferred, and the user will be redirected to the provided cancelUri.
Upon confirmation or cancellation, the payin will be considered completed, and the URL residing at /payin/:id will no longer function. Therefore, if you wish to complete an identical payin, you will need to create a new one.
The confirmationUri attribute should not be used for transaction completeness verification, if the URI was requested, it doesn't mean the transaction was completed successfully.
Redirection
[!important] If you are integrating our API in a mobile application, you will need to redirect the user with the payin generated url by making sure that you open the user’s external browser. By implementing this, the user’s device will be able to successfully handle deeplinks and redirect the users to the Airtm app to finish the operation.
Here are some code snippets in the most popular mobile development frameworks for you to implement the redirection:
Swift Example
// instead of opening a WKWebView or a Safari View Controller, do this:
let url = URL(string: "https://app.airtm.com/payin/payin-id")
if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
}
Kotlin Example
val url = "https://app.airtm.com/payin/payin-id"
fun Context.openUrl(url: String?) {
if (url == null) return
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
kotlin.runCatching {
this.startActivity(browserIntent)
}.onFailure {
// handle errors gracefully
}
}
Flutter Example
import 'package:url_launcher/url_launcher.dart';
void openUrl(String? url) async {
if (url == null) return;
final uri = Uri.parse(url);
try {
await launchUrl(uri, mode: LaunchMode.externalApplication);
} catch (_) {
// Fail silently or log if needed
}
}
React Native Example
import { Linking } from 'react-native';
const openUrl = async (url: string | null | undefined) => {
if (!url) return;
try {
const supported = await Linking.canOpenURL(url);
if (supported) {
await Linking.openURL(url);
}
// If not supported, you can silently fail or log
} catch (error) {
// Optional: Handle errors silently or log
}
};
Request
- Base URLhttps://api.enterprise.airtm.com/v2
- AuthHTTP basic
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"items": [
{
"amount": 10,
"quantity": 1
}
]
}Response
Ok
Example response
{
"amount": 10,
"netAmount": 9.5,
"airtmFee": 0.5,
"items": [
{
"amount": 10,
"quantity": 1
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.