Search code examples
balanced-payments

Error on account creation: "Card has already been associated with an account"


I am using TEST marketplace to add a new account for a credit card. Even though a new uri is generated for my credit card every time which I use to create new account, I get this error...

Account creation Request failed with response code 409. Reason: {
  "status": "Conflict",
  "category_code": "card-already-funding-src",
  "additional": null,
  "status_code": 409,
  "category_type": "logical",
  "extras": {},
  "request_id": "OHMaae31e38b88d11e2b762026ba7d31e6f",
  "description": "Card has already been associated with an account. Your request id is OHMaae31e38b88d11e2b762026ba7d31e
6f."
}

Also on the dashboard I can see that a new account has been created in my TEST marketplace despite the error. This other question also mentions the same error but the given solution doesn't apply in my case. Deleting a card or reassigning to new account


Solution

  • After a lot of experimenting I have figured out the issue. The following sample request given in the Balanced Processing tutorial under "Creating An Account" does not work for some reason at least it doesn't work in TEST marketplace.

    curl https://api.balancedpayments.com/v1/marketplaces/TEST-MPiuxfzhprKGoIc4yZ0OuNQ/accounts \
         -u 099e55e07f7311e2b923026ba7c1aba6: \
         -d "card_uri=/v1/marketplaces/TEST-MPiuxfzhprKGoIc4yZ0OuNQ/cards/CC4R7KXv0jiDTxo5W6Gg5PnM"
    

    Solution: It works if you skip the "card_uri". And after creating the account you have to associate the account with the card in a separate PUT request.