Postman Collection Guide
Overviewβ
The Billoget Public API v1.1.0 Postman Collection provides a comprehensive set of pre-configured requests for testing and integrating with the Billoget API. This guide will help you get started quickly with our API.
π₯ Download Collectionβ
Access the latest collection through our interactive documentation:
- Postman Collection v1.1.0 - Interactive documentation with download option
π Quick Startβ
Step 1: Access the Collectionβ
- Visit our Postman Documentation
- Click the "Run in Postman" button to import directly, or
- Click "Download Collection" to get the JSON file for manual import
βοΈ Configurationβ
Required Variablesβ
Before using the collection, configure these variables:
Variable | Description | Example Value |
---|---|---|
base_url | API base URL | https://api.billoget.com |
api_key | Your API key | bk_live_1234567890abcdef... |
Setting Variablesβ
- Collection Level: Right-click collection β Edit β Variables tab
- Environment: Create a new environment with these variables
- Global: Set as global variables for all collections
{
"base_url": "https://api.billoget.com/v1",
"api_key": "bk_live_your_actual_api_key_here"
}
π Authenticationβ
The collection is pre-configured with Bearer Token authentication:
- Type: Bearer Token
- Token:
{{api_key}}
- Applied to: All requests automatically
Getting Your API Keyβ
- Log into your Billoget dashboard
- Navigate to Settings β API Keys
- Click Create New API Key
- Configure scopes and settings
- Copy the generated key
π Collection Structureβ
π Budgets API (5 requests)β
Complete CRUD operations for budget management:
List Budgetsβ
GET {{base_url}}/api/public/budgets?page=1&limit=10
Query Parameters:
page
- Page number (default: 1)limit
- Items per page (max: 100)status
- Filter by status (PENDING, APPROVED, REJECTED, EXPIRED)customerId
- Filter by customer IDsearch
- Search in notes and descriptionsminTotal
/maxTotal
- Amount range filterscreatedAfter
/createdBefore
- Date range filterssort
/order
- Sorting options
Example Response:
{
"data": [
{
"id": "budget_123",
"customerId": "customer_456",
"status": "PENDING",
"total": 1500.0,
"subtotal": 1300.0,
"tax": 200.0,
"currency": "USD",
"validUntil": "2024-02-15T23:59:59Z",
"notes": "Q1 Marketing Budget",
"createdAt": "2024-01-15T10:30:00Z",
"customer": {
"id": "customer_456",
"name": "Acme Corp",
"email": "contact@acme.com"
}
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"hasMore": false
}
}
Get Budget by IDβ
GET {{base_url}}/api/public/budgets/:budgetId
Create Budgetβ
POST {{base_url}}/api/public/budgets
Request Body:
{
"customerId": "customer_456",
"items": [
{
"productId": "product_789",
"description": "Premium Marketing Package",
"quantity": 2,
"unitPrice": 500.0
},
{
"productId": "product_790",
"description": "Additional Services",
"quantity": 1,
"unitPrice": 200.0
}
],
"notes": "Q1 Marketing Campaign Budget",
"validUntil": "2024-03-31T23:59:59Z",
"metadata": {
"source": "api",
"campaign": "Q1_2024",
"department": "marketing"
}
}
Update Budgetβ
PUT {{base_url}}/api/public/budgets/:budgetId
Request Body:
{
"status": "APPROVED",
"notes": "Approved by manager - ready to proceed",
"validUntil": "2024-04-30T23:59:59Z"
}
Delete Budgetβ
DELETE {{base_url}}/api/public/budgets/:budgetId
π₯ Customers API (5 requests)β
Customer information management:
List Customersβ
GET {{base_url}}/api/public/customers?page=1&limit=10
Query Parameters:
page
- Page numberlimit
- Items per pagesearch
- Search by name or emailsort
/order
- Sorting options
Get Customer by IDβ
GET {{base_url}}/api/public/customers/:customerId
Create Customerβ
POST {{base_url}}/api/public/customers
Request Body:
{
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+1-555-123-4567",
"address": "123 Main Street",
"city": "New York",
"state": "NY",
"country": "USA",
"postalCode": "10001",
"taxId": "12-3456789",
"metadata": {
"source": "api",
"leadSource": "website",
"priority": "high"
}
}
Update Customerβ
PUT {{base_url}}/api/public/customers/:customerId
Delete Customerβ
DELETE {{base_url}}/api/public/customers/:customerId
π¦ Products API (5 requests)β
Product catalog management:
List Productsβ
GET {{base_url}}/api/public/products?page=1&limit=10
Query Parameters:
page
- Page numberlimit
- Items per pagecategory
- Filter by categorysearch
- Search in name/descriptionisActive
- Filter by active statusminPrice
/maxPrice
- Price range filters
Get Product by IDβ
GET {{base_url}}/api/public/products/:productId
Create Productβ
POST {{base_url}}/api/public/products
Request Body:
{
"name": "Premium Marketing Package",
"description": "Comprehensive marketing solution including strategy, content creation, and campaign management",
"price": 2500.0,
"sku": "MKT-PREM-001",
"category": "services",
"unit": "package",
"isActive": true,
"metadata": {
"duration": "3 months",
"deliverables": "strategy, content, reports",
"team": "marketing"
}
}
Update Productβ
PUT {{base_url}}/api/public/products/:productId
Delete Productβ
DELETE {{base_url}}/api/public/products/:productId
π Webhooks API (1 request)β
Webhook testing and management:
Test Webhookβ
POST {{base_url}}/api/public/webhooks/test
Request Body:
{
"event": "budget.created",
"data": {
"id": "budget_123",
"customerId": "customer_456",
"total": 1500.0,
"status": "PENDING",
"createdAt": "2024-01-15T10:30:00Z"
}
}
π§ͺ Built-in Testingβ
The collection includes automated tests for every request:
Global Testsβ
All requests automatically test:
- Response time < 2000ms
- Valid JSON response
- Rate limit headers presence
- Rate limit monitoring with warnings
Test Scriptsβ
// Response time validation
pm.test("Response time is less than 2000ms", function () {
pm.expect(pm.response.responseTime).to.be.below(2000);
});
// JSON validation
pm.test("Response has valid JSON", function () {
pm.response.to.have.jsonBody();
});
// Rate limit monitoring
const rateLimitRemaining = pm.response.headers.get("X-RateLimit-Remaining");
const rateLimitLimit = pm.response.headers.get("X-RateLimit-Limit");
if (rateLimitRemaining && rateLimitLimit) {
console.log(`Rate Limit: ${rateLimitRemaining}/${rateLimitLimit} remaining`);
if (parseInt(rateLimitRemaining) < 10) {
console.warn("β οΈ Rate limit running low!");
}
}
Pre-request Scriptsβ
Automatic timestamp generation:
// Set timestamp for requests
pm.globals.set("timestamp", new Date().toISOString());
π Usage Examplesβ
Running Individual Requestsβ
- Select a request from the collection
- Ensure variables are set correctly
- Click Send
- Check the Test Results tab for validation
Running the Entire Collectionβ
- Right-click the collection name
- Select Run collection
- Configure iterations and delay
- Click Run Billoget Public API v1.1.0
- Monitor results in the Collection Runner
Environment Switchingβ
Create different environments for different stages:
Development Environment:
{
"base_url": "https://api.billoget.com/v1",
"api_key": "bk_test_development_key"
}
Production Environment:
{
"base_url": "https://api.billoget.com/v1",
"api_key": "bk_live_production_key"
}
π Monitoring and Analyticsβ
Rate Limit Monitoringβ
The collection automatically monitors your rate limits:
- Displays current usage in console
- Warns when approaching limits
- Tracks remaining requests
Response Time Trackingβ
All requests are tested for performance:
- Fails if response time > 2000ms
- Helps identify API performance issues
- Useful for monitoring during load testing
π οΈ Customizationβ
Adding Custom Testsβ
Add request-specific tests in the Tests tab:
// Custom validation for budget creation
if (pm.response.code === 201) {
pm.test("Budget created successfully", function () {
const response = pm.response.json();
pm.expect(response.data.id).to.exist;
pm.expect(response.data.status).to.eql("PENDING");
});
}
Environment Variablesβ
Add custom variables for your integration:
{
"base_url": "https://api.billoget.com/v1",
"api_key": "bk_live_...",
"customer_id": "customer_123",
"product_id": "product_456",
"test_email": "test@yourcompany.com"
}
Custom Headersβ
Add integration-specific headers:
// Pre-request script
pm.request.headers.add({
key: "X-Integration-Name",
value: "My Company Integration",
});
π Troubleshootingβ
Common Issuesβ
401 Unauthorizedβ
- Check API key is correct
- Verify key hasn't expired
- Ensure key has required scopes
429 Rate Limitedβ
- Wait for rate limit reset
- Reduce request frequency
- Check rate limit headers
404 Not Foundβ
- Verify endpoint URL
- Check resource ID exists
- Confirm base_url is correct
Debug Modeβ
Enable detailed logging:
// Add to pre-request script
console.log("Request URL:", pm.request.url.toString());
console.log("Request Headers:", pm.request.headers.toJSON());
π Next Stepsβ
- API Reference - Detailed endpoint documentation
- Authentication Guide - API key setup
- Error Handling - Handle API errors
- Rate Limiting - Understand limits
π Additional Resourcesβ
Ready to start testing? Access the collection and start exploring the Billoget API! π