What is the Mock Service?
The Mock Service is the quickest way to try Premium APIs before onboarding. It returns responses based on examples in the API specification and may also return error responses at random to help you test error handling.
Availability: The Mock Service is available for Premium APIs only. Regulatory APIs are not available in the mock environment.
Key capabilities
-
Try APIs without authentication
Get started quickly without onboarding steps. -
Example-based responses
Responses are mocked using examples defined in the API specification. -
Resilience testing
The service can randomly return error responses so you can validate that your client handles failures correctly. -
Use it where you work
Call the Mock Service from the Developer Portal UI, from API testing tools, or directly from your application.
How to use it?
Use it from the Developer Portal UI
- Open an API and go to the View Specification page, which displays the full interactive API reference.
- In the left-side navigation, select the API endpoint you want to test.
- Then click Test Request to open the built-in HTTP client.

- In the address bar at the top of the request panel, choose the URL starting with https://mock-api.danskebank.com/.

- Fill in any required query parameters or request body fields as shown in the API operation.
- Click Send and review the returned response body.

If the steps above differ from what you see on screen, look for a dropdown near the request URL — this is the server/environment selector where you switch to the Mock Service.
Use it from your own tools or application
- In the API Specification view, select the endpoint you want to test.
- Open the code snippet generator (top-right of the request panel) and copy the generated example — available as cURL, Python, JavaScript, and other languages.

- The snippet contains the correct Mock Service URL for that operation. Paste it into your API testing tool (for example, Postman) or your application.
- Make sure any required query parameters and request body are included.
Example — FX Trade Execution API (cURL):
curl -X POST "https://mock-api.danskebank.com/mock/sandbox/1.0.1/fx-trade-execution-api/v1/trade-service/trade-execution/execute" \
-H "Content-Type: application/json" \
-d '{
"tradeId": "TRADE654321",
"executionId": "EXEC654321",
"tradeTime": "2025-10-07T11:05:12Z",
"autoSettle": false,
"bought": { "amount": 500000, "currency": "EUR" },
"sold": { "amount": 540500, "currency": "USD" },
"spotPrice": 1.081,
"forwardPrice": 1.0816,
"maturityDate": "2025-10-14",
"product": "FX Forward"
}'
Mock Service URL
The Mock Service base URL follows this pattern:
https://mock-api.danskebank.com/mock/sandbox/{api-version}/{api-name}/{operation-path}
│ │ │ │ │ │
│ │ │ │ │ └─ operation path (from API spec)
│ │ │ │ └────────────── API name (e.g. fx-trade-execution-api)
│ │ │ └──────────────────────────── API version (e.g. 1.0.1)
│ │ └───────────────────────────────────── fixed: environment
│ └────────────────────────────────────────── fixed: mock service prefix
└───────────────────────────────────────────────────────────────────────── base domain
To avoid using an outdated or incorrect URL, always copy the URL from the Developer Portal:
- In the built-in HTTP client, the correct URL is pre-populated when you select Mock Service from the server selector.
- For non-UI usage, copy the generated code snippet from the API Specification page — it always contains the correct endpoint for the selected operation.
Expected behaviour and limitations
| Limitation | Detail |
|---|---|
| Premium APIs only | Regulatory APIs are not available in the mock environment |
| No authentication required | Mock only — do not use production credentials |
| Responses are example-based | Not real data; structure reflects specification examples |
| Validation is partial | Malformed requests may still return a response — always validate in the Sandbox environment before moving to Production |
| Random errors are intentional | Every mock response includes an x-mockdata-info header. Build retry and fallback logic into your client |
Next steps
- Use the Mock Service to validate request/response handling and basic client robustness.
- When you're ready for end-to-end testing, follow the onboarding guide to set up access, test your integration in the Sandbox environment, and then switch to Production once everything works as expected.
Is this helpful?
On This Page