> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.shimi.cash/api-reference/shimi-api/settlement-payouts/link-account-to-settlement/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.shimi.cash/_mcp/server. # Link Account to Settlement POST https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement Content-Type: application/json Re-points a customer's dedicated account or a corporate sub-account so its future inbound credits land in a different settlement account. Provide exactly one of `customer_reference` (when `type` is `REGULAR`) or `corporate_reference` (when `type` is `CORPORATE`). **Body (JSON)** | Field | Type | Required | Notes | |---|---|---|---| | `type` | string | yes | `REGULAR` or `CORPORATE` | | `settlementId` | integer | yes | Target settlement account; must be a JSON number | | `customer_reference` | string | when `type=REGULAR` | Customer ID (must already have a dedicated account) | | `corporate_reference` | string | when `type=CORPORATE` | Corporate sub-account ID | **Behaviour notes** - Checks run in this order: `settlementId`, then `type`, then the reference for that type. - Linking to the settlement the account already uses returns `200` with an "already linked" message. - No `data` is returned. Reference: https://docs.shimi.cash/api-reference/shimi-api/settlement-payouts/link-account-to-settlement ## Authentication - `Authorization` header (bearer token, required) — Access token from Generate Access Token (valid 15 minutes). ## Request ### Body (application/json) This endpoint expects an object. - `type` (string, optional) - `customer_reference` (string, optional) - `settlementId` (integer, optional) ## Response ### 200 Updated / Already linked (customer) / Already linked (corporate) - `status` (string, optional) - `message` (string, optional) ## Errors ### 400 Bad Request Error settlementId missing / Invalid type / customer_reference missing / corporate_reference missing - `status` (string, optional) - `message` (string, optional) ### 401 Unauthorized Error Unauthorized - `message` (string, optional) ### 403 Forbidden Error Invalid or expired access token / KYB not approved / Account deactivated - `message` (string, optional) - `code` (string, optional) - `kybStatus` (string, optional) ### 404 Not Found Error Settlement not found / Customer not found / Customer has no bank account / Corporate account not found - `status` (string, optional) - `message` (string, optional) ## Examples ### 200 Updated **Response** ```json { "status": "success", "message": "Settlement account updated successfully" } ``` **SDK Code** ```python 200 Updated import requests url = "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript 200 Updated const url = 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go 200 Updated package main import ( "fmt" "net/http" "io" ) func main() { url := "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby 200 Updated require 'uri' require 'net/http' url = URI("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java 200 Updated import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement") .header("Authorization", "Bearer ") .asString(); ``` ```php 200 Updated request('POST', 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp 200 Updated using RestSharp; var client = new RestClient("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift 200 Updated import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### 200 Already linked (customer) **Response** ```json { "status": "success", "message": "Bank account is already linked to this settlement" } ``` **SDK Code** ```python 200 Already linked (customer) import requests url = "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript 200 Already linked (customer) const url = 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go 200 Already linked (customer) package main import ( "fmt" "net/http" "io" ) func main() { url := "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby 200 Already linked (customer) require 'uri' require 'net/http' url = URI("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java 200 Already linked (customer) import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement") .header("Authorization", "Bearer ") .asString(); ``` ```php 200 Already linked (customer) request('POST', 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp 200 Already linked (customer) using RestSharp; var client = new RestClient("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift 200 Already linked (customer) import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### 200 Already linked (corporate) **Response** ```json { "status": "success", "message": "Corporate account is already linked to this settlement" } ``` **SDK Code** ```python 200 Already linked (corporate) import requests url = "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript 200 Already linked (corporate) const url = 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go 200 Already linked (corporate) package main import ( "fmt" "net/http" "io" ) func main() { url := "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby 200 Already linked (corporate) require 'uri' require 'net/http' url = URI("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java 200 Already linked (corporate) import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement") .header("Authorization", "Bearer ") .asString(); ``` ```php 200 Already linked (corporate) request('POST', 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp 200 Already linked (corporate) using RestSharp; var client = new RestClient("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift 200 Already linked (corporate) import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Settlement & Payouts_linkAccountToSettlement_example **Request** ```json { "type": "REGULAR", "customer_reference": "{{customer_id}}", "settlementId": 1 } ``` **Response** ```json { "status": "success", "message": "Settlement account updated successfully" } ``` **SDK Code** ```python Settlement & Payouts_linkAccountToSettlement_example import requests url = "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement" payload = { "type": "REGULAR", "customer_reference": "{{customer_id}}", "settlementId": 1 } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Settlement & Payouts_linkAccountToSettlement_example const url = 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"type":"REGULAR","customer_reference":"{{customer_id}}","settlementId":1}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Settlement & Payouts_linkAccountToSettlement_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement" payload := strings.NewReader("{\n \"type\": \"REGULAR\",\n \"customer_reference\": \"{{customer_id}}\",\n \"settlementId\": 1\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Settlement & Payouts_linkAccountToSettlement_example require 'uri' require 'net/http' url = URI("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"type\": \"REGULAR\",\n \"customer_reference\": \"{{customer_id}}\",\n \"settlementId\": 1\n}" response = http.request(request) puts response.read_body ``` ```java Settlement & Payouts_linkAccountToSettlement_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"type\": \"REGULAR\",\n \"customer_reference\": \"{{customer_id}}\",\n \"settlementId\": 1\n}") .asString(); ``` ```php Settlement & Payouts_linkAccountToSettlement_example request('POST', 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement', [ 'body' => '{ "type": "REGULAR", "customer_reference": "{{customer_id}}", "settlementId": 1 }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Settlement & Payouts_linkAccountToSettlement_example using RestSharp; var client = new RestClient("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"type\": \"REGULAR\",\n \"customer_reference\": \"{{customer_id}}\",\n \"settlementId\": 1\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Settlement & Payouts_linkAccountToSettlement_example import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "type": "REGULAR", "customer_reference": "{{customer_id}}", "settlementId": 1 ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/settlement/update-settlement")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```