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

Account Balance

Retrieve an account balance

Request

curl -g "https://cms-sandbox.bongloy.com/v1/accounts/53c7c220-c019-45be-abfd-d34f89868583/balance" -X GET \
    -H "Authorization: Bearer 2qgDR5_6xuylGuEY-hQeENkoad6P3wRpfk7XZTbP940"

Endpoint

GET /v1/accounts/:account_id/balance

GET /v1/accounts/53c7c220-c019-45be-abfd-d34f89868583/balance

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "53c7c220-c019-45be-abfd-d34f89868583",
    "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": "2e5bdf25-9ed3-448a-9b21-8a5762d981b3"
        }
      }
    }
  }
}' -X POST \
    -H "Authorization: Bearer qnppXVT068-fLbkz-0WwBDUZL9rTMyZ-I4XRd4COMJI"

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": "2e5bdf25-9ed3-448a-9b21-8a5762d981b3"
        }
      }
    }
  }
}
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": "3997e814-2833-4e33-a2fd-2c561acb4a5e",
    "type": "account",
    "attributes": {
      "created_at": "2020-04-09T12:20:08Z",
      "updated_at": "2020-04-09T12:20:08Z",
      "currency": "USD",
      "number": "123456",
      "status": "active",
      "metadata": {
        "foobar": "foobar"
      }
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "2e5bdf25-9ed3-448a-9b21-8a5762d981b3",
          "type": "cardholder"
        }
      }
    }
  }
}

List all accounts

Request

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

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": "a7306ece-3004-4a8d-bd96-b14dec1bfc0f",
      "type": "account",
      "attributes": {
        "created_at": "2020-04-09T12:20:08Z",
        "updated_at": "2020-04-09T12:20:08Z",
        "currency": "USD",
        "number": "000123",
        "status": "active",
        "metadata": {
        }
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "b010775d-6fb9-41fa-893f-dd310746a653",
            "type": "cardholder"
          }
        }
      }
    },
    {
      "id": "ee027ded-485c-4ac7-950c-5af1238f35be",
      "type": "account",
      "attributes": {
        "created_at": "2020-04-09T12:20:08Z",
        "updated_at": "2020-04-09T12:20:08Z",
        "currency": "USD",
        "number": "000122",
        "status": "active",
        "metadata": {
        }
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "ae42126d-706f-44a4-a411-2d6e879fc127",
            "type": "cardholder"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/accounts?page%5Bbefore%5D=a7306ece-3004-4a8d-bd96-b14dec1bfc0f",
    "next": null
  }
}

Retrieve an account

Request

curl -g "https://cms-sandbox.bongloy.com/v1/accounts/d36054bf-9387-4962-97c2-7b055956bcf5" -X GET \
    -H "Authorization: Bearer v-Mgj8coae5Glb4qwcjmW7vzKSAf2yG1eTWFLdbiGF4"

Endpoint

GET /v1/accounts/:id

GET /v1/accounts/d36054bf-9387-4962-97c2-7b055956bcf5

Parameters

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

Response


200 OK
{
  "data": {
    "id": "d36054bf-9387-4962-97c2-7b055956bcf5",
    "type": "account",
    "attributes": {
      "created_at": "2020-04-09T12:20:08Z",
      "updated_at": "2020-04-09T12:20:08Z",
      "currency": "USD",
      "number": "000121",
      "status": "active",
      "metadata": {
      }
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "92a7b535-a9a6-4674-9f6c-ab549f97fda1",
          "type": "cardholder"
        }
      }
    }
  }
}

Update an account

Request

curl "https://cms-sandbox.bongloy.com/v1/accounts/7a9f200e-973a-4bc9-96ab-2c57641a740c" -d '{
  "data": {
    "type": "account",
    "id": "7a9f200e-973a-4bc9-96ab-2c57641a740c",
    "attributes": {
      "metadata": {
        "buzz": "foobar"
      }
    }
  }
}' -X PATCH \
    -H "Authorization: Bearer Py87UtjVhScOf6Im_xSNFzj0A9wSFmUQUZiCX5OQaMI"

Endpoint

PATCH /v1/accounts/:id

PATCH /v1/accounts/7a9f200e-973a-4bc9-96ab-2c57641a740c

Parameters

{
  "data": {
    "type": "account",
    "id": "7a9f200e-973a-4bc9-96ab-2c57641a740c",
    "attributes": {
      "metadata": {
        "buzz": "foobar"
      }
    }
  }
}

None known.

Response


