NAV Navbar
cURL

API Documentation for the Bongloy Card Management System. The API is written according to the JSON API Specification. We highly recommend using a JSON API Client for consuming this API.

Account Balance

Retrieve an account balance

Request

curl -g "https://cms-sandbox.bongloy.com/v1/accounts/2a2733c6-8884-4c5f-9d94-4525dd7f6017/balance" -X GET \
    -H "Authorization: Bearer 4mTf4XT9DXW4b_5catomOXacTbT9ixdIBfYR2-a_4_8"

Endpoint

GET /v1/accounts/:account_id/balance

GET /v1/accounts/2a2733c6-8884-4c5f-9d94-4525dd7f6017/balance

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "2a2733c6-8884-4c5f-9d94-4525dd7f6017",
    "type": "balance",
    "attributes": {
      "available": [
        {
          "amount": 9000,
          "currency": "USD"
        }
      ],
      "pending": [
        {
          "amount": -1000,
          "currency": "USD"
        }
      ]
    }
  }
}

Accounts

Create an account

Request

curl "https://cms-sandbox.bongloy.com/v1/accounts" -d '{
  "data": {
    "type": "account",
    "attributes": {
      "external_id": "P01-1234567",
      "currency": "USD",
      "metadata": {
        "foobar": "foobar"
      }
    },
    "relationships": {
      "cardholder": {
        "data": {
          "type": "cardholder",
          "id": "c3964345-daa2-45c0-990b-e84fae53c53c"
        }
      }
    }
  }
}' -X POST \
    -H "Authorization: Bearer 0DGMuIbQDWvdjT-TsJGEUoqEMJtBi29gwvPHpm_kJK8"

Endpoint

POST /v1/accounts

POST /v1/accounts

Parameters

{
  "data": {
    "type": "account",
    "attributes": {
      "external_id": "P01-1234567",
      "currency": "USD",
      "metadata": {
        "foobar": "foobar"
      }
    },
    "relationships": {
      "cardholder": {
        "data": {
          "type": "cardholder",
          "id": "c3964345-daa2-45c0-990b-e84fae53c53c"
        }
      }
    }
  }
}
Name Description
data[attributes][currency] required The currency of the account. Only USD is supported at this time
data[attributes][external_id] required A unique ID for the account set by the issuer. This must uniquely identify the account in the issuers 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": "6070be23-e82c-4f42-be3d-7d76d173d051",
    "type": "account",
    "attributes": {
      "created_at": "2020-02-17T06:40:01Z",
      "updated_at": "2020-02-17T06:40:01Z",
      "currency": "USD",
      "external_id": "P01-1234567",
      "status": "active",
      "metadata": {
        "foobar": "foobar"
      }
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "c3964345-daa2-45c0-990b-e84fae53c53c",
          "type": "cardholder"
        }
      }
    }
  }
}

List all accounts

Request

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

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": "b64f8ad1-4c6b-4bb8-ae1d-27b9212ef047",
      "type": "account",
      "attributes": {
        "created_at": "2020-02-17T06:40:02Z",
        "updated_at": "2020-02-17T06:40:02Z",
        "currency": "USD",
        "external_id": "abc-000118",
        "status": "active",
        "metadata": {
        }
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "8be03112-e4b6-42c0-9ae8-13c5527e3f8c",
            "type": "cardholder"
          }
        }
      }
    },
    {
      "id": "d501bff4-aa71-44a3-bede-51a67f3bf3b0",
      "type": "account",
      "attributes": {
        "created_at": "2020-02-17T06:40:02Z",
        "updated_at": "2020-02-17T06:40:02Z",
        "currency": "USD",
        "external_id": "abc-000117",
        "status": "active",
        "metadata": {
        }
      },
      "relationships": {
        "cardholder": {
          "data": {
            "id": "f86caff0-2d04-4602-8813-a78cf03a96cd",
            "type": "cardholder"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/accounts?page%5Bbefore%5D=b64f8ad1-4c6b-4bb8-ae1d-27b9212ef047",
    "next": null
  }
}

Retrieve an account

Request

curl -g "https://cms-sandbox.bongloy.com/v1/accounts/b1025533-8183-442f-a82c-385e79608ab7" -X GET \
    -H "Authorization: Bearer zp4nQVfJibMUfJ2rDouGPkL6cIQHqavuwdacUt2PkhI"

Endpoint

GET /v1/accounts/:id

GET /v1/accounts/b1025533-8183-442f-a82c-385e79608ab7

Parameters

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

Response


200 OK
{
  "data": {
    "id": "b1025533-8183-442f-a82c-385e79608ab7",
    "type": "account",
    "attributes": {
      "created_at": "2020-02-17T06:40:02Z",
      "updated_at": "2020-02-17T06:40:02Z",
      "currency": "USD",
      "external_id": "abc-000116",
      "status": "active",
      "metadata": {
      }
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "ed217bd9-5a43-4b0f-855c-e9d71f560096",
          "type": "cardholder"
        }
      }
    }
  }
}

