跳转到主要内容
所有收藏其他
Aspire 提供 APIs 吗?
Aspire 提供 APIs 吗?
超过 3 个月前更新

是的,Aspire 提供的 API 旨在灵活管理货币兑换、支付和账户管理。我们的直观 API 专为开发人员设计,确保无缝部署和自定义,以精准满足您的企业需求。

Aspire API 功能

支付 APIs

使用您的 Aspire SGDUSDEUR* GBP* 账户进行本地和国际支付!

  • 大规模支付

  • 自定义支付流程

  • 创建自动化支付链接

*请注意:Aspire EUR 和 GBP 账户目前仅支持本地支付。我们正在努力为这些账户提供国际支付。

发卡 APIs

会计自动化 API

  • 将 Aspire 交易同步到会计软件

  • 拉取银行数据

  • 运行与会计科目表映射到类别的对账

更多关于 Aspire API 的信息

Aspire API 以 REST 架构为基础。我们的 API 使用可预测的资源导向 URL,接受表单编码的请求主体,回传 JSON 编码的响应,并使用标准的 HTTP 响应代码、验证和动词。

您也可以获得模拟账户访问权限,并且可以在 Web 应用程序的账户设置 > API 密钥中生成客户端 ID 和 API 密钥。

如果您在集成过程中需要任何帮助,您的 Aspire 客户经理将能够为您提供指导。

入门指南

下面的示例工作流程将指导您了解 Aspire API 在实践中的操作。

在此示例中,我们希望用 SGD 账户的可用余额以新加坡元向在新加坡的收款人支付 $10,000 新元。

1. 验证

首先,您需要获取访问权杖以允许您访问所有其他 API 端点。使用您的唯一客户端 ID 和 API 密钥(可在 Aspire 网页应用程序的 API 菜单中找到),您可以调用验证 API 端点。成功后,您将授予访问权杖。

curl --location '<https://api.aspireapp.com/public/v1/login>' \\
--header 'Content-Type: application/json' \\
--data '{
"grant_type": "client_credentials",
"client_id": "SGLTTC-qXox2XXxxHs7Erd",
"client_secret": "CkuDGSF1HXXxx9ZEgthbor2suQAITZ36"
}'

[
{
"access_token": "eyJ0eXAiOiJKV1QxXXxhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMyIsImp0aSI6ImU3NTkxOWIwMzRkZGM1NjdkMDQ3NTM0OWU2MTlkOGNiYzA2NTI4NzI0MjgwYTg3NjZkMmRjN2QzMDA1MDk1ZTc1OGJkZDdhMDYwYjAwZWM0IiwiaWF0IjoxNzAxNzcxMTcyLCJuYmYiOjE3MDE3NzExNzIsImV4cCI6MTcwMTc3Mjk3Miwic3ViIjoiNzIyIn0.CPDe-EguskAKuyqRm04-oNuD-MLabe9lbiv74P1EEroO2zphk7mrfOAIm4jco5fVD7T_1-L-PoehhCF3rVU15GIlHqU8W-mrQzOn74_TL4aNviZQ78A0CwcXAqvimRco5d_dZaPIVvCOfIfdab3IL2F2vqQGDX_MzfFX45sbXKwehxvBRSC3DoK5dq-75MWv1jB1YWrcAHMGPK6K11PE2ud0h1lpx-BLWnHVy04tEuCHb4prCN64gWLUYLhGqmINSEpJ83DK34f4cZmJ16WzOYe6LoTproHGa24pfmSsXr_OzWmMYPxtFKLWzmmGqI_28pOHsQoyzX4061cEhAxP6g",
"token_type": "Bearer",
"expires_in": "1799",
"refresh_token": null
}
]

2. 获取账户

curl --request GET \
--url 'https://api.aspireapp.com/public/v1/accounts' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QxXXxhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMyIsImp0aSI6ImU3NTkxOWIwMzRkZGM1NjdkMDQ3NTM0OWU2MTlkOGNiYzA2NTI4NzI0MjgwYTg3NjZkMmRjN2QzMDA1MDk1ZTc1OGJkZDdhMDYwYjAwZWM0IiwiaWF0IjoxNzAxNzcxMTcyLCJuYmYiOjE3MDE3NzExNzIsImV4cCI6MTcwMTc3Mjk3Miwic3ViIjoiNzIyIn0.CPDe-EguskAKuyqRm04-oNuD-MLabe9lbiv74P1EEroO2zphk7mrfOAIm4jco5fVD7T_1-L-PoehhCF3rVU15GIlHqU8W-mrQzOn74_TL4aNviZQ78A0CwcXAqvimRco5d_dZaPIVvCOfIfdab3IL2F2vqQGDX_MzfFX45sbXKwehxvBRSC3DoK5dq-75MWv1jB1YWrcAHMGPK6K11PE2ud0h1lpx-BLWnHVy04tEuCHb4prCN64gWLUYLhGqmINSEpJ83DK34f4cZmJ16WzOYe6LoTproHGa24pfmSsXr_OzWmMYPxtFKLWzmmGqI_28pOHsQoyzX4061cEhAxP6g'

