Quickstart
You will create a sandbox API key, create a payment link, pay it in the sandbox, and read the payment back.
1. Create an account#
Sign up at merchant.olympuspay.co. You do not need to finish business verification to use the sandbox.
2. Create a sandbox API key#
In the dashboard open Developers, then API keys, then Create key and choose Sandbox. Copy the key when it is shown: it starts with olp_test_ and is displayed once. Store it as an environment variable, never in source control or in a browser.
export OLYMPUS_API_KEY="olp_test_..."3. Make your first request#
Check that the key works:
curl https://merchant.olympuspay.co/api/v1/account \
-H "Authorization: Bearer $OLYMPUS_API_KEY"
const res = await fetch('https://merchant.olympuspay.co/api/v1/account', {
headers: { Authorization: `Bearer ${process.env.OLYMPUS_API_KEY}` },
})
console.log(res.status, await res.json())
import os, requests
res = requests.get(
"https://merchant.olympuspay.co/api/v1/account",
headers={"Authorization": f"Bearer {os.environ['OLYMPUS_API_KEY']}"},
timeout=30,
)
print(res.status_code, res.json())A 200 means your key is valid. A 401 means it is missing, wrong, revoked, expired or used from an IP address the key does not allow. See Authentication.
4. Create a payment link#
curl https://merchant.olympuspay.co/api/v1/payment-links \
-X POST \
-H "Authorization: Bearer $OLYMPUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Order 1001",
"amount": 250.00,
"currency": "BWP",
"idempotencyKey": "order-1001"
}'
const res = await fetch('https://merchant.olympuspay.co/api/v1/payment-links', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.OLYMPUS_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ title: 'Order 1001', amount: 250.0, currency: 'BWP', idempotencyKey: 'order-1001' }),
})
console.log(res.status, await res.json())
import os, requests
res = requests.post(
"https://merchant.olympuspay.co/api/v1/payment-links",
headers={"Authorization": f"Bearer {os.environ['OLYMPUS_API_KEY']}"},
json={"title": "Order 1001", "amount": 250.00, "currency": "BWP", "idempotencyKey": "order-1001"},
timeout=30,
)
print(res.status_code, res.json())The response contains the link's id and the payUrl to send your customer to. Running the request again with the same idempotencyKey returns the same link.
5. Pay it#
Open the payUrl in a browser. Because the link was created with a sandbox key, it shows a sandbox confirmation page instead of a real card form. Choose Succeeded or Failed. No money moves.
6. Read the payment back#
curl "https://merchant.olympuspay.co/api/v1/payments?limit=5" \
-H "Authorization: Bearer $OLYMPUS_API_KEY"You will see the payment with status of succeeded (or failed) and amount in minor units.
7. Receive an event instead of polling#
Register an HTTPS endpoint with POST /webhooks and Olympus Pay will call it when the payment changes state. See Webhooks, including how to verify the signature.
8. Go live#
When you are ready for real money, finish business verification and create a live key: Go live.