NAV Navbar
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

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/v1/transactions?page[size]=2" -X GET \
    -H "Authorization: Bearer Jrnzay4My_gY-UPhwiQk1ZA172n26AERxI9p5o2yzWE"

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": "fc831444-d7f5-478c-afb5-b97d93b807b9",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-05-25T05:08:20Z",
        "updated_at": "2020-05-25T05:08:20Z",
        "currency": "USD",
        "transaction_number": "995543668176",
        "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": "11f5554f-17ef-4eb6-a274-6da4541c9615",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "20315d95-b94c-4276-8893-d48d65e89c2d",
            "type": "card"
          }
        }
      }
    },
    {
      "id": "ef29f8f1-466a-47c8-bc32-fb08d2a92ec8",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-05-25T05:08:20Z",
        "updated_at": "2020-05-25T05:08:20Z",
        "currency": "USD",
        "transaction_number": "792982161279",
        "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": "11f5554f-17ef-4eb6-a274-6da4541c9615",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "20315d95-b94c-4276-8893-d48d65e89c2d",
            "type": "card"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://cms-sandbox.bongloy.com/v1/transactions?page%5Bbefore%5D=fc831444-d7f5-478c-afb5-b97d93b807b9&page%5Bsize%5D=2",
    "next": "http://cms-sandbox.bongloy.com/v1/transactions?page%5Bafter%5D=ef29f8f1-466a-47c8-bc32-fb08d2a92ec8&page%5Bsize%5D=2"
  }
}

Account Balance

Retrieve an account balance

Request

curl -g "https://cms-sandbox.bongloy.com/v1/accounts/797cf2b9-cd2f-4857-b7e4-a79edbc32436/balance" -X GET \
    -H "Authorization: Bearer pOTqQhyPaPdGeY4HQpK21GBJyJAdT_gJZYcniG_h_1A"

Endpoint

GET /v1/accounts/:account_id/balance

GET /v1/accounts/797cf2b9-cd2f-4857-b7e4-a79edbc32436/balance

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "797cf2b9-cd2f-4857-b7e4-a79edbc32436",
    "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": "2f291c77-1d56-49cd-b05e-f810345ca43a"
        }
      }
    }
  }
}' -X POST \
    -H "Authorization: Bearer UC8JRqQ9QpvUvSIj0Z3xGFkowiGLH3LYkWKDDnoOfCI"

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": "2f291c77-1d56-49cd-b05e-f810345ca43a"
        }
      }
    }
  }
}
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": "67d0bfc7-d551-4814-ad54-03b6e67ef5e9",
    "type": "account",
    "attributes": {
      "created_at": "2020-05-25T05:08:24Z",
      "updated_at": "2020-05-25T05:08:24Z",
      "currency": "USD",
      "number": "123456",
      "status": "active",
      "metadata": {
        "foobar": "foobar"
      },
      "account_identifier": "218123456"
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "2f291c77-1d56-49cd-b05e-f810345ca43a",
          "type": "cardholder"
        }
      }
    }
  }
}

Update an account

Request

curl "https://cms-sandbox.bongloy.com/v1/accounts/a746acf8-b12e-4387-8d42-ba26f3748908" -d '{
  "data": {
    "type": "account",
    "id": "a746acf8-b12e-4387-8d42-ba26f3748908",
    "attributes": {
      "metadata": {
        "buzz": "foobar"
      }
    }
  }
}' -X PATCH \
    -H "Authorization: Bearer h0N1xjaCqzImJMGkoRWy0oZE4uOCO-VQMRe_sN5zA0I"

Endpoint

PATCH /v1/accounts/:id

PATCH /v1/accounts/a746acf8-b12e-4387-8d42-ba26f3748908

Parameters

{
  "data": {
    "type": "account",
    "id": "a746acf8-b12e-4387-8d42-ba26f3748908",
    "attributes": {
      "metadata": {
        "buzz": "foobar"
      }
    }
  }
}

None known.

Response


