5-minute Quickstart

From creating an API key to seeing your first Sandbox payment show up in the dashboard — every step here is a real API call you can run as-is.

View as Markdown
Want an AI to do the integration? Add the MCP server to Claude, Cursor or VS Code; for SDK usage see Framework Integration.

1. Create a test key

Dashboard → Developers → API Keys, create a key with products:write, prices:write, payment_links:write scopes. Details in Get an API key.

2. Set env vars

REBATE_PAY_API_KEY=rbp_test_...
REBATE_PAY_BASE_URL=https://revopay-dev.zeabur.app

3. Create a product and a price

curl -sS -X POST "$REBATE_PAY_BASE_URL/api/Product" \
  -H "Authorization: Bearer $REBATE_PAY_API_KEY" -H "Content-Type: application/json" \
  -d '{"name":"My first product"}'

# Using the product id from the response:
curl -sS -X POST "$REBATE_PAY_BASE_URL/api/Price" \
  -H "Authorization: Bearer $REBATE_PAY_API_KEY" -H "Content-Type: application/json" \
  -d '{"productId":"prod_...","currency":"TWD","amount":200,"type":"OneTime"}'
TWD has zero decimal places: amount is the TWD value itself (200 = NT$200), not an integer in a cents-style minor unit.

4. Create a Payment Link and redirect to Hosted Checkout

The simplest way to get paid: create a Payment Link and send the customer to ReBate Pay's own hosted checkout page — you don't build any checkout UI yourself.

curl -sS -X POST "$REBATE_PAY_BASE_URL/api/PaymentLink" \
  -H "Authorization: Bearer $REBATE_PAY_API_KEY" -H "Content-Type: application/json" \
  -d '{"name":"My first payment","priceId":"price_..."}'
# Response includes url: "/pay/{token}" — redirect the customer to "$REBATE_PAY_BASE_URL" + url

5. Complete the payment in Sandbox

  1. 1Open the checkout URL from the previous step.
  2. 2Enter an email and name.
  3. 3Pick "success" in the test-result selector.
  4. 4Confirm payment — the page shows "Payment succeeded".

6. Confirm it synced

Back in the merchant dashboard's Transactions page, you should see that same payment. The dashboard and your own integration read the exact same data — not two separate systems.

7. Next: wire up webhooks

The flow above relies on eyeballing the dashboard. A real integration should listen for webhooks instead (e.g. payment.succeeded) so your system learns the outcome reliably and in real time, without polling.