跳至主要內容
全部系列其他
Aspire 提供 APIs 嗎?
Aspire 提供 APIs 嗎?
4 個月前已更新

是的,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” 以與我們的專家聯繫!

有疑問?登入後即可點擊螢幕右下角的聊天圖示與我們對話。

是否回答了您的問題?