Testing with Postman Collection
To help you test the Trustist Ecommerce API efficiently, we provide a Postman collection that you can import and use to send requests to our API. Postman is a popular API testing tool that allows you to easily create, save, and execute HTTP requests with proper authentication.
Sandbox Environment Setup
Before you start testing, you need to set up a sandbox account. The sandbox environment allows you to test your integration without processing real payments.
Creating a Sandbox Account
- Visit https://sandbox.trustisttransfer.com
- Click on the "Sign up now" link on the login screen
- If you already have a live TrustistTransfer account, you can use the same login details
- Note: Sandbox and live accounts are completely separate
Getting Sandbox API Keys
- Log in to your sandbox account
- Navigate to Settings โ API Keys
- Generate your sandbox API key pair (public ID and private key)
Test Bank Accounts
The sandbox includes test bank accounts for simulating different payment scenarios:
Mock Redirect Bank
Use this for simple payment completion testing. It immediately returns success without user interaction. Select "Mock Redirect Bank" when prompted during payment flow.
Lloyds Bank Test Account
Use this when testing standing orders or account verification. Test credentials:
- Username:
llr001 - Password:
Password123
Getting Started with Postman
Step 1: Install Postman
If you haven't already, download and install Postman from https://www.postman.com/downloads/.
Step 2: Import the Collection
- Open Postman and click the "Import" button in the top left corner
- Download the TrustistEcommerce API Postman collection
- Click "Import" to confirm the import
- The collection will appear in your Postman workspace
Step 3: Configure Environment Variables
Before sending requests, you need to set up environment variables:
- Click the gear icon in the top right corner to open "Manage Environments"
- Create a new environment
- Add the following variables:
| Variable | Description | Example Value |
|---|---|---|
client-id |
Your Client ID (also known as the merchant ID or the public component of your API key) | abc123-def456-ghi789 |
client-key |
Your Private Key (the secret component of your API key) | your-private-key-here |
trustistecommerce-api-host |
The API host URL |
Sandbox: https://api-sandbox.trustistecommerce.comProduction: https://api.trustistecommerce.com
|
https://api-sandbox.trustistecommerce.com)
when testing your integration. Only switch to production once your integration is fully tested and ready.
Step 4: Select Your Environment
Select the environment you just created from the dropdown menu in the top right corner of Postman. This ensures all requests use the correct API host and credentials.
Step 5: Test an Endpoint
- Expand the TrustistEcommerce API collection
- Select an endpoint (e.g., "Create Payment")
- Ensure the request is using Hawk authentication with the correct credentials
- Review the request body and modify as needed
- Click "Send" to execute the request
- View the response below the request
Using Hawk Authentication in Postman
Postman has native support for Hawk authentication. To configure it:
- Select a request from the collection
- Go to the Authorization tab
- Select Hawk Authentication from the "Type" dropdown
- Configure the Hawk settings:
- Hawk Auth ID:
{{client-id}} - Hawk Auth Key:
{{client-key}} - Algorithm: sha256
- Hawk Auth ID:
For more details on Hawk authentication, see the Postman Hawk Authentication documentation or our Authentication guide.
Pre-defined Tests
The Postman collection includes pre-defined tests for some requests. After sending a request, check the "Test Results" tab below the response to see if the tests passed or failed.
These tests help you verify:
- HTTP status codes are correct (200, 201, 400, etc.)
- Response structure matches the expected format
- Required fields are present in responses
- Authentication is working correctly
Environment Comparison
| Feature | Sandbox | Production |
|---|---|---|
| API Host | https://api-sandbox.trustistecommerce.com |
https://api.trustistecommerce.com |
| Real Money | โ No | โ Yes |
| Test Credentials | โ Available from sandbox account | โ Use live merchant credentials only |
| Webhooks | โ Delivered to your test endpoints | โ Delivered to your production endpoints |
| Rate Limiting | More relaxed | Standard limits apply |
Common Testing Workflows
Testing Payment Creation
- Use the "Create Payment" endpoint in the collection
- Modify the request body with your test data
- Send the request and note the
paymentIdandredirectUrlin the response - Visit the
redirectUrlin a browser to complete the payment flow - Use the "Retrieve Payment" endpoint to check the payment status
Testing Standing Orders
- Use the "Create Standing Order" endpoint
- Configure the frequency (WEEKLY, MONTHLY, etc.)
- Send the request and note the
standingOrderIdandmandateLink - Visit the
mandateLinkto complete the Direct Debit mandate setup - Use the "Retrieve Standing Order" endpoint to check the status
Testing Webhooks
To test webhook delivery during development:
- Set up a webhook endpoint using a tool like webhook.site or ngrok
- Configure the webhook URL in your TrustistTransfer portal (Settings โ API Keys)
- Create a payment or standing order using Postman
- Complete the payment/mandate flow
- Verify that the webhook is delivered to your test endpoint
For more details on webhooks, see our Payment Webhooks guide.
Troubleshooting
Authentication Errors
Symptom: 401 Unauthorized responses
Solutions:
- Verify your
client-idandclient-keyare correct - Ensure you're using the correct environment (sandbox vs production)
- Check that Hawk authentication is properly configured
- Verify the algorithm is set to
sha256
Invalid Request Errors
Symptom: 400 Bad Request responses
Solutions:
- Check the request body matches the expected format
- Ensure all required fields are present
- Verify data types (numbers as numbers, strings as strings)
- Check the API documentation for the specific endpoint
Network Errors
Symptom: Unable to connect or timeout errors
Solutions:
- Verify the
trustistecommerce-api-hostvariable is correct - Check your internet connection
- Ensure your firewall isn't blocking the requests
- Try accessing the API host URL directly in a browser
Next Steps
- Follow the Quick Start guide for a complete workflow example
- View the API Reference for detailed endpoint documentation
- Set up Payment Webhooks for real-time notifications
- Read the Authentication guide for implementation details