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

Cardholder Authorization

Getting a Cardholder Access Token

For some API endpoints, such as Transfers you need explicit permission from the cardholder. Obtaining an access token requires a cardholder to authorize the app for the requested scopes. Then the cardholder's access token can be requested.

Request Cardholder Authorization

Direct the user to /oauth/authorize with the following query parameters:

Query Parameter Description
response_type Access response type being requested. The supported authorization workflow requires the value code.
redirect_uri URI to handle successful user authorization. Must match with Development or Production Redirect URI in your OAuth app settings.
client_id OAuth application's Development or Production Client ID.
cardholder_id The id of the cardholder
scope The scopes in which to authorize. Only transactions:transfer is supported at this time

Example:

https://cms-sandbox.bongloy.com/oauth/authorize?client_id=3T_pVr97_RJ3xMbYFTarDw1XVlcrUaz3GBKAZWYT79s&cardholder_id=2810059e-7a76-4b33-9ba6-65d4bf8491bd&redirect_uri=your-app://back-from-oauth&scope=transactions:transfer&response_type=code

After the cardholder has been redirected, they will be asked to enter their phone number. For testing purposes you can use the following phone number and OTP. Note that the phone number must match the provided cardholder's phone number.

Phone Number OTP
85513333333 123456

If authorized, the user will be redirected to the redirect_uri with the authorization code in the code query parameter.

your-app://back-from-oauth?code=obBEe8ewaL_KdyNjniT4KPd8ffDWt9fGB

Create a cardholder access token

Request

curl "https://cms-sandbox.bongloy.com/oauth/token" -d '{
  "grant_type": "authorization_code",
  "code": "fJIleR2y7-ZvMGjJB9JYVptEBm4cOXGjSNlmeNux7nI",
  "redirect_uri": "https://www.example.com",
  "client_id": "GuSQLlZgPqi8oEezz3WQPLam_ukmr6KEM6ll5QU_FDU",
  "client_secret": "sJj9TlD6cysnw6Pn10qrMjCH5XnBQ4Y-7bxKcNQIy6E"
}' -X POST \
    -H "Content-Type: application/vnd.api+json"

Endpoint

POST /oauth/token

POST /oauth/token

Parameters

{
  "grant_type": "authorization_code",
  "code": "fJIleR2y7-ZvMGjJB9JYVptEBm4cOXGjSNlmeNux7nI",
  "redirect_uri": "https://www.example.com",
  "client_id": "GuSQLlZgPqi8oEezz3WQPLam_ukmr6KEM6ll5QU_FDU",
  "client_secret": "sJj9TlD6cysnw6Pn10qrMjCH5XnBQ4Y-7bxKcNQIy6E"
}
Name Description
grant_type required The grant_type of the token. Must be authorization_code
code required The code returned from the authorization flow
client_id required The client id of the application
client_secret required The client secret of the application
redirect_uri required The redirect_uri for your application

Response


200 OK
{
  "access_token": "X_QSIGzIFciQoX1uiv4vPPr4sTNSWxIgdIbg1e-nJcY",
  "token_type": "Bearer",
  "expires_in": 7200,
  "refresh_token": "TXKRHPJv6i-kawZ9GDCfPVdbGIgc4LD0wCTn8vjlNq4",
  "scope": "transactions:transfer"
}

Refresh a cardholder access token

Request

curl "https://cms-sandbox.bongloy.com/oauth/token" -d '{
  "grant_type": "refresh_token",
  "refresh_token": "x59P3072FKGGCY6ql1QwPw",
  "client_id": "Qj_SX-0iw7BLmLLWu4dj27MOmSNVXUSRHxB1Wy5aH4U",
  "client_secret": "qr8dWrabXQxUzg_eiAXtpD-fMW4DuRoQbCIKH20wZug"
}' -X POST \
    -H "Content-Type: application/vnd.api+json"

Endpoint

POST /oauth/token

POST /oauth/token

Parameters

{
  "grant_type": "refresh_token",
  "refresh_token": "x59P3072FKGGCY6ql1QwPw",
  "client_id": "Qj_SX-0iw7BLmLLWu4dj27MOmSNVXUSRHxB1Wy5aH4U",
  "client_secret": "qr8dWrabXQxUzg_eiAXtpD-fMW4DuRoQbCIKH20wZug"
}
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": "SpFbcpCT3X2N9O_JyqIy5LuCdzb62znByT1aRXUqmQM",
  "token_type": "Bearer",
  "expires_in": 1,
  "refresh_token": "31dz-hfU8BTrOIWAjpCgGHQ3YTEQ1mAj-LjRGcfOB68",
  "scope": "transactions:transfer"
}

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/v1/transactions?page[size]=2" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJNMnZzNGtmUTFYdlplbV84S0xYSmRxSXp4YTN6dEJadzRHUzY0NDZfeG1jIiwidGltZXN0YW1wIjoiMTU5NzEzNDA3NSJ9.kfX7I-OWiPpfqytOTTZHaxLggtbBYD78NgrmgHqnFPQfXblWxvKE52oPhuP_kEVZWd1fGM_Z2Lnq7d2S9ICIupQvL5duI2Hap8FaW89Yv-KrgNjJ_DPnxrMAKjLb4_46K8Xv9DzuKHPowPpdnBndsv5LPnHQTb8gdpKhuvGCcqMKsir3GPqr_X2zQDIVBuNQM51JqmHpBrKLJWPVrB-L1Ppt-D4uKJPuI7IeDfbHiIr69ZtZMZNjWhqFWalDvxY4V_SyaWtltaPYu-gXisZm_L9YdTXG_cMC9JVrClXeMZjk-tDPDD8sT_YeDl3Ao0w00A5-wMtSpFgDX3k-2POcjg"

Endpoint

GET /v1/transactions

GET /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": "7182d211-62c5-4c58-b8bb-b2a12ae3ef1b",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-08-11T08:21:15Z",
        "updated_at": "2020-08-11T08:21:15Z",
        "currency": "USD",
        "transaction_number": "141538573497",
        "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,
        "transaction_time": "2020-01-03T00:00:00Z",
        "settlement_time": "2020-01-03T00:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "a9ab047f-4f28-41d2-b45b-83568587a30e",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "a0010a31-52fc-4871-a81a-f34fbf00b4a8",
            "type": "card"
          }
        }
      }
    },
    {
      "id": "e681125c-0f99-483c-b3ea-36d4ad93e3cf",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-08-11T08:21:15Z",
        "updated_at": "2020-08-11T08:21:15Z",
        "currency": "USD",
        "transaction_number": "185551021166",
        "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,
        "transaction_time": "2020-01-02T00:00:00Z",
        "settlement_time": "2020-01-02T00:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "a9ab047f-4f28-41d2-b45b-83568587a30e",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "a0010a31-52fc-4871-a81a-f34fbf00b4a8",
            "type": "card"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://cms-sandbox.bongloy.com/v1/transactions?page%5Bbefore%5D=7182d211-62c5-4c58-b8bb-b2a12ae3ef1b&page%5Bsize%5D=2",
    "next": "http://cms-sandbox.bongloy.com/v1/transactions?page%5Bafter%5D=e681125c-0f99-483c-b3ea-36d4ad93e3cf&page%5Bsize%5D=2"
  }
}

Account Inquiry

Lookup an account

Request

curl -g "https://cms-sandbox.bongloy.com/v1/account_inquiry?filter[account_identifier]=001123456" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJMWUFFa19ZalpLTWNPRDItckJ3UkxrU09zVGgzUnJCbk1jSERvTWQtY2lZIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MCJ9.hnLnE5jIIhc2g_3OQisAd6FsivjRFylhQB9vRSuwan28O2lkNNlStai3wl3GpmjjaGUYOsMljr6WTZAtfeML-P7eihCOBi3mXQHfH62u6NWuNafIOWbMVC7uisNiKcbyb2MlqL8684arGs0pVCjf1mEryM7FRYVDhMfgKLAqWTk55AL0jK3GIiS9i3idJNgWF5tdKJocA0MMCPeRRQOBkzaBc_p9s8ERxoYQrsV0Rhu8PSZ7Nec-NkjWB2ie3fjEFQ_kK7QPE6RWJ2fJEW4wBwGrzeLSmqbH22z4nsA5JkphJ-A1Em7EAX2lEHJWY0yJktiFbwu2loWxb1pX_kYFrA"

Endpoint

GET /v1/account_inquiry

GET /v1/account_inquiry?filter[account_identifier]=001123456

Parameters

filter: {"account_identifier"=>"001123456"}
Name Description
filter[account_identifier] required The account identifier of the account to inquire

Response


200 OK
{
  "data": {
    "id": "8e0b71a4-94d7-4653-b1c9-7437ff9c7c08",
    "type": "account_inquiry",
    "attributes": {
      "account_identifier": "001123456",
      "cardholder_name": "Meta Kanha",
      "issuer_name": "Issuer"
    }
  }
}

Account Balance

Retrieve an account balance

Request

