Developers
Use the Lucky Landing API
Read checkout payments from your server with an organization API key. You can try both requests below before your store has taken its first payment.
Browse the API reference · Download OpenAPI
As an owner or admin, sign in to the organization you want to read. Open Settings → API keys → Create key, name the integration, and choose Read everything. During the invite-only beta, you can join the waitlist for an account.
Copy the secret when it appears and save it in your server’s secret manager as LUCKYLANDING_API_KEY. Load that variable into the shell running the examples. Keep it out of browser code and source control.
Set the API address for the environment where you created the key. This example uses the API for this site’s environment.
export LL_API=https://api.luckylanding.io Use https://api-staging.luckylanding.io for a staging key and https://api.luckylanding.io for a production key.
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $LUCKYLANDING_API_KEY" \
"$LL_API/v1/credential" A successful response has "type": "credential" and an operations array. Look for listPayments before making the next call. These names match the operation IDs in the reference.
Fetch the five most recent payments your key can read. This request only reads payment records.
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $LUCKYLANDING_API_KEY" \
"$LL_API/v1/payments?limit=5" An organization with no visible payments receives:
{"data":[],"has_more":false,"first_id":null,"last_id":null} When has_more is true, add &after_id= followed by this page’s last_id to the same URL. Stop when has_more is false.
Read the JSON response’s code and detail. For a 401, check the key, its expiry and the environment. For a 403, check the operation’s required access and the store or project your credential can reach.
For a 429, wait the number of seconds in the Retry-After header before repeating the read. Add -i to curl to see response headers, including the request-id to share with support. If a create request times out, check whether the object exists before sending it again.