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! ๐