Skip to content

Postman Collection

Use our official Postman collection to quickly test all ShipYo API endpoints. The collection includes automatic token management, automated tests, and pre-configured variables for different environments.

Postman Collection

Download the complete Postman collection to test the ShipYo API

Complete Collection

Postman collection with all ShipYo API endpoints organized by category.

All endpointsAutomatic testsJWT token managementPre-request scripts
Download Collection

Environment File

ShipYo API

Environment file with pre-configured variables for quick testing.

URL: https://shipyo.itExample credentials included
Download Environment

Quick Setup

  1. Import the collection: Download and import the collection file into Postman
  2. Import the environment: Download and import the environment file
  3. Configure variables:api_key, user_email, user_password
  4. Start testing: Run login and test the endpoints!

Includes collection + environment file

What's Included in the Collection

Organized by Categories

  • Authentication - Login, token generation, password reset
  • User Management - Complete user CRUD operations
  • Tenant Management - Multi-tenancy tenant management
  • API Key Management - API key management
  • Getting Started - Simplified 3-step workflow

Automated Features

  • JWT Token Management - Automatic extraction and storage of tokens
  • Variable Population - IDs and values automatically extracted from responses
  • Pre-request Scripts - Automatic variable setup
  • Response Tests - Automatic response validation
  • Error Handling - Error management with detailed logging

Environment File

The collection includes a single environment file with:

  • Base URL: https://shipyo.it
  • Pre-filled values for immediate testing
  • Example credentials included for quick setup
  • All necessary variables for API testing

Quick Setup

1. Import into Postman

  1. Open Postman and go to Import
  2. Drag the downloaded files into the import window
  3. Confirm the import of collection + environment

2. Environment Configuration

Select the "ShipYo API" environment from the dropdown in the top right and configure:

VariableDescriptionExample
api_keyYour ShipYo API Keyak_1234567890abcdef
user_emailEmail for loginadmin@example.com
user_passwordPassword for loginpassword123
tenant_idTenant ID1

3. First Test

  1. Run "User Login" to get a JWT token
  2. The token is automatically saved in environment variables
  3. Try any endpoint - authentication is handled automatically

Authentication Types

The collection automatically handles three types of authentication:

Anonymous Endpoints

  • No authentication required
  • Only Content-Type and Accept headers
  • Examples: Login, Password Reset

API Key Only Endpoints

  • Only x-api-key header required
  • For basic operations without user context
  • Examples: Generate Token from API Key

JWT Protected Endpoints

  • x-api-key + Authorization: Bearer <token> headers
  • For operations requiring user context
  • Examples: User Management, Tenant Operations
mermaid
graph LR
    A[Import Collection] --> B[Import Environment]
    B --> C[Configure api_key]
    C --> D[Run Login]
    D --> E[Test Endpoints]

Automatic Variables

The collection automatically populates these variables:

From Login Responses

  • jwt_token - JWT token for authentication
  • user_role_id - User role ID
  • user_role_name - Role name
  • default_tenant_id - Default tenant (for Admin users)

From List Responses

  • sample_user_id - ID of the first user in the list
  • sample_tenant_id - ID of the first tenant
  • sample_api_key_id - ID of the first API key

From Creation Operations

  • created_user_id - ID of the newly created user
  • created_tenant_id - ID of the newly created tenant
  • created_api_key - Newly generated API key
  • subscription_id - ID of the created subscription

Advanced Features

Pre-request Scripts

javascript
// Auto-setup pagination variables
if (!pm.environment.get("page")) {
    pm.environment.set("page", "1");
}

// Logging for debugging  
console.log("Environment: " + pm.environment.name);
console.log("API Key: " + (pm.environment.get("api_key") ? "[PRESENT]" : "[MISSING]"));

Automatic Test Scripts

javascript
// Status code validation
pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
});

// JWT token extraction
if (jsonData.success && jsonData.data && jsonData.data.token) {
    pm.environment.set("jwt_token", jsonData.data.token);
}

Debugging and Troubleshooting

Console Logging

The collection includes automatic logging for:

  • Current environment variables
  • Presence/absence of credentials
  • API response errors
  • JWT token status

Common Errors

401 Unauthorized

json
{
  "success": false,
  "message": "API Key is missing."
}

Solution: Verify that api_key is configured in the environment

403 Forbidden

json
{
  "success": false,  
  "message": "Invalid API Key."
}

Solution: Check that the API key is valid and active

JWT Token Expired

Solution: Run login again - the token will be automatically updated

Best Practices

Security

  • Never commit environment files with real credentials
  • Keep your API keys secure and rotate them regularly
  • Use separate environments for different projects

Testing

  • Configure variables before starting
  • Test authentication first with the login endpoint
  • Check logs in case of errors

Maintenance

  • Update the collection when the API changes
  • Synchronize variables across teams
  • Document custom configurations

Support

For issues with the Postman collection:

  1. Check the logs in the Postman console
  2. Verify environment variables are configured correctly
  3. Test authentication endpoints first
  4. Consult the API documentation for specific details

The Postman collection is the quickest way to get started with the ShipYo API!