{"_id":"5bce6cb45a8c03005a1d35ba","project":"59f79e3c584eb200345ceafc","version":{"_id":"5ba178b00a916500030c6a21","project":"59f79e3c584eb200345ceafc","__v":24,"forked_from":"59f79e3c584eb200345ceaff","createdAt":"2015-09-17T03:47:20.956Z","releaseDate":"2015-09-17T03:47:20.956Z","categories":["5ba178b00a916500030c69a2","5ba178b00a916500030c69a3","5ba178b00a916500030c69a4","5ba178b00a916500030c69a5","5ba178b00a916500030c69a6","5ba178b00a916500030c69a7","5ba178b00a916500030c69a8","5ba178b00a916500030c69a9","5ba178b00a916500030c69aa","5ba178b00a916500030c69ab","5ba178b00a916500030c69ac","5afb6888212c690003ae3d3b","5ba178b00a916500030c69ad","5ba178b00a916500030c69ae","5ba2dcbc99f53f0003b97e2c","5babd73fa0ab3e0003ead030","5bb4038be7222e000334dd97","5bb55954478c1300031a44c2","5bb665a1607307000327c81e","5bb6f90229a7fb0003a0650d","5bb7f9bc29a7fb0003a07ac1","5bba58bd7ba7710003bd901d","5bba6dac7ba7710003bd908d","5bba6e257ba7710003bd9090","5bbac87810189c0003e619ea","5bbb9d02b5862c00036266b2","5bbbadb6219c3e000376c2de","5bc417751d1b0000182bf7f6","5bc59e3b2a5b4f0044db5b97","5bc7bbce2262cc0041f6eff2","5bce6a3580a7250031199f34","5bcfac2c4082510019f2d91b","5bcfac3757bed90030e45d68","5bcfac45d305bc0049941539","5bd2a43548bb6f00289c8fad","5bd3a42a026ebe001f66259e","5bd9d5afffe003005b02f97b","5becb7ee85c6b300557662b6"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":false,"codename":"","version_clean":"3.2.0","version":"3.2"},"category":{"_id":"5bce6a3580a7250031199f34","project":"59f79e3c584eb200345ceafc","version":"5ba178b00a916500030c6a21","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2018-10-23T00:24:21.671Z","from_sync":false,"order":18,"slug":"card-number-issuance","title":"Issue Debit Card"},"user":"5bbfef1d7d1cb0000384bec5","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-10-23T00:35:00.955Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"After you have issued a card number to a `DEPOSIT-US` or `SUBACCOUNT-US` account, set the card permissions to activate, deactivate or terminate a card. You also have the option to [set the PIN](doc:set-debit-card-pin) or [update card preferences](doc:update-card-preferences) by passing the `card_pin` or `preferences`.\n\n##API ENDPOINT\nhttps://uat-api.synapsefi.com/v3.1/users/:user_id/nodes/:node_id/subnets/:subnet_id\n\n##PATH PARAMETER\n[block:html]\n{\n  \"html\": \"<div class=\\\"api-manager\\\"> <div class=\\\"param-table\\\"> <div class=\\\"table\\\"> <div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong>user_id <span class=\\\"colon\\\">:</span> </strong> <div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>The user ID of the user</p></div></div></div><div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong>node_id <span class=\\\"colon\\\">:</span> </strong> <div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>The ID of the node the card number was issued to</p></div></div></div>\\n  <div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong>subnet_id<span class=\\\"colon\\\">:</span> </strong> <div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>The ID of the subnet (card number)</p></div></div></div></div></div></div>\"\n}\n[/block]\n##BODY PARAMETER\n[block:html]\n{\n  \"html\": \"<div class=\\\"api-manager\\\"> <div class=\\\"param-table\\\"> <div class=\\\"table\\\"> <div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong>status <span class=\\\"colon\\\">:</span> </strong><div class=\\\"required\\\">required</div> </div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>Permission of the card (Active, Inactive, or Terminated)</p></div></div></div><div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong>card_pin<span class=\\\"colon\\\">:</span> </strong> </div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>Encrypted pin for the card</p></div></div></div>\\n  \\n  <div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">preferences.</span>allow_foreign_transactions<span class=\\\"colon\\\">:</span> </strong> </div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">boolean</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>Allow foreign transaction on card</p></div></div></div><div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">preferences.</span>daily_atm_withdrawal_limit<span class=\\\"colon\\\">:</span> </strong> </div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">integer</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>Max atm withdraw limit for debit card</p></div></div></div><div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">preferences.</span>daily_transaction_limit <span class=\\\"colon\\\">:</span> </strong> </div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">integer</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>Daily transaction limit for debit card</p></div></div></div></div></div></div>\"\n}\n[/block]\n##CARD PERMISSIONS\nSet the following permissions to activate, deactivate or terminate a card number.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"ACTIVE\",\n    \"h-0\": \"Status\",\n    \"1-0\": \"INACTIVE\",\n    \"2-0\": \"TERMINATED\",\n    \"0-1\": \"Enables the card to be used for sending and receiving funds.\",\n    \"1-1\": \"Disables credits and debits on the node.\",\n    \"2-1\": \"Disables the card number and blocks all transactions. This is used when an account is fraudulent.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n##EXAMPLE REQUEST\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"PATCH /v3.1/users/5bb29f48520da000a38cb107/nodes/5bb29f5471fd1b0091317410/subnets/5bc920f2fff373002bf0d51b\\nHTTP/1.1\\nHost: uat-api.synapsefi.com\\nX-SP-USER-IP: 127.0.0.1\\nX-SP-USER: oauth_NhFV8tDKOMms2j5I4lzxJXUQY9BH6abycdnpTCA3|J6fhD7DNd238\\nContent-Type: application/json\\n\\n{\\n    \\\"status\\\": \\\"ACTIVE\\\",\\n    \\\"card_pin\\\": \\\"1234\\\",\\n    \\\"preferences\\\": {\\n      \\\"allow_foreign_transactions\\\":true,\\n      \\\"daily_atm_withdrawal_limit\\\":10,\\n      \\\"daily_transaction_limit\\\":1000\\n    }\\n}\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n##EXAMPLE RESPONSE\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"_id\\\": \\\"5bc920f2fff373002bf0d51b\\\",\\n    \\\"_links\\\": {\\n        \\\"self\\\": {\\n            \\\"href\\\": \\\"https://uat-api.synapsefi.com/v3.1/users/5bb29f48520da000a38cb107/nodes/5bb29f5471fd1b0091317410/subnets/5bc920f2fff373002bf0d51b\\\"\\n        }\\n    },\\n    \\\"access_token\\\": \\\"5bc920f9a5061e002681c89f\\\",\\n    \\\"account_class\\\": \\\"DEBIT_CARD\\\",\\n    \\\"card_hash\\\": \\\"78eb685b26d99d32538feb97cfd1274f994bdde48fa75471f22ba3029cbbc4e0\\\",\\n    \\\"card_number\\\": \\\"5431\\\",\\n    \\\"card_style_id\\\": null,\\n    \\\"client\\\": {\\n        \\\"id\\\": \\\"5b0da0f66e990e001f0c5f54\\\",\\n        \\\"name\\\": \\\"YY Test Account\\\"\\n    },\\n    \\\"cvc\\\": \\\"***\\\",\\n    \\\"exp\\\": \\\"2022-11-17\\\",\\n    \\\"nickname\\\": \\\"My Debit Card\\\",\\n    \\\"node_id\\\": \\\"5bb29f5471fd1b0091317410\\\",\\n    \\\"preferences\\\": {\\n        \\\"allow_foreign_transactions\\\": true,\\n        \\\"daily_atm_withdrawal_limit\\\": 10,\\n        \\\"daily_transaction_limit\\\": 1000\\n    },\\n    \\\"status\\\": \\\"ACTIVE\\\",\\n    \\\"user_id\\\": \\\"5bb29f48520da000a38cb107\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n## Encrypting Data\nMake sure you encrypt the `card_pin` on the client's device using our public key provided below.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"-----BEGIN PUBLIC KEY-----\\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzxVLeRTf77kmG/42SdjjtRfaI/7GN4UoUBfxzN80gCyrjK+tHYJR7DKefC47fNyA2dGU7x3tu1wQRKOkjschbC3ZWF1mCqccUiHRPiGhH9VBsxLbAUCFAKOPZcBDCT7IhUdd6S23e99ewkb0c6pRk28u+kz+7ZB7d6Z/S+Em316zs0HqEnEaoUNFXtdTyW3EPuaqo0+p9daICRC44VbrTlzc+Y1A/CsiOcCCl4ske8scu/fWg0K3nybfn7IdO2smkzRwwGOc4uexBMnAkAyl0eQrqXZO4vis6ktmLFV4NpYsd0U2vvmuXFoA9XBcJHdbAww/TGwHq5RJ3505QSEK8QIDAQAB\\n-----END PUBLIC KEY-----\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n[JSencrypt](https://github.com/travist/jsencrypt) is an easy to use library to use for this purpose, the implementation would look something like this\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Encrypt with the public key...\\nvar encrypt = new JSEncrypt();\\nencrypt.setPublicKey($('#pubkey').val());\\nvar encryptedCardPin = encrypt.encrypt($('#card_pin').val());\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Please make sure you are using PKCS1_v1_5 padding for encryption.\",\n  \"title\": \"Padding\"\n}\n[/block]","excerpt":"Activate, Inactivate or Terminate a card number","slug":"manage-card-number","type":"basic","title":"Activate/Deactivate/Terminate Card Number"}

Activate/Deactivate/Terminate Card Number

Activate, Inactivate or Terminate a card number

After you have issued a card number to a `DEPOSIT-US` or `SUBACCOUNT-US` account, set the card permissions to activate, deactivate or terminate a card. You also have the option to [set the PIN](doc:set-debit-card-pin) or [update card preferences](doc:update-card-preferences) by passing the `card_pin` or `preferences`. ##API ENDPOINT https://uat-api.synapsefi.com/v3.1/users/:user_id/nodes/:node_id/subnets/:subnet_id ##PATH PARAMETER [block:html] { "html": "<div class=\"api-manager\"> <div class=\"param-table\"> <div class=\"table\"> <div class=\"tr\"> <div class=\"td param\"> <strong>user_id <span class=\"colon\">:</span> </strong> <div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">string</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>The user ID of the user</p></div></div></div><div class=\"tr\"> <div class=\"td param\"> <strong>node_id <span class=\"colon\">:</span> </strong> <div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">string</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>The ID of the node the card number was issued to</p></div></div></div>\n <div class=\"tr\"> <div class=\"td param\"> <strong>subnet_id<span class=\"colon\">:</span> </strong> <div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">string</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>The ID of the subnet (card number)</p></div></div></div></div></div></div>" } [/block] ##BODY PARAMETER [block:html] { "html": "<div class=\"api-manager\"> <div class=\"param-table\"> <div class=\"table\"> <div class=\"tr\"> <div class=\"td param\"> <strong>status <span class=\"colon\">:</span> </strong><div class=\"required\">required</div> </div><div class=\"td\"> <strong class=\"param-type\">string</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>Permission of the card (Active, Inactive, or Terminated)</p></div></div></div><div class=\"tr\"> <div class=\"td param\"> <strong>card_pin<span class=\"colon\">:</span> </strong> </div><div class=\"td\"> <strong class=\"param-type\">string</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>Encrypted pin for the card</p></div></div></div>\n \n <div class=\"tr\"> <div class=\"td param\"> <strong> <span class=\"text-muted\">preferences.</span>allow_foreign_transactions<span class=\"colon\">:</span> </strong> </div><div class=\"td\"> <strong class=\"param-type\">boolean</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>Allow foreign transaction on card</p></div></div></div><div class=\"tr\"> <div class=\"td param\"> <strong> <span class=\"text-muted\">preferences.</span>daily_atm_withdrawal_limit<span class=\"colon\">:</span> </strong> </div><div class=\"td\"> <strong class=\"param-type\">integer</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>Max atm withdraw limit for debit card</p></div></div></div><div class=\"tr\"> <div class=\"td param\"> <strong> <span class=\"text-muted\">preferences.</span>daily_transaction_limit <span class=\"colon\">:</span> </strong> </div><div class=\"td\"> <strong class=\"param-type\">integer</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>Daily transaction limit for debit card</p></div></div></div></div></div></div>" } [/block] ##CARD PERMISSIONS Set the following permissions to activate, deactivate or terminate a card number. [block:parameters] { "data": { "0-0": "ACTIVE", "h-0": "Status", "1-0": "INACTIVE", "2-0": "TERMINATED", "0-1": "Enables the card to be used for sending and receiving funds.", "1-1": "Disables credits and debits on the node.", "2-1": "Disables the card number and blocks all transactions. This is used when an account is fraudulent." }, "cols": 2, "rows": 3 } [/block] ##EXAMPLE REQUEST [block:code] { "codes": [ { "code": "PATCH /v3.1/users/5bb29f48520da000a38cb107/nodes/5bb29f5471fd1b0091317410/subnets/5bc920f2fff373002bf0d51b\nHTTP/1.1\nHost: uat-api.synapsefi.com\nX-SP-USER-IP: 127.0.0.1\nX-SP-USER: oauth_NhFV8tDKOMms2j5I4lzxJXUQY9BH6abycdnpTCA3|J6fhD7DNd238\nContent-Type: application/json\n\n{\n \"status\": \"ACTIVE\",\n \"card_pin\": \"1234\",\n \"preferences\": {\n \"allow_foreign_transactions\":true,\n \"daily_atm_withdrawal_limit\":10,\n \"daily_transaction_limit\":1000\n }\n}", "language": "http" } ] } [/block] ##EXAMPLE RESPONSE [block:code] { "codes": [ { "code": "{\n \"_id\": \"5bc920f2fff373002bf0d51b\",\n \"_links\": {\n \"self\": {\n \"href\": \"https://uat-api.synapsefi.com/v3.1/users/5bb29f48520da000a38cb107/nodes/5bb29f5471fd1b0091317410/subnets/5bc920f2fff373002bf0d51b\"\n }\n },\n \"access_token\": \"5bc920f9a5061e002681c89f\",\n \"account_class\": \"DEBIT_CARD\",\n \"card_hash\": \"78eb685b26d99d32538feb97cfd1274f994bdde48fa75471f22ba3029cbbc4e0\",\n \"card_number\": \"5431\",\n \"card_style_id\": null,\n \"client\": {\n \"id\": \"5b0da0f66e990e001f0c5f54\",\n \"name\": \"YY Test Account\"\n },\n \"cvc\": \"***\",\n \"exp\": \"2022-11-17\",\n \"nickname\": \"My Debit Card\",\n \"node_id\": \"5bb29f5471fd1b0091317410\",\n \"preferences\": {\n \"allow_foreign_transactions\": true,\n \"daily_atm_withdrawal_limit\": 10,\n \"daily_transaction_limit\": 1000\n },\n \"status\": \"ACTIVE\",\n \"user_id\": \"5bb29f48520da000a38cb107\"\n}", "language": "json" } ] } [/block] ## Encrypting Data Make sure you encrypt the `card_pin` on the client's device using our public key provided below. [block:code] { "codes": [ { "code": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzxVLeRTf77kmG/42SdjjtRfaI/7GN4UoUBfxzN80gCyrjK+tHYJR7DKefC47fNyA2dGU7x3tu1wQRKOkjschbC3ZWF1mCqccUiHRPiGhH9VBsxLbAUCFAKOPZcBDCT7IhUdd6S23e99ewkb0c6pRk28u+kz+7ZB7d6Z/S+Em316zs0HqEnEaoUNFXtdTyW3EPuaqo0+p9daICRC44VbrTlzc+Y1A/CsiOcCCl4ske8scu/fWg0K3nybfn7IdO2smkzRwwGOc4uexBMnAkAyl0eQrqXZO4vis6ktmLFV4NpYsd0U2vvmuXFoA9XBcJHdbAww/TGwHq5RJ3505QSEK8QIDAQAB\n-----END PUBLIC KEY-----", "language": "text" } ] } [/block] [JSencrypt](https://github.com/travist/jsencrypt) is an easy to use library to use for this purpose, the implementation would look something like this [block:code] { "codes": [ { "code": "// Encrypt with the public key...\nvar encrypt = new JSEncrypt();\nencrypt.setPublicKey($('#pubkey').val());\nvar encryptedCardPin = encrypt.encrypt($('#card_pin').val());", "language": "javascript" } ] } [/block] [block:callout] { "type": "info", "body": "Please make sure you are using PKCS1_v1_5 padding for encryption.", "title": "Padding" } [/block]