账户请求示例

{
"data": [
{
"id": "9046d563-6d62-421f-acda-0b000b4aa4c8",
"account_status": "active",
"account_type": "debit",
"available_balance": 1889,
"currency_code": "SGD",
"debit_details": [
{
"account_name": "Larisa & Company Private Limited",
"funding_type": "LOCAL",
"account_number": "8852-1558-7308",
"bank_swift": "",
"bank_code": "DBSSSGSG",
"bank_name": "DBS",
"bank_address": "",
"bank_country": ""
},
{
"account_name": "Larisa & Company Private Limited",
"funding_type": "SWIFT",
"account_number": "GB68TCCL04140450470872",
"bank_swift": "TCCLGB3L",
"bank_code": "DBSSSGSG",
"bank_name": "The Currency Cloud Limited",
"bank_address": "12 Steward Street, The Steward Building, London, E1 6FQ, GB",
"bank_country": "United Kingdom"
}
],
"advance_details": []
}
],
"metadata": {
"total": 1,
"per_page": 100,
"current_page": 1,
"first_page_url": "https://api.aspireapp.com/public/v1/accounts?page=1",
"last_page_url": "https://api.aspireapp.com/public/v1/accounts?page=1",
"next_page_url": null,
"prev_page_url": null,
"from": 1,
"to": 1,
"aspire-request-id": "c4aa3565-06ca-41be-a775-fbd623c1c280"
}
}

账户响应示例

3. 获取余额

在进行交易之前,您可能希望查询 Aspire 账户中的可用余额。

curl --request GET \
--url 'https://api.aspireapp.com/public/v1/accounts/9046d563-6d62-421f-acda-0b000b4aa4c8/balance' \
--header 'Authorization: Bearer {{Token}}'

账户余额请求示例

{
"data": {
"account_id": "9046d563-6d62-421f-acda-0b000b4aa4c8",
"account_type": "debit",
"available_balance": 885756587,
"currency_code": "SGD",
"account_name": "Swaniawski PLC"
},
"metadata": {
"aspire-request-id": "b82b63d7-3a00-4b9a-bffc-49c4be9e5236"
}
}

账户余额响应示例

4. 创建转账

创建转账时,您可以通过指定不同于源货币的目标货币来自动记录外汇交易并将其连结到付款。该回应将传回交易的所有必要详细信息,包括转账 ID、交易 ID(如果转账成功)和转账状态。在外汇转账的情况下,您则需要添加 QuoteID

curl --location 'https://api.aspireapp.com/public/v1/transfer/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{Token}}'
--data '{
"source_currency": "SGD",
"source_account_id": "9b91285b-9c28-4207-af0f-a6dc8ffe8dcb",
"destination_currency": "SGD",
"bank_country_code": "SG",
"payment_method": "LOCAL",
"clearing_system":"REGULAR",
"entity_type": "INDIVIDUAL",
"beneficiary": {
"account_holder_name": "test SGD local",
"bank_code":"DBSSSGSGXXX",
"bank_account_number": "885215898101"
},
"reference":"budget",
"approval":true,
"source_amount": 1000
}'

SGD 本地转账的创建转账请求示例

{
"data": {
"id": "9b993fc3-5d85-435f-a013-d240f4b54def",
"initiated_at": "2024-03-19T05:10:20Z",
"transaction_id": null,
"source_currency": "SGD",
"source_account_id": "9b91285b-9c28-4207-af0f-a6dc8ffe8dcb",
"destination_currency": "SGD",
"bank_country_code": "SG",
"payment_method": "LOCAL",
"clearing_system": "FAST",
"entity_type": "INDIVIDUAL",
"beneficiary": {
"account_holder_name": "test SGD local",
"bank_code": "DBSSSGSGXXX",
"bank_account_number": "885215898101"
},
"beneficiary_id": null,
"payment_amount": null,
"source_amount": 1000,
"payment_date": null,
"reference": "budget",
"internal_notes": null,
"quote_id": null,
"budget_id": null,
"category_id": null,
"approval": true,
"transaction_datetime": null,
"transfer_status": "pending_approval",
"failure_reason": null,
"failure_id": null,
"fee": 0,
"fee_currency": null,
"fee_transaction_id": null,
"fee_reason": null
},
"metadata": {
"aspire-request-id": "e0eb50b2-6dd4-4c1a-8824-f9a2d0f6bb7c"
}
}

创建转账响应示例

5.检查转账状态

成功创建转账后,您可以通过使用转账 ID 查询转账状态来获取最新的转账状态更新。

--request GET \ --url 'https://api.aspireapp.com/public/v1/transfer/9c282e55-90cc-428c-a3bf-fcdd33accff2/status' --header 'Authorization: Bearer {{Token}}'

检查转账状态请求示例

