本指南演示如何使用推送通知和 API 调用来对 Currencycloud 账户收到的资金进行核对。
本指南假定您正在使用我们的 Currencycloud Spark 产品,您的客户为其终端客户提供结算详情,并且您支持子账户。有关子账户活动的更多信息,请参考我们的子账户活动指南。
第 1 步:登录
请参阅验证指南,获取如何开始新 API 会话的说明。
第 2 步:查找资金/SSL 详情
通过调用 Find Funding Accounts /v2/funding_accounts/find 端点,查找终端客户希望以特定货币接收资金所需的结算账户详情。
在下面的示例中,我们通过传入 payment_type
为 'regular', currency
为 'EUR',相应终端客户为 account-id
(子账户 ID),查找用于欧元收款/注资的账户详情。
请求:
参数名称 | 参数类型 | 示例值 |
---|---|---|
X-Auth-Token | 标头 | ea6d13c7bc50feb46cf978d137bc01a2 |
payment_type | 查询字符串 | regular |
currency | 查询字符串 | EUR |
account_id | 查询字符串 | 156d8d0e-2f05-4ffc-b7da-2b0be576bbb0 |
响应:
{ "funding_accounts": [ { "id":"9159cd45-ee3d-4e58-b2d7-00c5a68600c1", "account_id":"156d8d0e-2f05-4ffc-b7da-2b0be576bbb0", "account_number":"GB01TCCL06642902435207", "account_number_type": "iban", "account_holder_name":"Jimmy's Burritos_store 1", "bank_name":"The Currency Cloud Limited", "bank_address":"12 Steward Street, The Steward Building, London, E1 6FQ, GB", "bank_country":"GB", "currency":"EUR", "payment_type": "regular", "routing_code":"TCCLGB31", "routing_code_type": "bic_swift", "created_at":"2021-02-02T15:22:22+00:00", "updated_at":"2021-02-02T15:22:22+00:00" } ], "pagination": { "total_entries":1, "total_pages":1, "current_page":1, "per_page":25, "previous_page": -1, "next_page": -1, "order": "created_at", "order_asc_desc": "asc" } }
根据以上响应,我们可以使用必要的 IBAN 和银行信息,将欧元正确地存入相应的 Currencycloud 账户。由于 payment_type
参数设置为 'regular',发送资金到该账户的个人或公司将能够使用本地 SEPA 网络,通过位于欧洲经济区的本地银行账户进行转账。
请记住,这些结算指示可以由您的终端客户使用,或者您的终端客户可以将这些详细信息直接发送给他们的客户之一(也称为第四方),具体取决于您在 Currencycloud 的账户结构/合规模型。
第 3 步:使用推送通知
一旦资金结算到 Currencycloud 账户,您就可以接收指示资金已到账的资金推送通知。此消息可以进行自定义,并在您的应用程序中显示。请参考我们的推送通知页面了解更多细节。
注资交易
以下图表展示了注资交易的详细信息。
以下是上述图表中描述的“待处理”和“已完成”状态的推送通知示例,使用我们当前为账户注资欧元的示例。
消息标头
Content-Length:675 Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: */* User-Agent:Ruby Host: webhook.site x-hmac-digest-sha-512 e7ace9c29306a82b25bdb764f60f583aeb9145e17c06572640a2953c243e97e19dde7e5cf00b10e60e5ede255b5c91c09312dbec58b7f695d9801fa90514a1dd Content-Type: text/plain
通知类型:待处理现金管理器交易通知
推送通知:
{ "header": { "message_type": "cash_manager_transaction", "notification_type": "pending_cash_manager_transaction_notification" }, "body": { "id":"1b5d9096-74ef-4988-9d12-62662ee0e2a8", "balance_id":"2e6056ce-660f-4b4c-9470-27d8706f08ed", "account_id":"156d8d0e-2f05-4ffc-b7da-2b0be576bbb0", "currency":"EUR", "amount":"1000.00", "balance_amount": null, "type": "credit", "related_entity_type": "inbound_funds", "related_entity_id":"1f453dcb-05c3-4320-806f-2c86d0fe6ed2", "related_entity_short_reference":"IF-20210409-VMN9TQ", "status": "pending", "reason": "", "settles_at": null, "created_at":"2021-04-09T16:57:55+00:00", "updated_at":"2021-04-09T16:57:55+00:00", "completed_at": null, "action": "funding" } }
通知类型:现金管理器交易通知
推送通知:
{ "header": { "message_type": "cash_manager_transaction", "notification_type": "cash_manager_transaction_notification" }, "body": { "id":"1b5d9096-74ef-4988-9d12-62662ee0e2a8", "balance_id":"2e6056ce-660f-4b4c-9470-27d8706f08ed", "account_id":"156d8d0e-2f05-4ffc-b7da-2b0be576bbb0", "currency":"EUR", "amount":"10000.00", "balance_amount":"1000010000.00", "type": "credit", "related_entity_type": "inbound_funds", "related_entity_id":"1f453dcb-05c3-4320-806f-2c86d0fe6ed2", "related_entity_short_reference":"IF-20210409-VMN9TQ", "status": "completed", "reason": "", "settles_at":"2021-04-09T16:57:58+00:00", "created_at":"2021-04-09T16:57:55+00:00", "updated_at":"2021-04-09T16:57:58+00:00", "completed_at":"2021-04-09T16:57:58+00:00", "action": "funding" } }
第 4 步(可选):检索交易详情
从报告角度来看,您可以在主账户或子账户级别下拉交易活动。如果我们想要找到来自上述推送通知的资金交易,可以调用 Find Transactions /v2/transactions/find 端点。
在下面的示例中,我们使用了 currency
、amount
和 related_entity_id
(从上述推送通知中解析得出)作为查询参数。
请求:
参数名称 | 参数类型 | 示例值 |
---|---|---|
X-Auth-Token | 标头 | ea6d13c7bc50feb46cf978d137bc01a2 |
currency | 查询字符串 | EUR |
amount | 查询字符串 | 10000.00 |
related_entity_id | 查询字符串 | 1f453dcb-05c3-4320-806f-2c86d0fe6ed2 |
响应:
{ "transactions": [ { "id":"1b5d9096-74ef-4988-9d12-62662ee0e2a8", "balance_id":"2e6056ce-660f-4b4c-9470-27d8706f08ed", "account_id":"156d8d0e-2f05-4ffc-b7da-2b0be576bbb0", "currency":"EUR", "amount":"10000.00", "balance_amount":"1000010000.00", "type": "credit", "related_entity_type": "inbound_funds", "related_entity_id":"1f453dcb-05c3-4320-806f-2c86d0fe6ed2", "related_entity_short_reference":"IF-20210409-VMN9TQ", "status": "completed", "reason": "", "settles_at":"2021-04-09T16:57:58+00:00", "created_at":"2021-04-09T16:57:55+00:00", "updated_at":"2021-04-09T16:57:58+00:00", "completed_at":"2021-04-09T16:57:58+00:00", "action": "funding" } ], "pagination": { "total_entries":1, "total_pages":1, "current_page":1, "per_page":25, "previous_page": -1, "next_page": -1, "order": "default", "order_asc_desc": "asc" } }
第 5 步(可选):检索发送方详情
发送方 API /v2/transactions/sender/{id} 提供了入账支付的可见性,帮助在不同支付通道之间进行对账。与推送通知相结合,它提供了自动实时对账。以下是使用第 3 步中解析出的 UUID 作为 URL 路径的示例。
请求:
参数名称 | 参数类型 | 示例值 |
---|---|---|
X-Auth-Token |
标头 | ea6d13c7bc50feb46cf978d137bc01a2 |
id |
路径 | 1f453dcb-05c3-4320-806f-2c86d0fe6ed2 |
响应:
{
"id":"1f453dcb-05c3-4320-806f-2c86d0fe6ed2",
"amount":"12000.00",
"currency":"EUR",
"additional_information":"Payment to CC",
"value_date":"2021-05-25T00:00:00+00:00",
"sender":"John Smith;100 Bishopsgate, London, EC2M 1GT;GB;GB29NWBK60161331926819;NWBKGB2L;",
"receiving_account_number": null,
"receiving_account_iban":"GB41TCCL04140419897139",
"created_at":"2021-05-25T06:38:09+00:00",
"updated_at":"2021-05-25T06:38:13+00:00"
}
解释:
字段 | 解释 |
---|---|
additional_information |
发送方及发送银行提供的支付参考信息。 |
sender |
发送 IBAN、BIC、姓名和地址以以下格式显示:{sender.name};{sender.address};{sender.country};{sender.account_number} 或 {sender.iban};{sender.bic};{sender.routing_code} 。并非所有字段都会提供,具体取决于从发送银行收到的数据。 |
receiving_account_number |
支付所转账至的虚拟银行账户详情。在上面的示例中,使用了 IBAN 而非账号,因此显示 null 。 |
receiving_account_iban |
支付所转账至的虚拟账户。在上面的示例中,资金发送至账户:GB41TCCL04140419897139 。 |