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://cms-sandbox.bongloy.com
Production https://cms.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.

While using the sandbox you can download this private key. Your sandbox account is already configured with the matching public key.

In production you must generate your own RSA public/private key pair and provide us with your public key.

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

Sample Code (Ruby)

require "net/http"
require "uri"
require "jwt"

jwt_payload = {
  "api_token": "[your api token]",
  "timestamp": Time.now.to_i
}

private_key = OpenSSL::PKey::RSA.new(File.read("[YOUR PRIVATE KEY]"))
jwt = JWT.encode(jwt_payload, private_key, 'RS256')

uri = URI.parse("https://cms-sandbox.bongloy.com/v1/transactions")
request = Net::HTTP::Get.new(uri.request_uri)
request["Content-Type"] = "application/vnd.api+json"
request["Authorization"] = "Bearer #{jwt}"

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
response = http.request(request)

p response.body

Webhooks

Bongloy uses webhooks to notify your application when an event happens in your account. Bongloy signs the webhook events it sends to your endpoint by including a signature in each event's Authorization header. This allows you to verify that the events were sent by Bongloy, not by a third party.

All requests are signed using JSON Web Token (JWT) Bearer authentication, according to the HS256 (HMAC-SHA256) algorithm.

You should verify the events that Bongloy sends to your Webhook endpoints. Here's an example in Ruby:

JWT.decode(
  request.headers["Authorization"].sub("Bearer ", ""),
  "[your-webhook-signing-secret]",
  true,
  algorithm: "HS256",
  verify_iss: true,
  iss: "Bongloy"
)

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).

Pagination

Bongloy utilizes cursor-based pagination via the after and before parameters. Both parameters take an existing ID value (see below) and return objects in reverse chronological order. Requests for resources that support pagination return page navigation links to the next and previous page.

Example

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/transactions?page[size]=2" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer wbvxjUgQm5jT1Ck7L7pgy9jwWLB4k7xsTcsQZMX4r4Y"

Endpoint

GET /connect/v1/transactions

GET /connect/v1/transactions?page[size]=2

Parameters

page: {"size"=>"2"}
Name Description
page[size] A limit on the number of objects to be returned, between 1 and 100. Default is 10.
page[after] A cursor for use in pagination. after is the ID that defines your place in the list. For instance, if you make a list request and receive 10 objects, ending with ID abc, your subsequent call can include after=abc in order to fetch the next page of the list.
page[before] A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 10 objects, starting with ID def, your subsequent call can include before=def in order to fetch the previous page of the list.

Response


200 OK
{
  "data": [
    {
      "id": "02fbd581-4834-4e8f-a9f3-64d9312edf4e",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-11-23T08:42:10Z",
        "updated_at": "2020-11-23T08:42:10Z",
        "currency": "USD",
        "transaction_number": "830291955231",
        "transaction_currency": "USD",
        "transaction_details": {
          "card": {
            "merchant_data": {
              "city": "Phnom Penh",
              "name": "Rocket Rides",
              "country": "Cambodia",
              "category": "taxicabs_limousines"
            }
          },
          "type": "card"
        },
        "type": "purchase",
        "fees": [

        ],
        "status": "settled",
        "balance_adjustment_type": "debit",
        "amount": 1000,
        "total_fee": 0,
        "transaction_amount": 1000,
        "rewards": {
        },
        "transaction_time": "2020-01-03T00:00:00Z",
        "settlement_time": "2020-01-03T00:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "6d1297b4-7b44-4928-b29a-2ee706aec566",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "d2145d88-4f9a-4de6-9ce1-979986b09922",
            "type": "card"
          }
        }
      }
    },
    {
      "id": "c5c29fae-f5b2-4080-bc86-3454873bd800",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-11-23T08:42:10Z",
        "updated_at": "2020-11-23T08:42:10Z",
        "currency": "USD",
        "transaction_number": "682039110563",
        "transaction_currency": "USD",
        "transaction_details": {
          "card": {
            "merchant_data": {
              "city": "Phnom Penh",
              "name": "Rocket Rides",
              "country": "Cambodia",
              "category": "taxicabs_limousines"
            }
          },
          "type": "card"
        },
        "type": "purchase",
        "fees": [

        ],
        "status": "settled",
        "balance_adjustment_type": "debit",
        "amount": 1000,
        "total_fee": 0,
        "transaction_amount": 1000,
        "rewards": {
        },
        "transaction_time": "2020-01-02T00:00:00Z",
        "settlement_time": "2020-01-02T00:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "6d1297b4-7b44-4928-b29a-2ee706aec566",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "d2145d88-4f9a-4de6-9ce1-979986b09922",
            "type": "card"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://cms-sandbox.bongloy.com/connect/v1/transactions?page%5Bbefore%5D=02fbd581-4834-4e8f-a9f3-64d9312edf4e&page%5Bsize%5D=2",
    "next": "http://cms-sandbox.bongloy.com/connect/v1/transactions?page%5Bafter%5D=c5c29fae-f5b2-4080-bc86-3454873bd800&page%5Bsize%5D=2"
  }
}

