Skip to content

Get your first payment

This walks you through the entire integration loop once: create a payment, check its status, and verify the webhook telling you it completed. Every example on this page uses test mode keys and settles nothing real — safe to run exactly as written.

  1. From your dashboard, create a store and issue a secret key. You’ll get a public API key (pk_test_…) and a secret key (sk_test_…, shown once — save it). Every Store API call authenticates with both, as HTTP Basic auth: Authorization: Basic base64(apiKey:secretKey).

  2. Terminal window
    API_KEY="pk_test_3f9c...b2"
    SECRET_KEY="sk_test_7ac1...e40f9b"
    curl -s https://api.sendchain.example/v1/store-api/payments \
    -u "$API_KEY:$SECRET_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "asset": "USDC",
    "chain": "base",
    "amount": { "minor": 500, "currency": "USD" }
    }'

    You’ll get back a 201 with an id, a receiving address, and a payAmount — everything you need to show the payer a QR code or deep link. See Create a payment for every field.

  3. On the local/staging test network, send the exact payAmount shown in the response to address. In test mode this uses testnet funds, never real money — see your environment’s test-funding instructions.

  4. Poll for status (optional — webhooks arrive faster)

    Section titled “Poll for status (optional — webhooks arrive faster)”

    GET /v1/store-api/payments/{id} with the same Basic auth returns { "id": "...", "status": "...", "confirmations": N }. Useful for a manual check, but the webhook below is the reliable signal.

  5. Once your store account has a webhook endpoint registered and subscribed to payment.completed, Tribute POSTs a signed event to it the moment this payment clears:

    Terminal window
    # Illustrative — verification happens in your receiver's code. Given a
    # received body $BODY and header "Tribute-Signature: t=…,v1=…":
    SIGNED_PAYLOAD="${TIMESTAMP}.${BODY}"
    EXPECTED=$(printf '%s' "$SIGNED_PAYLOAD" | openssl dgst -sha256 -hmac "$ENDPOINT_SECRET" | sed 's/^.* //')
    # Compare $EXPECTED against each v1= value in the header.

    Full header format, retry behavior, and every event’s payload shape are in the Webhooks overview.

That’s the whole loop. From here: browse the API Reference for every field and error case, or the Webhooks section for every event type you can subscribe to.