---
title: "POST /general/swap/calculate"
method: POST
path: "/general/swap/calculate"
tags: ["Swap-calculate"]
---

# POST /general/swap/calculate

`POST /general/swap/calculate`

## Headers

- `general_api_key` string, required
- `Content-Type` string, required

## Request body

- object
  - `from_currency` string, required — Specify the currency symbol you want to swap from.
  - `to_currency` string, required — Specify the currency symbol you want to swap to.
  - `amount` number, required — Specify the amount of currency you want to swap.

## Response `200`

Successful operation

- object
  - `data` object
    - `to_amount` number — The amount of the "to_currency" received after the swap, represented with high precision.
    - `rate` number — The swap rate between the "from_currency" and "to_currency" at the time of the request.
    - `amount` number — The amount of the "from_currency" being swapped, represented with high precision.
  - `message` string — A message containing additional information about the result of the request.
  - `error` object, nullable — An object that provides details about any errors that occurred.
    - `type` string — Type of the error
    - `key` string — Key related to the error
    - `message` string — Error message
  - `status` integer — The status of the request response. Typically provided as a numeric code (e.g., 200 for success or other codes for errors).
  - `version` string — The version of the API being used.

## Other responses

- `400` — Bad request

---

[API](https://skmtc.net/oxapay/apis/payments.md) · [All operations](https://skmtc.net/oxapay/apis/payments/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/oxapay/payments/versions/19b6abc20c8d/schema)
