NAV
cURL

Introduction

The API is written according to the JSON API Specification. We highly recommend using a JSON API Client for consuming this API.

Environment Endpoint
Sandbox https://agent-network-sandbox.bongloy.com
Production https://agent-network.bongloy.com

Authentication

This API uses JSON Web Token (JWT) Bearer authentication. You must generate a JSON Web Token and include it in the Authorization header for all requests.

Request Signing

All requests require you to sign your JWT according to the RS256 (RSA using SHA-256 hash) algorithm. In production you must generate your own RSA public/private key pair and provide us with your public key. While using the sandbox you can use the sample private key provided with the code samples.

The payload of your JWT must include:

{
  "api_token": "[your api token]",
  "timestamp": "1581510124"
}

Generating a RSA public/private key pair

$ openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:4096
$ openssl rsa -pubout -in private_key.pem -out public_key.pub

Currencies

All API responses return amounts the currency's smallest unit. For example, a 10 USD transaction, would be returned as 1000 (i.e., 1000 cents).

Error Codes

Bongloy uses HTTP response status codes to indicate the success or failure of your API requests. If your request fails, Bongloy returns an error using the appropriate status code.

In general, there are three status code ranges you can expect:

Some 4xx errors that could be handled programmatically include an error code (a short string with a brief explanation) as a value for code. Below is a list of possible error codes that can be returned.

Code
validation_error
invalid_amount
insufficient_balance
invalid_transfer
expired_transfer
destination_account_daily_transfer_limit_exceeded
destination_account_not_found
destination_account_is_not_active

Code samples

Code samples for consuming this API can be found here https://gist.github.com/samnang/ad45122a7cdf50d5eebaba355f1126d4.

Organizations

List all Organizations

Request

curl -g "https://agent-network-sandbox.bongloy.com/v1/organizations" -X GET \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJQd0pqdmdCZThmcmdnYVlqX2E1MW5VSlpsRDVyckRQQ2QwU0ItNllWQkZJIiwidGltZXN0YW1wIjoiMTU5NTMwMjU3MCJ9.msNV7WT0ijW9SUZwDD3Zzlhg4ISdUpzGrc1NsBQMNRd_mJJ0wKCU5RbGFpEwFc2Nh1MTz9b_VhTT_zRSip_3KiHbLUhsLF36Ujxgyq0nfRs7yH4t3RoUqXSTy1Dd9v7Hvp3FVKh4KpXyyjOwDMGRiGqyMDEqN2VKIlm-NDEBw2cOEmplXXzUDSpwdkaXoZPUynfCoJiSzUgDMvlR-DOfS9neJolxEi2i7HHTl6r2iLBZeVTuzMGhhnuvqxrhqpq3Xm_x0mlxVJ7Qni059nKNCqARPXjFx1bVIskLhddzkfA4yK3qAqz5D3tCP9sn5-jQitkd61MkV3-0bfqDc1bES7FjGTDnKlUQw_DCjMAqQT1MSzn3Nze2R1CV2CICzSOfooWtOptbunB4pRhKKjNH4XIRht0d32FTOXUh1JvMtp2_-gSl6UV3toKXqTRBvU_2xE3-ESXSLdHYyD2y-HzlP9j3JQDRfPKciGWB_MuCFcy5o3W6VKQIylr0GGwKR_n8MYzt6segcN9MnRCeVf9w4taWJ_OSoXb61h4KsZ6UxhWzkGw5n_A0PdSvEEPJyBs2RAPq3cq75Act5zyhdUWIwdILuQs9SnM4OJBztcnpYN7HRNpfl66HNTbT2gbcFzyaiQHlqGAm2AvgxteViKHbNc3Be_kARhQdLWHlBIOTbAA"

Endpoint

GET /v1/organizations