200 OK
{
  "data": {
    "id": "7a9f200e-973a-4bc9-96ab-2c57641a740c",
    "type": "account",
    "attributes": {
      "created_at": "2020-04-09T12:20:08Z",
      "updated_at": "2020-04-09T12:20:08Z",
      "currency": "USD",
      "number": "000120",
      "status": "active",
      "metadata": {
        "foo": "bar",
        "buzz": "foobar"
      }
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "b493d06b-d3e1-4a33-9756-e8241acab222",
          "type": "cardholder"
        }
      }
    }
  }
}

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 LdofY8EfOhcZ0MBkw013wphlOZUD6HSbJ_DpMN0Wt1E"

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": "493fe8d2-3d6b-470b-8240-1b4a1cbff7ce",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-04-09T12:20:08Z",
      "updated_at": "2020-04-09T12:20:08Z",
      "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"
      }
    }
  }
}

List all cardholders

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cardholders" -X GET \
    -H "Authorization: Bearer 3EwwWYno-uOgtaufzskgsZiXs32jvA7vUUc6tnXxEO4"

Endpoint

GET /v1/cardholders

GET /v1/cardholders

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "5afe1876-665e-49e9-a744-933c30c55312",
      "type": "cardholder",
      "attributes": {
        "created_at": "2020-04-09T12:20:10Z",
        "updated_at": "2020-04-09T12:20:10Z",
        "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-04-09",
          "identity_document_number": "A123456789",
          "identity_document_type": "id_card"
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/cardholders?page%5Bbefore%5D=5afe1876-665e-49e9-a744-933c30c55312",
    "next": null
  }
}

Retrieve a cardholder

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cardholders/23cf351b-cb6c-461b-9e3b-1aee4343efb1" -X GET \
    -H "Authorization: Bearer 0i8pYq7z_6XKVld35B7cUBSzNpQ3XHrgNIWjdR7XXp4"

Endpoint

GET /v1/cardholders/:id

GET /v1/cardholders/23cf351b-cb6c-461b-9e3b-1aee4343efb1

Parameters

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

Response


200 OK
{
  "data": {
    "id": "23cf351b-cb6c-461b-9e3b-1aee4343efb1",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-04-09T12:20:10Z",
      "updated_at": "2020-04-09T12:20:10Z",
      "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-04-09",
        "identity_document_number": "A123456789",
        "identity_document_type": "id_card"
      }
    }
  }
}

Update a cardholder

Request

curl "https://cms-sandbox.bongloy.com/v1/cardholders/cbb70587-04d2-4301-8ee3-f51d453b0625" -d '{
  "data": {
    "type": "cardholder",
    "id": "cbb70587-04d2-4301-8ee3-f51d453b0625",
    "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 zxwayN2p1-aIuoO_oUL8yQlvhXwlwA4sQJKiUxUejFA"

Endpoint

PATCH /v1/cardholders/:id

PATCH /v1/cardholders/cbb70587-04d2-4301-8ee3-f51d453b0625

Parameters

{
  "data": {
    "type": "cardholder",
    "id": "cbb70587-04d2-4301-8ee3-f51d453b0625",
    "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": "cbb70587-04d2-4301-8ee3-f51d453b0625",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-04-09T12:20:10Z",
      "updated_at": "2020-04-09T12:20:10Z",
      "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"
      }
    }
  }
}

Cards

Create a card

Request

curl "https://cms-sandbox.bongloy.com/v1/cards" -d '{
  "data": {
    "type": "card",
    "attributes": {
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "57e442d9-3bb5-4c97-833e-b29dfdff7546",
          "type": "account"
        }
      }
    }
  }
}' -X POST \
    -H "Authorization: Bearer 3Dzr4tTF_dkSySwuZdY2RWjPxiqbWZF-Bdq7UQwgUYk"

Endpoint

POST /v1/cards

POST /v1/cards

Parameters

{
  "data": {
    "type": "card",
    "attributes": {
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "57e442d9-3bb5-4c97-833e-b29dfdff7546",
          "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": "4605181d-5661-4de3-8fe8-d895a311d918",
    "type": "card",
    "attributes": {
      "created_at": "2020-04-09T12:20:10Z",
      "updated_at": "2020-04-09T12:20:10Z",
      "last_four": "1178",
      "exp_month": 4,
      "exp_year": 2023,
      "status": "unactivated",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "57e442d9-3bb5-4c97-833e-b29dfdff7546",
          "type": "account"
        }
      }
    }
  }
}

Create a management token

Request

