Booking Attempt) → process
payment → booking moves to Paid by Customer automatically.
Create a booking
POST /api/v1/affiliates/users/add-booking
curl -X POST https://api.seyaha.net/api/v1/affiliates/users/add-booking \
-H "Authorization: Bearer $AFFILIATE_JWT" \
-H "Content-Type: application/json" \
-d '{
"activity_id": "6744810075becd2ef8c140f7",
"variation_id": "6751ad2d7533f379c9a1711b",
"promoCode": "SUMMER20",
"customer_details": {
"name": "Fatima Al-Zahra",
"email": "[email protected]",
"phone": "+966509876543"
},
"booking_details": {
"booking_date": "2026-07-15",
"booking_time": "10:00",
"currency": "SAR",
"guests": { "adult": 2, "child": 1, "infant": 0, "senior": 0 },
"pickup_address": {
"address": "King Abdullah Financial District",
"lat": 24.7640,
"lng": 46.6382
}
}
}'
const res = await fetch(
'https://api.seyaha.net/api/v1/affiliates/users/add-booking',
{
method: 'POST',
headers: {
'Authorization': `Bearer ${affiliateJwt}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
activity_id: activityId,
variation_id: varId,
customer_details: {
name: 'Fatima Al-Zahra',
email: '[email protected]',
phone: '+966509876543',
},
booking_details: {
booking_date: '2026-07-15',
booking_time: '10:00',
currency: 'SAR',
guests: { adult: 2, child: 1, infant: 0, senior: 0 },
},
}),
}
);
const { data: booking } = await res.json();
// booking._id — save this for the payment call
{
"success": 1,
"data": {
"_id": "67c896a6639e6ff76dd2f882",
"status": "Booking Attempt",
"partnerConfirmation": "Not Required",
"price": {
"individuals": {
"adults": { "number": 2, "price": 500 },
"children": { "number": 1, "price": 300 }
},
"value": 800,
"discountPercentage": 0
},
"bookingDate": "2026-07-15",
"bookingTime": "10:00",
"configurations": { "currency": "SAR", "serviceFee": 5, "taxes": 15 }
}
}
Process payment
POST /api/v1/affiliates/create-payment
Moyasar (credit card)
Submit card details directly. Atransaction_url is returned when 3DS verification
is required — redirect the user to complete it.
curl -X POST https://api.seyaha.net/api/v1/affiliates/create-payment \
-H "Authorization: Bearer $AFFILIATE_JWT" \
-H "Content-Type: application/json" \
-d '{
"callback_url": "https://yourapp.com/payment/callback",
"method": "Moyasar",
"source": {
"type": "creditcard",
"name": "Fatima Al-Zahra",
"number": "4111111111111111",
"cvc": "123",
"month": "07",
"year": "28"
},
"meta_data": { "booking_id": "67c896a6639e6ff76dd2f882" }
}'
const res = await fetch('https://api.seyaha.net/api/v1/affiliates/create-payment', {
method: 'POST',
headers: {
'Authorization': `Bearer ${affiliateJwt}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
callback_url: 'https://yourapp.com/payment/callback',
method: 'Moyasar',
source: {
type: 'creditcard',
name: 'Fatima Al-Zahra',
number: '4111111111111111',
cvc: '123',
month: '07',
year: '28',
},
meta_data: { booking_id: bookingId },
}),
});
const { data: payment } = await res.json();
if (payment.source?.transaction_url) {
// 3DS required — redirect user
window.location.href = payment.source.transaction_url;
}
Stripe (redirect)
Stripe always redirects to a Stripe-hosted checkout page. You must redirect the user todata.source.transaction_url to complete payment.
curl -X POST https://api.seyaha.net/api/v1/affiliates/create-payment \
-H "Authorization: Bearer $AFFILIATE_JWT" \
-H "Content-Type: application/json" \
-d '{
"callback_url": "https://yourapp.com/payment/callback",
"method": "Stripe",
"meta_data": { "booking_id": "67c896a6639e6ff76dd2f882" }
}'
const res = await fetch('https://api.seyaha.net/api/v1/affiliates/create-payment', {
method: 'POST',
headers: {
'Authorization': `Bearer ${affiliateJwt}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
callback_url: 'https://yourapp.com/payment/callback',
method: 'Stripe',
meta_data: { booking_id: bookingId },
}),
});
const { data: payment } = await res.json();
// Always redirect for Stripe
window.location.href = payment.source.transaction_url;
{
"success": 1,
"data": {
"success": true,
"status": "initiated",
"id": "pay_abc123",
"source": {
"transaction_url": "https://checkout.stripe.com/pay/cs_live_..."
},
"paymentMethod": "Stripe"
}
}
Payment providers reference
| Provider | method value | Card details needed | Redirect required |
|---|---|---|---|
| Moyasar | Moyasar | Yes — source object | Only for 3DS |
| Stripe | Stripe | No | Always |
Use Moyasar test cards (
4111111111111111) in the sandbox environment. Check
Moyasar’s test docs for the full list.