Update an account

Request

curl "https://cms-sandbox.bongloy.com/v1/accounts/497ce42f-4d39-43f6-9b8c-ff65d08aabb6" -d '{
  "data": {
    "type": "account",
    "id": "497ce42f-4d39-43f6-9b8c-ff65d08aabb6",
    "attributes": {
      "external_id": "C01-1234567",
      "metadata": {
        "buzz": "foobar"
      }
    }
  }
}' -X PATCH \
    -H "Authorization: Bearer lwJLbEJg00deqKsCQFmYdcQB1w6pB0Kt_hB_lVYuY5Q"

Endpoint

PATCH /v1/accounts/:id

PATCH /v1/accounts/497ce42f-4d39-43f6-9b8c-ff65d08aabb6

Parameters

{
  "data": {
    "type": "account",
    "id": "497ce42f-4d39-43f6-9b8c-ff65d08aabb6",
    "attributes": {
      "external_id": "C01-1234567",
      "metadata": {
        "buzz": "foobar"
      }
    }
  }
}
Name Description
external_id A unique ID for the account set by the issuer. This must uniquely identify the account in the issuers system.

Response


200 OK
{
  "data": {
    "id": "497ce42f-4d39-43f6-9b8c-ff65d08aabb6",
    "type": "account",
    "attributes": {
      "created_at": "2020-02-17T06:40:01Z",
      "updated_at": "2020-02-17T06:40:01Z",
      "currency": "USD",
      "external_id": "C01-1234567",
      "status": "active",
      "metadata": {
        "foo": "bar",
        "buzz": "foobar"
      }
    },
    "relationships": {
      "cardholder": {
        "data": {
          "id": "933f2ef0-1c87-4146-87db-bd430e821b6a",
          "type": "cardholder"
        }
      }
    }
  }
}

Balance Transactions

List all transactions

Request

curl -g "https://cms-sandbox.bongloy.com/v1/balance_transactions?filter[account]=68bd1d60-767a-469b-aef7-e59761bb5df7&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T12%3A00%3A00Z" -X GET \
    -H "Authorization: Bearer vh1i6oFof71Zk4CkMbTWx89jS4mXFlQYJahy02Pl3cg"

Endpoint

GET /v1/balance_transactions

GET /v1/balance_transactions?filter[account]=68bd1d60-767a-469b-aef7-e59761bb5df7&filter[from_date]=2020-01-01T00%3A00%3A00Z&filter[to_date]=2020-01-01T12%3A00%3A00Z

Parameters

filter: {"account"=>"68bd1d60-767a-469b-aef7-e59761bb5df7", "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[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": "32a3b385-e17f-4af4-9764-8b6ee454bcb0",
      "type": "balance_transaction",
      "attributes": {
        "created_at": "2020-01-01T07:00:00Z",
        "updated_at": "2020-02-17T06:40:02Z",
        "currency": "USD",
        "amount": 10000,
        "status": "available",
        "type": "topup"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "68bd1d60-767a-469b-aef7-e59761bb5df7",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "2cf52811-5132-4979-a51a-4ee511880227",
      "type": "balance_transaction",
      "attributes": {
        "created_at": "2020-01-01T01:00:00Z",
        "updated_at": "2020-02-17T06:40:02Z",
        "currency": "USD",
        "amount": -1000,
        "status": "available",
        "type": "purchase"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "68bd1d60-767a-469b-aef7-e59761bb5df7",
            "type": "account"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/balance_transactions?filter%5Baccount%5D=68bd1d60-767a-469b-aef7-e59761bb5df7&filter%5Bfrom_date%5D=2020-01-01T00%3A00%3A00Z&filter%5Bto_date%5D=2020-01-01T12%3A00%3A00Z&page%5Bbefore%5D=32a3b385-e17f-4af4-9764-8b6ee454bcb0",
    "next": null
  }
}

Retrieve a transaction

Request

curl -g "https://cms-sandbox.bongloy.com/v1/balance_transactions/f7dd3d76-2acc-42c2-8c38-97c76f0e9097" -X GET \
    -H "Authorization: Bearer XhtuLzdTnPAHBSfzxdf2HPJjlSujAdlPdXCM9wmm8b0"

Endpoint

GET /v1/balance_transactions/:id

GET /v1/balance_transactions/f7dd3d76-2acc-42c2-8c38-97c76f0e9097

Parameters

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

Response


200 OK
{
  "data": {
    "id": "f7dd3d76-2acc-42c2-8c38-97c76f0e9097",
    "type": "balance_transaction",
    "attributes": {
      "created_at": "2020-02-17T06:40:02Z",
      "updated_at": "2020-02-17T06:40:02Z",
      "currency": "USD",
      "amount": -1000,
      "status": "available",
      "type": "purchase"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "97c9e0ae-9f9c-4935-9882-dc137ec98b0e",
          "type": "account"
        }
      }
    }
  }
}