Authentication

Test Data

While testing in the sandbox you can use the following phone number and OTP code for authentication.

Phone Number OTP
85513333333 123456

Create a cardholder verification

Request

curl "https://cms-sandbox.bongloy.com/connect/v1/cardholder_verifications" -d '{
  "data": {
    "type": "cardholder_verification",
    "attributes": {
      "phone_number": "85512583587",
      "account_identifier": "277000182"
    }
  }
}' -X POST \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer 2F9ewtrg0XXYnmc54OlmZN2FY-yNE9k3YaSyGLfG3_g"

Endpoint

POST /connect/v1/cardholder_verifications

POST /connect/v1/cardholder_verifications

Parameters

{
  "data": {
    "type": "cardholder_verification",
    "attributes": {
      "phone_number": "85512583587",
      "account_identifier": "277000182"
    }
  }
}
Name Description
data[attributes][phone_number] required The cardholder's phone number in E.164 format
data[attributes][account_identifier] required A unique identifier for account

Response


201 Created
{
  "data": {
    "id": "96bf0a8a-271a-4754-9957-a988011f868e",
    "type": "cardholder_verification",
    "attributes": {
      "created_at": "2020-11-23T08:42:13Z",
      "updated_at": "2020-11-23T08:42:13Z",
      "phone_number": "85512583587",
      "status": "pending",
      "valid_until": "2020-11-23T08:44:13Z"
    }
  }
}

Authenticate a cardholder

Request

curl "https://cms-sandbox.bongloy.com/oauth/token" -d '{
  "grant_type": "password",
  "scope": "connect",
  "auth_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImY1YzlhZWJlMjM0ZGE2MDE2YmQ3Yjk0OTE2OGI4Y2Q1YjRlYzllZWIiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vYm9uZ2xveS1hcHAtc2FuZGJveCIsImF1ZCI6ImJvbmdsb3ktYXBwLXNhbmRib3giLCJhdXRoX3RpbWUiOjE1OTAwNTUxMjEsInVzZXJfaWQiOiJ0R21oMEl2M0dMU2FFandqREYwRHFMS3UzencxIiwic3ViIjoidEdtaDBJdjNHTFNhRWp3akRGMERxTEt1M3p3MSIsImlhdCI6MTU5MDA1NTEyMiwiZXhwIjoxNTkwMDU4NzIyLCJwaG9uZV9udW1iZXIiOiIrODU1MTMzMzMzMzMiLCJmaXJlYmFzZSI6eyJpZGVudGl0aWVzIjp7InBob25lIjpbIis4NTUxMzMzMzMzMyJdfSwic2lnbl9pbl9wcm92aWRlciI6InBob25lIn19.MKsGU4OeyyXDwgroKTu5yZFsw8LK7gubHflJ8TguEQ1nhuSpe3CWi56R-Cvviz54d2IdP09JHdEp5NFyoHcVAb9Pfkmo1wY1GrpVIulzzNBs2b-7JZe9ruEdgycUpDHpGC6glO39rnLaYvd9ZJZijrwDH3AUz5JN5LO0wAHWl9j23kqdTc5P5_n-n5dDQl4rPTwSZRWlXOqnqNfom4gpmYPR5OQf8Eot8meEYYDjpDxVQjobXhe5XaMObiis_EhbIUuZD6x3n3aYY3wj18d_KlN7iLWYTr8Z4_SScTi43cQa11mjdIpd-1BaFweoC30PhZUAINy1ymLx98esHaaIMA",
  "cardholder_verification_id": "0e8222c5-d5fe-414a-b684-fcd9611949c4",
  "client_id": "jHU7zhsbcU8cMe7RwbbL83gaBamfoN7JJ5kiXCEfXLU",
  "client_secret": "bMzNtWYnwN7GCi-7NzDljKbghn1RuWnQ_gGM4v3Izl0"
}' -X POST \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer e9mvHTiGb92QzncyxGS7R97yBxYYOXjbchCbxFzYqwM" \
    -H "X-Device-Token: device-registration-token"

