SRS Integration Partner Services
Home
APIs
Home
APIs
  1. Getting Started
  • SRS Integration Partner Services (SIPS)
  • FAQs
  • Getting Started
    • Introduction
    • Authentication
    • Order Flow
  • SRS API Guides
    • Reference Data
    • Product Data
    • Invoices
    • Web Hooks
  • Security
    • Credentials
  1. Getting Started

Authentication

Getting Started with SIPS API#

This guide walks you through the first 4 steps of integration: getting credentials, authenticating, validating customers, and exploring branch locations.

๐ŸŽฏ What You'll Accomplish#

By the end of this guide, you will:
โœ… Obtain API credentials from SRS
โœ… Authenticate and get your access token
โœ… Validate a customer to ensure they have access
โœ… Explore branch locations and understand available data
โœ… Be ready to proceed to the Place Order Guide
โฑ๏ธ Time to Complete: 30-45 minutes
๐Ÿ“‹ Integration Progress Tracker - Track Your Progress
Prerequisites (Authentication Guide - Steps 1-4):
  • API credentials obtained
  • Access token retrieved
  • Customer validated
  • Branch locations explored
Steps 5-8 Progress (Next: Order Flow Guide):
  • ๐Ÿช Step 5: Customer branches retrieved
  • ๐Ÿ“ฆ Step 6: Products browsed at branch
  • ๐Ÿ’ฐ Step 7: Real-time pricing obtained
  • โœ… Step 8: Order successfully submitted
Key Data Collected:
  • jobAccountNumber saved (from Step 5)
  • Product IDs identified (from Step 6)
  • Pricing validated (from Step 7)
  • Order ID received (from Step 8)
Integration Complete:
  • First test order submitted successfully
  • Order confirmation received
  • Webhook setup planned (for Production)
  • Error handling implemented

๐Ÿ”„ How Steps 1-4 Work Together#


Step 1: Request API Credentials#

๐Ÿ“ง How to Request Credentials - Click to expand

Email Template#

Email APISupportTeam@srsdistribution.com
What to Include:
โœ… Your company name
โœ… Integration use case (brief description)
โœ… Technical contact (name and email)
โœ… Environment needed (QA for testing, Production for live orders)
โœ… Phone number (optional but helpful)
Response Time:
๐Ÿ“… Typically 1-2 business days
๐Ÿšจ Urgent requests may be expedited (mention in subject)

What You'll Receive#

You will receive:
CredentialDescriptionExample
client_idYour unique application identifiersrs_partner_12345
client_secretConfidential key (keep secure!)a1b2c3d4e5f6g7h8...
API Base URLEnvironment endpointhttps://services-qa.roofhub.pro
EnvironmentTesting environment typeStaging
Staging Environment: You will be set up for synchronous order submission only for testing. Asynchronous order submission with webhooks is available in Production and is recommended for live deployments.
IMPORTANT: Do NOT share your credentials with customers or commit them to version control.
Pro Tip: Use a secure secrets management system (Azure Key Vault, AWS Secrets Manager, HashiCorp Vault, etc.) to store credentials. Environment variables should only be used as a mechanism to retrieve credentials from the secrets manager at runtimeโ€”never store sensitive values directly in environment variables.
๐Ÿ”’ Security Best Practices for Credentials - Click to expand
DO โœ…:
Store credentials in a secrets management system and retrieve them at runtime:
Use secrets management systems:
AWS Secrets Manager
Azure Key Vault
HashiCorp Vault
Kubernetes Secrets
Rotate credentials every 90 days
SRS will enforce credentials rotation every 6 months
Use different credentials for Staging vs Production
Limit access to credentials (need-to-know basis)
Audit credential usage regularly
DON'T โŒ:
Commit to Git/version control
Share via email or chat
Hard-code in source files
Store in plain text files
Share with customers or end-users
Use same credentials across environments
Log credentials in application logs
Compromised Credentials?
1.
Contact SRS API Support Team immediately
2.
Request credential rotation
3.
Review access logs for unauthorized usage
4.
Update all systems with new credentials

Step 2: Authenticate & Get Access Token#

๐Ÿ”‘ Understanding OAuth 2.0 Authentication - Click to expand

What is OAuth 2.0 Client Credentials?#

OAuth 2.0 is an industry-standard protocol for authorization. The Client Credentials flow is designed for server-to-server authentication.
How it works:
Key Benefits:
โœ… Secure: No user passwords involved
โœ… Stateless: Tokens are self-contained
โœ… Scalable: Works across distributed systems
โœ… Time-limited: Tokens expire (reduces risk)
โœ… Industry standard: OAuth 2.0 is widely supported
Token Lifecycle:
1
Request Token
๐Ÿ”‘ Request token with your client credentials
2
Token Valid Period
โฐ Token remains valid for 24 hours (86,400 seconds)
3
Refresh Before Expiry
๐Ÿ”„ Implement automatic refresh before token expires
4
Handle Expiration
๐Ÿšซ Expired tokens are rejected with 401 Unauthorized error