GET /v1/organizations

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "bongloy_real_bin_testing",
      "type": "organization",
      "attributes": {
        "name": "Bongloy Real BIN Testing",
        "code": "003"
      }
    },
    {
      "id": "bongloy_testing",
      "type": "organization",
      "attributes": {
        "name": "Bongloy Testing",
        "code": "002"
      }
    },
    {
      "id": "uyfc",
      "type": "organization",
      "attributes": {
        "name": "UYFC",
        "code": "001"
      }
    },
    {
      "id": "vfc",
      "type": "organization",
      "attributes": {
        "name": "Visakha FC",
        "code": "005"
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/organizations?page%5Bbefore%5D=bongloy_real_bin_testing",
    "next": null
  }
}

Transfers

Create a Transfer

Request

curl "https://agent-network-sandbox.bongloy.com/v1/transfers" -d '{
  "data": {
    "type": "transfer",
    "attributes": {
      "amount": 10000,
      "currency": "USD",
      "destination_account_number": "002002965",
      "metadata": {
        "foobar": "foobar"
      }
    }
  }
}' -X POST \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiI3VG40eU11cUs3LVp3ZmhBLWdqTFFSYzl5N3RDcjBtdm5LOS05U0MtNDVJIiwidGltZXN0YW1wIjoiMTU5NTMwMjU3MCJ9.EiuVqKUsczp17QNrKKVTNKdmUyvbQJyPs-ruhgnYtUN51YHt2R-gvWEmcMQVjcyUlcfD0u8KSYX9gpJCXrvHSEoVUmXgiZFdBU_9qaVcrWZre8IuR8FBP3z0nAeY237aiMXxLya0SsBD-FXZpHgXEF0Ccjd7phaODfMSo5d09j5QUCUP4M3iPc26shc1l0mZZ0PWUn-0fvsx8FErfZi8oYJrvd2g2df3NrTyk8eCuP1M68wccawt5CtmUxZV1I_u3jwloaD7l9k78NFcksqsUV32QkOMsz76Yy5xo-fAYspS-gOZOj0o6aHhTjenXssAygk9GZOLkwYh_lLV0N_anCfEBY84zk2UYVEvyyaL-Ke4zXfc_VLGb6DYSrTfa4rrYdrnh8XVY3qJpejddj_SoCzwF21nZIubAhYCkeQ33GxNqynhF44aS8GKDyMtXUkbQxDQtIN2pduyMB8BYcUqWlBLW3wgHwUDjcy8ZEvOfnToLXSvylM0J0wpJWgG3dzgZJCeMrOhrsAvTqreLWCkju7Jn-sXc9IvdxpfkG7fq7HY18aDs35nrccIZGYr3zu07jirnnBbpCJgFEm8dVX_Fkg8EVYM0K6PfeKVNnH6O9k7iw394IGjdhX2ocPpycr9AQXTNc7eJBUYKcGBK7e2bJoasPS-wT7q2-mFinjyzcM"

Endpoint

POST /v1/transfers

POST /v1/transfers

Parameters

{
  "data": {
    "type": "transfer",
    "attributes": {
      "amount": 10000,
      "currency": "USD",
      "destination_account_number": "002002965",
      "metadata": {
        "foobar": "foobar"
      }
    }
  }
}
Name Description
data[attributes][amount] required A positive integer representing how much to transfer in the smallest currency unit (e.g., 10000 cents to transfer $100.00). The minimum amount is $1.00
data[attributes][currency] required The currency of the account. Only USD is supported at this time
data[attributes][destination_account_number] required The destination Bongloy account number
data[attributes][metadata] Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

Response


201 Created
{
  "data": {
    "id": "64bab505-bf16-402b-986a-5abf3c9c2f58",
    "type": "transfer",
    "attributes": {
      "created_at": "2020-07-21T03:36:10Z",
      "updated_at": "2020-07-21T03:36:10Z",
      "destination_account_number": "002002965",
      "destination_account_holder_name": "Serey Dara",
      "currency": "USD",
      "status": "pending_confirmation",
      "metadata": {
        "foobar": "foobar"
      },
      "error_code": null,
      "error_message": null,
      "amount": 10000
    }
  }
}

Confirm a Transfer

Request

