{
	"info": {
		"_postman_id": "bulksms-nigeria-sandbox-api",
		"name": "BulkSMS Nigeria Sandbox API",
		"description": "**Sandbox/Test Environment** for BulkSMS Nigeria API v2\n\n## 🧪 What is Sandbox Mode?\n\nThe sandbox environment allows you to test API integration without:\n- Sending real SMS messages\n- Consuming wallet balance  \n- Affecting production data\n- Requiring sender ID approval\n\n## 🚀 Quick Start\n\n### Base URL\n`https://www.bulksmsnigeria.com/api/sandbox/v2`\n\n### Authentication\n**Option 1:** Use the default sandbox token (no registration required)\n```\nBearer sandbox_test_token_12345\n```\n\n**Option 2:** Use your real API token (if `SANDBOX_REQUIRE_AUTH=true`)\n```\nBearer your-api-token-here\n```\n\n## 🎯 Test Phone Numbers\n\nUse these special numbers to test specific scenarios:\n\n### Success Scenarios\n- `2348000000001` - Instant delivery\n- `2348000000002` - Sent (1s delay)\n- `2348000000003` - Pending (2s delay)\n\n### Network-Specific\n- `2348000001000` - MTN (3s delay)\n- `2347000001000` - Airtel (2.5s delay)\n- `2349000001000` - Glo (2s delay)\n\n### Error Scenarios\n- `2348000000404` - Processing failed (BSNG-4000)\n- `2348000000503` - Gateway unavailable (BSNG-4001)\n- `2348000000429` - Rate limit (BSNG-4003)\n- `2348000000422` - Invalid number (BSNG-2001)\n- `2348000000402` - Insufficient balance (BSNG-3000)\n\n## 🏷️ Pre-Approved Sender IDs\n\nThese sender IDs work automatically in sandbox:\n- SANDBOX\n- TEST\n- DEMO\n- TESTAPP\n- MYAPP\n\n**Note:** In sandbox mode, all sender IDs are accepted by default!\n\n## ✨ Features\n\n✅ Simulated SMS sending with realistic responses\n✅ Mock delivery reports\n✅ Test phone numbers for different scenarios\n✅ Simulated wallet balance (₦10,000)\n✅ No registration required (with default token)\n✅ Higher rate limits (120/min vs production 60/min)\n✅ Instant or configurable delays\n\n## 📋 All Responses Include\n```json\n{\n    \"sandbox_mode\": true,\n    \"note\": \"This is a simulated response\"\n}\n```\n\nAuthor: BulkSMS Nigeria\nVersion: 1.0\nEnvironment: Sandbox/Testing\nLast Updated: November 27, 2025",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"auth": {
		"type": "bearer",
		"bearer": [
			{
				"key": "token",
				"value": "{{sandbox_token}}",
				"type": "string"
			}
		]
	},
	"item": [
		{
			"name": "📱 SMS Testing",
			"description": "Test SMS sending without consuming credits",
			"item": [
				{
					"name": "Send Test SMS - Success",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Sandbox mode enabled\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData.data.sandbox_mode).to.eql(true);",
									"});",
									"",
									"pm.test(\"Message ID generated\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData.data.id).to.be.a('string');",
									"    pm.environment.set('test_message_id', jsonData.data.id);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"from\": \"SANDBOX\",\n    \"to\": \"2348000000001\",\n    \"body\": \"Test message from sandbox environment - instant delivery!\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{sandbox_base_url}}/sms",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"sms"
							]
						},
						"description": "Send a test SMS with instant delivery using special test number `2348000000001`."
					},
					"response": []
				},
				{
					"name": "Send Test SMS - Delayed Delivery",
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"from\": \"TEST\",\n    \"to\": \"2348000000002\",\n    \"body\": \"Test message with 1 second delay\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{sandbox_base_url}}/sms",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"sms"
							]
						},
						"description": "Test SMS with simulated 1-second processing delay."
					},
					"response": []
				},
				{
					"name": "Send Bulk SMS - Mixed Results",
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"from\": \"DEMO\",\n    \"to\": [\n        \"2348000000001\",\n        \"2348000000404\",\n        \"2348012345678\",\n        \"2348000000503\"\n    ],\n    \"body\": \"Bulk test message with mixed success/failure\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{sandbox_base_url}}/sms",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"sms"
							]
						},
						"description": "Send bulk SMS to multiple recipients including test numbers that will fail, demonstrating error handling."
					},
					"response": []
				},
				{
					"name": "Test Error - Processing Failed",
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"from\": \"SANDBOX\",\n    \"to\": \"2348000000404\",\n    \"body\": \"This will trigger a processing failure\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{sandbox_base_url}}/sms",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"sms"
							]
						},
						"description": "Test error response for SMS processing failure (BSNG-4000)."
					},
					"response": []
				},
				{
					"name": "Test Error - Insufficient Balance",
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"from\": \"SANDBOX\",\n    \"to\": \"2348000000402\",\n    \"body\": \"This will trigger insufficient balance error\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{sandbox_base_url}}/sms",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"sms"
							]
						},
						"description": "Test insufficient wallet balance error (BSNG-3000)."
					},
					"response": []
				},
				{
					"name": "Test Network-Specific - MTN",
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"from\": \"TESTAPP\",\n    \"to\": \"2348000001000\",\n    \"body\": \"Test MTN-specific routing with 3s delay\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{sandbox_base_url}}/sms",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"sms"
							]
						},
						"description": "Test MTN network routing with 3-second delay."
					},
					"response": []
				}
			]
		},
		{
			"name": "📊 Delivery Reports",
			"description": "Test delivery report retrieval",
			"item": [
				{
					"name": "Get Delivery Report",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{sandbox_base_url}}/delivery-reports/{{test_message_id}}",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"delivery-reports",
								"{{test_message_id}}"
							]
						},
						"description": "Get simulated delivery report for a message. Use message ID from previous send SMS request."
					},
					"response": []
				},
				{
					"name": "Get All Delivery Reports",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{sandbox_base_url}}/delivery-reports",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"delivery-reports"
							]
						},
						"description": "Get list of all delivery reports (simulated data)."
					},
					"response": []
				}
			]
		},
		{
			"name": "💰 Wallet & Balance",
			"description": "Test wallet and balance endpoints",
			"item": [
				{
					"name": "Get Sandbox Balance",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{sandbox_base_url}}/balance",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"balance"
							]
						},
						"description": "Get simulated wallet balance (default: ₦10,000).\n\n**Note:** This is sandbox balance only. Real wallet balance is not shown or affected."
					},
					"response": []
				},
				{
					"name": "Get Transaction History",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{sandbox_base_url}}/transactions?limit=20&page=1",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"transactions"
							],
							"query": [
								{
									"key": "limit",
									"value": "20"
								},
								{
									"key": "page",
									"value": "1"
								}
							]
						},
						"description": "Get simulated transaction history with pagination."
					},
					"response": []
				}
			]
		},
		{
			"name": "🏷️ Sender IDs",
			"description": "Test sender ID management",
			"item": [
				{
					"name": "List Sender IDs",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{sandbox_base_url}}/sender-ids",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"sender-ids"
							]
						},
						"description": "List all pre-approved sandbox sender IDs.\n\n**Pre-approved IDs:**\n- SANDBOX\n- TEST\n- DEMO\n- TESTAPP\n- MYAPP\n\n**Note:** All sender IDs are automatically approved in sandbox mode!"
					},
					"response": []
				}
			]
		},
		{
			"name": "👤 Account Info",
			"description": "Test account information endpoints",
			"item": [
				{
					"name": "Get Account Info",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{sandbox_base_url}}/account",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"account"
							]
						},
						"description": "Get simulated account information."
					},
					"response": []
				},
				{
					"name": "Get Usage Statistics",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{sandbox_base_url}}/account/usage?period=month",
							"host": [
								"{{sandbox_base_url}}"
							],
							"path": [
								"account",
								"usage"
							],
							"query": [
								{
									"key": "period",
									"value": "month",
									"description": "today, week, month, year"
								}
							]
						},
						"description": "Get simulated API usage statistics."
					},
					"response": []
				}
			]
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					"// Sandbox Pre-request Script",
					"console.log('🧪 SANDBOX MODE - No real SMS will be sent');",
					"console.log('📍 Endpoint:', pm.request.url.toString());",
					"",
					"// Verify sandbox token is set",
					"if (!pm.environment.get('sandbox_token')) {",
					"    console.warn('⚠️ Sandbox token not set! Using default: sandbox_test_token_12345');",
					"    pm.environment.set('sandbox_token', 'sandbox_test_token_12345');",
					"}"
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					"// Global Sandbox Test Script",
					"",
					"// Verify sandbox headers",
					"pm.test('Sandbox mode header present', function () {",
					"    pm.response.to.have.header('X-Sandbox-Mode');",
					"    pm.expect(pm.response.headers.get('X-Sandbox-Mode')).to.eql('true');",
					"});",
					"",
					"// Log response",
					"console.log('✅ Sandbox Response:', pm.response.code, pm.response.status);",
					"",
					"// Check if response indicates sandbox mode",
					"try {",
					"    var jsonData = pm.response.json();",
					"    if (jsonData.data && jsonData.data.sandbox_mode) {",
					"        console.log('🧪 Confirmed: Running in SANDBOX mode');",
					"    }",
					"} catch (e) {",
					"    // Not JSON or no sandbox indicator",
					"}"
				]
			}
		}
	],
	"variable": [
		{
			"key": "sandbox_base_url",
			"value": "https://www.bulksmsnigeria.com/api/sandbox/v2",
			"type": "string"
		},
		{
			"key": "sandbox_token",
			"value": "sandbox_test_token_12345",
			"type": "string"
		},
		{
			"key": "test_message_id",
			"value": "",
			"type": "string"
		}
	]
}