200 OK
{
  "data": {
    "id": "a746acf8-b12e-4387-8d42-ba26f3748908",
    "type": "account",
    "attributes": {
      "created_at": "2020-05-25T05:08:24Z",
      "updated_at": "2020-05-25T05:08:24Z",
      "currency": "USD",
      "number": "000153",
      "status": "active",
      "metadata": {
        "foo": "bar",
        "buzz": "foobar"
      },
      "account_identifier": "220000153"
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "23ad4e18-8a72-4ee3-a470-6c69e9e9163b",
          "type": "cardholder"
        }
      }
    }
  }
}

Retrieve an account

Request

curl -g "https://cms-sandbox.bongloy.com/v1/accounts/b16bb74f-3e8c-4c46-81e8-e60b0fcfbadf" -X GET \
    -H "Authorization: Bearer DNe4GKb3_M6ogsqkgiubFY_TZfsT-yHs-naRAddREhY"

Endpoint

GET /v1/accounts/:id

GET /v1/accounts/b16bb74f-3e8c-4c46-81e8-e60b0fcfbadf

Parameters

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

Response


200 OK
{
  "data": {
    "id": "b16bb74f-3e8c-4c46-81e8-e60b0fcfbadf",
    "type": "account",
    "attributes": {
      "created_at": "2020-05-25T05:08:24Z",
      "updated_at": "2020-05-25T05:08:24Z",
      "currency": "USD",
      "number": "000154",
      "status": "active",
      "metadata": {
      },
      "account_identifier": "221000154"
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "beeccc42-7fd8-4f8c-befc-1e5f3f1ea8cd",
          "type": "cardholder"
        }
      }
    }
  }
}

List all accounts

Request

curl -g "https://cms-sandbox.bongloy.com/v1/accounts" -X GET \
    -H "Authorization: Bearer vWaptslRZtdkvrW0riC2HfzSDCRBTBczjq2lHj8yLGc"

Endpoint

GET /v1/accounts

GET /v1/accounts

Parameters

Name Description
filter[cardholder] Only return accounts belonging to the Cardholder with the provided ID.

Response


