# Accept crypto payments with payitgo

payitgo is a crypto payment gateway. Your server creates a payment, your
customer pays it in stablecoins or crypto on a checkout page, and payitgo tells
your server, with a signed notification (IPN), when the money has arrived and
is final. The money is then sent to your own wallet, or kept in your payitgo
balance until you withdraw it.

**Base URL:** `https://api.payitgo.co`

## How a payment flows

```
 your server              payitgo                       your customer
     │                      │                               │
     │ 1. POST /v1/payments │                               │
     │─────────────────────▶│                               │
     │◀─ payment + checkout_url                             │
     │                      │                               │
     │ 2. redirect to checkout_url ────────────────────────▶│
     │                      │◀──── 3. pays to the address ──│
     │                      │  (watches the chain)          │
     │◀─ 4. webhook: payment.detecting                      │
     │◀─ 4. webhook: payment.confirmed                      │
     │ 5. verify signature, mark the order paid, answer 200 │
     │                      │                               │
     │◀─ 6. webhook: settlement.completed (money in your wallet)
```

1. **Your server creates a payment** with `POST /v1/payments`: your order id,
   the amount in US dollars and, if you like, the coin. payitgo returns a
   payment with a one-time deposit address, the exact crypto amount at a locked
   rate, and a `checkout_url`.
2. **You send the customer to `checkout_url`** (or show the address, amount and
   QR code on [your own page](/docs/checkout#your-own-payment-page)). They have 15 minutes to pay once the coin is set.
3. **The customer pays.** payitgo watches the chain: the payment becomes
   `detecting` as soon as the money is seen, and `confirmed` once the network
   has enough confirmations.
4. **payitgo notifies your server** with a webhook (IPN) at each step, signed
   with your webhook secret.
5. **Your server verifies the signature** and, on `payment.confirmed`, marks
   the order paid.
6. **The money is settled**, less payitgo's service fee and the network fee:
   sent to your wallet within minutes (direct settlement), or added to your
   balance (custody).

## Webhooks are payitgo's IPN

If you know them as IPNs: yes, payitgo has IPNs and a signing key.
payitgo's **webhooks** are its IPN, and the **webhook secret** is the
signing key. Every notification carries an `X-Webhook-Signature` header, an
HMAC-SHA256 you check with that secret. Each mode (test, live) has one webhook
URL and one secret, and each payment can name its own `webhook_url`, a
callback URL for that payment alone. See [Webhooks (IPN)](/docs/webhooks).

## Test mode and live mode

Every account has a test key and a live key:

| Key | Mode | Money | Webhook |
|---|---|---|---|
| Test key | Test | No coins: you simulate what the customer pays, nothing real moves | The test webhook URL and its own secret |
| Live key | Live | Real coins on mainnet | The live webhook URL and its own secret |

A key's text does not say its mode: the dashboard shows each key with a Test
or Live badge, and the key object's `livemode` says it
([Authentication](/docs/authentication#test-keys-and-live-keys)).

The API is the same in both: build and test your whole integration with the
test key, then swap in the live key and the live webhook secret. New accounts
start in test mode; the account owner turns live mode on when ready. See
[Test mode](/docs/testing).

## Supported coins

USDT (Tron, Ethereum, BNB Smart Chain), USDC (Ethereum, BNB Smart Chain), TRX,
ETH, BNB, BTC, LTC, DOGE and XRP, in both modes. See
[Currencies](/docs/currencies) for minimums and confirmation times.

## Where to find what

| I want to… | Read |
|---|---|
| Take my first test payment, end to end | [Quickstart](/docs/quickstart) |
| Use a library (Node.js, Python, PHP, Go, Dart) | [Libraries](/docs/sdks) |
| Send my API key correctly, manage keys | [Authentication](/docs/authentication) |
| Know every field of a payment, every status, every error | [Payments](/docs/payments) |
| Send customers to the hosted page | [Checkout](/docs/checkout) |
| Show the checkout in a modal in my React app | [React checkout widget](/docs/sdk-react) |
| Show the amount, address and QR code on my own page, in my own design | [Your own payment page](/docs/checkout#your-own-payment-page) |
| Receive and verify IPN notifications | [Webhooks (IPN)](/docs/webhooks) |
| Know which coins and networks are supported | [Currencies](/docs/currencies) |
| Understand fees, minimums and where my money goes | [Fees and settlement](/docs/settlement) |
| Test every scenario before going live | [Test mode](/docs/testing) |
| Manage my team, settings, balances and payouts | [Account and team](/docs/account) |
| Handle errors, rate limits and retries | [Errors and limits](/docs/errors) |

Every page is also available as Markdown: add `.md` to its address, for
example [`/docs/payments.md`](/docs/payments.md).
