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

Endpoint

GET /connect/v1/transactions

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

Parameters

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

Response


200 OK
{
  "data": [
    {
      "id": "327cfed6-1e9e-4bbe-9532-a86be4b7ddd1",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-05-25T05:08:20Z",
        "updated_at": "2020-05-25T05:08:20Z",
        "currency": "USD",
        "transaction_number": "999542400183",
        "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": "c7d6e5db-4551-4ad1-87fa-7db4c1ab917a",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "bc944846-0d11-49f6-af76-47154d4ad71a",
            "type": "card"
          }
        }
      }
    },
    {
      "id": "221bacf3-38b6-42bb-b8d4-d7b497f120ee",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-05-25T05:08:20Z",
        "updated_at": "2020-05-25T05:08:20Z",
        "currency": "USD",
        "transaction_number": "893638277150",
        "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": "c7d6e5db-4551-4ad1-87fa-7db4c1ab917a",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "bc944846-0d11-49f6-af76-47154d4ad71a",
            "type": "card"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://cms-sandbox.bongloy.com/connect/v1/transactions?page%5Bbefore%5D=327cfed6-1e9e-4bbe-9532-a86be4b7ddd1&page%5Bsize%5D=2",
    "next": "http://cms-sandbox.bongloy.com/connect/v1/transactions?page%5Bafter%5D=221bacf3-38b6-42bb-b8d4-d7b497f120ee&page%5Bsize%5D=2"
  }
}

Authentication

Test Data

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

Phone Number OTP
85513333333 123456

Create a cardholder verification

Request

curl "https://cms-sandbox.bongloy.com/connect/v1/cardholder_verifications" -d '{
  "data": {
    "type": "cardholder_verification",
    "attributes": {
      "phone_number": "85512583587",
      "account_identifier": "195000131"
    }
  }
}' -X POST \
    -H "Authorization: Bearer nE-RCaILpenUADeKbDIQjMLmBIsGbAARBgWvMSntBpM"

Endpoint

POST /connect/v1/cardholder_verifications

POST /connect/v1/cardholder_verifications

Parameters

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

Response


201 Created
{
  "data": {
    "id": "41b3e962-eaa7-460a-aaba-029b4673952b",
    "type": "cardholder_verification",
    "attributes": {
      "created_at": "2020-05-25T05:08:23Z",
      "updated_at": "2020-05-25T05:08:23Z",
      "phone_number": "85512583587",
      "status": "pending",
      "valid_until": "2020-05-25T05:10:23.434Z"
    }
  }
}

Authenticate a cardholder

Request

curl "https://cms-sandbox.bongloy.com/oauth/token" -d '{
  "grant_type": "password",
  "scope": "connect",
  "auth_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImY1YzlhZWJlMjM0ZGE2MDE2YmQ3Yjk0OTE2OGI4Y2Q1YjRlYzllZWIiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vYm9uZ2xveS1hcHAtc2FuZGJveCIsImF1ZCI6ImJvbmdsb3ktYXBwLXNhbmRib3giLCJhdXRoX3RpbWUiOjE1OTAwNTUxMjEsInVzZXJfaWQiOiJ0R21oMEl2M0dMU2FFandqREYwRHFMS3UzencxIiwic3ViIjoidEdtaDBJdjNHTFNhRWp3akRGMERxTEt1M3p3MSIsImlhdCI6MTU5MDA1NTEyMiwiZXhwIjoxNTkwMDU4NzIyLCJwaG9uZV9udW1iZXIiOiIrODU1MTMzMzMzMzMiLCJmaXJlYmFzZSI6eyJpZGVudGl0aWVzIjp7InBob25lIjpbIis4NTUxMzMzMzMzMyJdfSwic2lnbl9pbl9wcm92aWRlciI6InBob25lIn19.MKsGU4OeyyXDwgroKTu5yZFsw8LK7gubHflJ8TguEQ1nhuSpe3CWi56R-Cvviz54d2IdP09JHdEp5NFyoHcVAb9Pfkmo1wY1GrpVIulzzNBs2b-7JZe9ruEdgycUpDHpGC6glO39rnLaYvd9ZJZijrwDH3AUz5JN5LO0wAHWl9j23kqdTc5P5_n-n5dDQl4rPTwSZRWlXOqnqNfom4gpmYPR5OQf8Eot8meEYYDjpDxVQjobXhe5XaMObiis_EhbIUuZD6x3n3aYY3wj18d_KlN7iLWYTr8Z4_SScTi43cQa11mjdIpd-1BaFweoC30PhZUAINy1ymLx98esHaaIMA",
  "cardholder_verification_id": "0972496e-8406-49bd-af70-980e6faa4864",
  "client_id": "16EIULrG1YIhdYhkQU6C4AaWb8MoRKJUfWjnfRZ-obY",
  "client_secret": "fxmwTMWaTSAKwCWRw9nA3jKgXb_TI1966athGI01JAo"
}' -X POST \
    -H "Authorization: Bearer dRhP5xUX3gzOx-UgCi6FIkNsx21paARECE0SpQQpjTE"

