Beast Insights
  1. BIN Routing
Beast Insights
  • Order Summary Data
    • Order Summary (Event Date)
      POST
    • Cohort Summary (Initial Date)
      POST
  • BIN Routing
    • BIN Routing
      POST
  • Schemas
    • Schemas
      • PaginationInfo
      • OrderSummaryRecord
    • Response
      • UnauthorizedError
      • RateLimitError
      • BadRequestError
      • InternalServerError
    • ErrorResponse
    • SuccessResponse
    • BinRoutingRequest
    • OrderSummaryCohortRequest
    • OrderSummaryRequest
    • BinRoutingResponse
  1. BIN Routing

BIN Routing

POST
https://api.beastinsights.com/api/bin-routing/route
BIN Routing

BIN Routing#

This endpoint provides payment gateway routing based on Bank Identification Number (BIN) with detailed session information for testing and debugging purposes.

How It Works#

1. BIN-Based Routing#

Provide a BIN (first 6-8 digits of credit card) to get the recommended payment gateway:
{
  "bin": "411111"
}

2. Sales Type Filtering#

Use sales_type to filter by transaction type:
{
  "bin": "411111",
  "sales_type": "INITIALS"
}
"INITIALS": Route for Initial/Straight Sales and specific Rebills (cycle 0 or 2)
"REBILLS": Route for standard Rebills (cycle 1 or 2)
No filter: all transaction types

3. Enhanced Context#

Add optional fields for better routing decisions:
{
  "bin": "411111",
  "customer_id": "customer_12345",
  "product_id": "product_789",
  "email": "customer@example.com",
  "sales_type": "INITIALS"
}

Routing Logic#

1.
BIN Matching: Finds configurations that match the provided BIN
2.
Config Prioritization:
Latest configurations take priority over older ones
BIN-specific configs prioritized over BANK configs
3.
Gateway Selection: Based on configured method (Round Robin, Weightage, Random)

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200OK
application/json
Routing completed successfully
Body

🟠400Bad Request
🟠404Record Not Found
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://api.beastinsights.com/api/bin-routing/route' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "bin": "411111"
}'
Response Response Example
200 - Successful BIN routing with session info
{
    "success": true,
    "gateway_id": "1234",
    "group_id": 1,
    "group_name": "Visa Main Group",
    "is_fallback": false,
    "timestamp": "2025-11-03T10:30:00.000Z",
    "session_info": {
        "selection_method": "ROUND_ROBIN",
        "rule_name": "Visa Main Group",
        "current_index": 2,
        "total_calls": 15,
        "total_mids": 5,
        "next_gateway_id": "1234"
    }
}
Modified at 2025-12-17 12:23:57
Previous
Cohort Summary (Initial Date)
Next
PaginationInfo
Built with