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

# Server Setup

## Create a Payment Using S2S Call

To create a payment intent, send a request to either our sandbox or production endpoint. For detailed information, refer to the **API Reference** documentation.

Upon successful creation, you will receive a `client_secret`, which must be provided to the SDK to render it properly.

```javascript theme={"system"}
// Example Usage :- Can be Modified
async function createPaymentIntent(request) {
  /* Add respective env endpoints
   - Sandbox - https://sandbox.Pesaswap.io
   - Prod - https://api.Pesaswap.io
  */
  const url = "https://sandbox.Pesaswap.io";
  const apiResponse = await fetch(`${url}/payments`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Accept: "application/json",
      "api-key": `API_KEY`,
    },
    body: JSON.stringify(request),
  });
  const paymentIntent = await apiResponse.json();

  if (paymentIntent.error) {
    console.error("Error - ", paymentIntent.error);
    throw new Error(paymentIntent?.error?.message ?? "Something went wrong.");
  }
  return paymentIntent;
}
```

## Integrate Web SDK

To integrate Web SDK, follow these guides:

* [Node And React](node-and-react)
* [Node and HTML](node-and-html)
* [Vanilla JS and REST API Integration](vanilla-js-and-rest-api-integration)

## Integrate Mobile SDK

To integrate mobile SDK, follow these guides:

* [Kotlin with Node](kotlin-with-node-backend)
* [Swift with Node](swift-with-node-backend)
* [React Native with Node](react-native-with-node-backend)
* [Flutter with Node](flutter-with-node-backend)

## Additional Notes

In case you're integrating the ExpressCheckout (mentioned later below), instead of creating multiple paymentIntents for the same customer session, you can also use paymentsUpdate API for better analytics.