curl "https://cms-sandbox.bongloy.com/v1/cards/571d8c31-709e-463b-9870-3373c5df9f8e/management_tokens" -d '{
  "data": {
    "type": "card_management_token",
    "attributes": {
      "type": "card_activation"
    }
  }
}' -X POST \
    -H "Authorization: Bearer doO8jR4NvX2GXNzNhWsXMRj6DxwEMb1IfWBbxXEUYJY"

Endpoint

POST /v1/cards/:card_id/management_tokens

POST /v1/cards/571d8c31-709e-463b-9870-3373c5df9f8e/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": "8a49706f-d989-45b2-bd46-6e109625902f",
    "type": "card_management_token",
    "attributes": {
      "created_at": "2020-04-09T12:20:10Z",
      "updated_at": "2020-04-09T12:20:10Z",
      "expires_at": "2020-04-09T12:30:10Z",
      "type": "card_activation",
      "url": "https://cms-sandbox.bongloy.com/card_activation/new?token=YzFq4xV9jq8juEgUxrAP8eB1zRsoAVAu54qBHl0Sbzs"
    }
  }
}

List all cards

Request

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

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": "2a480f67-52b2-43a0-9e2a-b04a7566d2f3",
      "type": "card",
      "attributes": {
        "created_at": "2020-04-09T12:20:10Z",
        "updated_at": "2020-04-09T12:20:10Z",
        "last_four": "2345",
        "exp_month": 4,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "b1459539-8ab6-45f2-bde0-77422f967253",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "ea9d5608-8b4f-4bae-a169-3a40301f6d19",
      "type": "card",
      "attributes": {
        "created_at": "2020-04-09T12:20:10Z",
        "updated_at": "2020-04-09T12:20:10Z",
        "last_four": "2345",
        "exp_month": 4,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "6b2f38d8-d1b2-4a98-8960-412a7e4c8354",
            "type": "account"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/cards?page%5Bbefore%5D=2a480f67-52b2-43a0-9e2a-b04a7566d2f3",
    "next": null
  }
}

Retrieve a card

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cards/2828a2ad-ff2c-46df-8189-fa88f1b96564" -X GET \
    -H "Authorization: Bearer sE2JqUO44fQ7BO18zyGrJpiakLs5vpnAlJydTKfKoVE"

Endpoint

GET /v1/cards/:id

GET /v1/cards/2828a2ad-ff2c-46df-8189-fa88f1b96564

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "2828a2ad-ff2c-46df-8189-fa88f1b96564",
    "type": "card",
    "attributes": {
      "created_at": "2020-04-09T12:20:10Z",
      "updated_at": "2020-04-09T12:20:10Z",
      "last_four": "2345",
      "exp_month": 4,
      "exp_year": 2023,
      "status": "active",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "6f1251ad-6a26-4f32-90a6-845dbe19a156",
          "type": "account"
        }
      }
    }
  }
}

Update a card

Request

curl "https://cms-sandbox.bongloy.com/v1/cards/7803f448-4224-406f-a992-9140eff7a21d" -d '{
  "data": {
    "attributes": {
      "status": null,
      "status": "inactive"
    },
    "type": "card",
    "id": "7803f448-4224-406f-a992-9140eff7a21d"
  }
}' -X PATCH \
    -H "Authorization: Bearer fI-xZemnV7uPFIPOaB0UqLLFDZ88E8NVMTdsbSE1dCc"

Endpoint

PATCH /v1/cards/:id

PATCH /v1/cards/7803f448-4224-406f-a992-9140eff7a21d

Parameters

{
  "data": {
    "attributes": {
      "status": null,
      "status": "inactive"
    },
    "type": "card",
    "id": "7803f448-4224-406f-a992-9140eff7a21d"
  }
}
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": "7803f448-4224-406f-a992-9140eff7a21d",
    "type": "card",
    "attributes": {
      "created_at": "2020-04-09T12:20:10Z",
      "updated_at": "2020-04-09T12:20:10Z",
      "last_four": "2345",
      "exp_month": 4,
      "exp_year": 2023,
      "status": "inactive",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "8469bb12-7366-4b74-b1f4-cb53b6ae08f0",
          "type": "account"
        }
      }
    }
  }
}

Events

List all events

Request

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

Endpoint

GET /v1/events

