Test environment
You cannot build checkout autofill or a rider screen against a Pin you do not have. A real Pin belongs to a real customer, so you would wait for one to hand you theirs.
The test environment gives you a test Pin in each target country. A test Pin always returns complete sample data, so you can check your app handles every field a Pin can return.
The test Pins
| Test Pin | Country | Sample address |
|---|---|---|
JM:TEST01 | Jamaica | Hope Road 16, Half Way Tree, Kingston |
NG:TEST01 | Nigeria | Broad Street 103, Lagos Island, Lagos |
DK:TEST01 | Denmark | Nørrebrogade 12, 3. th, 2200 København N |
The addresses, names and phone numbers are invented. A test Pin is not a real place.
Look one up
Use the same call as for any Pin, with any valid API key:
curl https://api.vayapin.com/v1/pins/DK:TEST01 \
-H "Authorization: Bearer $VAYAPIN_API_KEY"
See GET /v1/pins/{id} for the full response. A test Pin returns:
- Every field filled. Name, phone, email, website, WhatsApp, the full address, a business address, location and QR code. Nothing is password-protected.
- The same response shape as a real Pin. Your plan does not hide any field of a test Pin. On a real Pin, the fields you get, such as email or website, depend on the Pin owner's plan, not yours. The QR code has no
id. - Local data. The address follows the country's format and the phone number is in the country's format.
"test": true. Real Pins return"test": false.
Quota and keys
- A test Pin lookup does not count against your quota. It succeeds even when your account is at or over its limit.
- You still need a valid API key. A missing or invalid key returns
401. - Other names that look like test Pins, such as
DE:TEST01, are not test Pins. They return404and count against your quota like any lookup.
Trigger a test webhook
You learn that a customer changed their Pin only from a webhook. To test your handler without waiting for a customer, ask VayaPin to send one for a test Pin:
curl -X POST https://api.vayapin.com/v1/pins/JM:TEST01/test_webhook \
-H "Authorization: Bearer $VAYAPIN_API_KEY"
VayaPin sends a pin.address_updated event to every enabled webhook endpoint of your account and answers 202:
{
"data": [
{
"event_id": "0b6c2f4e-8d1a-4c3b-9e7f-1a2b3c4d5e6f",
"event_type": "pin.address_updated",
"url": "https://yourstore.example.com/webhooks/vayapin"
}
]
}
- The event is a real event. It has the same payload, signature, headers and retries as any
pin.address_updatedevent. See Receiving webhooks. - It is marked as a test. The payload has
"test": trueand"request_id": null. Real events have"test": false. - Each call sends a new event with a new
event_id. To test deduplication, answer the first delivery with a5xxand VayaPin retries it with the sameevent_id. - A trigger does not count against your quota.
| Status | error.code | Meaning |
|---|---|---|
| 422 | not_a_test_pin | The id is not a test Pin. You cannot trigger an event for a real Pin. |
| 422 | webhook_endpoint_missing | Your account has no enabled webhook endpoint. Register one in the dashboard first. |
Never send a rider to a test Pin
A person can type a test Pin into a real checkout. Check test on every Pin you look up, and refuse to ship to one where it is true:
const { data } = await response.json();
if (data.test) {
throw new Error("This is a test Pin. Ask the customer for their own Pin.");
}
What a test Pin cannot do
- It never expires.
- Nobody can claim, edit or delete it, through the API or the dashboard.
- It does not appear on the map, in search or in any public listing.
- No customer can register the names
TEST01toTEST99.