curl -g "https://cms-sandbox.bongloy.com/v1/accounts/920a3421-2587-4755-a426-cf3ecf1bd447/balance" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJvbXZXbjdMRFpWaW4zdUY3Z3RqcUZOcEpzVjZQM0dYSjVsNHlOMW9FUVAwIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MCJ9.WmndJCIw8bbe2C8hrU6lbzqzzZeMTc1xicU_xX0rVPmy2nZRm8W5XAa3P0FuHRs3PpqHiZhSU5hZZYUnF64HGGX1OqlPq8GdKNhUHFTLYOWvrPWVxAy3_10F_B39hH1KSZoCP9nQYIc5g18QBzpb098Dal31UDZNg7VSxqAGcVE8n4AKzDzpeQA1INo4ujbyCK7nJ2tQhSYaI3ttJl4e-0jNEn0nXC9zZ3Dhkp9QN33TDZbkr3ZxgvaievFToPTPL3zkbzdDJKAAEx2wxCJTe-rGqxEpFv82NDhrgGtFfgZJ6TaCRDbim4LkVaN8lKU4Sft-G1PO_3PgziCdH81Gww"

Endpoint

GET /v1/accounts/:account_id/balance

GET /v1/accounts/920a3421-2587-4755-a426-cf3ecf1bd447/balance

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "920a3421-2587-4755-a426-cf3ecf1bd447",
    "type": "balance",
    "attributes": {
      "available": {
        "amount": 9000,
        "currency": "USD"
      },
      "balance": {
        "amount": 10000,
        "currency": "USD"
      }
    }
  }
}

Accounts

Create an account

Request

curl "https://cms-sandbox.bongloy.com/v1/accounts" -d '{
  "data": {
    "type": "account",
    "attributes": {
      "number": "123456",
      "currency": "USD",
      "metadata": {
        "foobar": "foobar"
      }
    },
    "relationships": {
      "cardholder": {
        "data": {
          "type": "cardholder",
          "id": "d762e50a-7b67-4b23-b646-d95387c6b9c1"
        }
      }
    }
  }
}' -X POST \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJCUXZiWURySzFITDNBWVZNQmNxdUtSZWl5MEVMTnBXeFAwUWhwTXdrM3g0IiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MSJ9.kAweBW7RYOjm-GMZhmvXOeth-0jUcFVX4Wkf9abjKLTQenAkCVqUz9MMWfjuFq-QoDZUDF4LcU4_GL6davSbei81_poDzwIMCwodmrGQTygM6DWKDLvVz8X9HU2QgYIvtfYId9xo4mr7bhRJKNl2AldKvPikMcbGE9k0ksqKVr7QLrWR3aBV-K3YurlWU94He7LX6SMFP269VAyxo6FooLaiJPOI3bSoAkyu0zau-H1_RTXytYlGBGZ35TKAwcJzY_ZZI6sLjdX8vb1bVPzQkoh9BgAzlN9_R1N9jgcFmcz5a8_PeW7OlrRf-Ctr6tplvI_nckygdw6--drg8Jkd-Q"

Endpoint

POST /v1/accounts

POST /v1/accounts

Parameters

{
  "data": {
    "type": "account",
    "attributes": {
      "number": "123456",
      "currency": "USD",
      "metadata": {
        "foobar": "foobar"
      }
    },
    "relationships": {
      "cardholder": {
        "data": {
          "type": "cardholder",
          "id": "d762e50a-7b67-4b23-b646-d95387c6b9c1"
        }
      }
    }
  }
}
Name Description
data[attributes][currency] required The currency of the account. Only USD is supported at this time
data[attributes][number] required A unique 6 digit number set by the issuer. This must uniquely identify the account in the issuer's system.
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.
data[relationships][cardholder] required The id of the cardholder in which the account will be created for

Response


201 Created
{
  "data": {
    "id": "694227e8-1e5b-48dc-aff9-cc4cb5e6acc3",
    "type": "account",
    "attributes": {
      "created_at": "2020-08-11T08:21:21Z",
      "updated_at": "2020-08-11T08:21:21Z",
      "currency": "USD",
      "number": "123456",
      "status": "active",
      "metadata": {
        "foobar": "foobar"
      },
      "account_identifier": "278123456"
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "d762e50a-7b67-4b23-b646-d95387c6b9c1",
          "type": "cardholder"
        }
      }
    }
  }
}

Update an account

Request

curl "https://cms-sandbox.bongloy.com/v1/accounts/fa6ae1d7-8d0c-49ec-9ea3-fc2174b56939" -d '{
  "data": {
    "type": "account",
    "id": "fa6ae1d7-8d0c-49ec-9ea3-fc2174b56939",
    "attributes": {
      "metadata": {
        "buzz": "foobar"
      }
    }
  }
}' -X PATCH \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiIwQzBONlRyWE9YUmF6anB4WUQ0WEFUUGFZTnBJbmtRbllOdnJuS09RYzNFIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MSJ9.UeBSyY44hxC6GHSrmHDu64Qgdc7l5E7EUlzxGZ3Hzpat4amRqJlFzVBvEYCq-l1c4Z0mKqi8_zfl1_V0HMt6cPWl5TaW3jR5BKTV6LvBScavf77xyjGpERqxx_1uVd1SarVujhjiUmeC9us-pkUb9GDpFf-UwLSKAA_GkrT4_WBofAkzL1PlGlHTemsNam1pgnVYD2C_3L4D_P7aQFjWKVzkfMNMqdU6dZhJhuW_JkTghmdTbktTjZzkHV9LZdIg2WOQPnpdPKcbTRxjjTUa6OZRCQSqi_wIEPzgOM9HTjzO6x4BIFaCT3OLQ2RhXaNRLM3TCN_mYfWdLI-GpucZzg"

Endpoint

PATCH /v1/accounts/:id

PATCH /v1/accounts/fa6ae1d7-8d0c-49ec-9ea3-fc2174b56939

Parameters

{
  "data": {
    "type": "account",
    "id": "fa6ae1d7-8d0c-49ec-9ea3-fc2174b56939",
    "attributes": {
      "metadata": {
        "buzz": "foobar"
      }
    }
  }
}

None known.

Response


200 OK
{
  "data": {
    "id": "fa6ae1d7-8d0c-49ec-9ea3-fc2174b56939",
    "type": "account",
    "attributes": {
      "created_at": "2020-08-11T08:21:21Z",
      "updated_at": "2020-08-11T08:21:21Z",
      "currency": "USD",
      "number": "000189",
      "status": "active",
      "metadata": {
        "foo": "bar",
        "buzz": "foobar"
      },
      "account_identifier": "280000189"
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "f0b7748e-a2c6-49e6-a805-4942f9ab3afc",
          "type": "cardholder"
        }
      }
    }
  }
}

Retrieve an account

Request

curl -g "https://cms-sandbox.bongloy.com/v1/accounts/1525616c-a76a-4b59-b885-ee4cfeff3893" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJNcWNjelZ4M2MtakZTN1RXMmxKUGdldUlnSnhSSTRfeHBBM1kteVdnck9JIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MSJ9.W9a0q5rsHn0mu_wTo9ZP8IM-gAKOcOqF3JiirH0MDwegOHFouK-9v4ERNwTIsDVsH1wV_JOjpMiTzSu6RFE5vOdhSWpCSpi9diq_uEKCgZTGwDPEFIT1fWwSCO9CQ-exJ79bDhMYuA57kYhHCse40czRoE4nit2lkatOWP23BT0iB43Zew0qSSqMN5JeZo7JAN0ygdkx2GyhEFeOpw0MZFfNfsAWiyvyFHtvVzaCa3IUDHLUCbKPtRnu6szGFe7psDYheZ4rBxiaKJYRnx5OIt_b2KdBLiltD5owIKuhpl6le1hewSMTbSdGmKBQT33rvyNsYsSS-Qyh_V1jEBi16w"

Endpoint

GET /v1/accounts/:id

GET /v1/accounts/1525616c-a76a-4b59-b885-ee4cfeff3893

Parameters

Name Description
id required The id of the account to be retrieved.

Response


200 OK
{
  "data": {
    "id": "1525616c-a76a-4b59-b885-ee4cfeff3893",
    "type": "account",
    "attributes": {
      "created_at": "2020-08-11T08:21:21Z",
      "updated_at": "2020-08-11T08:21:21Z",
      "currency": "USD",
      "number": "000190",
      "status": "active",
      "metadata": {
      },
      "account_identifier": "281000190"
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "7139d655-12b9-4ea6-b2db-dc45ef347308",
          "type": "cardholder"
        }
      }
    }
  }
}

List all accounts

Request

curl -g "https://cms-sandbox.bongloy.com/v1/accounts" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJUZzh5TXRxWkRpWG85TWxfaElrVTBQRVl6d29pZ0FxN25NR2hnZ2VycDZjIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MSJ9.eqhcMaPXv39GZTWhL2i7MbyS6uN2TH4abY1XjQ6bF2i5IdCKV4db6gI6qdcmZcKzlFjPEw5vDixrgb1DPdYA5c5Z5_SbAok1oTUWLHiCtsJWxCFvPGDpMaFOHJRFhFHpLqlQeTqaB82aOfwvw0QfAJUgDQrER24yPiH24fwkIdJEd1hSVXBSi8g2UyswJKCvVN7F9zox_D_X-jc-UVE5gs8Aka9AxDrIhsJgAvWAaHZ_ohhsbbMc9Nft4T33R_x8qNQ5z3mXGjqdPxguPMHQAyVZILXcO5AHOfiLqOUEcCcDWhQCd3hMuH0ufgzm66lp8xKEJQnhgBHi4VYX9hokDQ"

Endpoint

GET /v1/accounts

GET /v1/accounts

Parameters

Name Description
filter[cardholder] Only return accounts belonging to the Cardholder with the provided ID.
filter[account_identifier] Returns the account with the given identifier