GET /v1/events

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "c27668b0-598f-4f11-a2a7-9a1c9ad816b4",
      "type": "event",
      "attributes": {
        "created_at": "2020-04-09T12:20:11Z",
        "updated_at": "2020-04-09T12:20:11Z",
        "type": "transaction.created",
        "details": {
          "data": {
            "id": "e389a19a-ac21-4624-9cd7-acb7005144dc",
            "type": "transaction",
            "attributes": {
              "fees": [

              ],
              "type": "purchase",
              "amount": 1000,
              "status": "settled",
              "currency": "USD",
              "total_fee": 0,
              "created_at": "2020-04-09T12:20:11Z",
              "updated_at": "2020-04-09T12:20:11Z",
              "settlement_time": "2020-04-09T12:20:11Z",
              "transaction_time": "2020-04-09T12:20:11Z",
              "transaction_amount": 1000,
              "transaction_number": "950753538637",
              "transaction_details": {
                "card": {
                  "merchant_data": {
                    "city": "Phnom Penh",
                    "name": "Rocket Rides",
                    "country": "KH",
                    "category": "taxicabs_limousines"
                  }
                },
                "type": "card"
              },
              "transaction_currency": "USD",
              "balance_adjustment_type": "debit"
            },
            "relationships": {
              "account": {
                "data": {
                  "id": "b7c0a33f-30f8-4087-8971-9ab013aad33c",
                  "type": "account"
                }
              }
            }
          }
        }
      }
    },
    {
      "id": "dbf0697a-c1a0-460b-9257-fcb7269555ba",
      "type": "event",
      "attributes": {
        "created_at": "2020-04-09T12:20:11Z",
        "updated_at": "2020-04-09T12:20:11Z",
        "type": "transaction.created",
        "details": {
          "data": {
            "id": "0737d715-6edb-4581-b12d-4c867e169a83",
            "type": "transaction",
            "attributes": {
              "fees": [

              ],
              "type": "purchase",
              "amount": 1000,
              "status": "settled",
              "currency": "USD",
              "total_fee": 0,
              "created_at": "2020-04-09T12:20:10Z",
              "updated_at": "2020-04-09T12:20:10Z",
              "settlement_time": "2020-04-09T12:20:10Z",
              "transaction_time": "2020-04-09T12:20:10Z",
              "transaction_amount": 1000,
              "transaction_number": "815257624651",
              "transaction_details": {
                "card": {
                  "merchant_data": {
                    "city": "Phnom Penh",
                    "name": "Rocket Rides",
                    "country": "KH",
                    "category": "taxicabs_limousines"
                  }
                },
                "type": "card"
              },
              "transaction_currency": "USD",
              "balance_adjustment_type": "debit"
            },
            "relationships": {
              "account": {
                "data": {
                  "id": "3a5ffda3-a820-4d0f-a141-767be3b0c3f6",
                  "type": "account"
                }
              }
            }
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/events?page%5Bbefore%5D=c27668b0-598f-4f11-a2a7-9a1c9ad816b4",
    "next": null
  }
}

Retrieve an Event

Request

curl -g "https://cms-sandbox.bongloy.com/v1/events/5889cf0f-1e74-41ba-81a0-015eebda74de" -X GET \
    -H "Authorization: Bearer CtioTyQIEuEiqsegNazl_wpjY5lF7MIfXRluVlzedzQ"

Endpoint

GET /v1/events/:id

GET /v1/events/5889cf0f-1e74-41ba-81a0-015eebda74de

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "5889cf0f-1e74-41ba-81a0-015eebda74de",
    "type": "event",
    "attributes": {
      "created_at": "2020-04-09T12:20:11Z",
      "updated_at": "2020-04-09T12:20:11Z",
      "type": "transaction.created",
      "details": {
        "data": {
          "id": "22717994-020e-4015-b6e6-97f951d265be",
          "type": "transaction",
          "attributes": {
            "fees": [

            ],
            "type": "purchase",
            "amount": 1000,
            "status": "settled",
            "currency": "USD",
            "total_fee": 0,
            "created_at": "2020-04-09T12:20:11Z",
            "updated_at": "2020-04-09T12:20:11Z",
            "settlement_time": "2020-04-09T12:20:11Z",
            "transaction_time": "2020-04-09T12:20:11Z",
            "transaction_amount": 1000,
            "transaction_number": "512691568702",
            "transaction_details": {
              "card": {
                "merchant_data": {
                  "city": "Phnom Penh",
                  "name": "Rocket Rides",
                  "country": "KH",
                  "category": "taxicabs_limousines"
                }
              },
              "type": "card"
            },
            "transaction_currency": "USD",
            "balance_adjustment_type": "debit"
          },
          "relationships": {
            "account": {
              "data": {
                "id": "70bbfe02-1311-4ff6-a20b-a38bf0ad9ac7",
                "type": "account"
              }
            }
          }
        }
      }
    }
  }
}