curl "https://agent-network-sandbox.bongloy.com/v1/transfers/77944b0b-fbc7-4cd8-b92e-4faaa8054647/confirm" -d '{
  "data": {
    "type": "transfer",
    "id": "77944b0b-fbc7-4cd8-b92e-4faaa8054647"
  }
}' -X PATCH \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJ1VF84RlNxdDZtNFVtTDhEYWRPamVSbXFzQTV3bHRTLTJUckFfYjVfdzNZIiwidGltZXN0YW1wIjoiMTU5NTMwMjU3MCJ9.OA-W1AViTf01zUsAkHCk4FxoSXSaWwEVWci7Mh8--eU3egUjJtESd4wmlMDt9fM7n-ltAvqyKTyfPm8tXOBoe8AHDTHGqtYxojVqFNmIzIwnS1naRQOoVFrRe5nDmHfZZYbtG_EtL5cQxGlXVle99xcagft0KKuR6qBxmTLwYcE6ImgnnbogAWbdbejrNQ_dNMm0m97FMna2oFAz_i1t3NMJ5cmGjwNLyp1ZDh7RWufP6sz6m5RbHLz95wx34rs5hmIRgE8Kr9Cfnp03gWAauFvZ7IO_Xrn4wIJSp4AlWWyZZ74XsGd97QRQhEa_14M7GSy-8WoAF7R3tnFVcM-hDY8MOLX91FvSVkCW1Cdfi6RbNk7hrhHKiT8mU2qR9jaVtWRZiBN9SHQdUzymvs-YiMhbQSSjP07qFXfxetSvwnXGMcWl-CPJ1Ug7fhN3pRkgUFdt7sYgG53XXRwaB0zO_XfpYGs7Sf2Itv3K8qT-qQ_6Qw6P5dewMxGVJOdRe87EI0dL7jWAAjBDpAx_42jnE_RkYCS2FMgHihfYwyx5ThOOAkobiXgaaII9exlxA23L8Cd9rYbCm6niwZrOo0V_eVxD_vOe71rqmwt4gYkaVe3qPWHA0Owr_0GWXrzmu7Vg7GhE73LySfotEyR6XW_vLxICMjQg368FuUe60Qowqyo"

Endpoint

PATCH /v1/transfers/:id/confirm

PATCH /v1/transfers/77944b0b-fbc7-4cd8-b92e-4faaa8054647/confirm

Parameters

{
  "data": {
    "type": "transfer",
    "id": "77944b0b-fbc7-4cd8-b92e-4faaa8054647"
  }
}

None known.

Response


200 OK
{
  "data": {
    "id": "77944b0b-fbc7-4cd8-b92e-4faaa8054647",
    "type": "transfer",
    "attributes": {
      "created_at": "2020-07-21T03:36:10Z",
      "updated_at": "2020-07-21T03:36:10Z",
      "destination_account_number": "001123456",
      "destination_account_holder_name": "John Doe",
      "currency": "USD",
      "status": "successful",
      "metadata": {
      },
      "error_code": null,
      "error_message": null,
      "amount": 10000
    }
  }
}

Retrieve a Transfer

Request

curl -g "https://agent-network-sandbox.bongloy.com/v1/transfers/66eb85f6-efaa-4cb5-b45f-31c31db1a4d1" -X GET \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiIxd1hvZDhBci1RX081dnVqQ3h0bXo3UmlHdWFxVTZudGlHMl9yS0xaZDNRIiwidGltZXN0YW1wIjoiMTU5NTMwMjU3MCJ9.lhOONJxLYWMTqAH73jON4QA9J5ytxFesxVAAKakKkzqHe_naX3zEsVCfmoNcpp6oAkuShFTBQQp_O3vvvqFsX317ykQ60ze3bPsu9IdXzyKNROgOYIwz0jvdAeZxK0Au7eYvMxMiL0h0cyHQQpdw9EYaQiCDkOryGjQc1bwOgWmd80yc92GasevbznNhR68SUCLACjL_idK0XT_zOIamJfHflu8cYbFQ4zCIAzZw31WOAbUS_6uhpBdxsiQe58KykezGPoDqb2bbofBdeuxdwG0JmvNn4EetHvG7FiHPzRte6ooULrtADEKSl_lgPpjjn7xBnOCT3iLVYM3gdVHllXhRRbToc7VTOX-ZKTUoUJ4gGmowjEgrS54HDS9t93vNaeSllo3UNj-oevdKEr1lFl0FAnLBDS_ddtyJBkgdYy4KuciRyggvzIdsUb46DdrHKwWKpFQjYn_-BcSuNA0CwX0B_NBR8-RqssEA5gnC9hJDQl29K0nYNHRbB5Vly0MMDOwAxjCCvbonagrfToP7ARpcdSu3vmU4IIegYG78AYD-ZCC1GGCySAAy5r8mGm4HKYgopftjTok7XbXBt3l_VtafYGBWP71VRFk82sm7GcdFTL9aaux2oCW6Vgxal8C6XJjJjytVNU3ZDHOjkF9q2QiYXji-fa6xoFH313u2dyk"