{
"data": {
"id": "9c282e55-90cc-428c-a3bf-fcdd33accff2",
"initiated_at": "2024-05-29T07:35:58Z",
"transaction_id": "9c2847b7-cd80-4e30-b622-ab48e62ebdce",
"source_currency": "USD",
"source_account_id": "9c19d3fe-90e9-4ccf-a63c-ef706fbe5287",
"destination_currency": "USD",
"bank_country_code": "US",
"payment_method": "LOCAL",
"clearing_system": "REGULAR",
"entity_type": "INDIVIDUAL",
"beneficiary": {
"aba": "123456789",
"acct_number": "1234567890",
"beneficiary_city": "some city",
"account_holder_name": "test account",
"beneficiary_address": "some address",
"beneficiary_postcode": "some post",
"beneficiary_state_or_province": "some state"
},
"beneficiary_id": null,
"payment_amount": 1200,
"source_amount": 1200,
"payment_date": "2024-05-29T07:35:58Z",
"reference": "reference",
"internal_notes": "to test internal note",
"quote_id": null,
"budget_id": null,
"approval": null,
"transaction_datetime": "2024-05-29T07:35:58Z",
"transfer_status": "posted",
"failure_reason": null,
"failure_id": null,
"fee": 100,
"fee_currency": "USD",
"fee_transaction_id": "9c2847b8-1dc1-4264-a947-ce717b40cf24",
"fee_reason": "Fee for transaction Y5GJTYK5EGMG"
},
"metadata": {
"aspire-request-id": "785d563a-272a-4692-a502-cf9730e06158"
}
}

检查转账状态响应示例

6. 创建卡

您可以为您的组织创建虚拟卡,这些卡可以是单次或多次使用,并可根据商户代码、货币和交易金额进行限制。

创建卡后,您还可以使用我们的安全加密端点访问安全的卡详情。

curl --location 'https://api.aspireapp.com/public/v1/cards' \
--header 'Authorization: Bearer {{your_bearer_token}}' \
--data-raw '
{
"user_id": "9a1119e9-6746-413b-9dd9-354c5f927c9e",
"card_name": "IDR card",
"category": "Travel",
"account_id": "9a1119f6-3fec-4595-8122-59759937a6e5",
"email": "johndoe@example.com",
"country_code": "IN",
"phone_number": "9514567890",
"budget_id": "9b54f47a-6a2d-4051-9977-15be157a0273",
"reporting_field_values": [
{
"reporting_field_uuid": "1122aa22-12av-3321-a0f8-115e60587722",
"reporting_field_option_uuid": "3344bb44-12av-3321-a0f8-115e60587722",
"text_value": null

}
"spend_controls": {
"active_to": "2024-02-19",
"active_from": "2024-02-14",
"freeze_automatically_after": 10,
"spend_limit": null,
"merchant_locks": "98bd588b-fe98-4bff-89cb-89b80e67edfd,98bd58a8-96d7-4be2-a1d0-b697345a0ae4",
"category_locks": "9ad3f0ec-70aa-4406-83a5-dc38d6dc4a40,9ad3f0e8-e9ec-46a3-9f10-996151462ccb",
"currency_locks": "USD,SGD"

}
},
'

创建卡请求示例

{
"data": {
"card_id": "9b52f47e-b95f-4286-97af-acdb9b59aa2a",
"card_name": "IDR card",
"last_four": "3354",
"card_status": "Frozen",
"user_id": "9a1119e9-6746-413b-9dd9-354c5f927c9e",
"category": "Travel",
"account_id": "9a1119f6-3fec-4595-8122-59759937a6e5",
"email": "johndoe@example.com",
"country_code": "IN",
"phone_number": "9514567890",
"budget_id": "9b54f47a-6a2d-4051-9977-15be157a0273",
"issued_by": "All Client 2",
"reporting_field_values": [
{
"reporting_field_uuid": "1122aa22-12av-3321-a0f8-115e60587722",
"reporting_field_option_uuid": "3344bb44-12av-3321-a0f8-115e60587722",
"text_value": null

}
"spend_controls": {
"active_to": "2024-02-19",
"active_from": "2024-02-14",
"freeze_automatically_after": 10,
"spend_limit": null,
"merchant_locks": [
{
"merchant_id": "98bd588b-fe98-4bff-89cb-89b80e67edfd",
"merchant_name": "Facebook"
},
{
"merchant_id": "98bd58a8-96d7-4be2-a1d0-b697345a0ae4",
"merchant_name": "Google"
}
],
"category_locks": [
{
"category_id": "9ad3f0ec-70aa-4406-83a5-dc38d6dc4a40",
"category_name": "Agricultural Co-operatives"
},
{
"category_id": "9ad3f0e8-e9ec-46a3-9f10-996151462ccb",
"category_name": "Airlines"
}
],
"currency_locks": [
{
"currency_code": "SGD",
"currency_name": "Singapore Dollar"
},
{
"currency_code": "USD",
"currency_name": "United States Dollar"
}
]
}
},
"metadata": []
}

创建卡响应示例

想要详细了解如何使用 Aspire API 扩展业务?请访问我们的页面并点击 “Request early access” 以与我们的专家联系!

有疑问?登录后即可点击屏幕右下角的聊天图标与我们对话。

这是否解答了您的问题?