Transactions

List all transactions

Request

curl -g "https://cms-sandbox.bongloy.com/v1/transactions?filter[status]=settled&filter[account]=174a7f39-49fa-4972-a996-6420b64bd957&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T12%3A00%3A00Z" -X GET \
    -H "Authorization: Bearer tjxULqv45w5cRHMsnPUveHQYJxXfQFRy9blHMrppd5M"

Endpoint

GET /v1/transactions

GET /v1/transactions?filter[status]=settled&filter[account]=174a7f39-49fa-4972-a996-6420b64bd957&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T12%3A00%3A00Z

Parameters

filter: {"status"=>"settled", "account"=>"174a7f39-49fa-4972-a996-6420b64bd957", "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": "81215a56-6af3-43c1-a755-df5ffc2ca82e",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-04-09T12:20:11Z",
        "updated_at": "2020-04-09T12:20:11Z",
        "currency": "USD",
        "transaction_number": "770056540520",
        "transaction_currency": "USD",
        "transaction_details": {
          "card": {
            "merchant_data": {
              "city": "Phnom Penh",
              "name": "Rocket Rides",
              "country": "KH",
              "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": "174a7f39-49fa-4972-a996-6420b64bd957",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "27819e52-9884-4a61-8dbb-bf15fc8c94e3",
            "type": "card"
          }
        }
      }
    },
    {
      "id": "43b04868-4b69-47be-96ac-785edc9ee5df",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-04-09T12:20:11Z",
        "updated_at": "2020-04-09T12:20:11Z",
        "currency": "USD",
        "transaction_number": "787115539215",
        "transaction_currency": "USD",
        "transaction_details": {
          "type": "topup",
          "topup": {
            "funding_source": "Agent Network"
          }
        },
        "type": "purchase",
        "fees": [

        ],
        "status": "settled",
        "balance_adjustment_type": "credit",
        "amount": 1000,
        "total_fee": 0,
        "transaction_amount": 1000,
        "transaction_time": "2020-01-01T07:00:00Z",
        "settlement_time": "2020-01-01T07:00:00Z"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "174a7f39-49fa-4972-a996-6420b64bd957",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "998d5b28-a8dd-4fa6-89c0-c186cca6e4e7",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-04-09T12:20:11Z",
        "updated_at": "2020-04-09T12:20:11Z",
        "currency": "USD",
        "transaction_number": "395231542132",
        "transaction_currency": "USD",
        "transaction_details": {
          "card": {
            "merchant_data": {
              "city": "Phnom Penh",
              "name": "Rocket Rides",
              "country": "KH",
              "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": "174a7f39-49fa-4972-a996-6420b64bd957",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "27819e52-9884-4a61-8dbb-bf15fc8c94e3",
            "type": "card"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/transactions?filter%5Baccount%5D=174a7f39-49fa-4972-a996-6420b64bd957&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=81215a56-6af3-43c1-a755-df5ffc2ca82e",
    "next": null
  }
}

Retrieve a transaction

Request

curl -g "https://cms-sandbox.bongloy.com/v1/transactions/a0e8366c-4ff7-4480-a6bd-7ca2dfbc6f0f" -X GET \
    -H "Authorization: Bearer IyZj3WktTz4ks2-QYFqmhB7fmbzqELQf_1pwU3VTNjs"

Endpoint

GET /v1/transactions/:id

GET /v1/transactions/a0e8366c-4ff7-4480-a6bd-7ca2dfbc6f0f

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "a0e8366c-4ff7-4480-a6bd-7ca2dfbc6f0f",
    "type": "transaction",
    "attributes": {
      "created_at": "2020-04-09T12:20:11Z",
      "updated_at": "2020-04-09T12:20:11Z",
      "currency": "USD",
      "transaction_number": "326072182882",
      "transaction_currency": "USD",
      "transaction_details": {
        "card": {
          "merchant_data": {
            "city": "Phnom Penh",
            "name": "Rocket Rides",
            "country": "KH",
            "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-04-09T12:20:11Z",
      "settlement_time": "2020-04-09T12:20:11Z"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "28790910-d5ad-4007-a439-aaac1db0d3c6",
          "type": "account"
        }
      },
      "card": {
        "data": {
          "id": "facc6682-b702-4a4f-b8da-89faf506a09c",
          "type": "card"
        }
      }
    }
  }
}