Endpoint

GET /v1/transfers/:id

GET /v1/transfers/66eb85f6-efaa-4cb5-b45f-31c31db1a4d1

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "66eb85f6-efaa-4cb5-b45f-31c31db1a4d1",
    "type": "transfer",
    "attributes": {
      "created_at": "2020-07-21T03:36:10Z",
      "updated_at": "2020-07-21T03:36:10Z",
      "destination_account_number": "001123456",
      "destination_account_holder_name": "John Doe",
      "currency": "USD",
      "status": "successful",
      "metadata": {
      },
      "error_code": null,
      "error_message": null,
      "amount": 10000
    }
  }
}

Update a Transfer

Request

curl "https://agent-network-sandbox.bongloy.com/v1/transfers/80acd568-0cf1-4e46-b106-5dea77475811" -d '{
  "data": {
    "id": "80acd568-0cf1-4e46-b106-5dea77475811",
    "type": "transfer",
    "attributes": {
      "metadata": {
        "reference_number": "cde456",
        "other_field": "foobar"
      }
    }
  }
}' -X PATCH \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJTNEtUaEpsdjFncVZBYmF1elZvNzU2ZHNna2dZNkp1WmJrbVlIbHNId0FVIiwidGltZXN0YW1wIjoiMTU5NTMwMjU3MCJ9.ACyLC3lDgplFQ7kKsU7Ou8NKnQgjx1KQWiP18xc2bDU8bhBlpc4JCRjy2U3cNpEqFx-6HI5sOBUyz5O_15mVYx5fsx03LVAM1lwm2_yYghBf0vGZcxyYupCUXJXuAEesVifheSTMBlUZaERO9eEGKtX08JnQrcpymAlwrEuaVJztpDn5yiq7gC4HK-fv53p4hUCaYd8lLoJIK0Mob2PcJLy8IJFeLPJb3V5MFRkFAOyTsESFOMR5lwBfUxisClYlGWDM0barCQJe4nWHc0mjMrWzlgVkd2XPoQNA0I_hk_0QUWyKuitrv7ErtGfU6nrbWC4BS9RJCqZLYa84dsLkKqGoeFkDyZHtr6DC6T1CG47GUWhPqKrURRINg8ziIkKQnmvMvroOexAVYEU4qknFgS2dbdCvuq9zRG-bTQGH1gqceCr-zr5LjT22OUGjrJU7GGjGbyvV3UJld0vzEYn2JD5eQg7Qq_PFR_BlGeTT8u21B397KCPZ7vY4EVCGds0xXud_idbzTbiXnWE2Ub-qX-55Fz_19v83OSH2UqqXNnsaJr2TqW-d7HkfWhUYac6BbCxVt0nyuKYHO9BMzOIudhshDVvmqBa5Ha0EfbftmvYZ-AJGwmhV3HSqsPT-IMqfcGGcgfNCPI9QhJf0djJdxeAkyPkbEw4rl8cfWRD90T4"

Endpoint

PATCH /v1/transfers/:id

PATCH /v1/transfers/80acd568-0cf1-4e46-b106-5dea77475811

Parameters

{
  "data": {
    "id": "80acd568-0cf1-4e46-b106-5dea77475811",
    "type": "transfer",
    "attributes": {
      "metadata": {
        "reference_number": "cde456",
        "other_field": "foobar"
      }
    }
  }
}