Response


200 OK
{
  "data": [
    {
      "id": "358a6e34-bdbb-4efc-9b01-ae67efe02473",
      "type": "account",
      "attributes": {
        "created_at": "2020-08-11T08:21:21Z",
        "updated_at": "2020-08-11T08:21:21Z",
        "currency": "USD",
        "number": "000192",
        "status": "active",
        "metadata": {
        },
        "account_identifier": "282000192"
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "c9823230-446b-4b61-91b9-e37a37756c26",
            "type": "cardholder"
          }
        }
      }
    },
    {
      "id": "74c0e50a-4a41-4bf7-9427-84b50a982694",
      "type": "account",
      "attributes": {
        "created_at": "2020-08-11T08:21:21Z",
        "updated_at": "2020-08-11T08:21:21Z",
        "currency": "USD",
        "number": "000191",
        "status": "active",
        "metadata": {
        },
        "account_identifier": "282000191"
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "2742e0c0-981d-497b-86a6-3aa6de242b83",
            "type": "cardholder"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/accounts?page%5Bbefore%5D=358a6e34-bdbb-4efc-9b01-ae67efe02473",
    "next": null
  }
}

Cardholders

Create a cardholder

Request

curl "https://cms-sandbox.bongloy.com/v1/cardholders" -d '{
  "data": {
    "type": "cardholder",
    "attributes": {
      "name": "Tang Dara",
      "phone_number": "855715200960",
      "type": "individual",
      "individual": {
        "date_of_birth": "20161220",
        "address": "#87, Street 63 (Trasak Paem), Sangkat Boeung Raing, Khan Daun Penh, Phnom Penh, Cambodia",
        "remote_photo_url": "https://via.placeholder.com/150.png",
        "remote_identity_document_url": "https://via.placeholder.com/600.png",
        "identity_document_number": "123456789",
        "identity_document_type": "id_card"
      },
      "additional_details": {
        "name_km": "តាំង តារា",
        "member_since": "2017",
        "member_id": "P01-123456"
      },
      "metadata": {
        "foobar": "foobar"
      }
    }
  }
}' -X POST \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJHWmRMS18yUnMwdnhHY0s1Ti1vR05LQXE1VWJQSDlmLVg5Sk8tdFlNV2U0IiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MiJ9.f4zzDc3_0vroiOG5M5_qVTAE4bCXm-x3iuW0evtB51z_h3jL5R1MHfBUTXdgnReHRoRpydp0eGpeCzx4YEBz8HmAr-VY6TO8BGIlvE18pg4DHfdwPXsc9yPQncTLNeOdvX63q8veBMWNcbrfEE2-ktXkFLf_DGmVetslN0-tXazvJHUiix43cOJ6N8W80PP3md60ol7ZMbMCCNqWfr1vKASfFcJloZuxa_N0XJ604dotEYnlz71NXd82SCqpKryPrGBlI4WQKn3XZj9meUvat5DhMZON_NKe4e5n2xEmHf2jHnrAkqd8Y49xUymRjlxah9Qu8F04OE5einl2XXOIjg"

Endpoint

POST /v1/cardholders

POST /v1/cardholders

Parameters

{
  "data": {
    "type": "cardholder",
    "attributes": {
      "name": "Tang Dara",
      "phone_number": "855715200960",
      "type": "individual",
      "individual": {
        "date_of_birth": "20161220",
        "address": "#87, Street 63 (Trasak Paem), Sangkat Boeung Raing, Khan Daun Penh, Phnom Penh, Cambodia",
        "remote_photo_url": "https://via.placeholder.com/150.png",
        "remote_identity_document_url": "https://via.placeholder.com/600.png",
        "identity_document_number": "123456789",
        "identity_document_type": "id_card"
      },
      "additional_details": {
        "name_km": "តាំង តារា",
        "member_since": "2017",
        "member_id": "P01-123456"
      },
      "metadata": {
        "foobar": "foobar"
      }
    }
  }
}
Name Description
data[attributes][name] required The cardholder's name. This will be printed on cards issued to them.
data[attributes][phone_number] required The cardholder's phone number. This will be transformed to E.164 if it is not provided in that format already.
data[attributes][type] required Must be individual.
data[attributes][individual] required KYC requirements for an individual cardholder.
data[attributes][additional_details] Additional details to print on the card.
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


202 Accepted
{
  "data": {
    "id": "55bf4895-8a85-4382-87c8-8597314f1584",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-08-11T08:21:22Z",
      "updated_at": "2020-08-11T08:21:22Z",
      "name": "Tang Dara",
      "phone_number": "855715200960",
      "email": null,
      "type": "individual",
      "status": "processing_profile",
      "additional_details": {
        "name_km": "តាំង តារា",
        "member_since": "2017",
        "member_id": "P01-123456"
      },
      "metadata": {
        "foobar": "foobar"
      },
      "individual": {
        "address": "#87, Street 63 (Trasak Paem), Sangkat Boeung Raing, Khan Daun Penh, Phnom Penh, Cambodia",
        "date_of_birth": "2016-12-20",
        "identity_document_number": "123456789",
        "identity_document_type": "id_card"
      }
    }
  }
}

Update a cardholder

Request

curl "https://cms-sandbox.bongloy.com/v1/cardholders/ae461e59-2dcc-4f63-a01d-5f8cacdd24ec" -d '{
  "data": {
    "type": "cardholder",
    "id": "ae461e59-2dcc-4f63-a01d-5f8cacdd24ec",
    "attributes": {
      "name": "Tang Dara",
      "phone_number": "855715100860",
      "individual": {
        "address": "new address",
        "remote_photo_url": "https://via.placeholder.com/150.png",
        "remote_identity_document_url": "https://via.placeholder.com/600.png"
      },
      "additional_details": {
        "member_since": "2017"
      },
      "metadata": {
        "foobar": "foobar"
      }
    }
  }
}' -X PATCH \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJ4VXpEVVJIdnIwWGRSZkdoTzI5Smhac0JVcXpLNEZEYkZ4RzVDMVZ3aGU0IiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MyJ9.KL5bW_MNh7h2E561hGjVyz_p5YC6P_th90WHlT9U-wzaiWUK2a4W_z-UyjVH-JX61CDTx1-jthvCu9nV1h2Ux_4pKOhK4tU6km-lKWo7pF5aZlagd0VtYrDJhyG0Ek-KFsk8SQTpZ6P-DAQ4-mOrf_YDJDTPV4Afa7D30tuxNdCuTFIWa0PKHtZjJJTXouP0MRy4b2icNaoQZ0EQfuNmfSm8iyPbxLhY65McePLdbS79wz-PDTJhLT5sZDgbION8nyStxnk4mIHeIUeCTfjIln_ygrxGlKPy7uoCTt3BN79qQlz08kVbtuk0oE5Q987pFhk92N2eODwAmHHd9OVMug"

Endpoint

PATCH /v1/cardholders/:id

PATCH /v1/cardholders/ae461e59-2dcc-4f63-a01d-5f8cacdd24ec

Parameters

{
  "data": {
    "type": "cardholder",
    "id": "ae461e59-2dcc-4f63-a01d-5f8cacdd24ec",
    "attributes": {
      "name": "Tang Dara",
      "phone_number": "855715100860",
      "individual": {
        "address": "new address",
        "remote_photo_url": "https://via.placeholder.com/150.png",
        "remote_identity_document_url": "https://via.placeholder.com/600.png"
      },
      "additional_details": {
        "member_since": "2017"
      },
      "metadata": {
        "foobar": "foobar"
      }
    }
  }
}

None known.

Response


202 Accepted
{
  "data": {
    "id": "ae461e59-2dcc-4f63-a01d-5f8cacdd24ec",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-08-11T08:21:23Z",
      "updated_at": "2020-08-11T08:21:23Z",
      "name": "Tang Dara",
      "phone_number": "855715100860",
      "email": null,
      "type": "individual",
      "status": "processing_profile",
      "additional_details": {
        "name_km": "តាំង តារា",
        "member_id": "P01-123456",
        "member_since": "2017"
      },
      "metadata": {
        "foo": "bar",
        "foobar": "foobar"
      },
      "individual": {
        "address": "new address",
        "date_of_birth": "2016-12-20",
        "identity_document_number": "123456789",
        "identity_document_type": "id_card"
      }
    }
  }
}

Retrieve a cardholder

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cardholders/e811af78-57e4-47a8-8335-76aa721e2b44" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJyRjFPYVl6UjVhSXhod1p6ek5HbUZhcm51RXc4ZENOdnFkRkdZSEZuSHBzIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MyJ9.oxOy5kqVJNrUR3pcfWyk0V2xUf0ftXXRB8vcdIU4Z50Ss4ts3pkFKmWOb3C1i3pjpr6E4KFzdYu5lDvtTjOkuXCslY9vtgnIu6v2ErrgV0oTh2Apw-Pip5kMX68Fs3VtJqSo647M82e02bpl7XSJzgLCVc_1TKVDnrC2ZBGLm9Aht3zIROZmMQajj6O4aSA_OPxNOlKQLc1xq2A2LHEqs9AyUqidW-6tPxWvPUEbGKEXlomDRfzlJDpIvQsHUJsfpilXWu16wEbcKusnHZOKD9xxbM2Q4bKIuto6M1VwKH19fh7R5sTXbiMZttHyFa9ahuayULzHwq9iMbIA1eUCcQ"