Cardholders

Create a cardholder

Request

curl "https://cms-sandbox.bongloy.com/v1/cardholders" -d '{
  "data": {
    "type": "cardholder",
    "attributes": {
      "name": "Tang Dara",
      "phone_number": "855715100860",
      "additional_details": {
        "name_km": "តាំង តារា",
        "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",
        "member_since": "2017"
      },
      "metadata": {
        "foobar": "foobar"
      }
    }
  }
}' -X POST \
    -H "Authorization: Bearer GyClJYFf_A-GisMfwy_z8eCtbkSzXICyFlZHYLLwdu4"

Endpoint

POST /v1/cardholders

POST /v1/cardholders

Parameters

{
  "data": {
    "type": "cardholder",
    "attributes": {
      "name": "Tang Dara",
      "phone_number": "855715100860",
      "additional_details": {
        "name_km": "តាំង តារា",
        "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",
        "member_since": "2017"
      },
      "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][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": "8c85d15a-f410-4b37-b98b-97ae1c1bad66",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-02-17T06:40:02Z",
      "updated_at": "2020-02-17T06:40:02Z",
      "name": "Tang Dara",
      "phone_number": "855715100860",
      "additional_details": {
        "name_km": "តាំង តារា",
        "date_of_birth": "2016-12-20",
        "member_since": "2017",
        "remote_identity_document_url": "https://via.placeholder.com/600.png",
        "remote_photo_url": "https://via.placeholder.com/150.png",
        "identity_document_number": "123456789",
        "identity_document_type": "id_card",
        "address": "#87, Street 63 (Trasak Paem), Sangkat Boeung Raing, Khan Daun Penh, Phnom Penh, Cambodia"
      },
      "metadata": {
        "foobar": "foobar"
      },
      "status": "processing_profile"
    }
  }
}

List all cardholders

Request

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

Endpoint

GET /v1/cardholders

GET /v1/cardholders

Parameters

None known.

Response


