Chilkat Online Tools

Android / Bond APIs / create transfer

Back to Collection Items

// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;

import android.app.Activity;
import com.chilkatsoft.*;

import android.widget.TextView;
import android.os.Bundle;

public class SimpleActivity extends Activity {

  private static final String TAG = "Chilkat";

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttp http = new CkHttp();
    boolean success;

    // Use this online tool to generate code from sample JSON: Generate Code to Create JSON

    // The following JSON is sent in the request body.

    // {
    //   "origination_account_id": "",
    //   "account_id": "",
    //   "type": "ach",
    //   "ach_class_code": "CCD",
    //   "ach_direction": "debit",
    //   "amount": "1.00"
    // }

    CkJsonObject json = new CkJsonObject();
    json.UpdateString("origination_account_id","");
    json.UpdateString("account_id","");
    json.UpdateString("type","ach");
    json.UpdateString("ach_class_code","CCD");
    json.UpdateString("ach_direction","debit");
    json.UpdateString("amount","1.00");

    http.SetRequestHeader("Content-Type","application/json");
    http.SetRequestHeader("Authorization","{{authorization}}");
    http.SetRequestHeader("Identity","{{identity}}");

    CkHttpResponse resp = http.PostJson3("https://{{environment}}.bond.tech/api/v0/transfers","application/json",json);
    if (http.get_LastMethodSuccess() == false) {
        Log.i(TAG, http.lastErrorText());
        return;
        }

    Log.i(TAG, String.valueOf(resp.get_StatusCode()));
    Log.i(TAG, resp.bodyStr());


  }

  static {
      System.loadLibrary("chilkat");

      // Note: If the incorrect library name is passed to System.loadLibrary,
      // then you will see the following error message at application startup:
      //"The application <your-application-name> has stopped unexpectedly. Please try again."
  }
}

Curl Command

curl -X POST
	-H "Content-Type: application/json"
	-H "Authorization: {{authorization}}"
	-H "Identity: {{identity}}"
	-d '{
    "origination_account_id": "",
    "account_id": "",
    "type": "ach",
    "ach_class_code": "CCD",
    "ach_direction": "debit",
    "amount": "1.00"
}'
https://{{environment}}.bond.tech/api/v0/transfers

Postman Collection Item JSON

{
  "name": "create transfer",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "type": "text",
        "value": "application/json"
      },
      {
        "key": "Authorization",
        "type": "text",
        "value": "{{authorization}}"
      },
      {
        "key": "Identity",
        "type": "text",
        "value": "{{identity}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n    \"origination_account_id\": \"\",\n    \"account_id\": \"\",\n    \"type\": \"ach\",\n    \"ach_class_code\": \"CCD\",\n    \"ach_direction\": \"debit\",\n    \"amount\": \"1.00\"\n}"
    },
    "url": {
      "raw": "https://{{environment}}.bond.tech/api/v0/transfers",
      "protocol": "https",
      "host": [
        "{{environment}}",
        "bond",
        "tech"
      ],
      "path": [
        "api",
        "v0",
        "transfers"
      ]
    },
    "description": "Add Card financial Core"
  },
  "response": [
    {
      "name": "ach",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "name": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Authorization",
            "type": "text",
            "value": "{{authorization}}"
          },
          {
            "key": "Identity",
            "type": "text",
            "value": "{{identity}}"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"origination_account_id\": \"49483eb9-1404-4fe9-aa9b-80e014cdc393\",\n    \"account_id\": \"092c2e63-6141-4f29-8aa3-93881dc97483\",\n    \"type\": \"ach\",\n    \"ach_class_code\": \"CCD\",\n    \"ach_direction\": \"debit\",\n    \"amount\": \"1.00\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://sandbox.bond.tech/api/v0/transfers/:transfer_id",
          "protocol": "https",
          "host": [
            "sandbox",
            "bond",
            "tech"
          ],
          "path": [
            "api",
            "v0",
            "transfers",
            ":transfer_id"
          ],
          "variable": [
            {
              "key": "transfer_id",
              "value": ""
            }
          ]
        }
      },
      "_postman_previewlanguage": null,
      "header": null,
      "cookie": [
      ],
      "body": null
    },
    {
      "name": "card-to-card",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "name": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Authorization",
            "type": "text",
            "value": "{{authorization}}"
          },
          {
            "key": "Identity",
            "type": "text",
            "value": "{{identity}}"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"origination_account_id\": \"49483eb9-1404-4fe9-aa9b-80e014cdc393\",\n    \"account_id\": \"092c2e63-6141-4f29-8aa3-93881dc97483\",\n    \"type\": \"card-to-card\",\n    \"amount\": \"1.00\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://sandbox.bond.tech/api/v0/transfers/:transfer_id",
          "protocol": "https",
          "host": [
            "sandbox",
            "bond",
            "tech"
          ],
          "path": [
            "api",
            "v0",
            "transfers",
            ":transfer_id"
          ],
          "variable": [
            {
              "key": "transfer_id",
              "value": ""
            }
          ]
        }
      },
      "_postman_previewlanguage": null,
      "header": null,
      "cookie": [
      ],
      "body": null
    }
  ]
}