200 OK
{
  "data": [
    {
      "id": "645b783c-2065-4330-aed2-bdec276795d2",
      "type": "account",
      "attributes": {
        "created_at": "2020-05-25T05:08:24Z",
        "updated_at": "2020-05-25T05:08:24Z",
        "currency": "USD",
        "number": "000156",
        "status": "active",
        "metadata": {
        },
        "account_identifier": "222000156"
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "f4fb4c9c-6411-4888-97e2-1a825ecca088",
            "type": "cardholder"
          }
        }
      }
    },
    {
      "id": "caf1cbc3-63a1-4d56-8324-027acad12187",
      "type": "account",
      "attributes": {
        "created_at": "2020-05-25T05:08:24Z",
        "updated_at": "2020-05-25T05:08:24Z",
        "currency": "USD",
        "number": "000155",
        "status": "active",
        "metadata": {
        },
        "account_identifier": "222000155"
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "9a71e30a-2664-46a8-8b1b-124b406c570c",
            "type": "cardholder"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/accounts?page%5Bbefore%5D=645b783c-2065-4330-aed2-bdec276795d2",
    "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 "Authorization: Bearer XJ6gUh0NvD9IZaIZ7bKYCgncJx0LybfhmkEtmdRVcic"

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": "4186801a-51d6-4669-b453-6d0a32be6e8f",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-05-25T05:08:25Z",
      "updated_at": "2020-05-25T05:08:25Z",
      "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/140e9ca8-5537-4280-98af-d8cded19afad" -d '{
  "data": {
    "type": "cardholder",
    "id": "140e9ca8-5537-4280-98af-d8cded19afad",
    "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 "Authorization: Bearer PnvYs-SEGGauLQAgKb6Y3d2hDK8Y_mEbUzLeJFsLpkg"

Endpoint

PATCH /v1/cardholders/:id

PATCH /v1/cardholders/140e9ca8-5537-4280-98af-d8cded19afad

Parameters

{
  "data": {
    "type": "cardholder",
    "id": "140e9ca8-5537-4280-98af-d8cded19afad",
    "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": "140e9ca8-5537-4280-98af-d8cded19afad",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-05-25T05:08:25Z",
      "updated_at": "2020-05-25T05:08:25Z",
      "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/ccc195ba-8bc6-46f3-a7b1-68da37ffacbe" -X GET \
    -H "Authorization: Bearer 5OGaaXzEzOJ_JV5TaZ3Yt596nldl7bP4dC-6OxUlZL0"

Endpoint

GET /v1/cardholders/:id

GET /v1/cardholders/ccc195ba-8bc6-46f3-a7b1-68da37ffacbe

Parameters

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

Response


200 OK
{
  "data": {
    "id": "ccc195ba-8bc6-46f3-a7b1-68da37ffacbe",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-05-25T05:08:25Z",
      "updated_at": "2020-05-25T05:08:25Z",
      "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-05-25",
        "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 "Authorization: Bearer OXLYoHqHXuhJ-QBY-JqE5hZ5ofSKKDPwOBGrbkeVnh0"

Endpoint

GET /v1/cardholders

GET /v1/cardholders

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "c7f55046-1c6d-43c8-bb7f-1dd740a210a7",
      "type": "cardholder",
      "attributes": {
        "created_at": "2020-05-25T05:08:26Z",
        "updated_at": "2020-05-25T05:08:26Z",
        "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-05-25",
          "identity_document_number": "A123456789",
          "identity_document_type": "id_card"
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/cardholders?page%5Bbefore%5D=c7f55046-1c6d-43c8-bb7f-1dd740a210a7",
    "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": "6ed1a891-309e-4fe3-bf40-fec08877ea8b",
          "type": "account"
        }
      }
    }
  }
}' -X POST \
    -H "Authorization: Bearer thy_sRqODbAvUowC9-pgbgmD0v2Gs5tk7ZzfZZS2jQE"

Endpoint

POST /v1/cards

POST /v1/cards

Parameters

{
  "data": {
    "type": "card",
    "attributes": {
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "6ed1a891-309e-4fe3-bf40-fec08877ea8b",
          "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. Only physical is supported at this time.
data[relationships][account] required The id of the account in which the card will be created for

Response


201 Created
{
  "data": {
    "id": "892d18b8-aadb-49dc-a81d-419d53f2436f",
    "type": "card",
    "attributes": {
      "created_at": "2020-05-25T05:08:26Z",
      "updated_at": "2020-05-25T05:08:26Z",
      "last_four": "1977",
      "exp_month": 5,
      "exp_year": 2023,
      "status": "unactivated",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "6ed1a891-309e-4fe3-bf40-fec08877ea8b",
          "type": "account"
        }
      }
    }
  }
}

Retrieve a card

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cards/4dc817f4-f271-406b-bcfc-399697976f55" -X GET \
    -H "Authorization: Bearer G9njT_tbv9yXno_g5Xz0DVkRYkbo0zOufXn-50g2e2Y"

Endpoint

GET /v1/cards/:id

GET /v1/cards/4dc817f4-f271-406b-bcfc-399697976f55

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "4dc817f4-f271-406b-bcfc-399697976f55",
    "type": "card",
    "attributes": {
      "created_at": "2020-05-25T05:08:26Z",
      "updated_at": "2020-05-25T05:08:26Z",
      "last_four": "2345",
      "exp_month": 5,
      "exp_year": 2023,
      "status": "active",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "a6e9eeee-d8a0-4a99-986c-b66888dcb2f8",
          "type": "account"
        }
      }
    }
  }
}

Update a card

Request

curl "https://cms-sandbox.bongloy.com/v1/cards/f8169dc7-7b6d-4dd1-82e6-c0d5eb0562f7" -d '{
  "data": {
    "attributes": {
      "status": null,
      "status": "inactive"
    },
    "type": "card",
    "id": "f8169dc7-7b6d-4dd1-82e6-c0d5eb0562f7"
  }
}' -X PATCH \
    -H "Authorization: Bearer wuzsyc0ptTF-qt77SJRGVxA1QZKeZUA0H9h-Urzjb2Y"