Endpoint

POST /oauth/token

POST /oauth/token

Parameters

{
  "grant_type": "password",
  "scope": "connect",
  "auth_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImY1YzlhZWJlMjM0ZGE2MDE2YmQ3Yjk0OTE2OGI4Y2Q1YjRlYzllZWIiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vYm9uZ2xveS1hcHAtc2FuZGJveCIsImF1ZCI6ImJvbmdsb3ktYXBwLXNhbmRib3giLCJhdXRoX3RpbWUiOjE1OTAwNTUxMjEsInVzZXJfaWQiOiJ0R21oMEl2M0dMU2FFandqREYwRHFMS3UzencxIiwic3ViIjoidEdtaDBJdjNHTFNhRWp3akRGMERxTEt1M3p3MSIsImlhdCI6MTU5MDA1NTEyMiwiZXhwIjoxNTkwMDU4NzIyLCJwaG9uZV9udW1iZXIiOiIrODU1MTMzMzMzMzMiLCJmaXJlYmFzZSI6eyJpZGVudGl0aWVzIjp7InBob25lIjpbIis4NTUxMzMzMzMzMyJdfSwic2lnbl9pbl9wcm92aWRlciI6InBob25lIn19.MKsGU4OeyyXDwgroKTu5yZFsw8LK7gubHflJ8TguEQ1nhuSpe3CWi56R-Cvviz54d2IdP09JHdEp5NFyoHcVAb9Pfkmo1wY1GrpVIulzzNBs2b-7JZe9ruEdgycUpDHpGC6glO39rnLaYvd9ZJZijrwDH3AUz5JN5LO0wAHWl9j23kqdTc5P5_n-n5dDQl4rPTwSZRWlXOqnqNfom4gpmYPR5OQf8Eot8meEYYDjpDxVQjobXhe5XaMObiis_EhbIUuZD6x3n3aYY3wj18d_KlN7iLWYTr8Z4_SScTi43cQa11mjdIpd-1BaFweoC30PhZUAINy1ymLx98esHaaIMA",
  "cardholder_verification_id": "0e8222c5-d5fe-414a-b684-fcd9611949c4",
  "client_id": "jHU7zhsbcU8cMe7RwbbL83gaBamfoN7JJ5kiXCEfXLU",
  "client_secret": "bMzNtWYnwN7GCi-7NzDljKbghn1RuWnQ_gGM4v3Izl0"
}
Name Description
grant_type required The grant_type of the token. Must be password
scope required Must be connect
client_id required The client id of the application
client_secret required The client secret of the application
auth_token required The auth token from the authentication provider
cardholder_verification_id required The id of the cardholder_verification

Response


200 OK
{
  "access_token": "6rOE7TRpVZtsHlZaru6j7mKf3GqGWH8c0ZDCl3s60go",
  "token_type": "Bearer",
  "expires_in": 7200,
  "refresh_token": "G69p8YR_FNmSPzR3tnnlgwvbeD6E2g3bdcNs-kMvTcA",
  "scope": "connect"
}

Refresh cardholder access token

Request

curl "https://cms-sandbox.bongloy.com/oauth/token" -d '{
  "grant_type": "refresh_token",
  "refresh_token": "1Ko7_tx5wiFL9Dc0xGnY8A",
  "client_id": "v9oQ5-j0W20jEMBObPQJKwGRTOpr19pNp25Gc7qwwiU",
  "client_secret": "HT6OWan21Fp4UIsGBvGYkVddrw06m-EptLow4R5Pm34"
}' -X POST \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer e9mvHTiGb92QzncyxGS7R97yBxYYOXjbchCbxFzYqwM" \
    -H "X-Device-Token: device-registration-token"

Endpoint

POST /oauth/token

POST /oauth/token

Parameters

{
  "grant_type": "refresh_token",
  "refresh_token": "1Ko7_tx5wiFL9Dc0xGnY8A",
  "client_id": "v9oQ5-j0W20jEMBObPQJKwGRTOpr19pNp25Gc7qwwiU",
  "client_secret": "HT6OWan21Fp4UIsGBvGYkVddrw06m-EptLow4R5Pm34"
}
Name Description
grant_type required The grant_type of the token. Must be refresh_token
refresh_token required The refresh token
client_id required The client id of the application
client_secret required The client secret of the application