Endpoint

POST /oauth/token

POST /oauth/token

Parameters

{
  "grant_type": "password",
  "scope": "connect",
  "auth_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImY1YzlhZWJlMjM0ZGE2MDE2YmQ3Yjk0OTE2OGI4Y2Q1YjRlYzllZWIiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vYm9uZ2xveS1hcHAtc2FuZGJveCIsImF1ZCI6ImJvbmdsb3ktYXBwLXNhbmRib3giLCJhdXRoX3RpbWUiOjE1OTAwNTUxMjEsInVzZXJfaWQiOiJ0R21oMEl2M0dMU2FFandqREYwRHFMS3UzencxIiwic3ViIjoidEdtaDBJdjNHTFNhRWp3akRGMERxTEt1M3p3MSIsImlhdCI6MTU5MDA1NTEyMiwiZXhwIjoxNTkwMDU4NzIyLCJwaG9uZV9udW1iZXIiOiIrODU1MTMzMzMzMzMiLCJmaXJlYmFzZSI6eyJpZGVudGl0aWVzIjp7InBob25lIjpbIis4NTUxMzMzMzMzMyJdfSwic2lnbl9pbl9wcm92aWRlciI6InBob25lIn19.MKsGU4OeyyXDwgroKTu5yZFsw8LK7gubHflJ8TguEQ1nhuSpe3CWi56R-Cvviz54d2IdP09JHdEp5NFyoHcVAb9Pfkmo1wY1GrpVIulzzNBs2b-7JZe9ruEdgycUpDHpGC6glO39rnLaYvd9ZJZijrwDH3AUz5JN5LO0wAHWl9j23kqdTc5P5_n-n5dDQl4rPTwSZRWlXOqnqNfom4gpmYPR5OQf8Eot8meEYYDjpDxVQjobXhe5XaMObiis_EhbIUuZD6x3n3aYY3wj18d_KlN7iLWYTr8Z4_SScTi43cQa11mjdIpd-1BaFweoC30PhZUAINy1ymLx98esHaaIMA",
  "cardholder_verification_id": "0972496e-8406-49bd-af70-980e6faa4864",
  "client_id": "16EIULrG1YIhdYhkQU6C4AaWb8MoRKJUfWjnfRZ-obY",
  "client_secret": "fxmwTMWaTSAKwCWRw9nA3jKgXb_TI1966athGI01JAo"
}
Name Description
grant_type required The grant_type of the token. Must be password
scope required Must be connect
client_id required The client id of the application
client_secret required The client secret of the application
auth_token required The auth token from the authentication provider
cardholder_verification_id required The id of the cardholder_verification

Response


200 OK
{
  "access_token": "PkQntstru8Wg_y4ST8eolryx5nK3qaOJpDRTfRihzPI",
  "token_type": "Bearer",
  "expires_in": 7200,
  "refresh_token": "A7m19wQGgddP0_ej3H3vrrAWJyccNC_gUOsIdr1TyB0",
  "scope": "connect"
}

Refresh cardholder access token

Request