Endpoint

PATCH /v1/cards/:id

PATCH /v1/cards/f8169dc7-7b6d-4dd1-82e6-c0d5eb0562f7

Parameters

{
  "data": {
    "attributes": {
      "status": null,
      "status": "inactive"
    },
    "type": "card",
    "id": "f8169dc7-7b6d-4dd1-82e6-c0d5eb0562f7"
  }
}
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.

Response


200 OK
{
  "data": {
    "id": "f8169dc7-7b6d-4dd1-82e6-c0d5eb0562f7",
    "type": "card",
    "attributes": {
      "created_at": "2020-05-25T05:08:26Z",
      "updated_at": "2020-05-25T05:08:26Z",
      "last_four": "2345",
      "exp_month": 5,
      "exp_year": 2023,
      "status": "inactive",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "379316d7-7491-411f-8398-9f42626ef382",
          "type": "account"
        }
      }
    }
  }
}

List all cards

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cards" -X GET \
    -H "Authorization: Bearer yJCPl9jismjLQFL9BNLVMD14gYbYTi35HCq6pGiIuSE"

Endpoint

GET /v1/cards

GET /v1/cards

Parameters

Name Description
filter[cardholder] Only return cards belonging to the Cardholder with the provided ID.

Response


200 OK
{
  "data": [
    {
      "id": "ee2998d8-d044-4512-a553-d21f5a2bd6cb",
      "type": "card",
      "attributes": {
        "created_at": "2020-05-25T05:08:26Z",
        "updated_at": "2020-05-25T05:08:26Z",
        "last_four": "2345",
        "exp_month": 5,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "7a2b0c48-d2bb-494c-916f-2d1e371fc4c6",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "ec4f590f-2f0e-4881-b827-474de61b5fb5",
      "type": "card",
      "attributes": {
        "created_at": "2020-05-25T05:08:26Z",
        "updated_at": "2020-05-25T05:08:26Z",
        "last_four": "2345",
        "exp_month": 5,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "f3ed8511-052e-4a2f-984b-9467526ad4b6",
            "type": "account"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/cards?page%5Bbefore%5D=ee2998d8-d044-4512-a553-d21f5a2bd6cb",
    "next": null
  }
}

Create a management token

Request

curl "https://cms-sandbox.bongloy.com/v1/cards/a3b01cdb-a220-4f7c-a0a9-aa9d927a20a2/management_tokens" -d '{
  "data": {
    "type": "card_management_token",
    "attributes": {
      "type": "card_activation"
    }
  }
}' -X POST \
    -H "Authorization: Bearer FHunEDdJsKOPa4nCRO_654kRXYp6YP79fYq4PxzsrPg"

Endpoint

POST /v1/cards/:card_id/management_tokens

POST /v1/cards/a3b01cdb-a220-4f7c-a0a9-aa9d927a20a2/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 or pin_reset

Response


201 Created
{
  "data": {
    "id": "3882814e-ea14-4725-a529-3d2b39ab0327",
    "type": "card_management_token",
    "attributes": {
      "created_at": "2020-05-25T05:08:26Z",
      "updated_at": "2020-05-25T05:08:26Z",
      "expires_at": "2020-05-25T05:18:26Z",
      "type": "card_activation",
      "url": "https://cms-sandbox.bongloy.com/card_activation/new?token=wPyDCD8AOOHqZxtDxcC4hblxEwi4zhQP1gc1C2pOU-c"
    }
  }
}

Retrieve a card management token

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cards/5ad45d80-9bee-4165-87bb-0d1427e9a55c/management_tokens/1cc3ac1e-3846-4b0e-9f58-3f761c2dc3a9" -X GET \
    -H "Authorization: Bearer 8byqQz1Y2k7NsrenM-uIKmm7mO1FUgsSkd91WIjusPw"

Endpoint

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

GET /v1/cards/5ad45d80-9bee-4165-87bb-0d1427e9a55c/management_tokens/1cc3ac1e-3846-4b0e-9f58-3f761c2dc3a9

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "1cc3ac1e-3846-4b0e-9f58-3f761c2dc3a9",
    "type": "card_management_token",
    "attributes": {
      "created_at": "2020-05-25T05:08:26Z",
      "updated_at": "2020-05-25T05:08:26Z",
      "expires_at": "2020-05-25T05:18:26Z",
      "type": "card_activation",
      "url": "https://cms-sandbox.bongloy.com/card_activation/new?token=oeXX4gB_NFmxhgh_RhGk72PhaH8YFAnusshj_Lc3xVs"
    }
  }
}