Endpoint

GET /v1/cardholders/:id

GET /v1/cardholders/e811af78-57e4-47a8-8335-76aa721e2b44

Parameters

Name Description
id required The id of the cardholder to be retrieved.

Response


200 OK
{
  "data": {
    "id": "e811af78-57e4-47a8-8335-76aa721e2b44",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-08-11T08:21:23Z",
      "updated_at": "2020-08-11T08:21:23Z",
      "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-08-11",
        "identity_document_number": "A123456789",
        "identity_document_type": "id_card"
      }
    }
  }
}

List all cardholders

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cardholders" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJTNHZuWFB2bTNtWmFHSE5JM21mNi0zMmlyM3VwSGU1NUU1MG1DTU5uSHlVIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MyJ9.kFtqsx0W2nLmJ782lbZUrv0hX6FJls3n54p-7XBtVh_GAp-Ps0CtJXHf7ANQheJ2OnXsOn8y3_J7qjY0BRbc84VbAqVKLNODbbIAKPY0ehqPwXv6dlS2dWLmNevse86yK6SVA7rgWLjrKih6fgsQOjPC5MtkKBZ1qrS3dGga_17ktZ_2_nTYJ032ESMlhZOx3sTI6bjsg8YfGiFDHU5A8ILVjOr31KxMTc5M0Unj3bVvrkL6qDnmf1PCoEWZuQZrb6kNUUWjehHk6weIy2B4BdwbF7koUoge-s9p2zpvU9omKjSy3kDUjOsD_maZHYj8AxDykU1omTRdnt-GcuLN0A"

Endpoint

GET /v1/cardholders

GET /v1/cardholders

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "d42caef1-966d-47d5-89fd-1022e588dd23",
      "type": "cardholder",
      "attributes": {
        "created_at": "2020-08-11T08:21:23Z",
        "updated_at": "2020-08-11T08:21:23Z",
        "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-08-11",
          "identity_document_number": "A123456789",
          "identity_document_type": "id_card"
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/cardholders?page%5Bbefore%5D=d42caef1-966d-47d5-89fd-1022e588dd23",
    "next": null
  }
}

Cards

Create a card

Request

curl "https://cms-sandbox.bongloy.com/v1/cards" -d '{
  "data": {
    "type": "card",
    "attributes": {
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "749a6108-c395-489b-98f0-a546d2812711",
          "type": "account"
        }
      }
    }
  }
}' -X POST \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJhWDk5cklmZk1rWkx2X29qc2NEdkFVYnpFOU54ZzEzeGVxUlg3SFNEQkdvIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MyJ9.RFflg13aNn9Nqapv4V5JZUDOOrrc2oCcCT6L65Tmf2jsOjPXFwf7J9ad3DQonKZIqud5ta7hOXEuW66Cmu2gsiyU-NwbWMQcyYwME6rpTBLHzHncgPfK3qsfOulj_yubf-wlhSoloypx7hIbdhZ2-IZ4Epqi2WHFlP2_l-CzUsivLSkoGAJFSpQkamZRZ8dC-rYjuWosMN_PE443jdw0Ep6p3Dqt0Hjxed8Klm443rGBB72Wz9buahbzmuPDYwqfncNqjodcLcz-YChewywQnfGxysbDkEVSz4axpxVJ-jhrf5llqGbAiDDpLbdG76fcwOhPKp8qg22x4qTH9-nCdw"

Endpoint

POST /v1/cards

POST /v1/cards

Parameters

{
  "data": {
    "type": "card",
    "attributes": {
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "749a6108-c395-489b-98f0-a546d2812711",
          "type": "account"
        }
      }
    }
  }
}
Name Description
data[attributes][currency] required The currency for the card. This currently must be USD.
data[attributes][type] required The type of card to issue. Possible values are physical or virtual.
data[relationships][account] required The id of the account in which the card will be created for

Response


201 Created
{
  "data": {
    "id": "d0421b9b-0df3-4ac5-9080-e9ae263a71e6",
    "type": "card",
    "attributes": {
      "created_at": "2020-08-11T08:21:23Z",
      "updated_at": "2020-08-11T08:21:23Z",
      "last_four": "3839",
      "exp_month": 8,
      "exp_year": 2023,
      "status": "unactivated",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "749a6108-c395-489b-98f0-a546d2812711",
          "type": "account"
        }
      },
      "card_product": {
        "data": {
          "id": "0abd0f24-7f20-4ee5-a2d2-7e41c67ec3db",
          "type": "card_product"
        }
      }
    }
  }
}

Retrieve a card

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cards/dbc38675-92a6-4cb0-9a88-58ca603ce38c" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJZZ1hkY1ZhSEJ6S1B1bG16bWp0ZHN2cXg1QVFCUVYtOXNERUlZVHZKeEI0IiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MyJ9.adhViiqF1_OXrqaaKDffeZ3rHsRWXdiBNU8Yh8NlPxgiV_fvOIrY4C4tclXmOupKDOITOHZfBjQ3250lQ5x5QNaL5LQfk8J9U0Rx3oJS0aF6YqAM8uTZEQDH1ZML_UPHgzlgbAv4ZSPyVdzqeyQOJcVNCMCoBefAjHrnSdpTOn9lilsh136mSvZ2Hmr-cydLI2lKYB2CNw7VX6kzRR9JH6oy-VsyZo0q0zW5tqfMV_PTp9zIzBWMt2aihOFGEbR2bzGiDq8Kbs3ZOu9JXWrkL2gd24BETCgTjMifoOydjEqC60xw5lH01Aban0v4qBEgXOPctqlDGWu1BRAGuXR4Ag"

Endpoint

GET /v1/cards/:id

GET /v1/cards/dbc38675-92a6-4cb0-9a88-58ca603ce38c

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "dbc38675-92a6-4cb0-9a88-58ca603ce38c",
    "type": "card",
    "attributes": {
      "created_at": "2020-08-11T08:21:23Z",
      "updated_at": "2020-08-11T08:21:23Z",
      "last_four": "2345",
      "exp_month": 8,
      "exp_year": 2023,
      "status": "active",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "6d9c9b2b-cf7c-48d8-920c-a9c513a0ded0",
          "type": "account"
        }
      },
      "card_product": {
        "data": {
          "id": "c0b24313-aefa-4de2-aa39-ace26c55d473",
          "type": "card_product"
        }
      }
    }
  }
}

Update a card

Request

curl "https://cms-sandbox.bongloy.com/v1/cards/1bc1a70f-3ce6-4775-b65e-02e77eb336e3" -d '{
  "data": {
    "attributes": {
      "status": null,
      "status": "inactive"
    },
    "type": "card",
    "id": "1bc1a70f-3ce6-4775-b65e-02e77eb336e3"
  }
}' -X PATCH \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJFTXJPNTRhdmM4dFFjUVdMUUdDYlRLaEtIcEN4MVp2UnZaZTQ4R2JtRW5jIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4MyJ9.q_LQLL3fEkpZU23rGZA9sYqBZM-DkkafZSBHDeagON_OcKA290EccbxP-WXGYqYB6grG5SkZEGZZsUSfqNxxhLG2A50ZwdFgd3F-WgX7PvxvjWeb2WhY7_z-yquKQvSLdGY0c2yjsSakCLrULoZpsig5S_LcqXeQe_ZdIyD8fzI31hvYJQsVJAiAgp_MMGjpn0JOgOr6yqbmVyMNK_SN4_xNu0gCfBLp48Sa-7WWmnqi7bWesuoPZ8saKwBxNLQ__GGRK5-Qdsc0vpIQx5DcIHHxlk9wBlGLRdV0d5FfJwPP7kx38h7ATxbh1TspU8T9siWvKJ5mKD3cnLnL8MiNiw"

Endpoint

PATCH /v1/cards/:id

PATCH /v1/cards/1bc1a70f-3ce6-4775-b65e-02e77eb336e3

Parameters

{
  "data": {
    "attributes": {
      "status": null,
      "status": "inactive"
    },
    "type": "card",
    "id": "1bc1a70f-3ce6-4775-b65e-02e77eb336e3"
  }
}
Name Description
data[attributes][status] Specifies the status of the card. Possible values are active, inactive, canceled, lost or stolen. Note that once the card is marked as canceled, lost or stolen it cannot be reactivated. Virtual cards cannot be marked as lost or stolen.

Response


200 OK
{
  "data": {
    "id": "1bc1a70f-3ce6-4775-b65e-02e77eb336e3",
    "type": "card",
    "attributes": {
      "created_at": "2020-08-11T08:21:23Z",
      "updated_at": "2020-08-11T08:21:23Z",
      "last_four": "2345",
      "exp_month": 8,
      "exp_year": 2023,
      "status": "inactive",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "b801ce58-847b-4b29-8b33-603c147c9bc9",
          "type": "account"
        }
      },
      "card_product": {
        "data": {
          "id": "42be31c1-f74f-4cd1-89d5-2e68c296ec4e",
          "type": "card_product"
        }
      }
    }
  }
}

