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

# Quickstart

> Accept your first payment in under 5 minutes

## Prerequisites

Before you start, make sure you have:

<CardGroup cols={2}>
  <Card title="Yabetoo Account" icon="user">
    [Create an account](https://app.yabetoo.com) if you haven't already
  </Card>

  <Card title="API Keys" icon="key">
    Get your test API keys from the Dashboard
  </Card>
</CardGroup>

<Warning>
  Never share your secret API key publicly. Use environment variables to store them securely.
</Warning>

## Step 1: Get your API keys

<Steps>
  <Step title="Log in to your Dashboard">
    Go to [app.yabetoo.com](https://app.yabetoo.com) and log in to your account
  </Step>

  <Step title="Navigate to API Keys">
    Click on **Settings** > **API Keys** in the sidebar
  </Step>

  <Step title="Copy your test keys">
    Copy your test secret key (starts with `sk_test_`)
  </Step>
</Steps>

<Info>
  Test keys allow you to simulate payments without real money. Use them during development.
</Info>

## Step 2: Install an SDK (optional)

Choose your preferred language:

<CodeGroup>
  ```bash npm theme={null}
  npm install @yabetoo/sdk-js
  ```

  ```bash pip theme={null}
  pip install yabetoo-sdk
  ```

  ```bash composer theme={null}
  composer require yabetoo/yabetoo-php
  ```

  ```bash gradle theme={null}
  implementation 'com.yabetoo:yabetoo-java:1.0.0'
  ```
</CodeGroup>

## Step 3: Create your first payment

### Option A: Hosted Checkout (Recommended)

The fastest way to accept payments. Redirect your customers to a Yabetoo-hosted page.

<CodeGroup>
  ```javascript JavaScript theme={null}
  import Yabetoo from "@yabetoo/sdk-js";

  const yabetoo = new Yabetoo("sk_test_XXXXXXXXXXXXXXXXXXXXXXXX");

  const session = await yabetoo.sessions.create({
    accountId: "acct_xxxxxxxx",
    total: 5000,
    currency: "xaf",
    successUrl: "https://your-site.com/success",
    cancelUrl: "https://your-site.com/cancel",
    items: [
      {
        productId: "prod_123",
        productName: "Premium Plan",
        quantity: 1,
        price: 5000,
      },
    ],
  });

  // Redirect customer to session.url
  console.log(session.url);
  ```

  ```python Python theme={null}
  from yabetoo import Yabetoo
  from yabetoo.models.checkout import CreateCheckoutSession, CheckoutItem

  yabetoo = Yabetoo("sk_test_XXXXXXXXXXXXXXXXXXXXXXXX")

  session = yabetoo.sessions.create(CreateCheckoutSession(
      account_id="acct_xxxxxxxx",
      total=5000,
      currency="xaf",
      success_url="https://your-site.com/success",
      cancel_url="https://your-site.com/cancel",
      items=[
          CheckoutItem(
              product_id="prod_123",
              product_name="Premium Plan",
              quantity=1,
              price=5000
          )
      ]
  ))

  # Redirect customer to session.url
  print(session.url)
  ```

  ```bash cURL theme={null}
  curl -X POST https://buy.api.yabetoopay.com/v1/sessions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk_test_XXXXXXXXXXXXXXXXXXXXXXXX" \
    -d '{
      "total": 5000,
      "currency": "xaf",
      "accountId": "acct_xxxxxxxx",
      "successUrl": "https://your-site.com/success",
      "cancelUrl": "https://your-site.com/cancel",
      "items": [{
        "productId": "prod_123",
        "productName": "Premium Plan",
        "quantity": 1,
        "price": 5000
      }]
    }'
  ```
</CodeGroup>

### Option B: Custom Integration

For full control over the payment experience, use the Payment Intent API.

<CodeGroup>
  ```javascript JavaScript theme={null}
  import Yabetoo from "@yabetoo/sdk-js";

  const yabetoo = new Yabetoo("sk_test_XXXXXXXXXXXXXXXXXXXXXXXX");

  // Step 1: Create payment intent
  const intent = await yabetoo.payments.create({
    amount: 5000,
    currency: "xaf",
    description: "Premium Plan subscription",
  });

  // Step 2: Confirm with customer's payment method
  const payment = await yabetoo.payments.confirm(intent.id, {
    clientSecret: intent.clientSecret,
    firstName: "John",
    lastName: "Doe",
    receiptEmail: "john@example.com",
    paymentMethodData: {
      type: "momo",
      momo: {
        country: "cg",
        msisdn: "242123456789",
        operatorName: "mtn",
      },
    },
  });

  console.log(payment.status); // "succeeded"
  ```

  ```python Python theme={null}
  from yabetoo import Yabetoo
  from yabetoo.models.payment import (
      CreateIntentRequest,
      ConfirmIntentRequest,
      PaymentMethodData,
      MomoData
  )

  yabetoo = Yabetoo("sk_test_XXXXXXXXXXXXXXXXXXXXXXXX")

  # Step 1: Create payment intent
  intent = yabetoo.payments.create(CreateIntentRequest(
      amount=5000,
      currency="xaf",
      description="Premium Plan subscription"
  ))

  # Step 2: Confirm with customer's payment method
  payment = yabetoo.payments.confirm(
      payment_id=intent.id,
      data=ConfirmIntentRequest(
          client_secret=intent.client_secret,
          first_name="John",
          last_name="Doe",
          receipt_email="john@example.com",
          payment_method_data=PaymentMethodData(
              type="momo",
              momo=MomoData(
                  country="cg",
                  msisdn="242123456789",
                  operator_name="mtn"
              )
          )
      )
  )

  print(payment.status)  # "succeeded"
  ```
</CodeGroup>

## Step 4: Test your integration

Use these test phone numbers in sandbox mode:

| Phone Number   | Behavior                              |
| -------------- | ------------------------------------- |
| `242000000001` | Always succeeds                       |
| `242000000002` | Always fails (insufficient funds)     |
| `242000000003` | Pending for 30 seconds, then succeeds |

<Tip>
  Check your Dashboard to see all test transactions in real-time.
</Tip>

## Step 5: Go live

When you're ready to accept real payments:

<Steps>
  <Step title="Complete account verification">
    Submit your business documents in the Dashboard
  </Step>

  <Step title="Switch to production keys">
    Replace `sk_test_` with `sk_live_` in your code
  </Step>

  <Step title="Update webhook endpoints">
    Point webhooks to your production server
  </Step>
</Steps>

<Check>
  Congratulations! You're now ready to accept payments with Yabetoo.
</Check>

## Next steps

<CardGroup cols={2}>
  <Card title="Handle Webhooks" icon="bell" href="/en/developer-tools/webhook/overview">
    Get notified when payments complete
  </Card>

  <Card title="Explore SDKs" icon="cubes" href="/en/developer-tools/sdk/javascript">
    Discover all SDK features
  </Card>

  <Card title="API Reference" icon="book" href="/en/api-reference/introduction">
    Full API documentation
  </Card>

  <Card title="Error Handling" icon="triangle-exclamation" href="/en/api-reference/errors">
    Handle errors gracefully
  </Card>
</CardGroup>
