Skip to main content
The affiliate booking flow: create a booking (status 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
      }
    }
  }'
Response:
{
  "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. A transaction_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" }
  }'

Stripe (redirect)

Stripe always redirects to a Stripe-hosted checkout page. You must redirect the user to data.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" }
  }'
Payment response:
{
  "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

Providermethod valueCard details neededRedirect required
MoyasarMoyasarYes — source objectOnly for 3DS
StripeStripeNoAlways
Use Moyasar test cards (4111111111111111) in the sandbox environment. Check Moyasar’s test docs for the full list.