API Documentation

PayBridge API Documentation

Complete API reference for PayBridge payment integration.

Authentication

All API requests require authentication using OAuth2 Bearer tokens.

Get Access Token
POST /merchant/api/verify
Request Body:
{
  "client_id": "your_client_id",
  "client_secret": "your_client_secret"
}
Response:
{
  "status": "success",
  "data": {
    "accessToken": "eyJ0eXAiOiJKV1Q...",
    "expiresIn": 3600
  }
}

Create Payment

Create a new payment transaction.

POST /merchant/api/transaction-info
Headers:
Authorization: Bearer {access_token}
Content-Type: application/json
Request Body:
{
  "amount": "100.00",
  "currency": "MYR",
  "payer": "Mts",
  "successUrl": "https://yoursite.com/success",
  "cancelUrl": "https://yoursite.com/cancel",
  "order_id": "ORD-12345",
  "item_name": "Product Purchase",
  "payer_name": "John Doe",
  "payer_email": "john@example.com",
  "payer_phone": "0123456789"
}
Response:
{
  "status": "success",
  "data": {
    "grant_id": "abc123",
    "token": "xyz789",
    "approvalUrl": "https://paybridge.my/merchant/payment?grant_id=abc123&token=xyz789"
  }
}

Payment Status

StatusDescription
SuccessPayment completed successfully
PendingPayment is being processed
FailedPayment failed or rejected
CancelledPayment cancelled by user

Callbacks

PayBridge will send callbacks to your success/cancel URLs with these parameters:

Success Callback Parameters:
ParameterDescription
statusPayment status (success/failed)
order_idYour order reference
transaction_idPayBridge transaction ID
amountPayment amount
currencyPayment currency

Error Codes

CodeMessageDescription
401UnauthorizedInvalid or expired access token
400Bad RequestMissing or invalid parameters
404Not FoundResource not found
500Server ErrorInternal server error