ProBuy Logo
PB

ProBuy Docs

Version 1.0

Integration Documentation

Your comprehensive guide to integrating ProBuy's Buy Now, Pay Later solutions across digital channels. From portal configuration to custom API implementations, we've got you covered.

Integration Example

// Install the ProBuy Backend SDK
npm install @probuy/backend-sdk
// Initialize ProBuy Backend SDK
import { ProBuyBackendSDK } from '@probuy/backend-sdk';
const probuy = new ProBuyBackendSDK({
apiToken: process.env.PROBUY_API_TOKEN,
environment: 'sandbox' // 'sandbox' or 'prod'
});
// Create a checkout session
const session = await probuy.createCheckoutWithRedirectUrl({
order_reference_id: 'order-123',
order_number: 'ORD-123',
currency: 'SAR',
total_amount: 500,
consumer: {
first_name: 'Ahmed',
last_name: 'Ali',
phone_number: '+966501234567'
},
country_code: 'SA',
merchant_url: {
success: 'https://yoursite.com/success',
failure: 'https://yoursite.com/failure',
cancel: 'https://yoursite.com/cancel'
},
// ... more fields
});
// Redirect customer to checkout
console.log('Redirect to:', session.redirect_url);