Chilkat Online Tools

Swift3 / Bond APIs / get transactions by id

Back to Collection Items

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

    let http = CkoHttp()!
    var success: Bool

    http.setRequestHeader("Authorization", value: "{{authorization}}")
    http.setRequestHeader("Identity", value: "{{identity}}")

    let sbResponseBody = CkoStringBuilder()!
    success = http.quickGetSb("https://{{environment}}.bond.tech/api/v0/transatcions/:transaction_id", sbContent: sbResponseBody)
    if success == false {
        print("\(http.lastErrorText!)")
        return
    }

    print("Response status code = \(http.lastStatus.intValue)")
    print("\(sbResponseBody.getAsString()!)")

}

Curl Command

curl -X GET
	-H "Authorization: {{authorization}}"
	-H "Identity: {{identity}}"
https://{{environment}}.bond.tech/api/v0/transatcions/:transaction_id

Postman Collection Item JSON

{
  "name": "get transactions by id",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "{{authorization}}",
        "type": "text"
      },
      {
        "key": "Identity",
        "value": "{{identity}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "https://{{environment}}.bond.tech/api/v0/transatcions/:transaction_id",
      "protocol": "https",
      "host": [
        "{{environment}}",
        "bond",
        "tech"
      ],
      "path": [
        "api",
        "v0",
        "transatcions",
        ":transaction_id"
      ],
      "query": [
        {
          "key": "card_account_id",
          "value": "b18f94bc-0d7c-456e-a2e7-19e68393b64f",
          "disabled": true
        }
      ],
      "variable": [
        {
          "key": "transaction_id",
          "value": ""
        }
      ]
    },
    "description": "Retrieve Card to Card Transfer"
  },
  "response": [
    {
      "name": "example",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "{{authorization}}",
            "type": "text"
          },
          {
            "key": "Identity",
            "value": "{{identity}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://{{environment}}.bond.tech/api/v0/transatcions/:transaction_id",
          "protocol": "https",
          "host": [
            "{{environment}}",
            "bond",
            "tech"
          ],
          "path": [
            "api",
            "v0",
            "transatcions",
            ":transaction_id"
          ],
          "query": [
            {
              "key": "card_account_id",
              "value": "b18f94bc-0d7c-456e-a2e7-19e68393b64f",
              "disabled": true
            }
          ],
          "variable": [
            {
              "key": "transaction_id",
              "value": ""
            }
          ]
        }
      },
      "_postman_previewlanguage": "json",
      "header": null,
      "cookie": [
      ],
      "body": "{\n    \"transaction_id\": \"b9b8da9a-5ff2-4e5c-84ee-587b7d092f6b\",\n    \"bond_brand_id\": \"8ed5c9fe-581b-490a-9dcb-3302db235a4b\",\n    \"customer_id\": \"6493109c-7cb5-4f21-9d19-d9c3901d452d\",\n    \"account_id\": \"9dc86a8a-4c12-4107-84a8-e7cf6a76586f\",\n    \"payment_type\": \"card\",\n    \"transaction_type\": \"credit\",\n    \"previous_transaction_id\": null,\n    \"state\": \"pending\",\n    \"amount\": \"5.30\",\n    \"currency\": \"USD\",\n    \"created_time\": \"2021-02-02T22:27:13+00:00\",\n    \"updated_time\": \"2021-03-02T20:39:56+00:00\",\n    \"balances\": {\n        \"prior_balance\": \"68.83\",\n        \"new_balance\": \"63.53\"\n    },\n    \"details\": {\n        \"card_id\": \"71efc729-830f-455f-9525-281c19bb4bb4\",\n        \"mcc\": \"3542\",\n        \"mcc_description\": \"matrix dynamic eyeballs\",\n        \"currency\": \"USD\",\n        \"exchange_rate\": \"0.00\",\n        \"merchant_id\": \"9le8DI5z8am54O3b\",\n        \"merchant_name\": \"Baldwin, Wright and Martinez\",\n        \"merchant_city\": \"New Nathanshire\",\n        \"merchant_state\": \"Missouri\",\n        \"merchant_country\": \"Colombia\",\n        \"merchant_postal_code\": \"34100\",\n        \"cardholder_presence\": true,\n        \"statement_descriptor\": \"Target #4744\",\n        \"arn\": \"000091556011\",\n        \"fraud_rule_triggered\": \"spend_velocity\"\n    }\n}"
    }
  ]
}