Authentication Process#

SIPS uses OAuth 2.0 Client Credentials flow:
1
Send Credentials
Send your client_id and client_secret to POST /authentication/token
2
Receive Access Token
Receive an access_token valid for 24 hours
3
Use Token in API Calls
Include token in Authorization: Bearer {token} header for all API requests

Make Your First Authentication Request#

Endpoint: POST /authentication/token
๐Ÿ“ค Request Details - Click to expand
Request Headers:
Content-Type: application/json
Request Body:
{
  "client_id": "your_client_id",
  "client_secret": "your_client_secret",
  "grant_type": "client_credentials",
  "scope": "ALL"
}
โœ… Successful Response - Click to expand
{
  "token_type": "Bearer",  // ๐Ÿ”‘ Always "Bearer" for OAuth 2.0
  "expires_in": 86400,  // โฐ Token expires in 24 hours (86400 seconds)
  "ext_expires_in": 86400,  // ๐Ÿ”„ Extended expiration time
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."  // ๐ŸŽฏ Use this in all API requests
}
Key Response Fields
FieldDescriptionValue
access_token๐ŸŽฏ Use this in all API requestsJWT token string
expires_inโฐ Token lifetime in seconds86400 (24 hours)
ext_expires_in๐Ÿ”„ Extended expiration time86400 (24 hours)
token_type๐Ÿ”‘ Authentication typeAlways "Bearer"
Token Management Best Practice: Cache tokens and refresh before expiry (24 hours). Implement token caching in your application to avoid unnecessary authentication requests.

Step 3: Validate Customer Access#

Before processing any orders, always validate that the customer has access to place orders through your integration.

Why Validate?#

Customer Validation Benefits
โœ… Ensures customer is active in SRS system
โœ… Retrieves customer code needed for subsequent calls
โœ… Prevents failed orders due to invalid customers
โœ… Returns customer details for verification

Customer Validation API Call#

Endpoint: GET /customers/validate/
๐Ÿ“ค Request Details - Click to expand
Request Headers:
Authorization: Bearer {token}
Content-Type: application/json
Query Parameters:
ParameterTypeRequiredDescription
accountNumberstringโœ…Customer account number
invoiceNumberstringโš ๏ธ OptionalInvoice number for validation
invoiceDatestringโš ๏ธ OptionalInvoice date (YYYY-MM-DD)
Example Request:
โœ… Response Example - Click to expand
{
  "validIndicator": "Y",  // ๐Ÿ”‘ CRITICAL - Must be "Y" to proceed (not boolean!)
  "customerId": 46225,  // ๐ŸŽฏ Unique customer ID
  "accountNumber": "STO1170",  // ๐ŸŽฏ Save this for Step 5 (finding customer branches)
  "customerName": "STORM TEAM CONSTRUCTION INC",  // ๐Ÿ‘ค Display for user confirmation
  "homeBranchId": "3",  // ๐Ÿข Default branch for this customer
  "customerAddress1": "4050 S US HWY 1",  // ๐Ÿ“ Customer address line 1
  "customerAddress2": "SUITE 303",  // ๐Ÿ“ Customer address line 2
  "customerAddress3": "",  // ๐Ÿ“ Customer address line 3 (optional)
  "customerCity": "JUPITER",  // ๐Ÿ™๏ธ Customer city
  "customerState": "FL",  // ๐Ÿ—บ๏ธ Customer state
  "customerZipCode": "33477",  // ๐Ÿ“ฎ Customer zip code
  "customerPhone": "6146944583"  // ๐Ÿ“ž Customer contact phone
}
Key Response Fields
FieldDescriptionUsage
validIndicator๐Ÿ”‘ CRITICAL - Must be "Y" (string!)Validation status
accountNumber๐ŸŽฏ Customer account codeSave for Step 5
customerId๐Ÿ†” Unique customer IDReference identifier
customerName๐Ÿ‘ค Company nameDisplay to user
homeBranchId๐Ÿข Default branch IDPreferred location
customerAddress1-3๐Ÿ“ Street addressShipping reference
customerCity๐Ÿ™๏ธ CityGeographic data
customerState๐Ÿ—บ๏ธ State codeGeographic data
customerZipCode๐Ÿ“ฎ ZIP/Postal codeGeographic data
customerPhone๐Ÿ“ž Contact numberCommunication
Critical: Always check validIndicator === "Y" before proceeding with order flow. It's a string value, not boolean!