List all cards

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cards" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJiLXVrZkdrbV9ZNFpoeWdfUm9rNkFtMVpuUEZHZVZlU2JtTVkxWnlsWEpBIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4NCJ9.G4I9XR2V16SisQYeM4yIbsg8zDr2NLFpK0-DO6WX-rN4wMAv3TbVoh3OA6TH0FBqeUwmETOfMArfxDnXFc2y3NYtOR0exYUiACMsGRHlcZfHjxStOK4xIKSEHT3_xkZw26nBZIg2xdKVnNrRAnZAiFTlYwijZXhgj3PT_OqLzIo-spKy8HnNE75GJaVuTQsoBsVIBfFAUqz2Yrlwa2nqI01QMPYPPXYYYx3Vd2yPTO3QDACnki8-e-Umd_MqEFBJ-SnGwBRzyC6GcA3qjoxAeKm_lJT0YNVFfB0uN7kUbr90skaGqg1biAI_-CvknLFHI6T-sSiN3aQtrD5QbpSIBw"

Endpoint

GET /v1/cards

GET /v1/cards

Parameters

Name Description
filter[cardholder] Only return cards belonging to the Cardholder with the provided ID.
filter[type] Either physical or virtual.
filter[status] One of unactivated, inactive, active, lost, stolen or canceled.

Response


200 OK
{
  "data": [
    {
      "id": "9cfc5c0c-64bb-4678-aa13-73ac4f6d480a",
      "type": "card",
      "attributes": {
        "created_at": "2020-08-11T08:21:24Z",
        "updated_at": "2020-08-11T08:21:24Z",
        "last_four": "2345",
        "exp_month": 8,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "fa27eb06-c683-4d3e-a528-4ae29f22424b",
            "type": "account"
          }
        },
        "card_product": {
          "data": {
            "id": "b201dfb2-3de7-4e4e-a773-7e65d4a92047",
            "type": "card_product"
          }
        }
      }
    },
    {
      "id": "2a544f57-1e33-4eb2-a183-ea210926d8bc",
      "type": "card",
      "attributes": {
        "created_at": "2020-08-11T08:21:24Z",
        "updated_at": "2020-08-11T08:21:24Z",
        "last_four": "2345",
        "exp_month": 8,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "e1dfdb04-ce77-478c-b09f-bed00554d294",
            "type": "account"
          }
        },
        "card_product": {
          "data": {
            "id": "b201dfb2-3de7-4e4e-a773-7e65d4a92047",
            "type": "card_product"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/cards?page%5Bbefore%5D=9cfc5c0c-64bb-4678-aa13-73ac4f6d480a",
    "next": null
  }
}

Create a management token

Request

curl "https://cms-sandbox.bongloy.com/v1/cards/03866535-93a0-4482-a46e-d7c65238258f/management_tokens" -d '{
  "data": {
    "type": "card_management_token",
    "attributes": {
      "type": "card_activation"
    }
  }
}' -X POST \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJHVDEwQXlzbzNmQXZUU2J4NE1GeDk1TW1vUmtZdkNlTG5wZ2NyYTJ0dzY4IiwidGltZXN0YW1wIjoiMTU5NzEzNDA4NCJ9.g8FwW1JFkicdtYdl0Kb9q4UOrrPjpwr-wJU5TBAsOWEsqqyghR4kS213oVovf_ltPYcc9U14kDR32TQc3EE3Dsk7qwr4li_jYRu5BJLKJ6H9Wa8BkBx6IJINN9zfJCeOWVylA87oHkelkgLWOXHp96UK8ItEn2-ViCZiufQVK8vdtvtcyjFQhJ5qb9dX8A4dPMek_bb1CS_KPanNgh-K2ttweReEy1mAnfr0VreX5EKlIpa8r7UrI--diH2WwjPgsEDwHW1kfTdB6ZKq_A5VB6q6QPa-PCdnlouYgJgu7_TKrhufhmvfzyNZUY0vxzGFmrHf8eSIzEYNcM0pFwXHoA"

Endpoint

POST /v1/cards/:card_id/management_tokens

POST /v1/cards/03866535-93a0-4482-a46e-d7c65238258f/management_tokens

Parameters

{
  "data": {
    "type": "card_management_token",
    "attributes": {
      "type": "card_activation"
    }
  }
}
Name Description
type required The type of management token to issue. Possible values are card_activation, pin_reset, card_elements_data, or card_elements_data. Note that card_elements_data can only be used for virtual cards.

Response


201 Created
{
  "data": {
    "id": "8073dd85-654e-46f3-9101-3501a8255bb3",
    "type": "card_management_token",
    "attributes": {
      "created_at": "2020-08-11T08:21:24Z",
      "updated_at": "2020-08-11T08:21:24Z",
      "expires_at": "2020-08-11T08:31:24Z",
      "type": "card_activation",
      "token": "E9pWBymIoMD2AAak-z1fZPAAosPkey7_ke0IXXaAH0I",
      "url": "https://cms-sandbox.bongloy.com/card_activation/new?token=E9pWBymIoMD2AAak-z1fZPAAosPkey7_ke0IXXaAH0I"
    }
  }
}

Retrieve a card management token

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cards/a7c0912e-5987-4eb5-a48d-58115d1eb6d6/management_tokens/2990f2f0-295c-42b6-884d-506afb7d5209" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJBdFRXdTQtX2hZWF9jaUx3clFWZFJibDZldndGdklBM082TEVoejFqb1RjIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4NSJ9.gD3NKxgvlkEU0l633XrZDn6kPm37B9CxqMSSPjfV0hVmu5-Oywd--j6cYBGXHvNMRh-atkesNG1gnIRzc5IaOhS9F299AGdVqfVpdjregcgK_xAHrKRuH-hAtLBurvkpSy9obfJjk9gz7qAn8HLuNl1-S-MmLIBWv725sI_g8EUqHBcKPETF1C2i6HInF0BpkK7zjYidRQYf9jIvi4uwlWIANbqs3Ijzvb-K5qlM7qgoZIi2kA_fRsBzJnRPj4v0pJpZ41gw6_137lcaPoIqwqEbZoA5U8sCrxXzNm_7drQl7PPdksi_S0evcXse3JtLg9ln-QBR4C12K-_JBpOlwA"

Endpoint

GET /v1/cards/:card_id/management_tokens/:id

GET /v1/cards/a7c0912e-5987-4eb5-a48d-58115d1eb6d6/management_tokens/2990f2f0-295c-42b6-884d-506afb7d5209

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "2990f2f0-295c-42b6-884d-506afb7d5209",
    "type": "card_management_token",
    "attributes": {
      "created_at": "2020-08-11T08:21:24Z",
      "updated_at": "2020-08-11T08:21:24Z",
      "expires_at": "2020-08-11T08:31:24Z",
      "type": "card_activation",
      "token": "tO8-gzU5-UB9RxVKB2M3BQkYWi8l_Rwg2SkWC0gvK6s",
      "url": "https://cms-sandbox.bongloy.com/card_activation/new?token=tO8-gzU5-UB9RxVKB2M3BQkYWi8l_Rwg2SkWC0gvK6s"
    }
  }
}

Display a virtual card

Data security compliance

Companies that store, transmit, or process sensitive card data, including the primary account number (PAN), expiration date, and card verification value (CVV2), must comply with the Payment Card Industry Data Security Standard (PCI DSS). Achieving PCI DSS certification is both time consuming and expensive.

Bongloy card elements javascript library offloads some of the PCI compliance burden (for certain use cases) by enabling the encrypted transmission of sensitive card data. Bongloy is fully PCI-Level 1 compliant and handle the unencrypted sensitive card data for you. Your servers never store, transmit, or process the card data.

Dynamic card data iframes

The iframes injected by the Bongloy javascript libary enable you to control the styling and layout of the HTML pages you serve to client applications while delegating secure handling of the sensitive data to Bongloy servers. You create and style pages in whatever manner you desire and Bongloy inserts the card data into the page locations specified in the HTML.

Note: To display virtual cards within a mobile application, you can embed the iframes using a web element.

Example