Events

List all events

Request

curl -g "https://cms-sandbox.bongloy.com/v1/events" -X GET \
    -H "Authorization: Bearer vtieyKO47RBQTNoWjaNktUgi5aYcCp82DNul4x0uWcc"

Endpoint

GET /v1/events

GET /v1/events

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "2c284273-edaf-4ef6-9616-179229387bc3",
      "type": "event",
      "attributes": {
        "created_at": "2020-05-25T05:08:27Z",
        "updated_at": "2020-05-25T05:08:27Z",
        "type": "transaction.created",
        "details": {
          "data": {
            "id": "e9ee70a4-4cf3-414e-a145-762d6663512d",
            "type": "transaction",
            "attributes": {
              "fees": [

              ],
              "type": "purchase",
              "amount": 1000,
              "status": "settled",
              "currency": "USD",
              "total_fee": 0,
              "created_at": "2020-05-25T05:08:26Z",
              "updated_at": "2020-05-25T05:08:26Z",
              "settlement_time": "2020-05-25T05:08:26Z",
              "transaction_time": "2020-05-25T05:08:26Z",
              "transaction_amount": 1000,
              "transaction_number": "798206444728",
              "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": "49d74d0d-d8eb-4dac-b051-a1c3eabb10af",
                  "type": "account"
                }
              }
            }
          }
        }
      }
    },
    {
      "id": "d5f18c7c-9462-4218-9ec0-72a00d45ea31",
      "type": "event",
      "attributes": {
        "created_at": "2020-05-25T05:08:26Z",
        "updated_at": "2020-05-25T05:08:26Z",
        "type": "transaction.created",
        "details": {
          "data": {
            "id": "9bd59382-6460-4df9-ba45-2105dbe3e620",
            "type": "transaction",
            "attributes": {
              "fees": [

              ],
              "type": "purchase",
              "amount": 1000,
              "status": "settled",
              "currency": "USD",
              "total_fee": 0,
              "created_at": "2020-05-25T05:08:26Z",
              "updated_at": "2020-05-25T05:08:26Z",
              "settlement_time": "2020-05-25T05:08:26Z",
              "transaction_time": "2020-05-25T05:08:26Z",
              "transaction_amount": 1000,
              "transaction_number": "894557537110",
              "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": "0ef3ac3a-3c30-4245-b9fb-230faa4be5de",
                  "type": "account"
                }
              }
            }
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/events?page%5Bbefore%5D=2c284273-edaf-4ef6-9616-179229387bc3",
    "next": null
  }
}

Retrieve an Event

Request

curl -g "https://cms-sandbox.bongloy.com/v1/events/ef99c404-cace-4478-bb4c-3f53be89d398" -X GET \
    -H "Authorization: Bearer dQcOd91bDU2CMeyxGCKuea1jHAYqH115LmstqU9XRhw"

Endpoint

GET /v1/events/:id

