我正在使用带有C#的REST API,所以我不确定如果我共享代码会有多大帮助。
我有一个account
,其唯一role
为buyer
且只有1张信用卡已关联。
我想通过关联银行帐户和必要的商家信息,将merchant
角色添加到此account
。
如果我有以下account
:
{
"holds_uri": "/v1/marketplaces/MyMarket/accounts/MyAccount/holds",
"name": "John Smith",
"roles": [
"buyer"
],
"created_at": "2012-11-06T02:54:03.300028Z",
"uri": "/v1/marketplaces/MyMarket/accounts/MyAccount",
"bank_accounts_uri": "/v1/marketplaces/MyMarket/accounts/MyAccount/bank_accounts",
"refunds_uri": "/v1/marketplaces/MyMarket/accounts/MyAccount/refunds",
"meta": {},
"debits_uri": "/v1/marketplaces/MyMarket/accounts/MyAccount/debits",
"transactions_uri": "/v1/marketplaces/MyMarket/accounts/MyAccount/transactions",
"email_address": "john@smith.com",
"id": "MyAccount",
"credits_uri": "/v1/marketplaces/MyMarket/accounts/MyAccount/credits",
"cards_uri": "/v1/marketplaces/MyMarket/accounts/MyAccount/cards"
}
我知道我可以POST
将以下银行帐户信息发送到account
的{{1}},以便将银行帐户与bank_account_uri
相关联:
account
{
"name": "WHC III Checking",
"account_number": "12341234",
"bank_code": "321174851"
}
account
buyer
role
新的银行帐户信息POST
后,account
仍然只显示一个bank_account_uri
merchant
如何使用buyer
将account
角色添加到现有Balanced Payments REST API
{{1}}?
答案 0 :(得分:2)
我在BalancedPayments IRC频道上找到了一些帮助。
本文介绍了如何:Promote a Buyer Account to a Merchant
您需要将PUT
请求与正文中的商家详细信息一起提交至account_uri
PUT /v1/marketplaces/MyMarket/accounts/MyAccount
{
"merchant": {
"phone_number": "+19046281796",
"city": "San Francisco",
"name": "jo",
"dob": "1984-01",
"state": "CA",
"postal_code": "94110",
"type": "person",
"street_address": "Somewhere over the rainbow",
"tax_id": "013825400"
}
}
答案 1 :(得分:0)
使用平衡付款KFC重定向创建商家,它会将您重定向到您指定的redirect_uri。
它将发回两个参数:email_address和merchant_uri。您可以将(更新)PUT请求发送到Greg提到的相同路由,以便将现有帐户与商家相关联。
PUT / v1 / marketplaces / your_marketplace_id / accounts / account_id
{
"merchant_uri": "merchant uri goes here"
}