Response


200 OK
{
  "access_token": "H-q8bAOAG16760x-jx6IbyIt5YcsIRO86Vz-0ykavYw",
  "token_type": "Bearer",
  "expires_in": 1,
  "refresh_token": "E5xq0hMsuszF1z4L-hnFcwUqmIh_lU-PRwNmYdwzMVA",
  "scope": "connect"
}

Logout a cardholder

Request

curl "https://cms-sandbox.bongloy.com/oauth/revoke" -d '{
  "token": "yJJNJqO2yFGuTA0--WcLvE3dH-Lv-hqPmP5u-EJnbCE",
  "client_id": "bg4duvxNMZd44MmIGs32yWfkfZ9V_31kjYfEL_xS33E",
  "client_secret": "A5hARPDKA234hiPSA-AOpQK7qI_5rAuguvhiTvOTcJM"
}' -X POST \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer e9mvHTiGb92QzncyxGS7R97yBxYYOXjbchCbxFzYqwM" \
    -H "X-Device-Token: device-registration-token"

Endpoint

POST /oauth/revoke

POST /oauth/revoke

Parameters

{
  "token": "yJJNJqO2yFGuTA0--WcLvE3dH-Lv-hqPmP5u-EJnbCE",
  "client_id": "bg4duvxNMZd44MmIGs32yWfkfZ9V_31kjYfEL_xS33E",
  "client_secret": "A5hARPDKA234hiPSA-AOpQK7qI_5rAuguvhiTvOTcJM"
}
Name Description
token required The token in which to revoke. Can be either a refresh token or an access token
client_id required The client id of the application
client_secret required The client secret of the application

Response


200 OK
{
}

Account Balance

Retrieve an account balance

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/accounts/77d9c23b-4524-4922-a50f-342463968ebc/balance" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer _2MFi_YFxaUUrPSDxsyx7vJ6A4OSYPz4m5gFGUoxZNQ"

Endpoint

GET /connect/v1/accounts/:account_id/balance

GET /connect/v1/accounts/77d9c23b-4524-4922-a50f-342463968ebc/balance

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "77d9c23b-4524-4922-a50f-342463968ebc",
    "type": "balance",
    "attributes": {
      "available": {
        "amount": 10000,
        "currency": "USD"
      },
      "balance": {
        "amount": 10000,
        "currency": "USD"
      }
    }
  }
}

Accounts

List all accounts

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/accounts" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer PUiHL5yFUfe98gLGyRHrL_MHbiz7Ip2MpBCUW3RfiIs"

Endpoint

GET /connect/v1/accounts

GET /connect/v1/accounts

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "1118cfc4-554e-4c8a-a4a4-36e5ec88c942",
      "type": "account",
      "attributes": {
        "created_at": "2020-11-23T08:42:13Z",
        "updated_at": "2020-11-23T08:42:13Z",
        "currency": "USD",
        "number": "000189",
        "status": "active",
        "metadata": {
        },
        "account_identifier": "284000189"
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "7c2da6a1-96c6-4e45-a2a8-f93c394ef239",
            "type": "cardholder"
          }
        }
      }
    },
    {
      "id": "1c5c7460-09bd-4126-990f-2c598145032f",
      "type": "account",
      "attributes": {
        "created_at": "2020-11-23T08:42:13Z",
        "updated_at": "2020-11-23T08:42:13Z",
        "currency": "USD",
        "number": "000188",
        "status": "active",
        "metadata": {
        },
        "account_identifier": "284000188"
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "7c2da6a1-96c6-4e45-a2a8-f93c394ef239",
            "type": "cardholder"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/connect/v1/accounts?page%5Bbefore%5D=1118cfc4-554e-4c8a-a4a4-36e5ec88c942",
    "next": null
  }
}

Retrieve an account

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/accounts/8800ac55-29a0-4482-b252-2546e8a20864" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer E3UYmG2s2I9JUmJJtEQRfhtXbHhoW9FFKQhPkkhTBeQ"

Endpoint

GET /connect/v1/accounts/:id