curl "https://cms-sandbox.bongloy.com/oauth/token" -d '{
  "grant_type": "refresh_token",
  "refresh_token": "AoM77nPMx6lpj0SDWYHCMg",
  "client_id": "Q5JEzwfX-5PAJYk_u6vwRUVOgOqrVrPna8f3Z1yS3fY",
  "client_secret": "U8ahwZHw5w1lzoHzVir0uz-RNx3J7EdusrYhuAM1gMs"
}' -X POST \
    -H "Authorization: Bearer dRhP5xUX3gzOx-UgCi6FIkNsx21paARECE0SpQQpjTE"

Endpoint

POST /oauth/token

POST /oauth/token

Parameters

{
  "grant_type": "refresh_token",
  "refresh_token": "AoM77nPMx6lpj0SDWYHCMg",
  "client_id": "Q5JEzwfX-5PAJYk_u6vwRUVOgOqrVrPna8f3Z1yS3fY",
  "client_secret": "U8ahwZHw5w1lzoHzVir0uz-RNx3J7EdusrYhuAM1gMs"
}
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": "GisrljcQVqdicXgtXgK5ORSlMggSRymtcEk3bkqqKJ4",
  "token_type": "Bearer",
  "expires_in": 7200,
  "refresh_token": "VwnI-8oyMg0a1acRyd26YI_opIYdnaFnysjKSz_2G4w",
  "scope": "connect"
}

Logout a cardholder

Request

curl "https://cms-sandbox.bongloy.com/oauth/revoke" -d '{
  "token": "SugAJIrCcGHu7G7yHfKxTZiS1CfRQn96U6A6bKnmzhw",
  "client_id": "XYoUznoimNFJm9o_vdJo0qRrDaTCO9hraEOE3aYhxmA",
  "client_secret": "6vhrlXWyTVYXNZPPSi6Q-pPoHQeufOMCpS9OvNnEROk"
}' -X POST \
    -H "Authorization: Bearer dRhP5xUX3gzOx-UgCi6FIkNsx21paARECE0SpQQpjTE"

Endpoint

POST /oauth/revoke

POST /oauth/revoke

Parameters

{
  "token": "SugAJIrCcGHu7G7yHfKxTZiS1CfRQn96U6A6bKnmzhw",
  "client_id": "XYoUznoimNFJm9o_vdJo0qRrDaTCO9hraEOE3aYhxmA",
  "client_secret": "6vhrlXWyTVYXNZPPSi6Q-pPoHQeufOMCpS9OvNnEROk"
}
Name Description
token required The token in which to revoke. Can be either a refresh token or an access token
client_id required The client id of the application
client_secret required The client secret of the application

Response


200 OK
{
}

Account Balance

Retrieve an account balance

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/accounts/213a65a1-6ec5-4181-817e-0766170b406d/balance" -X GET \
    -H "Authorization: Bearer io5q8ovqig70jTFwWmNm5alVl75oD_DPIEPFe494Z-I"

Endpoint

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

GET /connect/v1/accounts/213a65a1-6ec5-4181-817e-0766170b406d/balance

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "213a65a1-6ec5-4181-817e-0766170b406d",
    "type": "balance",
    "attributes": {
      "available": {
        "amount": 10000,
        "currency": "USD"
      },
      "balance": {
        "amount": 10000,
        "currency": "USD"
      }
    }
  }
}

Accounts

List all accounts

Request

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

Endpoint

GET /connect/v1/accounts

GET /connect/v1/accounts

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "105563c0-e136-43ba-88d4-de968b4110c1",
      "type": "account",
      "attributes": {
        "created_at": "2020-05-25T05:08:23Z",
        "updated_at": "2020-05-25T05:08:23Z",
        "currency": "USD",
        "number": "000138",
        "status": "active",
        "metadata": {
        },
        "account_identifier": "201000138"
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "af0cc7b9-3083-4fea-9661-dc494de50b33",
            "type": "cardholder"
          }
        }
      }
    },
    {
      "id": "3671cc02-346b-492d-a3a1-0ae7222a51c1",
      "type": "account",
      "attributes": {
        "created_at": "2020-05-25T05:08:23Z",
        "updated_at": "2020-05-25T05:08:23Z",
        "currency": "USD",
        "number": "000137",
        "status": "active",
        "metadata": {
        },
        "account_identifier": "201000137"
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "af0cc7b9-3083-4fea-9661-dc494de50b33",
            "type": "cardholder"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/connect/v1/accounts?page%5Bbefore%5D=105563c0-e136-43ba-88d4-de968b4110c1",
    "next": null
  }
}

