> ## Documentation Index
> Fetch the complete documentation index at: https://doc.gopay.et/llms.txt
> Use this file to discover all available pages before exploring further.

# Payment Acceptance Quick Start

> Get up and running with payment acceptance in minutes

## Prerequisites

* **Merchant Account**: Contact sales for a GoPay merchant account
* **API Key Pair**: Create an Ed25519 key pair with the `c2b` permission — see [Authentication](/getting-started/authentication#api-keys)
* **Server Environment**: A backend to securely sign and send API requests — never sign requests in a browser or mobile app

## Implementation Steps

<Tabs>
  <Tab title="Step 1: Sign the Request">
    Every request is authenticated with a detached Ed25519 signature sent in HTTP headers (`X-Public-Key`, `X-Signature`, `X-Timestamp`, `X-Request-ID`) — nothing auth-related goes in the JSON body.

    The full scheme, including ready-to-use signing helpers in Node.js, Python, and Go, is on the [Authentication](/getting-started/authentication) page. In short:

    1. Hash your exact request body bytes with SHA-256
    2. Build the [v1 canonical string](/getting-started/authentication#the-canonical-string-v1) from the method, host, path, timestamp, request ID, and body hash
    3. Sign it with your Ed25519 private key and send `X-Signature: ed25519=<base64>`

    Also send the optional `Idempotency-Key` header if you retry on network errors.
  </Tab>

  <Tab title="Step 2: Create Payment">
    Send a POST request to `/api/v1/initiate-payment`:

    | Parameter     | Type   | Required | Description                                             |
    | ------------- | ------ | -------- | ------------------------------------------------------- |
    | `merchantId`  | string | Yes      | Your merchant ID                                        |
    | `amount`      | number | Yes      | Payment amount (> 0)                                    |
    | `currency`    | string | Yes      | Currency code (see supported list in the API reference) |
    | `phoneNumber` | string | Yes      | Customer phone number (10–15 digits, optional `+`)      |
    | `successUrl`  | string | Yes      | HTTPS URL to redirect after successful payment          |
    | `failUrl`     | string | Yes      | HTTPS URL to redirect after failed payment              |
    | `notifyUrl`   | string | Yes      | HTTPS URL for the settlement webhook                    |

    All three URLs must be absolute HTTPS URLs — plain HTTP is rejected.
  </Tab>

  <Tab title="Step 3: Redirect to Checkout">
    On success the API returns:

    ```json theme={null}
    {
        "checkoutUrl": "https://checkout.gopay.example.com/?token=eyJhbGciOi...",
        "sessionId": 12345
    }
    ```

    1. Redirect your customer to `checkoutUrl` to complete the payment
    2. Store `sessionId` for correlation and support
    3. After completion the customer is redirected to your `successUrl` or `failUrl`
    4. The authoritative settlement result arrives as a signed webhook on your `notifyUrl` — see [C2B Callbacks](/webhooks/c2b-callbacks)
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/receive-payments/api-reference">
    Full request/response contract and validation rules
  </Card>

  <Card title="Code Examples" icon="file-code" href="/receive-payments/examples">
    Complete initiate-payment calls in Node.js, Python, and Go
  </Card>
</CardGroup>
