Getting Started
Last updated: 2023-06-30
Prerequisites
Before you can use the Westpay Online API, you will need:
- A Westpay merchant account with API access enabled.
- A merchant subscription key (
Ocp-Apim-Subscription-Key) — provided by Westpay. - A bearer access token — obtained by authenticating against the Westpay identity service.
- At least one Westpay payment terminal that has been linked to your account.
Step 1 — Obtain Your Credentials
Contact your Westpay account manager or log in to the Westpay merchant portal to:
- Retrieve your subscription key.
- Generate or refresh your access token.
Step 2 — Choose Your Environment
The Online API is available in two environments:
| Environment | Base URL |
|---|---|
| Demo | https://demo-api.westpay.se/in-store/api/v1 |
| Production | https://api.westpay.se/in-store/api/v1 |
Always develop and test in the demo environment before switching to production. See Environments for full details.
Step 3 — Link a Terminal
Before sending payment requests, you must link a terminal to your merchant account using the Link Terminal endpoint. You will need the terminal's serial number.
Step 4 — Send Your First Payment Request
Once a terminal is linked, you can send a purchase request using the Create Payment Request endpoint.
A minimal request looks like:
json{ "amount": 0.00, "currencyCode": 0, "terminalId": "string", "paymentMethod": "string" }
Step 5 — Handle the Response
The API responds with an onlineAPIRefId that you can use to retrieve the transaction status or track the transaction in your system.
Support
If you run into issues during integration, contact us at support@westpay.se.