GET /connect/v1/accounts/8800ac55-29a0-4482-b252-2546e8a20864

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "8800ac55-29a0-4482-b252-2546e8a20864",
    "type": "account",
    "attributes": {
      "created_at": "2020-11-23T08:42:13Z",
      "updated_at": "2020-11-23T08:42:13Z",
      "currency": "USD",
      "number": "000191",
      "status": "active",
      "metadata": {
      },
      "account_identifier": "286000191"
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "96f27b31-af86-4fd2-ac09-fe23031bbf20",
          "type": "cardholder"
        }
      }
    }
  }
}

Cardholder

Retrieve cardholder information

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/cardholder" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer v7WF9l7XYQKkjJ2Gxpv-B_gDeCHxRUVZk0lg9Drx4cI"

Endpoint

GET /connect/v1/cardholder

GET /connect/v1/cardholder

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "595ed23d-7450-4dea-80e4-18a4545e91d2",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-11-23T08:42:13Z",
      "updated_at": "2020-11-23T08:42:13Z",
      "name": "Meta Kanha",
      "phone_number": "855715100860",
      "email": null,
      "type": "individual",
      "status": "active",
      "additional_details": {
        "name_km": "មេត្តា កញ្ញា",
        "member_id": "P01-123456",
        "member_since": "2019"
      },
      "metadata": {
      },
      "individual": {
        "address": "#87, Street 63 (Trasak Paem), Sangkat Boeung Raing, Khan Daun Penh, Phnom Penh, Cambodia",
        "date_of_birth": "2002-11-23",
        "identity_document_number": "A123456789",
        "identity_document_type": "id_card"
      }
    }
  }
}

Cards

List all cards

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/cards" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer iaOx9nz2FSRtzFsKxDLn8SfwYGpWe9QV-IIn_pdFiGA"

Endpoint

GET /connect/v1/cards

GET /connect/v1/cards

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "e6e21feb-21b1-45a4-8eb4-342f4181e486",
      "type": "card",
      "attributes": {
        "created_at": "2020-11-23T08:42:14Z",
        "updated_at": "2020-11-23T08:42:14Z",
        "last_four": "2345",
        "exp_month": 11,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "1831048a-e7a1-4723-8fcb-0758c8702b03",
            "type": "account"
          }
        },
        "card_product": {
          "data": {
            "id": "7fcaedc6-8691-440f-b2e0-fc31ee2657ff",
            "type": "card_product"
          }
        }
      }
    },
    {
      "id": "3df9a35b-1c75-4eb4-ad4a-66668a14b463",
      "type": "card",
      "attributes": {
        "created_at": "2020-11-23T08:42:14Z",
        "updated_at": "2020-11-23T08:42:14Z",
        "last_four": "2345",
        "exp_month": 11,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "1831048a-e7a1-4723-8fcb-0758c8702b03",
            "type": "account"
          }
        },
        "card_product": {
          "data": {
            "id": "7fcaedc6-8691-440f-b2e0-fc31ee2657ff",
            "type": "card_product"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/connect/v1/cards?page%5Bbefore%5D=e6e21feb-21b1-45a4-8eb4-342f4181e486",
    "next": null
  }
}

Retrieve a card

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/cards/86fcedde-f92d-4995-a19e-f87d9c8673f1" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer Hh9KIQqTvsFtvaHDtAJxNCwXOct9iAqFpM0E8pDjk_Q"

Endpoint

GET /connect/v1/cards/:id

GET /connect/v1/cards/86fcedde-f92d-4995-a19e-f87d9c8673f1

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "86fcedde-f92d-4995-a19e-f87d9c8673f1",
    "type": "card",
    "attributes": {
      "created_at": "2020-11-23T08:42:14Z",
      "updated_at": "2020-11-23T08:42:14Z",
      "last_four": "2345",
      "exp_month": 11,
      "exp_year": 2023,
      "status": "active",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "49446cdf-3ca4-457e-bf9e-afffcf475fc2",
          "type": "account"
        }
      },
      "card_product": {
        "data": {
          "id": "21b39160-826c-4882-a458-dc96e00227b5",
          "type": "card_product"
        }
      }
    }
  }
}

Transactions

List all transactions

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/transactions?filter[status]=settled&filter[account]=04028bbf-59ae-4b47-9ea3-90c1ffb1371f&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T12%3A00%3A00Z" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer 7Nz0obFRGfXq7Zheyhs1apn9QZBFVaMYl5NMozwmMfg"

Endpoint

GET /connect/v1/transactions

GET /connect/v1/transactions?filter[status]=settled&filter[account]=04028bbf-59ae-4b47-9ea3-90c1ffb1371f&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T12%3A00%3A00Z