Environment JS Host
Sandbox https://cdn.bongloy.com/sandbox/assets/js/card_elements.js
Production https://cdn.bongloy.com/assets/js/card_elements.js
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <script src="https://cdn.bongloy.com/sandbox/assets/js/card_elements.js"></script>

    <style>
      @font-face {
        font-family: 'credit_card';
        src: url('https://cdn.bongloy.com/assets/fonts/credit-card-font-webfont.woff2') format('woff2'),
            url('https://cdn.bongloy.com/assets/fonts/credit-card-font-webfont.woff') format('woff');
        font-weight: normal;
        font-style: normal;
      }

      #virtual-card {
        background-image: url("card-image-front.png");
        background-repeat: no-repeat;
        background-size: cover;
        width: 350px;
        height: 220px;
        margin: 30px auto;
      }

      #show-button {
        width: 100px;
        height: 40px;
        top: 145px;
        left: 25px;
        position: relative;
      }

      #card-elements {
        margin-top: 60px;
        margin-left: 20px;
      }

      #card-pan {
        width: 320px;
        height: 40px;
        margin: 0 auto;
      }

      #card-cvv {
        float: left;
        margin-left: 110px;
        height: 50px;
        width: 40px;
      }

      #card-expiry {
        margin-left: 150px;
        height: 50px;
        width: 80px;
      }

      #cardholder-name {
        margin-left: 25px;
        color: white;
        font-family: "credit_card", "Courier";
        text-transform: uppercase;
      }

      .label {
        color: white;
        font-size: 0.5em;
        font-family: "Courier";
      }
    </style>
  </head>

  <body>
    <div id="virtual-card">
      <div id="show-button"></div>

      <div id="card-elements">
        <div id="card-pan"></div>

        <div id="card-cvv">
          <span class="label">CVV</span>
        </div>

        <div id="card-expiry">
          <span class="label">VALID THRU</span>
        </div>
      </div>

      <div id="cardholder-name">
        <span>John Doe</span>
      </div>
    </div>

    <script>
      // fetch card management token from server side
      const cardManagementToken = {
        token: "[card-management-token]",
        expiresAt: Date.parse("[card-management-token-expires-at]")
      }

      const cardElementsComponent = Bongloy.cardElementsComponent({
        token: () => {
          //if (cardManagementToken.expiresAt <= Date.now()) {
          //   fetch a new card management token from server side
          //}

          return cardManagementToken.token;
        },
        showButton: {
          containerId: "show-button",
          text: "Show",
          style: `
            color: white;
            font-size: 0.9em;
            font-family: Arial;
            text-decoration: none;
            display: inline-block;
            cursor: pointer;

            padding: 5px 15px;
            border-radius: 30px;
            border: 2px solid white;
            background-color: #999;
            text-shadow: rgb(47, 102, 39) 0px 1px 0px;
          `
        },
        elements: {
          pan: {
            containerId: "card-pan",
            style: `
              font-size: 1.7em;
            `
          },
          expiry: {
            containerId: "card-expiry",
            style: `
              font-size: 0.8em;
            `
          },
          cvv: {
            containerId: "card-cvv",
            style: `
              font-size: 0.8em;
            `
          }
        }
      })

      cardElementsComponent.on("ready", () => {
        console.log("Ready")
      })

      cardElementsComponent.on("click", () => {
        console.log("Clicked")
      })

      cardElementsComponent.on("complete", () => {
        console.log("Success")
      })

      cardElementsComponent.on("failure", () => {
        console.log("Failed")
      })

      cardElementsComponent.render()
    </script>
  </body>
</html>

Request

curl "https://cms-sandbox.bongloy.com/v1/cards/eec01423-7bcd-4e97-854b-ec3bc9a8e2e6/management_tokens" -d '{
  "data": {
    "type": "card_management_token",
    "attributes": {
      "type": "card_elements_data"
    }
  }
}' -X POST \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJDSWhUbWM2RU84S29zMDlUYS1RUUZZTFo2aWVJY2FsN1ZuQVk2YV9NREI0IiwidGltZXN0YW1wIjoiMTU5NzEzNDA4NSJ9.BOSB9TkiBmoNM7Fdkc4_88DggOkbaKE1C1GWys4ID465J0qzKPlxO0aAGNX_InoI4U2yrUlBFj2gjrFe8mI7rfWjI63e6sMMkbzUjDl_znwSfrJf2O2-wQuL0gC5ZAzjvioTfyzXGS2vebT6OpaNxMGUaa8Pe5wpi_RMiKhsjauwNjUs-dd9OadcUcq0PfQtAc4UXDmtsDLPNzfeE4jWbH1nppb3QMM-w1xwcVip5dS055G11lgkIcVm3JgbLsP0SzzwFbe16tPUdblZDtUcslhs0TgKOZ67vke2Pb4GZeloMitN8aqYIdvsd1zUHJ-b7tsZ5vRxQYIAcv9iGGmFsg"

Endpoint

POST /v1/cards/:card_id/management_tokens

POST /v1/cards/eec01423-7bcd-4e97-854b-ec3bc9a8e2e6/management_tokens

Parameters

{
  "data": {
    "type": "card_management_token",
    "attributes": {
      "type": "card_elements_data"
    }
  }
}
Name Description
type required Must be card_elements_data

Response


201 Created
{
  "data": {
    "id": "ec21416b-0075-40ae-baee-2b0b7aef50c4",
    "type": "card_management_token",
    "attributes": {
      "created_at": "2020-08-11T08:21:25Z",
      "updated_at": "2020-08-11T08:21:25Z",
      "expires_at": "2020-08-11T08:31:25Z",
      "type": "card_elements_data",
      "token": "SNK6j1aNqOtNo8Ch2sRmCxg1jHyU9m7Rj2z4Wk3WORg",
      "url": null
    }
  }
}

Events

List all events

Request

curl -g "https://cms-sandbox.bongloy.com/v1/events" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJ5d2lLN0FFU1ZJTmdMYmh4QkkyY3dnTmFnQXA0WFNuVWhmb01rVEduSmNBIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4NSJ9.B9QDZxIxKYEiDQHn9GpPoe5GvfeybDpLVVNZFkbopPZNy6JrJONZqKsfyDocYntMEqsre7BIn8xdUNshehPOMxEQxm8yO_-A0r4oBzd2Bcqf99CpS9k08NZLSodyZbUA8PzOLciqtrtPIjPBZdop49su1RvZUQd_uRtngAy4ZFnpj9uF-zP86SM0JxCe7lG811caAVvAcAWACoS1FkKrmwnMT2gIXGzGmlu2mexAvewdVFSL4iQ3ZKyqoYkBSTDHCk2LhM3wudYOAUxrfQX0MiYXP-0GoTFUIVawSKUJpDmxt4CXxOZNTiS1PS0fVISEjtlA4dYaiD5Ew7JCHN098w"

Endpoint

GET /v1/events

GET /v1/events

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "e53d2b47-39a1-4166-8890-92444d502a15",
      "type": "event",
      "attributes": {
        "created_at": "2020-08-11T08:21:25Z",
        "updated_at": "2020-08-11T08:21:25Z",
        "type": "transaction.created",
        "details": {
          "data": {
            "id": "91f5b4c9-10e9-4d67-80ec-61f5a5f03316",
            "type": "transaction",
            "attributes": {
              "fees": [

              ],
              "type": "purchase",
              "amount": 1000,
              "status": "settled",
              "currency": "USD",
              "total_fee": 0,
              "created_at": "2020-08-11T08:21:25Z",
              "updated_at": "2020-08-11T08:21:25Z",
              "settlement_time": "2020-08-11T08:21:25Z",
              "transaction_time": "2020-08-11T08:21:25Z",
              "transaction_amount": 1000,
              "transaction_number": "026565785616",
              "transaction_details": {
                "card": {
                  "merchant_data": {
                    "city": "Phnom Penh",
                    "name": "Rocket Rides",
                    "country": "Cambodia",
                    "category": "taxicabs_limousines"
                  }
                },
                "type": "card"
              },
              "transaction_currency": "USD",
              "balance_adjustment_type": "debit"
            },
            "relationships": {
              "account": {
                "data": {
                  "id": "0bbf88cc-7360-4b4f-ae27-fdf5106a889c",
                  "type": "account"
                }
              }
            }
          }
        }
      }
    },
    {
      "id": "0e923e61-8b50-4f0f-806b-977ace88a7bf",
      "type": "event",
      "attributes": {
        "created_at": "2020-08-11T08:21:25Z",
        "updated_at": "2020-08-11T08:21:25Z",
        "type": "transaction.created",
        "details": {
          "data": {
            "id": "ef5b9420-3d73-4855-be43-ca7799076786",
            "type": "transaction",
            "attributes": {
              "fees": [

              ],
              "type": "purchase",
              "amount": 1000,
              "status": "settled",
              "currency": "USD",
              "total_fee": 0,
              "created_at": "2020-08-11T08:21:25Z",
              "updated_at": "2020-08-11T08:21:25Z",
              "settlement_time": "2020-08-11T08:21:25Z",
              "transaction_time": "2020-08-11T08:21:25Z",
              "transaction_amount": 1000,
              "transaction_number": "550493091981",
              "transaction_details": {
                "card": {
                  "merchant_data": {
                    "city": "Phnom Penh",
                    "name": "Rocket Rides",
                    "country": "Cambodia",
                    "category": "taxicabs_limousines"
                  }
                },
                "type": "card"
              },
              "transaction_currency": "USD",
              "balance_adjustment_type": "debit"
            },
            "relationships": {
              "account": {
                "data": {
                  "id": "47f0b2d6-867a-4aae-bd24-721acd29ecf6",
                  "type": "account"
                }
              }
            }
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/events?page%5Bbefore%5D=e53d2b47-39a1-4166-8890-92444d502a15",
    "next": null
  }
}

Retrieve an Event

Request

curl -g "https://cms-sandbox.bongloy.com/v1/events/d1d331a4-e59b-46a9-9578-d937c865c87e" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJPNmk2amhvODRNaDZ4djc5SE5Md3VzSmVfRnkzSHd0ZUVpUDlTOW9sV2NvIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4NSJ9.mTPJcYUAGHII9bUdPuvTJEdX_xJ5MPEwmp2koGC4_ry6i6swxgxdz2TVl3Zz26nV4XycPynGflyuqV-CuvBI-UlNEotpvnRWpQ44g61_rzu4NVgujccmJ6COz_4oQ8C5nv8mVbijGqgoOcW348A4wOQcCY28_kxi7BGsHMeQJAGC6Z_G3EHu9hTWUpIRb7M1lVn7kke8zh4bLTSeqEK7xIAWCXpfDQx9R7NQqC5hJonuEGCelsJtyHUGEzjjVuttgofA4LLpXzZTEXVLHE_HLlVwDbpU_jYCNAwQG--D-kvJU6aNcBRUi7EpBFfiFSHMhRoqHwNfupYkV0MEcWYsTA"

Endpoint

GET /v1/events/:id

GET /v1/events/d1d331a4-e59b-46a9-9578-d937c865c87e

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "d1d331a4-e59b-46a9-9578-d937c865c87e",
    "type": "event",
    "attributes": {
      "created_at": "2020-08-11T08:21:25Z",
      "updated_at": "2020-08-11T08:21:25Z",
      "type": "transaction.created",
      "details": {
        "data": {
          "id": "0a04a957-931d-4089-a69c-cb83f39400f8",
          "type": "transaction",
          "attributes": {
            "fees": [

            ],
            "type": "purchase",
            "amount": 1000,
            "status": "settled",
            "currency": "USD",
            "total_fee": 0,
            "created_at": "2020-08-11T08:21:25Z",
            "updated_at": "2020-08-11T08:21:25Z",
            "settlement_time": "2020-08-11T08:21:25Z",
            "transaction_time": "2020-08-11T08:21:25Z",
            "transaction_amount": 1000,
            "transaction_number": "542634374973",
            "transaction_details": {
              "card": {
                "merchant_data": {
                  "city": "Phnom Penh",
                  "name": "Rocket Rides",
                  "country": "Cambodia",
                  "category": "taxicabs_limousines"
                }
              },
              "type": "card"
            },
            "transaction_currency": "USD",
            "balance_adjustment_type": "debit"
          },
          "relationships": {
            "account": {
              "data": {
                "id": "a2927b77-32be-46aa-afd8-e22827a14b0b",
                "type": "account"
              }
            }
          }
        }
      }
    }
  }
}

