Quickstart
Go from credentials to your first response in about five minutes. You will create an API key, exchange it for an access token, and read an order from the test environment.
Before you startβ
You need:
- Access to the test Merchant Hub at merchanthub.aks.uat.walleydev.com with permission to manage access
- An order id from the test environment. Pick one in Merchant Hub, or take the
OrderIdfrom awalley:order:createdwebhook - A terminal with
curl
Every example below points at the test environment. Production has its own Merchant Hub, hostnames, and scope, and keys from one environment do not work in the other. See Merchant Hub environments and Endpoints for test and production.
1. Create an API keyβ
In the test Merchant Hub, open the menu under your name in the top right and select Manage access. Select Create +, then API key. Fill out the form and select Create.
Copy the client id and secret into a password manager before you close the dialog.
Walley cannot recover a lost secret. If you lose it, create a new key.
2. Get an access tokenβ
Exchange the client id and secret for a token. Replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET
with your own values.
curl -X POST https://api.uat.walleydev.com/oauth2/v2.0/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "scope=705798e0-8cef-427c-ae00-6023deba29af/.default"
You get back a token and its lifetime in seconds:
{
"token_type": "Bearer",
"expires_in": 3599,
"ext_expires_in": 3599,
"access_token": "bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE..."
}
Cache the token and reuse it until expires_in runs out. To get a new one, repeat the same
request. For the full flow, see Authentication.
3. Read an orderβ
Call the Get order endpoint with the token in an Authorization header.
curl https://api.uat.walleydev.com/manage/orders/YOUR_ORDER_ID \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
A 200 OK response carries the order under data:
{
"data": {
"id": "853f3f82-ab12-47c3-9d97-af17009852cd",
"reference": "MX_220921_111434",
"paymentMethod": "Invoice",
"totalAmount": 2459.49,
"currency": "SEK",
"status": "Activated",
"salesSegment": "B2C",
"countryCode": "SE",
"customer": {},
"items": [],
"invoices": []
},
"links": {},
"metaData": {}
}
The status field decides what you can do next. See Order lifecycle.
Where to go nextβ
| You want to | Read |
|---|---|
| Know which actions an order allows | Order lifecycle |
| Understand why a change is not visible yet | Asynchronous operations |
| Confirm a shipment and trigger payout | Capture order |
| Give money back | Refund order |
| Change an order before shipping | Reauthorize order |
| Handle a failed request | Errors |