GET /v1/events/ef99c404-cace-4478-bb4c-3f53be89d398

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "ef99c404-cace-4478-bb4c-3f53be89d398",
    "type": "event",
    "attributes": {
      "created_at": "2020-05-25T05:08:27Z",
      "updated_at": "2020-05-25T05:08:27Z",
      "type": "transaction.created",
      "details": {
        "data": {
          "id": "1639f097-f624-4ae8-a872-bd71e6b0baad",
          "type": "transaction",
          "attributes": {
            "fees": [

            ],
            "type": "purchase",
            "amount": 1000,
            "status": "settled",
            "currency": "USD",
            "total_fee": 0,
            "created_at": "2020-05-25T05:08:27Z",
            "updated_at": "2020-05-25T05:08:27Z",
            "settlement_time": "2020-05-25T05:08:27Z",
            "transaction_time": "2020-05-25T05:08:27Z",
            "transaction_amount": 1000,
            "transaction_number": "391941448886",
            "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": "4767c931-02e2-4b3a-a93f-7b68f40b1181",
                "type": "account"
              }
            }
          }
        }
      }
    }
  }
}

Transactions

List all transactions

Request

curl -g "https://cms-sandbox.bongloy.com/v1/transactions?filter[status]=settled&filter[account]=36d30b33-6e87-42e5-9c6b-2bc24f470eed&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T12%3A00%3A00Z" -X GET \
    -H "Authorization: Bearer vAB7SNqHaR8RJw1sSb0XJEK9yILy2vmCnfSulFH3ilo"

Endpoint

GET /v1/transactions

GET /v1/transactions?filter[status]=settled&filter[account]=36d30b33-6e87-42e5-9c6b-2bc24f470eed&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T12%3A00%3A00Z

Parameters

filter: {"status"=>"settled", "account"=>"36d30b33-6e87-42e5-9c6b-2bc24f470eed", "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": "6b5cb114-41b2-4332-aeff-8be0d762a45d",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-05-25T05:08:27Z",
        "updated_at": "2020-05-25T05:08:27Z",
        "currency": "USD",
        "transaction_number": "288396952967",
        "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": "36d30b33-6e87-42e5-9c6b-2bc24f470eed",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "ad4888d0-98f3-4a13-9a91-8483bc003bd9",
            "type": "card"
          }
        }
      }
    },
    {
      "id": "f6af8330-f87a-46a7-9f90-9e4516ba5633",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-05-25T05:08:27Z",
        "updated_at": "2020-05-25T05:08:27Z",
        "currency": "USD",
        "transaction_number": "846151661850",
        "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": "36d30b33-6e87-42e5-9c6b-2bc24f470eed",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "d3153f31-fa95-40f3-a32f-2c6c84c382c7",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-05-25T05:08:27Z",
        "updated_at": "2020-05-25T05:08:27Z",
        "currency": "USD",
        "transaction_number": "260782348509",
        "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": "36d30b33-6e87-42e5-9c6b-2bc24f470eed",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "ad4888d0-98f3-4a13-9a91-8483bc003bd9",
            "type": "card"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/transactions?filter%5Baccount%5D=36d30b33-6e87-42e5-9c6b-2bc24f470eed&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=6b5cb114-41b2-4332-aeff-8be0d762a45d",
    "next": null
  }
}

Retrieve a transaction

Request

curl -g "https://cms-sandbox.bongloy.com/v1/transactions/0fbfcf3e-6f24-455d-9cda-d945429f9095" -X GET \
    -H "Authorization: Bearer tix6Wv442CjQp4h8oBqDgCZ4AIY_PQtbW79UyWIg9b0"

Endpoint

GET /v1/transactions/:id

GET /v1/transactions/0fbfcf3e-6f24-455d-9cda-d945429f9095

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "0fbfcf3e-6f24-455d-9cda-d945429f9095",
    "type": "transaction",
    "attributes": {
      "created_at": "2020-05-25T05:08:27Z",
      "updated_at": "2020-05-25T05:08:27Z",
      "currency": "USD",
      "transaction_number": "815474621529",
      "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-05-25T05:08:27Z",
      "settlement_time": "2020-05-25T05:08:27Z"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "287cb6b7-169d-437d-b5a1-b786c28c1e5b",
          "type": "account"
        }
      },
      "card": {
        "data": {
          "id": "a83e4f87-ec9d-4d62-a79e-5e757a12ec0f",
          "type": "card"
        }
      }
    }
  }
}