兑换是将一种货币持有的资金换成另一种货币的过程。
工作流程图
主账户:

子账户:

集成指南
在本指南中,您将:
- 获取将英镑 (GBP) 兑换为欧元 (EUR) 的报价汇率。
- 通过交易一些英镑来为您的欧元余额充值。
第 1 步:登录
请参阅验证指南,获取开始新 API 会话的说明。
第 2 步:获得报价汇率
通过调用 Get Detailed Rates /v2/rates/detailed 端点,查看使用您的英镑余额购买 10,000 欧元需要花费多少。
GET /v2/rates/detailed
| 参数名称 | 参数类型 | 示例值 |
|---|---|---|
buy_currency |
查询字符串 | EUR |
sell_currency |
查询字符串 | GBP |
amount |
查询字符串 | 10000.00 |
fixed_side |
查询字符串 | buy |
X-Auth-Token |
标头 | ea6d13c7bc50feb46cf978d137bc01a2 |
成功时,响应负载将包含 Currencycloud 报价的详细信息以进行兑换。以下示例告诉您,您可以出售 £8,059 以购买 €10,000。请注意,报价汇率仅供参考,必须进行兑换预订以锁定汇率。
HTTP/1.1 200 OK
Content-Type: application/json
{
"settlement_cut_off_time":"2021-02-06T14:00:00Z",
"currency_pair":"EURGBP",
"client_buy_currency":"EUR",
"client_sell_currency":"GBP",
"client_buy_amount":"10000.00",
"client_sell_amount":"8059.00",
"fixed_side": "buy",
"client_rate":"0.8059",
"partner_rate": null,
"core_rate":"0.8059",
"deposit_required": false,
"deposit_amount":"0.0",
"deposit_currency":"GBP",
"mid_market_rate":"0.8056"
}
第 3 步:兑换
如果您对报价汇率感到满意,可以调用 Create Conversion /v2/conversions/create 端点来创建兑换。
POST /v2/conversions/create Content-Type: multipart/form-data
| 参数名称 | 参数类型 | 示例值 |
|---|---|---|
buy_currency |
表单数据 | EUR |
sell_currency |
表单数据 | GBP |
amount |
表单数据 | 10000.00 |
fixed_side |
表单数据 | buy |
reason |
表单数据 | Top up Euros balance |
term_agreement |
表单数据 | true |
X-Auth-Token |
标头 | ea6d13c7bc50feb46cf978d137bc01a2 |
成功时,响应消息的负载将包含在您 Currencycloud 账户中记录的完整兑换详情。
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":"4c52215f-ca4b-4dcb-a7ae-36edc4f5db16",
"settlement_date":"2021-02-06T14:00:00+00:00",
"conversion_date":"2021-02-06T00:00:00+00:00",
"short_reference":"20210202-FYYXFH",
"creator_contact_id":"1993263d-be07-42d4-b75b-ae4ea18bcb6c",
"account_id": "d22073a6-4c56-4980-8699-504b0c70003f",
"currency_pair":"EURGBP",
"status": "awaiting_funds",
"buy_currency":"EUR",
"sell_currency":"GBP",
"client_buy_amount":"10000.00",
"client_sell_amount":"8059.00",
"fixed_side": "buy",
"core_rate":"0.8059",
"partner_rate": "",
"partner_status": "funds_arrived",
"partner_buy_amount":"0.00",
"partner_sell_amount":"0.00",
"client_rate":"0.8059",
"deposit_required": false,
"deposit_amount":"0.00",
"deposit_currency": "",
"deposit_status": "not_required",
"deposit_required_at": "",
"payment_ids": [],
"unallocated_funds":"0.00",
"unique_request_id": null,
"created_at":"2021-02-02T11:41:29+00:00",
"updated_at":"2021-02-02T11:41:29+00:00",
"mid_market_rate":"0.8056"
}
只要账户的英镑余额足够支付 client_sell_amount,此兑换将在 settlement_date 自动结算。如果需要,请使用您的现金管理器为英镑余额充值。