Transactions

List all transactions

Request

curl -g "https://cms-sandbox.bongloy.com/v1/transactions?filter[status]=settled&filter[account]=cb7edda2-9037-4d6d-9030-84213c72cdbb&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 eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJhV1pBOUFVYzVWdDJIaFp2N2VKZWVqUklZR1hnc0JMUG1yR2J6WlJzakk0IiwidGltZXN0YW1wIjoiMTU5NzEzNDA4NiJ9.jNsmpFUj0Vvf9-vJjCs1PlAOys9d7eDPeS8W4ebFULP-cs8sPmIa6Z5PN1CJDsCF8oaqLoJYri8t8GlVy0ktXzJXic2oxHCFJB9jZFm3OB4RQO2j1JE9IhbVSkqw7wt_7dNumCmP9wzT-nPAW7kmmrrd90BmfICoDjFX99nuSgrjbGbfghqcvTzBtOkJrVFTijrPl6d7MH4hOibsZ9LRUYUzfrK6qQo6wYmRVLuIA_QhbzjW2xgs3Jbl6v7gmNuaQNV1-oPRxJ60tdsPwyaQEQRaVqM_nnZyJEtjTxeBaWmWL49MAMrlATn2jKz695do8ZQ-Suy8FMkTW8gp0unHgg"

Endpoint

GET /v1/transactions

GET /v1/transactions?filter[status]=settled&amp;filter[account]=cb7edda2-9037-4d6d-9030-84213c72cdbb&amp;filter[from_date]=2020-01-01T00%3A00%3A00Z&amp;filter[to_date]=2020-01-01T12%3A00%3A00Z

Parameters

filter: {&quot;status&quot;=&gt;&quot;settled&quot;, &quot;account&quot;=&gt;&quot;cb7edda2-9037-4d6d-9030-84213c72cdbb&quot;, &quot;from_date&quot;=&gt;&quot;2020-01-01T00:00:00Z&quot;, &quot;to_date&quot;=&gt;&quot;2020-01-01T12:00:00Z&quot;}
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": "63431ca0-741c-4b0d-9916-b47f1c5ebdf8",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-08-11T08:21:26Z",
        "updated_at": "2020-08-11T08:21:26Z",
        "currency": "USD",
        "transaction_number": "064056900204",
        "transaction_currency": "USD",
        "transaction_details": {
          "type": "transfer",
          "transfer": {
            "direction": "inward",
            "description": "foobar",
            "source_account_id": "02863b2a-4bf0-4c9b-87be-58ebdbfefee0",
            "source_issuer_name": "Issuer",
            "source_cardholder_name": "Meta Kanha",
            "source_account_identifier": "323000224"
          }
        },
        "type": "transfer",
        "fees": [

        ],
        "status": "settled",
        "balance_adjustment_type": "credit",
        "amount": 10000,
        "total_fee": 0,
        "transaction_amount": 10000,
        "transaction_time": "2020-01-01T01:00:00Z",
        "settlement_time": "2020-01-01T01:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "cb7edda2-9037-4d6d-9030-84213c72cdbb",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "acde9496-06ad-429d-98d9-4cedb89e26b9",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-08-11T08:21:26Z",
        "updated_at": "2020-08-11T08:21:26Z",
        "currency": "USD",
        "transaction_number": "813771020630",
        "transaction_currency": "USD",
        "transaction_details": {
          "type": "transfer",
          "transfer": {
            "direction": "outward",
            "description": "foobar",
            "destination_account_id": "7cf3337b-fea9-434f-99c5-27faa90ffb7d",
            "destination_issuer_name": "Issuer",
            "destination_cardholder_name": "Meta Kanha",
            "destination_account_identifier": "322000223"
          }
        },
        "type": "transfer",
        "fees": [

        ],
        "status": "settled",
        "balance_adjustment_type": "debit",
        "amount": 10000,
        "total_fee": 0,
        "transaction_amount": 10000,
        "transaction_time": "2020-01-01T01:00:00Z",
        "settlement_time": "2020-01-01T01:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "cb7edda2-9037-4d6d-9030-84213c72cdbb",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "91a219e6-6b94-4171-9454-624e5d9ad5c5",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-08-11T08:21:26Z",
        "updated_at": "2020-08-11T08:21:26Z",
        "currency": "USD",
        "transaction_number": "161781549006",
        "transaction_currency": "USD",
        "transaction_details": {
          "card": {
            "merchant_data": {
              "city": "Phnom Penh",
              "name": "Rocket Rides",
              "country": "Cambodia",
              "category": "taxicabs_limousines"
            }
          },
          "type": "card"
        },
        "type": "cash_withdrawal",
        "fees": [
          {
            "type": "interbank_cash_withdrawal",
            "amount": 300,
            "currency": "USD"
          }
        ],
        "status": "settled",
        "balance_adjustment_type": "debit",
        "amount": 10000,
        "total_fee": 0,
        "transaction_amount": 1000,
        "transaction_time": "2020-01-01T01:00:00Z",
        "settlement_time": "2020-01-01T01:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "cb7edda2-9037-4d6d-9030-84213c72cdbb",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "b30e4096-43d4-49a1-a60c-cf2111bc6442",
            "type": "card"
          }
        }
      }
    },
    {
      "id": "67d9e42a-2f20-431b-88b2-359ecd4edd08",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-08-11T08:21:26Z",
        "updated_at": "2020-08-11T08:21:26Z",
        "currency": "USD",
        "transaction_number": "738120958573",
        "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,
        "transaction_time": "2020-01-01T07:00:00Z",
        "settlement_time": "2020-01-01T07:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "cb7edda2-9037-4d6d-9030-84213c72cdbb",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "745fbf57-166a-4308-80c4-802b2a5ae1f1",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-08-11T08:21:25Z",
        "updated_at": "2020-08-11T08:21:25Z",
        "currency": "USD",
        "transaction_number": "599785854671",
        "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,
        "transaction_time": "2020-01-01T01:00:00Z",
        "settlement_time": "2020-01-01T01:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "cb7edda2-9037-4d6d-9030-84213c72cdbb",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "b30e4096-43d4-49a1-a60c-cf2111bc6442",
            "type": "card"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/transactions?filter%5Baccount%5D=cb7edda2-9037-4d6d-9030-84213c72cdbb&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=63431ca0-741c-4b0d-9916-b47f1c5ebdf8",
    "next": null
  }
}

Retrieve a transaction

Request

curl -g "https://cms-sandbox.bongloy.com/v1/transactions/5a6e2ddc-f100-41fb-8bbd-7a7488ac653f" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiIwdlA0MjV3djRERHhvMG4zNkgzRmdadjBXbFNnLWhZOGFWTExRQnEzLVRRIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4NiJ9.QURHt1_EHoYhLemrdZRiLG1Cckq-SlWSCbucplR8x6YduLD67tCV0TUHXwdEHHQQjkFA-_O5_Qa_kJEuL4xXBHsb5_is12Zj3MIad7WjUfCv8k-A7bmydtHUufGNJ8XhKyxn73YXz7desZqy0zfo8xwAQkO80ZJcwHdm0VTnWOPyZkQVDaFGa6NkuxXIZW27Rac0Z_tgpo8KiWGMcf0sN25W3ouy-2vCi31h7z-Q81sLDjX0q_s3vegBRRP-JHM9gjIhHk-oa_eu3qF0DYEFr2keDu2d9hFSOvbc-gj-UkGVSBO3YDhEib5WWWzYVYT38CZ1vF8Q42FjOURBrMu1AA"

Endpoint

GET /v1/transactions/:id

GET /v1/transactions/5a6e2ddc-f100-41fb-8bbd-7a7488ac653f

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "5a6e2ddc-f100-41fb-8bbd-7a7488ac653f",
    "type": "transaction",
    "attributes": {
      "created_at": "2020-08-11T08:21:26Z",
      "updated_at": "2020-08-11T08:21:26Z",
      "currency": "USD",
      "transaction_number": "354914778366",
      "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,
      "transaction_time": "2020-08-11T08:21:26Z",
      "settlement_time": "2020-08-11T08:21:26Z"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "9429243c-29ed-4d48-a0d2-186e03a607d2",
          "type": "account"
        }
      },
      "card": {
        "data": {
          "id": "81282ad6-eb9a-4a93-a0cd-781ab9ba4094",
          "type": "card"
        }
      }
    }
  }
}