200 OK
{
  "data": [
    {
      "id": "6a81d7d1-568a-4dae-8ca4-b8a9d5a8b864",
      "type": "cardholder",
      "attributes": {
        "created_at": "2020-02-17T06:40:03Z",
        "updated_at": "2020-02-17T06:40:03Z",
        "name": "Meta Kanha",
        "phone_number": "855715100860",
        "additional_details": {
          "name_km": "មេត្តា កញ្ញា",
          "member_since": "2019",
          "date_of_birth": "2002-02-17T06:40:03.105Z",
          "identity_document_type": "id_card",
          "identity_document_number": "P01-2345678"
        },
        "metadata": {
        },
        "status": "active"
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/cardholders?page%5Bbefore%5D=6a81d7d1-568a-4dae-8ca4-b8a9d5a8b864",
    "next": null
  }
}

Retrieve a cardholder

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cardholders/1e90d764-929a-4fc9-bea5-5668af6244b4" -X GET \
    -H "Authorization: Bearer GKaAIaw8m4n3V2Pkh4JbL48JDPZs8dIU4V1zCqvM0Ao"

Endpoint

GET /v1/cardholders/:id

GET /v1/cardholders/1e90d764-929a-4fc9-bea5-5668af6244b4

Parameters

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

Response


200 OK
{
  "data": {
    "id": "1e90d764-929a-4fc9-bea5-5668af6244b4",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-02-17T06:40:03Z",
      "updated_at": "2020-02-17T06:40:03Z",
      "name": "Meta Kanha",
      "phone_number": "855715100860",
      "additional_details": {
        "name_km": "មេត្តា កញ្ញា",
        "member_since": "2019",
        "date_of_birth": "2002-02-17T06:40:03.080Z",
        "identity_document_type": "id_card",
        "identity_document_number": "P01-2345678"
      },
      "metadata": {
      },
      "status": "active"
    }
  }
}

Update a cardholder

Request

curl "https://cms-sandbox.bongloy.com/v1/cardholders/960a5890-7bba-4967-ba62-80667e87d3a2" -d '{
  "data": {
    "type": "cardholder",
    "id": "960a5890-7bba-4967-ba62-80667e87d3a2",
    "attributes": {
      "name": "Tang Dara",
      "phone_number": "855715100860",
      "additional_details": {
        "remote_photo_url": "https://via.placeholder.com/150.png",
        "member_since": "2017"
      },
      "metadata": {
        "foobar": "foobar"
      }
    }
  }
}' -X PATCH \
    -H "Authorization: Bearer XCj1J7Bljud5yPNylhGOTiPv1qVur8aXVd7kMYc9wf4"

Endpoint

PATCH /v1/cardholders/:id

PATCH /v1/cardholders/960a5890-7bba-4967-ba62-80667e87d3a2

Parameters

{
  "data": {
    "type": "cardholder",
    "id": "960a5890-7bba-4967-ba62-80667e87d3a2",
    "attributes": {
      "name": "Tang Dara",
      "phone_number": "855715100860",
      "additional_details": {
        "remote_photo_url": "https://via.placeholder.com/150.png",
        "member_since": "2017"
      },
      "metadata": {
        "foobar": "foobar"
      }
    }
  }
}

None known.

Response


202 Accepted
{
  "data": {
    "id": "960a5890-7bba-4967-ba62-80667e87d3a2",
    "type": "cardholder",
    "attributes": {
      "created_at": "2020-02-17T06:40:03Z",
      "updated_at": "2020-02-17T06:40:03Z",
      "name": "Tang Dara",
      "phone_number": "855715100860",
      "additional_details": {
        "address": "#87, Street 63 (Trasak Paem), Sangkat Boeung Raing, Khan Daun Penh, Phnom Penh, Cambodia",
        "name_km": "តាំង តារា",
        "member_since": "2017",
        "date_of_birth": "20161220",
        "remote_photo_url": "https://via.placeholder.com/150.png",
        "identity_document_type": "id_card",
        "identity_document_number": "123456789",
        "remote_identity_document_url": "https://via.placeholder.com/600.png"
      },
      "metadata": {
        "foo": "bar",
        "foobar": "foobar"
      },
      "status": "processing_profile"
    }
  }
}

Cards

Create a card

Request

curl "https://cms-sandbox.bongloy.com/v1/cards" -d '{
  "data": {
    "type": "card",
    "attributes": {
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "4d681eac-6606-4588-81e1-97da346a3a62",
          "type": "account"
        }
      }
    }
  }
}' -X POST \
    -H "Authorization: Bearer sDG7frtE0i1G0vp54A8FdWNn7QrxaWKFzbO0wWxPvW8"

Endpoint

POST /v1/cards

POST /v1/cards

Parameters

{
  "data": {
    "type": "card",
    "attributes": {
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "4d681eac-6606-4588-81e1-97da346a3a62",
          "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": "825a8a4e-73a3-467a-9321-76ad099522a4",
    "type": "card",
    "attributes": {
      "created_at": "2020-02-17T06:40:03Z",
      "updated_at": "2020-02-17T06:40:03Z",
      "last_four": "2322",
      "exp_month": 2,
      "exp_year": 2023,
      "status": "unactivated",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "4d681eac-6606-4588-81e1-97da346a3a62",
          "type": "account"
        }
      }
    }
  }
}

Create a management token

Request

curl "https://cms-sandbox.bongloy.com/v1/cards/c5167aed-b243-44e4-9236-f78111f084da/management_tokens" -d '{
  "data": {
    "type": "card_management_token",
    "attributes": {
      "type": "card_activation"
    }
  }
}' -X POST \
    -H "Authorization: Bearer EWfiNXLR2fOIBBEmYMMzhEgJbQ1rPtv_-MO9yG-BubU"