Step 4: Get Branch Locations#

Explore available SRS branch locations to understand shipping options and coverage areas.

Why Get Branch Locations?#

Branch Location Benefits
โœ… See all available SRS branches
โœ… Understand geographic coverage
โœ… Display shipping options to users
โœ… No prerequisites - safe to call anytime

Branch Locations API Call#

Endpoint: GET /branches/v2/branchLocations
๐Ÿ“ค Request Details - Click to expand
Request Headers:
Authorization: Bearer {token}
Content-Type: application/json
โœ… Response Example - Click to expand

Branch Data Structure#

[
  {
    "brandName": "SUNCOAST ROOFERS SUPPLY",  // ๐Ÿข Brand identity
    "branchName": "SUNCOAST - PORT CHARLOTTE",  // ๐Ÿช Display name
    "branchCode": "SRPCH",  // ๐Ÿ”‘ Used in subsequent API calls (Step 6)
    "branchAddress": "23264 Harbor View Road",  // ๐Ÿ“ Street address
    "branchCity": "Port Charlotte",  // ๐Ÿ™๏ธ City
    "branchState": "FL",  // ๐Ÿ—บ๏ธ State
    "branchZip": "33980",  // ๐Ÿ“ฎ Zip code
    "branchFax": "941-279-2804",  // ๐Ÿ“  Fax number
    "branchPhone": "941-279-2795",  // ๐Ÿ“ž Phone number
    "shippingMethods": ["Ground Drop", "Roof Load"],  // ๐Ÿšš Available shipping options
    "salesTypes": {  // ๐Ÿ“‹ Order types supported
      "Delivery": "WHSE",
      "Pickup": "WILLCALL"
    },
    "businessHours": "MONDAY - FRIDAY, 7:00 AM TO 4:00 PM",  // โฐ Operating hours
    "ordersEmail": "OrdersPortCharlotte@SuncoastRoofersSupply.com"  // ๐Ÿ“ง Order contact email
  },
  {
    "brandName": "SUNCOAST ROOFERS SUPPLY",
    "branchName": "SUNCOAST - TAMPA",
    "branchCode": "SRTPA",
    "branchAddress": "5801 E Adamo Dr",
    "branchCity": "Tampa",
    "branchState": "FL",
    "branchZip": "33605",
    "branchFax": "813-241-8989",
    "branchPhone": "813-241-8900",
    "shippingMethods": ["Ground Drop", "Roof Load"],
    "salesTypes": {
      "Delivery": "WHSE",
      "Pickup": "WILLCALL"
    },
    "businessHours": "MONDAY - FRIDAY, 7:00 AM TO 4:00 PM",
    "ordersEmail": "OrdersTampa@SuncoastRoofersSupply.com"
  }
]
Key Response Fields
FieldDescriptionUsage
branchCode๐Ÿ”‘ Branch identifierUse in Steps 6, 7, 8
branchName๐Ÿช Display nameShow to users
branchAddress๐Ÿ“ Street addressLocation info
branchCity๐Ÿ™๏ธ CityGeographic filter
branchState๐Ÿ—บ๏ธ State codeGeographic filter
branchZip๐Ÿ“ฎ ZIP codeLocation lookup
branchPhone๐Ÿ“ž Contact numberCustomer support
branchFax๐Ÿ“  Fax numberAlternative contact
shippingMethods๐Ÿšš Delivery optionsOrder configuration
salesTypes๐Ÿ“‹ Order typesPickup vs Delivery
businessHoursโฐ Operating hoursScheduling
ordersEmail๐Ÿ“ง Order contactEmail notifications

โœ… Checkpoint: What You've Accomplished#

Congratulations! You've completed the foundational steps:
โœ… Step 1: Obtained API credentials
โœ… Step 2: Authenticated and retrieved access token
โœ… Step 3: Validated a customer
โœ… Step 4: Explored available branch locations
๐Ÿ† Skills You've Mastered - Click to expand
Technical Skills:
โœ… OAuth 2.0 Client Credentials flow
โœ… Bearer token authentication
โœ… RESTful API calls (GET/POST)
โœ… JSON request/response handling
โœ… HTTP header management
โœ… Error handling basics
Integration Knowledge:
โœ… SRS API authentication workflow
โœ… Customer validation process
โœ… Branch location data structure
โœ… Token lifecycle management
โœ… Environment differences (Staging vs Production)
Data You Now Have:
๐Ÿ”‘ Working access token (valid 24 hours)
๐Ÿ‘ค Valid customer code and account number
๐Ÿข Complete list of SRS branch locations
๐Ÿ“Š Understanding of API response structures
๐Ÿ“Š Progress Assessment - Click to expand
You're ready for the next phase if:
Can successfully authenticate and get token
Token works in subsequent API calls
Can validate at least one customer
Retrieved branch locations successfully
Understand response data structure
Have basic error handling in place
Need more practice?
Try authenticating multiple times
Test with different customers
Explore all branch data fields
Implement token caching
Add logging and monitoring
Next Level Challenges:
Automate token refresh
Build customer search function
Create branch location finder
Implement comprehensive error handling
Set up integration testing suite
You now have:
Working authentication
Valid customer code
List of available branches
Understanding of API structure