Parameters

filter: {"status"=>"settled", "account"=>"04028bbf-59ae-4b47-9ea3-90c1ffb1371f", "from_date"=>"2020-01-01T00:00:00Z", "to_date"=>"2020-01-01T12:00:00Z"}
Name Description
filter[account] Return transactions belonging to the account with the provided ID.
filter[card] Return transactions belonging to the card with the provided ID.
filter[status] Return transactions with the provided status. Either settled or pending.
filter[balance_adjustment_type] Return transactions with the provided balance_adjustment_type. Either credit or debit.
filter[from_date] Return transactions on or after the provided date/time in ISO 8601 format.
filter[to_date] Return transactions on or before the provided date/time in ISO 8601 format.

Response


200 OK
{
  "data": [
    {
      "id": "1766838c-7564-4db9-95a1-dba6d578aee7",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-11-23T08:42:14Z",
        "updated_at": "2020-11-23T08:42:14Z",
        "currency": "USD",
        "transaction_number": "323666645594",
        "transaction_currency": "USD",
        "transaction_details": {
          "type": "transfer",
          "transfer": {
            "direction": "inward",
            "description": "foobar",
            "source_account_id": "eef2bcfb-20cb-406a-b03f-f14cf5a9b0f8",
            "source_issuer_name": "Issuer",
            "source_cardholder_name": "Meta Kanha",
            "source_account_identifier": "303000206"
          }
        },
        "type": "transfer",
        "fees": [

        ],
        "status": "settled",
        "balance_adjustment_type": "credit",
        "amount": 10000,
        "total_fee": 0,
        "transaction_amount": 10000,
        "rewards": {
        },
        "transaction_time": "2020-01-01T01:00:00Z",
        "settlement_time": "2020-01-01T01:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "04028bbf-59ae-4b47-9ea3-90c1ffb1371f",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "270dcbba-706d-4d1e-a317-64e4421fa48a",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-11-23T08:42:14Z",
        "updated_at": "2020-11-23T08:42:14Z",
        "currency": "USD",
        "transaction_number": "004266010538",
        "transaction_currency": "USD",
        "transaction_details": {
          "type": "transfer",
          "transfer": {
            "direction": "outward",
            "description": "foobar",
            "destination_account_id": "c58252c8-e60e-4b24-8ace-8285ce024934",
            "destination_issuer_name": "Issuer",
            "destination_cardholder_name": "Meta Kanha",
            "destination_account_identifier": "302000205"
          }
        },
        "type": "transfer",
        "fees": [

        ],
        "status": "settled",
        "balance_adjustment_type": "debit",
        "amount": 10000,
        "total_fee": 0,
        "transaction_amount": 10000,
        "rewards": {
        },
        "transaction_time": "2020-01-01T01:00:00Z",
        "settlement_time": "2020-01-01T01:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "04028bbf-59ae-4b47-9ea3-90c1ffb1371f",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "58b169a5-6ddc-4fad-b268-01647725eb13",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-11-23T08:42:14Z",
        "updated_at": "2020-11-23T08:42:14Z",
        "currency": "USD",
        "transaction_number": "390606229398",
        "transaction_currency": "USD",
        "transaction_details": {
          "type": "topup",
          "topup": {
            "funding_source": "Agent Network"
          }
        },
        "type": "topup",
        "fees": [

        ],
        "status": "settled",
        "balance_adjustment_type": "credit",
        "amount": 10000,
        "total_fee": 0,
        "transaction_amount": 10000,
        "rewards": {
        },
        "transaction_time": "2020-01-01T07:00:00Z",
        "settlement_time": "2020-01-01T07:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "04028bbf-59ae-4b47-9ea3-90c1ffb1371f",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "2907dfff-b432-4742-86ae-a18ddca69fe2",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-11-23T08:42:14Z",
        "updated_at": "2020-11-23T08:42:14Z",
        "currency": "USD",
        "transaction_number": "197466177688",
        "transaction_currency": "USD",
        "transaction_details": {
          "type": "balance_adjustment",
          "balance_adjustment": {
            "description": "Cashback payment for Sep 2020"
          }
        },
        "type": "cashback_payment",
        "fees": [

        ],
        "status": "settled",
        "balance_adjustment_type": "credit",
        "amount": 500,
        "total_fee": 0,
        "transaction_amount": 500,
        "rewards": {
        },
        "transaction_time": "2020-01-01T01:00:00Z",
        "settlement_time": "2020-01-01T01:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "04028bbf-59ae-4b47-9ea3-90c1ffb1371f",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "2f689400-4941-4937-959e-6f724598d9a2",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-11-23T08:42:14Z",
        "updated_at": "2020-11-23T08:42:14Z",
        "currency": "USD",
        "transaction_number": "503572098711",
        "transaction_currency": "USD",
        "transaction_details": {
          "card": {
            "merchant_data": {
              "city": "Phnom Penh",
              "name": "Rocket Rides",
              "country": "Cambodia",
              "category": "taxicabs_limousines"
            }
          },
          "type": "card"
        },
        "type": "purchase",
        "fees": [

        ],
        "status": "settled",
        "balance_adjustment_type": "debit",
        "amount": 1000,
        "total_fee": 0,
        "transaction_amount": 1000,
        "rewards": {
        },
        "transaction_time": "2020-01-01T01:00:00Z",
        "settlement_time": "2020-01-01T01:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "04028bbf-59ae-4b47-9ea3-90c1ffb1371f",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "7d654a0b-1c82-4e36-a4ed-b89cbccd0edc",
            "type": "card"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/connect/v1/transactions?filter%5Baccount%5D=04028bbf-59ae-4b47-9ea3-90c1ffb1371f&filter%5Bfrom_date%5D=2020-01-01T00%3A00%3A00Z&filter%5Bstatus%5D=settled&filter%5Bto_date%5D=2020-01-01T12%3A00%3A00Z&page%5Bbefore%5D=1766838c-7564-4db9-95a1-dba6d578aee7",
    "next": null
  }
}

Retrieve a transaction

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/transactions/e023324c-fd2f-454c-8ab7-604ed1f92395" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer NUeZMyU36HuRrypWeORlRGIJno25DBzh0PgANv7X9M4"

Endpoint

GET /connect/v1/transactions/:id

GET /connect/v1/transactions/e023324c-fd2f-454c-8ab7-604ed1f92395

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "e023324c-fd2f-454c-8ab7-604ed1f92395",
    "type": "transaction",
    "attributes": {
      "created_at": "2020-11-23T08:42:14Z",
      "updated_at": "2020-11-23T08:42:14Z",
      "currency": "USD",
      "transaction_number": "941601021010",
      "transaction_currency": "USD",
      "transaction_details": {
        "card": {
          "merchant_data": {
            "city": "Phnom Penh",
            "name": "Rocket Rides",
            "country": "Cambodia",
            "category": "taxicabs_limousines"
          }
        },
        "type": "card"
      },
      "type": "purchase",
      "fees": [

      ],
      "status": "settled",
      "balance_adjustment_type": "debit",
      "amount": 10000,
      "total_fee": 0,
      "transaction_amount": 10000,
      "rewards": {
        "cashback": {
          "amount": 20,
          "currency": "USD",
          "rate": "0.002"
        }
      },
      "transaction_time": "2020-11-23T08:42:14Z",
      "settlement_time": "2020-11-23T08:42:14Z"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "ee1b6de3-01ec-4aa0-ad8b-04b333b1fc79",
          "type": "account"
        }
      },
      "card": {
        "data": {
          "id": "3788d7a4-ffed-47ba-8c4f-5ae116b75c7a",
          "type": "card"
        }
      }
    }
  }
}

Get a transaction summary

Returns a summary of transactions for the current month

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/transactions/summary?filter[account]=f7d59bed-72bb-409a-9ee1-cf926b8ebba4" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer e09I0bNGwNw13N54JrC-Zh9grScIHoSObqdQfEWfkVg"

Endpoint

GET /connect/v1/transactions/summary

GET /connect/v1/transactions/summary?filter[account]=f7d59bed-72bb-409a-9ee1-cf926b8ebba4

Parameters

filter: {"account"=>"f7d59bed-72bb-409a-9ee1-cf926b8ebba4"}
Name Description
filter[account] required Return a summary of transactions belonging to the account with the provided ID.

Response


200 OK
{
  "data": {
    "id": "22f1bad0-f11f-4ca8-a6a4-01ce7a8a4b34",
    "type": "transactions_summary",
    "attributes": {
      "currency": "USD",
      "month": 11,
      "year": 2020,
      "debits": 10000,
      "credits": 2000,
      "cashback": 200
    }
  }
}