Skip to main content

Testing Your Strike Integration

Work through these checks in order. Each one isolates a different failure point, so the first one that fails tells you where the problem is.

Before You Start

The Hosted Platform Uses Strike Production

Strike offers a sandbox at https://api.dev.strike.me/v1, but the Strike API base URL on Lightning Enable's hosted platform is a platform-wide setting pointed at production. It is not selectable per merchant.

That means testing uses real mainnet Bitcoin. Use small amounts — $1 USD or a few hundred sats is enough to prove every step.

You need:

  • A Strike API key saved in Lightning Enable, with all three required scopes
  • Your Lightning Enable merchant API key
  • A Lightning wallet holding a small balance

Step 1: Validate the Key

curl -X POST https://api.lightningenable.com/api/merchant/validate-strike \
-H "X-API-Key: your-merchant-api-key"

This returns HTTP 200 whether or not the key works. Read the isValid field in the body — do not gate on the status code, and do not use curl -f here.

"isValid": true means Lightning Enable authenticated against Strike with your key. It does not mean your scopes are correct: validation reads your account profile and exercises none of the three required scopes. A scope gap shows up at Step 2 or Step 4 instead.

If isValid is false, the problem is the key itself — see API Keys.

Step 2: Create a Small Invoice

curl -X POST https://api.lightningenable.com/api/payments \
-H "X-API-Key: your-merchant-api-key" \
-H "Content-Type: application/json" \
-d '{
"orderId": "strike-test-001",
"amount": 1.00,
"currency": "USD",
"description": "Strike integration test"
}'

orderId is required and must be 1–100 characters. It is your own reference for the payment.

The response includes an invoice ID and a BOLT11 Lightning invoice.

If this fails, read the error before changing anything:

  • A validation error naming a field means the request body is wrong — Lightning Enable never contacted Strike, and your key is not the problem.
  • A provider error means Strike rejected the call. That is where a missing partner.receive-request.create scope surfaces.
Description Length

Strike accepts a description between 1 and 250 bytes on the invoice. Lightning Enable truncates longer descriptions rather than rejecting them, and substitutes a default when the description is blank.

Step 3: Pay the Invoice

Pay the BOLT11 invoice with your Lightning wallet. Payment settles in about a second.

Step 4: Confirm the Status Changed

curl -X GET https://api.lightningenable.com/api/payments/{invoiceId}/status

The status should read as paid. If it still reads unpaid a minute after your wallet confirms, the Strike webhook is not reaching Lightning Enable — see Webhooks.

Step 5: Confirm Your Callback Fired

If you configured a callback URL, check that your endpoint received a signed webhook and that your signature check passed. A delivery that arrives but fails verification is almost always a raw-body problem — see Verify the Signature.

Testing L402

If you are monetizing an API with L402, Strike is the provider you want. Strike returns the payment preimage on outgoing payments, which matters when an agent pays from your balance. Receiving L402 payments works on either provider — challenge creation and verification are provider-agnostic, and verification compares SHA256(payer's preimage) against the payment hash without asking your provider for anything.

To see the protocol shape before wiring your own endpoint, request the public demo:

curl -i https://api.lightningenable.com/l402/test/ping

You get a 402 Payment Required with a challenge containing a macaroon and an invoice. Pay it, then retry with the token:

curl -i https://api.lightningenable.com/l402/test/ping \
-H "Authorization: L402 {macaroon}:{preimage}"
This Endpoint Does Not Test Your Account

/l402/test/ping mints and verifies against Lightning Enable's own test merchant. It does not read your API key, your Strike key, or your configuration — the route skips authentication entirely.

A 200 here proves the protocol works, not that your setup works. It succeeds even if you have no Strike key saved, and it can return 503 for reasons that have nothing to do with your account.

To test your own L402 configuration, create a proxy or a producer challenge on your own merchant and pay that. See Agentic Commerce.

One Payment Cycle at a Time

Finish one 402 to payment to access cycle before starting the next. Running L402 payments concurrently during testing makes failures much harder to attribute.

What to Check Before Going Live

  • Key validates, and all three scopes are granted
  • An invoice is created and paid successfully
  • Payment status updates without manual intervention
  • Your callback receives webhooks and signature verification passes
  • Your webhook handler is idempotent against duplicate deliveries
  • Your handler returns 2xx promptly and does slow work afterward
  • For L402: a paid token grants access and an unpaid request is refused

Troubleshooting

Invoice Is Created but Never Settles

Confirm you paid the BOLT11 invoice rather than an expired copy. Lightning invoices expire; create a fresh one and retry.

Status Stays Unpaid After a Confirmed Payment

The Strike webhook is not arriving. Confirm the partner.webhooks.manage scope, then create another payment to trigger re-registration.

L402 Returns 503

A 503 with challenge_persist_failed means Lightning Enable could not durably record the challenge and deliberately issued no invoice. You were not charged. Retry, and if it persists, the platform is reporting a storage fault rather than a problem with your configuration.

L402 Returns 414

Your resource path exceeds the 848-character limit for a resource identifier. Shorten the path.

If Something Does Not Add Up

You do not have to work through this alone. Email support@lightningenable.com with the step you are on and what you are seeing — including the correlation ID if you have one — and we will help you finish the integration. We would rather hear from you before your first real payment than after.

Next Steps