๐ŸŽฏ Next Steps#

You're ready to build complete order flows!
Continue to Place Order Guide

Place Order Guide - Steps 5-8#

What you'll learn:
Step 5: Find customer-specific branches and job accounts
Step 6: Get available products at branches
Step 7: Get real-time pricing and availability
Step 8: Submit orders (sync or async)
Time to complete: 45-60 minutes

Troubleshooting Common Issues#

๐Ÿ”‘ Issue: Authentication fails (401 Unauthorized) - Click to expand
Symptoms:
HTTP 401 response
Error message: "Unauthorized" or "Invalid credentials"
Cannot get access token
Common Causes & Solutions:
1.
โŒ Wrong credentials
โœ… Double-check client_id and client_secret
โœ… Ensure no extra spaces or newlines
โœ… Verify you're using the right credentials (not copy-paste errors)
2.
โŒ Wrong environment
โœ… Staging credentials won't work in Production
โœ… Verify base URL matches credential environment
โœ… Check email from SRS for correct environment
3.
โŒ Missing or wrong grant_type
โœ… Ensure grant_type is exactly "client_credentials"
โœ… Check for typos: client_credential (singular) won't work
4.
โŒ Credentials expired or revoked
โœ… Contact SRS API Support for new credentials
โœ… Check if you requested credential rotation recently
Debug Checklist:
๐Ÿ‘ค Issue: Customer validation fails - Click to expand
Symptoms:
validIndicator is not "Y"
Customer not found error
Empty response or null values
Common Causes & Solutions:
1.
โŒ Customer identifier format
โœ… Remove dashes, spaces, special characters
โœ… Use exact format: "CUST12345" not "CUST-12345"
โœ… Try different identifier types (code, email, account number)
2.
โŒ Customer not active in SRS system
โœ… Verify customer account is active
โœ… Contact SRS support to check customer status
โœ… Customer may need onboarding to API access
3.
โŒ Customer not enabled for API
โœ… Not all SRS customers have API access
โœ… Contact SRS support to enable API for customer
โœ… May require customer authorization
4.
โŒ Wrong environment
โœ… Customer may exist in Production but not Staging
โœ… Staging uses test customer data
โœ… Try standard test customers for Staging
๏ฟฝ Issue: Branch locations returns empty array - Click to expand
Symptoms:
Response is [] (empty array)
No branches returned
HTTP 200 but no data
Common Causes & Solutions:
1.
โŒ Token expired
โœ… Verify token is still valid (< 24 hours old)
โœ… Get new token and try again
โœ… Check token expiry timestamp
2.
โŒ Wrong Authorization header format
โœ… Must be: Authorization: Bearer YOUR_TOKEN
โœ… Note the space after "Bearer"
โœ… Token should not be wrapped in quotes in header
3.
โŒ Wrong environment/endpoint
โœ… Verify base URL is correct
โœ… Ensure endpoint path is exact: /branches/v2/branchLocations
โœ… Check for typos in URL
Test with cURL:

Need Help?#

๐Ÿ“ง Contact SRS API Support Team - Click to expand
Email: APISupportTeam@srsdistribution.com
What to Include in Your Support Request:
โœ… Your client ID (NOT the secret!)
โœ… Environment (QA or Production)
โœ… Error messages or response codes
โœ… Request/response examples
โœ… Steps to reproduce the issue
โœ… What you've already tried
Response Time:
๐Ÿ“… Standard: 1-2 business days
๐Ÿšจ Urgent (Production down): Same day
Urgent Issues:
Production outages
Authentication failures in Production
Order processing halted
Security concerns
For urgent issues, mark subject as: [URGENT]
๐Ÿ“š Self-Service Resources - Click to expand
Documentation:
๐Ÿ“– API Reference - Complete endpoint docs
๐Ÿ“– FAQ - Common questions answered
Tools:
๐Ÿ”ง APIdog Interactive Docs - Test live
๐Ÿ”ง Postman Collection - Download collection

๐Ÿš€ Ready for the next phase? Proceed to the Place Order Guide to complete your integration!
Modified atย 2026-05-04 14:05:43
Previous
Introduction
Next
Order Flow
Built with