Retrieve an account

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/accounts/1ac8d3c9-cb7c-419d-a84d-d006ff618edd" -X GET \
    -H "Authorization: Bearer 7c0L-w7XpRIUuObFlJAuf64JZe8HkpZ81EH4aWfEls8"

Endpoint

GET /connect/v1/accounts/:id

GET /connect/v1/accounts/1ac8d3c9-cb7c-419d-a84d-d006ff618edd

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "1ac8d3c9-cb7c-419d-a84d-d006ff618edd",
    "type": "account",
    "attributes": {
      "created_at": "2020-05-25T05:08:23Z",
      "updated_at": "2020-05-25T05:08:23Z",
      "currency": "USD",
      "number": "000140",
      "status": "active",
      "metadata": {
      },
      "account_identifier": "203000140"
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "e1f40d6a-d448-4af8-80b7-bc84d08ddbb2",
          "type": "cardholder"
        }
      }
    }
  }
}

Card Issuer

Retrieve card issuer information

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/card_issuer" -X GET \
    -H "Authorization: Bearer BH5plfJzI_3UQLghhZ_z0zS4L_Wbg1KHsIay_pfUuGE"

Endpoint

GET /connect/v1/card_issuer

GET /connect/v1/card_issuer

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "2e9bfb60-f5fc-4233-a70e-2eb8c7681c04",
    "type": "card_issuer",
    "attributes": {
      "created_at": "2020-05-25T05:08:23Z",
      "updated_at": "2020-05-25T05:08:23Z",
      "identifier": "digikh",
      "name": "Digital Cambodia",
      "code": "204",
      "card_artwork": {
        "image_front_url": "https://cms-sandbox.bongloy.com/assets/card-image-front-d717049cc1122eb2ff08523b55d8831faa737f0c6d7b6993b8c849e9a912e88a.png",
        "image_back_url": "https://cms-sandbox.bongloy.com/assets/card-image-back-b26a18e711d82d00d642a3d1abc2382a0edb2c994fc15ab6cbc5a182031537b9.png"
      }
    }
  }
}

Cardholder

Retrieve cardholder information

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/cardholder" -X GET \
    -H "Authorization: Bearer jVpNHawEhKeGJErZBPsske7L6tlcmX-H4XQwvfIrXkQ"

Endpoint

GET /connect/v1/cardholder

GET /connect/v1/cardholder

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "1bac7f07-8acb-43a6-bcca-ec9637eb0135",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-05-25T05:08:23Z",
      "updated_at": "2020-05-25T05:08: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-05-25",
        "identity_document_number": "A123456789",
        "identity_document_type": "id_card"
      }
    }
  }
}

Cards

List all cards

Request

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

Endpoint

GET /connect/v1/cards

GET /connect/v1/cards

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "b496bcdf-3804-491b-9b2c-b7f2eb24856e",
      "type": "card",
      "attributes": {
        "created_at": "2020-05-25T05:08:23Z",
        "updated_at": "2020-05-25T05:08:23Z",
        "last_four": "2345",
        "exp_month": 5,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "fea9a79c-24c0-4179-9c15-832977c8e601",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "4de4c647-6f3c-4761-9a0c-861acadaf797",
      "type": "card",
      "attributes": {
        "created_at": "2020-05-25T05:08:23Z",
        "updated_at": "2020-05-25T05:08:23Z",
        "last_four": "2345",
        "exp_month": 5,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "fea9a79c-24c0-4179-9c15-832977c8e601",
            "type": "account"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/connect/v1/cards?page%5Bbefore%5D=b496bcdf-3804-491b-9b2c-b7f2eb24856e",
    "next": null
  }
}