None known.

Response


200 OK
{
  "data": {
    "id": "80acd568-0cf1-4e46-b106-5dea77475811",
    "type": "transfer",
    "attributes": {
      "created_at": "2020-07-21T03:36:10Z",
      "updated_at": "2020-07-21T03:36:10Z",
      "destination_account_number": "001123456",
      "destination_account_holder_name": "John Doe",
      "currency": "USD",
      "status": "successful",
      "metadata": {
        "reference_number": "cde456",
        "foo": "bar",
        "other_field": "foobar"
      },
      "error_code": null,
      "error_message": null,
      "amount": 10000
    }
  }
}

List all Transfers

Request

curl -g "https://agent-network-sandbox.bongloy.com/v1/transfers?filter[status]=successful&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T11%3A00%3A00Z" -X GET \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJBcWR2U3VyU0J1VEJWTGxlTTZjYjFEbHZlNFdma3hSZi1Fa2tyb04yaFpzIiwidGltZXN0YW1wIjoiMTU5NTMwMjU3MCJ9.ORerUCnoB7u1B4MLoJtp7aJlFlAQ4orHV6RhwoLc_SuBjzTrxBXGD9Yi_shj6fYdNGBzLtFsmjLUi5eOR-BWlIlmQnAZMpBiDANxWXVtm2iSoHzZ0xcmd9RjTI8iXz-ebBokR_DI2crrYTAtUB7SuoNE86bjHB0BR1iCSTO4b-Ss0aMbPhJN_CnHv7MmM3td6266YxHHMjE1OuJxECZnEwzQiPCmkw9Cn4bG-SfPCM1mCZIWnk3Ypq-6t2KreV_geZp_3SSBVgYznpy1WrHT3fYOObKmHX7Q4YkGoUzM8UNBS75vIZums703VXLo_3nYBmRc4dZKJVbs3JnLV_M71tMp3aCLNlKjbiiuaoT6Wszhm8A_1ebj7EQZC2nuEMPV4IaxfoKTTQbPTDnWlXVAzE2M1us0TEerGkkhMwxc_j836h5dR3L-nLSJTz0hS-xPMR5DiuIH5h4vRisvEQy9njfNUl0Z-juKb-6tWFXqV5_RYK2PEAfoZXq5MSEJkuX8-C8R-A_jKIicruXlPNXTCXyE_H2m7W9eCvqGrCqdCzLeCqwZLNsiuUAWnC_ZGtgYcEVNEFi20QARUUqzFcYOf5hrfkE6iezPKZwT6IzXFMgbOPBlX8Ce4ndFQ5W8pZp8lZS9J-j5S26PdSgq3NEbdDpqsN5xEcRGxhcm-IanuN8"

Endpoint

GET /v1/transfers

GET /v1/transfers?filter[status]=successful&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T11%3A00%3A00Z

Parameters

filter: {"status"=>"successful", "from_date"=>"2020-01-01T00:00:00Z", "to_date"=>"2020-01-01T11:00:00Z"}
Name Description
filter[status] Return transfers that match the provided status.
filter[from_date] Return transfers on or after the provided date/time in ISO 8601 format.
filter[to_date] Return transfers on or before the provided date/time in ISO 8601 format.

Response


200 OK
{
  "data": [
    {
      "id": "ad13bc32-476a-4c83-afc3-56a3381de506",
      "type": "transfer",
      "attributes": {
        "created_at": "2020-01-01T01:00:00Z",
        "updated_at": "2020-07-21T03:36:10Z",
        "destination_account_number": "001123456",
        "destination_account_holder_name": "John Doe",
        "currency": "USD",
        "status": "successful",
        "metadata": {
        },
        "error_code": null,
        "error_message": null,
        "amount": 10000
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/transfers?filter%5Bfrom_date%5D=2020-01-01T00%3A00%3A00Z&filter%5Bstatus%5D=successful&filter%5Bto_date%5D=2020-01-01T11%3A00%3A00Z&page%5Bbefore%5D=ad13bc32-476a-4c83-afc3-56a3381de506",
    "next": null
  }
}