Transfers

In order to use this API, you must first ask the cardholder for explicit permission using the OAuth Authorization Code flow. See Cardholder Authorization for more details. Once you have obtained a oauth token for the cardholder, pass it in the X-Cardholder-Auth-Token request header.

Create a transfer

Request

curl "https://cms-sandbox.bongloy.com/v1/transfers" -d '{
  "data": {
    "type": "transfer",
    "attributes": {
      "amount": 5000,
      "currency": "USD",
      "description": "Foobar",
      "metadata": {
        "foo": "bar"
      }
    },
    "relationships": {
      "source": {
        "data": {
          "id": "15e28fe2-ef25-46ae-a9fa-8e4f1bd7a0b8",
          "type": "account"
        }
      },
      "destination": {
        "data": {
          "id": "059ae3f2-7c2e-41bb-b54e-41385a3a75cc",
          "type": "account"
        }
      }
    }
  }
}' -X POST \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJpR3Y0aW85RzRPWGlDQk1rVnpBcFc1N0xOcnVLTUdvYTc4RVZmNUYzaXp3IiwidGltZXN0YW1wIjoiMTU5NzEzNDA4NiJ9.jeslinQ2b0b1DckkMUKCSkEfyusY1Z4agkC8dxi5PPI9ji6fX17QLym_U6aCu9QVI3ulhRVf2_Cvp5EJADRlyQkeK-0kBZWdjk74Cf3Je0kqn8J1XQlMl0bANRlPj9VWflPpDv8j3sciUs2TQHt8i2Y-7kyXpmwNR8okKy_f965hghK28LwZvJqJ0CEyunbLA-UWNjgekjEsrApsz_a__wv7r_BZcnSWJfMyPMWSwYxrRE74k7BjzHeEZuRG5tAAdQEejr-z55P5Q-gFe4sA7prs6TcIdfed9FKM8TLIrXg--rJBk1bwhMR9WZ1GZrCc7qylOM-qgFFKATtaNIeHFA" \
    -H "X-Cardholder-Auth-Token: cbGTI5B8IVIQeZ9mqOD0qk0BUc3C2_SGJtGwqJkzeig"

Endpoint

POST /v1/transfers

POST /v1/transfers

Parameters

{
  "data": {
    "type": "transfer",
    "attributes": {
      "amount": 5000,
      "currency": "USD",
      "description": "Foobar",
      "metadata": {
        "foo": "bar"
      }
    },
    "relationships": {
      "source": {
        "data": {
          "id": "15e28fe2-ef25-46ae-a9fa-8e4f1bd7a0b8",
          "type": "account"
        }
      },
      "destination": {
        "data": {
          "id": "059ae3f2-7c2e-41bb-b54e-41385a3a75cc",
          "type": "account"
        }
      }
    }
  }
}
Name Description
data[attributes][amount] required The amount to transfer in cents. e.g. 10000 for $100.00.
data[attributes][currency] required The currency of the transfer. Only USD is supported at this time.
data[attributes][description] An arbitrary string attached to the object. Often useful for displaying to users.
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.
data[relationships][source][id] required The id of the sender's account
data[relationships][source][type] required Must be account
data[relationships][destination][id] required The id of the receiver's account. Use the Account Inquiry API to look up the destination account
data[relationships][destination][type] required Must be account

Response


201 Created
{
  "data": {
    "id": "75411ce2-0c19-45f7-bd83-df0213b51624",
    "type": "transfer",
    "attributes": {
      "created_at": "2020-08-11T08:21:26Z",
      "updated_at": "2020-08-11T08:21:26Z",
      "currency": "USD",
      "description": "Foobar",
      "metadata": {
        "foo": "bar"
      },
      "amount": 5000
    },
    "relationships": {
      "source": {
        "data": {
          "id": "15e28fe2-ef25-46ae-a9fa-8e4f1bd7a0b8",
          "type": "account"
        }
      },
      "destination": {
        "data": {
          "id": "059ae3f2-7c2e-41bb-b54e-41385a3a75cc",
          "type": "account"
        }
      }
    }
  }
}

List all transfers

Request

curl -g "https://cms-sandbox.bongloy.com/v1/transfers" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiJNYkV1NnpwRWVtQzdINXNSdTc5SlJBTlpkNWhpcjdmUEYyTkJwMVByVTFjIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4NyJ9.SnH914Y5CNeZnhntVtRccA9-omKc8zmL5msjcGrlH2tyNRGUZRzNsXnf-62x2qj2nC4wYtRPGW_BXGVzrPSnYQKG3Zx4x1btf36OTVtnPHm0wHtQKoR9XtJKGElmkO-s0h2-ufQzFF-BecPBVv6gD-MBlkCyIz8kAJgK0eNVSsQNn1cHQmonkNXR5XCzhxh1o21F12cbZJ_stN_Gp9aSGEdzcJx_m5t3GY_FhCP860PBL1Quyl7Ve4cE1TGFmEcZbbvXDabXX3wP_YHa-A4At7zb9OP9eARvwxaZPz7isnGrXqJPLGcIV2P1xyZdyODOjPJ9BoRY0aqu3r27AEe23Q" \
    -H "X-Cardholder-Auth-Token: tqu31FQ1U9Kw-Hfh1uvP8OwojvpxlP20c-Q8FDk7nH4"

Endpoint

GET /v1/transfers

GET /v1/transfers

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "1694adcc-4c90-42c6-b933-ac0a4750c0d7",
      "type": "transfer",
      "attributes": {
        "created_at": "2020-08-11T08:21:27Z",
        "updated_at": "2020-08-11T08:21:27Z",
        "currency": "USD",
        "description": null,
        "metadata": {
        },
        "amount": 10000
      },
      "relationships": {
        "source": {
          "data": {
            "id": "c03bf18d-81d4-476f-bd62-c7481371c346",
            "type": "account"
          }
        },
        "destination": {
          "data": {
            "id": "49441ae8-5b6d-4c04-8b05-72853ce3133c",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "bfdf9570-a55e-4857-a400-c5629f8a645f",
      "type": "transfer",
      "attributes": {
        "created_at": "2020-08-11T08:21:27Z",
        "updated_at": "2020-08-11T08:21:27Z",
        "currency": "USD",
        "description": null,
        "metadata": {
        },
        "amount": 10000
      },
      "relationships": {
        "source": {
          "data": {
            "id": "ccaaf929-8dd1-4778-8407-64599293917b",
            "type": "account"
          }
        },
        "destination": {
          "data": {
            "id": "a569a7d0-3aa0-4941-9a2a-aed49ecacea1",
            "type": "account"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/transfers?page%5Bbefore%5D=1694adcc-4c90-42c6-b933-ac0a4750c0d7",
    "next": null
  }
}

Retrieve a transfer

Request

curl -g "https://cms-sandbox.bongloy.com/v1/transfers/a2513b4c-8e62-4e78-9ba1-49023264fae7" -X GET \
    -H "Content-Type: application/vnd.api+json" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhcGlfdG9rZW4iOiIwcFoyQ2c0WndFUnJkUFVnYVNaOGhTR1ZTVFVIMEFIMGNsX3F6LUR3OXBZIiwidGltZXN0YW1wIjoiMTU5NzEzNDA4NyJ9.SAJUrSbUygEMEfo4FNDgYH4SWpzAenRupCEa3yH1RyRubT83ML3WZnTq0Dhw-GUgmJhJhH7xhMsCdq7zG5DEdxu9SWYoKXhUiWqDsDJ5JZIrUR7PIJe79zePXhbuep-AlkIBcbXdFIsxCgWtAb6wT14Tg2VhGYT0VqIkk4WSfJqcyQhRoq-q4GlGpzXGy5AEL0_DsSM4hKI7178MC1dnCPHBA0WDrpedhSINlXnIoJ9sQsheN9DHKpISzjlNhPwcP0BJXmFSJZzVOQQvI5IrcRemvlB5EBocgnGV8ZWvB2yHJyeTdH-cQ8zjAmQXKMVN9YsYjMcKteMSRv-8K-aWkg" \
    -H "X-Cardholder-Auth-Token: tqu31FQ1U9Kw-Hfh1uvP8OwojvpxlP20c-Q8FDk7nH4"

Endpoint

GET /v1/transfers/:id

GET /v1/transfers/a2513b4c-8e62-4e78-9ba1-49023264fae7

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "a2513b4c-8e62-4e78-9ba1-49023264fae7",
    "type": "transfer",
    "attributes": {
      "created_at": "2020-08-11T08:21:27Z",
      "updated_at": "2020-08-11T08:21:27Z",
      "currency": "USD",
      "description": null,
      "metadata": {
      },
      "amount": 10000
    },
    "relationships": {
      "source": {
        "data": {
          "id": "2de5b9de-52b6-47f3-972c-3d45b6e874f6",
          "type": "account"
        }
      },
      "destination": {
        "data": {
          "id": "2f32d938-4acb-4696-9b1e-ffa1d8730a0f",
          "type": "account"
        }
      }
    }
  }
}