Retrieve a card

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/cards/86dbf71d-8fba-43ba-a1bc-a62385c68e62" -X GET \
    -H "Authorization: Bearer QJ10OtWG6ZAmUW7I7yQABWUfbt12cKfW_2Q_HcwhKaw"

Endpoint

GET /connect/v1/cards/:id

GET /connect/v1/cards/86dbf71d-8fba-43ba-a1bc-a62385c68e62

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "86dbf71d-8fba-43ba-a1bc-a62385c68e62",
    "type": "card",
    "attributes": {
      "created_at": "2020-05-25T05:08:24Z",
      "updated_at": "2020-05-25T05:08:24Z",
      "last_four": "2345",
      "exp_month": 5,
      "exp_year": 2023,
      "status": "active",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "d0058220-8194-4117-afa4-638dcb85bc91",
          "type": "account"
        }
      }
    }
  }
}

Transactions

List all transactions

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/transactions?filter[status]=settled&filter[account]=4ec7d89a-57e1-4084-87d5-46835dbcf929&filter[card]=43390a01-2d49-4b1c-9c9c-ab8883f2974a&filter[balance_adjustment_type]=debit&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T12%3A00%3A00Z" -X GET \
    -H "Authorization: Bearer 7MO4aNN1zRIKCD4KpmGH-0RaxakNxaCp6qzkvW--3wE"

Endpoint

GET /connect/v1/transactions

GET /connect/v1/transactions?filter[status]=settled&filter[account]=4ec7d89a-57e1-4084-87d5-46835dbcf929&filter[card]=43390a01-2d49-4b1c-9c9c-ab8883f2974a&filter[balance_adjustment_type]=debit&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T12%3A00%3A00Z

Parameters

filter: {"status"=>"settled", "account"=>"4ec7d89a-57e1-4084-87d5-46835dbcf929", "card"=>"43390a01-2d49-4b1c-9c9c-ab8883f2974a", "balance_adjustment_type"=>"debit", "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": "d278b579-217f-44b1-a340-c829d1708cfe",
      "type": "transaction",
      "attributes": {
        "created_at": "2020-05-25T05:08:24Z",
        "updated_at": "2020-05-25T05:08:24Z",
        "currency": "USD",
        "transaction_number": "865786306204",
        "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": "4ec7d89a-57e1-4084-87d5-46835dbcf929",
            "type": "account"
          }
        },
        "card": {
          "data": {
            "id": "43390a01-2d49-4b1c-9c9c-ab8883f2974a",
            "type": "card"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/connect/v1/transactions?filter%5Baccount%5D=4ec7d89a-57e1-4084-87d5-46835dbcf929&filter%5Bbalance_adjustment_type%5D=debit&filter%5Bcard%5D=43390a01-2d49-4b1c-9c9c-ab8883f2974a&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=d278b579-217f-44b1-a340-c829d1708cfe",
    "next": null
  }
}

Retrieve a transaction

Request

curl -g "https://cms-sandbox.bongloy.com/connect/v1/transactions/124b35c6-0246-42b3-8b88-fe4485fa3b4e?filter[status]" -X GET \
    -H "Authorization: Bearer M6w_mvNWRhzxb0CX6N8-tc0w8ldPK9RJMd7VPINvZ6k"

Endpoint

GET /connect/v1/transactions/:id

GET /connect/v1/transactions/124b35c6-0246-42b3-8b88-fe4485fa3b4e?filter[status]

Parameters

filter: {"status"=>nil}
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": "124b35c6-0246-42b3-8b88-fe4485fa3b4e",
    "type": "transaction",
    "attributes": {
      "created_at": "2020-05-25T05:08:24Z",
      "updated_at": "2020-05-25T05:08:24Z",
      "currency": "USD",
      "transaction_number": "445120215177",
      "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:24Z",
      "settlement_time": "2020-05-25T05:08:24Z"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "de447152-51d2-4024-bc3d-8e3fbc6a8ced",
          "type": "account"
        }
      },
      "card": {
        "data": {
          "id": "2c952203-ad9f-4d99-b562-541cfe18734c",
          "type": "card"
        }
      }
    }
  }
}