# Setup

> Prepare the request environment, sandbox access, source IP addresses, credentials, and event callbacks before calling Embedded Finance APIs.

## Setup steps

<steps level="3">

### Select the base URL

Use the base URL for your integration environment and the `apiKey` Onerway provides for that environment. See each API Reference page for its request method and path.

| Environment | Base URL |
| --- | --- |
| Production | `https://baas.onerway.com` |
| Sandbox | `https://sandbox-baas.onerway.com/embedded-finance` |

<note>

When switching environments, confirm that the base URL, `apiKey`, and event callback configuration all correspond to the target environment.

</note>

### Arrange sandbox access

Contact Onerway to confirm how to enable Embedded Finance sandbox access and obtain the `apiKey`, `webhook_secret` for webhook verification, and event callback configuration requirements for that environment.

### Provide source IP addresses

Before calling Embedded Finance APIs, provide Onerway with stable server source IP addresses for the access allowlist. Provide separate addresses if sandbox and production use different source IPs, and update the allowlist before switching traffic when a source IP changes.

### Store credentials securely

Embedded Finance APIs identify the caller through the `apiKey` request header. Store the `apiKey` and `webhook_secret` on your server.

<warning>

Do not expose your `apiKey` or `webhook_secret` in frontend pages, mobile apps, client-side bundles, logs, or public repositories.

</warning>

### Configure event callbacks

Prepare a server-side callback URL for Embedded Finance events and confirm the callback configuration with Onerway. Once you have the `webhook_secret`, follow the [Webhook description](/embedded-finance/api-reference/webhook-description) to verify `x-signature` using `x-timestamp` and the raw request body as received. Deduplicate deliveries by `request_id`. After accepting a notification, return HTTP 200 and JSON `respCode=20000`.

</steps>

## Suggested integration flow

| Step | Action | Endpoint or notification |
| --- | --- | --- |
| 1 | Upload materials that require file IDs, submit business KYC, and save the returned `userId`. | [Upload file](/embedded-finance/api-reference/endpoints/upload-file), [Business KYC](/embedded-finance/api-reference/endpoints/submit-business-kyc) |
| 2 | Continue based on the KYC review result. If more information is requested, submit the materials listed in the notification. | [Handle KYC status notifications](/embedded-finance/get-started/kyc-status-webhook) |
| 3 | Request a currency or virtual account for the relevant `userId`, according to your use case, and handle the virtual account opening result. | [Open currency account](/embedded-finance/api-reference/endpoints/open-currency-account), [Open virtual account](/embedded-finance/api-reference/endpoints/open-virtual-account) |
| 4 | After receiving a deposit notification, match the deposit and track the result. Respond if additional information is requested. | [Deposit notification](/embedded-finance/api-reference/webhooks/deposit-notification), [Match deposit](/embedded-finance/api-reference/endpoints/match-deposit) |

## Next steps

- [Business scenarios](/embedded-finance/get-started/scenarios) — choose a guide for accounts, deposits, refunds, or additional materials
- [API specifications](/embedded-finance/api-reference) — review common Embedded Finance API rules
- [Webhook description](/embedded-finance/api-reference/webhook-description) — implement signature verification, deduplication, and acknowledgement
- [Business KYC](/embedded-finance/api-reference/endpoints/submit-business-kyc) — submit your first business KYC request