Endpoint

POST /v1/cards/:card_id/management_tokens

POST /v1/cards/c5167aed-b243-44e4-9236-f78111f084da/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": "52c93828-078b-47a9-a58f-921f75249b66",
    "type": "card_management_token",
    "attributes": {
      "created_at": "2020-02-17T06:40:03Z",
      "updated_at": "2020-02-17T06:40:03Z",
      "expires_at": "2020-02-17T06:50:03.575Z",
      "type": "card_activation",
      "url": "https://cms-sandbox.bongloy.com/card_activation/new?token=gnoxm4-NnU7pc3Fgwm2HJLR1frFB7X6GkYWhB35gSmo"
    }
  }
}

List all cards

Request

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

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": "309488ae-1c96-44fd-89bc-ae6f5197cd7a",
      "type": "card",
      "attributes": {
        "created_at": "2020-02-17T06:40:03Z",
        "updated_at": "2020-02-17T06:40:03Z",
        "last_four": "2345",
        "exp_month": 2,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "e9fc6c73-4425-4d78-ab13-6f06da822c3a",
            "type": "account"
          }
        }
      }
    },
    {
      "id": "009be835-3227-45e8-bbcc-42cdc6aec7b3",
      "type": "card",
      "attributes": {
        "created_at": "2020-02-17T06:40:03Z",
        "updated_at": "2020-02-17T06:40:03Z",
        "last_four": "2345",
        "exp_month": 2,
        "exp_year": 2023,
        "status": "active",
        "type": "physical"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "2e91f653-143a-414d-80a6-22ec204db165",
            "type": "account"
          }
        }
      }
    }
  ],
  "links": {
    "prev": "http://example.org/v1/cards?page%5Bbefore%5D=309488ae-1c96-44fd-89bc-ae6f5197cd7a",
    "next": null
  }
}

Retrieve a card

Request

curl -g "https://cms-sandbox.bongloy.com/v1/cards/a1b96ba5-9bf7-4899-aaff-b7262fd525aa" -X GET \
    -H "Authorization: Bearer f3r3dC3U_EDigmxNW27iZeXWNlR1Eypi_aLHtOTfeh0"

Endpoint

GET /v1/cards/:id

GET /v1/cards/a1b96ba5-9bf7-4899-aaff-b7262fd525aa

Parameters

None known.

Response


200 OK
{
  "data": {
    "id": "a1b96ba5-9bf7-4899-aaff-b7262fd525aa",
    "type": "card",
    "attributes": {
      "created_at": "2020-02-17T06:40:03Z",
      "updated_at": "2020-02-17T06:40:03Z",
      "last_four": "2345",
      "exp_month": 2,
      "exp_year": 2023,
      "status": "active",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "e7a0f8eb-aa2a-4454-b2cb-ea646a9b49df",
          "type": "account"
        }
      }
    }
  }
}

Update a card

Request

curl "https://cms-sandbox.bongloy.com/v1/cards/3fa64270-f2ac-4730-82cc-1bfd474465f2" -d '{
  "data": {
    "attributes": {
      "status": null,
      "status": "inactive"
    },
    "type": "card",
    "id": "3fa64270-f2ac-4730-82cc-1bfd474465f2"
  }
}' -X PATCH \
    -H "Authorization: Bearer jtQkQ8laK6TpptpflfFF1LBjLtBpc9FfrBkgzZm0k6s"

Endpoint

PATCH /v1/cards/:id

PATCH /v1/cards/3fa64270-f2ac-4730-82cc-1bfd474465f2

Parameters

{
  "data": {
    "attributes": {
      "status": null,
      "status": "inactive"
    },
    "type": "card",
    "id": "3fa64270-f2ac-4730-82cc-1bfd474465f2"
  }
}
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": "3fa64270-f2ac-4730-82cc-1bfd474465f2",
    "type": "card",
    "attributes": {
      "created_at": "2020-02-17T06:40:03Z",
      "updated_at": "2020-02-17T06:40:03Z",
      "last_four": "2345",
      "exp_month": 2,
      "exp_year": 2023,
      "status": "inactive",
      "type": "physical"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "92e539e7-9ba0-494f-a5c8-f4f66ed132c5",
          "type": "account"
        }
      }
    }
  }
}