# Setup

> Prepare the Transfer V3 base URL and ApiKey, then complete the payment integration flow.

Before calling Transfer V3 APIs, confirm that payment API access is enabled and obtain the ApiKey for the target environment.

## Setup steps

<steps level="3">

### Confirm API access

Confirm your destination countries, currencies and payment methods with Onerway. If you need to act on behalf of another merchant, also confirm the relevant permissions and supply that merchant's number in `onBehalfOf`.

### Select the base URL

| Environment | Base URL |
| --- | --- |
| Sandbox | `https://sandbox-transfer-api.onerway.com` |
| Production | `https://transfer-api.onerway.com` |

Append the path shown on the endpoint page to the base URL. For example, the sandbox exchange-rate query URL is:

`https://sandbox-transfer-api.onerway.com/api/v3/acct/queryExchangeRate`

<note>

Use an ApiKey for the same environment as the request domain. Before switching to production, check the domain, credentials and API permissions.

</note>

### Obtain credentials

Obtain the credentials for the corresponding environment in the merchant portal:

| Credential | Purpose |
| --- | --- |
| `merchantNo` | Identifies the merchant. Use it as required by each endpoint. |
| API Key of type `API_KEY` | Authenticates server-side Transfer V3 requests through the `ApiKey` header. |
| Notification signing key | Verifies webhook notifications on your server. Use it separately from the API Key. |

Use the following merchant portal pages to obtain your credentials:

- `merchantNo`: **Settings → Merchant → Merchant information** — [Sandbox](https://sandbox-merchant.onerway.com/settings/user/info) · [Production](https://merchant.onerway.com/settings/user/info).
- API Key and notification signing key: **Developer center → API keys** — [Sandbox](https://sandbox-merchant.onerway.com/develops/api-keys) · [Production](https://merchant.onerway.com/develops/api-keys).

Keep both keys on your server. Do not put them in client-side code, mobile app packages, version control, or logs. Send the API Key in the `ApiKey` request header and set `Content-Type: application/json`. See [Webhooks and signature verification](/transfer/api-reference/v3-payment-notifications) for notification verification.

### Configure the IP allowlist

Before making your first server-side API request in the sandbox, add all public outbound IP addresses used by your server to the sandbox IP allowlist. In the sandbox merchant portal, go to **Developer center → IP allowlist** and add these addresses. Use your server's outbound IP addresses, not the IP addresses of customer devices or browsers visiting your website.

Configure the IP allowlist separately for the sandbox and production environments. Before going live, add all public outbound IP addresses used by your production servers in the production merchant portal. Add the addresses in each environment even if they are the same.

| Environment | When to configure | Merchant portal page |
| --- | --- | --- |
| Sandbox | Before your first server-side API request in the sandbox | [Sandbox IP allowlist](https://sandbox-merchant.onerway.com/develops/ip-allowlist) |
| Production | Before your first server-side API request in production | [Production IP allowlist](https://merchant.onerway.com/develops/ip-allowlist) |

When the IP allowlist is enabled, requests from IP addresses that are not on the allowlist for the target environment may be rejected.

To restrict the source IPs of incoming webhooks, configure your receiving endpoint using the [webhook source IP allowlist](/transfer/api-reference/v3-payment-notifications#source-ip-allowlist).

### Send a server-side request

Confirm the outbound IP allowlist is configured before sending a request from your server.

Start with [Query an exchange rate](/transfer/api-reference/endpoints/v3-accounts-query-exchange-rate). Follow the endpoint's request example to supply the source currency, target currency and amount, and include the headers above.

Read business data when `respCode` is `20000`. Treat other values as errors and use the error code and message to investigate. After a successful exchange-rate query, continue validating the beneficiary and payment flow.

</steps>

## Complete the payment integration

1. [List available payment methods](/transfer/api-reference/endpoints/v3-accounts-query-payment-methods) for your payment scenario.
2. [Retrieve beneficiary field rules](/transfer/api-reference/endpoints/v3-beneficiaries-schema), prepare the details, then [validate](/transfer/api-reference/endpoints/v3-beneficiaries-validate) and [create the beneficiary](/transfer/api-reference/endpoints/v3-beneficiaries-add).
3. Use the saved `beneficiaryId` to [validate a transfer](/transfer/api-reference/endpoints/v3-transactions-validate), then [create the transfer](/transfer/api-reference/endpoints/v3-transactions-remittance).
4. Track the result through [transfer details](/transfer/api-reference/endpoints/v3-transactions-query-detail) and [V3 payment notifications](/transfer/api-reference/webhooks/v3-transfer-result). Acceptance does not mean the payment has succeeded. If the request outcome is unclear, query with the original `requestId` to avoid duplicate payments.

See the [V3 API overview](/transfer/api-reference/v3) for the detailed flow and status handling.

## Payment status flow

The following shows a common payment status flow:

```text
A Created → P Processing → S Succeeded → RETURNED Returned
                        ↘ F Failed
```

Queries and callbacks may not show every intermediate status. Acceptance does not mean the payment has succeeded, and a successful payment can subsequently be returned. On receiving `RETURNED`, update the original transaction and inspect `payoutStatusReason`; do not automatically initiate another payment. If a request times out or its outcome is unclear, query the payment details using the original `requestId` first.

See [payment statuses](/transfer/api-reference/v3-enums#transactionstatus-payment-statuses) for all values and [Webhooks and signature verification](/transfer/api-reference/v3-payment-notifications) for notification handling.

## Account balances and transactions

Account balance and account transaction queries use Account service APIs. Refer to [Account service setup](/account/get-started/setup) for their base URLs, request headers and integration requirements.

- [Query account balance](/account/api-reference/endpoints/query-account-balance)
- [Query account balance transactions](/account/api-reference/endpoints/query-account-transactions)
