{"_id":"55fa37ca8065a10d004e5bbd","parentDoc":null,"project":"54e405191e51932d006abc39","version":{"_id":"55fa37c88065a10d004e5bb6","project":"54e405191e51932d006abc39","__v":9,"createdAt":"2015-09-17T03:47:20.956Z","releaseDate":"2015-09-17T03:47:20.956Z","categories":["55fa37ca8065a10d004e5bb7","55fa37ca8065a10d004e5bb8","55fa37ca8065a10d004e5bb9","55fa37ca8065a10d004e5bba","55fca6bf34ae7c0d00ab8ea0","55ff80fd9e7ccf0d000a1d93","560220af7435de0d00fabd0d","56107f21bb9d920d00303e70","563e184077681a0d00d96a02","56fafc6596ec7e0e002ac85f","5915e54f7c2c552d008b8549","59499fcd64b5f5002690bbc1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"REST V3","version_clean":"3.1.0","version":"3.1"},"category":{"_id":"59499fcd64b5f5002690bbc1","project":"54e405191e51932d006abc39","version":"55fa37c88065a10d004e5bb6","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-06-20T22:21:01.625Z","from_sync":false,"order":2,"slug":"quickstart-flows","title":"Quickstart Flows"},"user":"54e4044e8ef7552300409dcb","__v":64,"updates":["55caafaf27fde72b003e982f","56071a92a4574a0d00811428","561d51a5281aec0d00eb27bb","561f5c2bca8cfb0d0058fa0f","5772a638dceb570e003a90bf"],"next":{"pages":[],"description":""},"createdAt":"2015-08-06T05:20:56.937Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":true,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Onboarding users (KYC) and payment flows are customized for every platform. We recommend [contacting us](doc:contact-us) before you start developing against our APIs. But if you are curious and still want to test out our APIs, this common flow can help.\n\n## Example Flow\n\n1) **Create a user account**: supply email, phone number and name and add KYC info.\n2) **Link bank account**: supply account and routing number or supply online banking credentials to instantly link an account.\n3) **Create a transaction**: once steps 1 and 2 are complete you can create a transaction.\n\n## 1. Create Users\n\n[Create User](doc:create-a-user) objects for both the fund originator and the fund recipient.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"User verification is async. If you do `GET` user after the `POST` user API call and all documents have been submitted and verified, the user will have `SEND-AND-RECEIVE` permissions.\",\n  \"title\": \"Asynchronous User Verification\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST https://uat-api.synapsefi.com/v3.1/users -H 'content-type: application/json' -H 'x-sp-gateway: client_id_5p7x3zfEglJOGcR2beTCyNAKtLnVSFBXh6vdos4k|client_secret_nP213c0wuyWIdKZRXmjHTDC0FxNBkvLoVYfi6glt' -H 'x-sp-user: |e83cf6ddcf778e37bfe3d48fc78a6502062fc1030449628c699ef3c4ffa6f9a2000b8acc3c4c0addd8013285bb52c89e5267b628ca02fa84a6d71fe186b7cd5d' -H 'x-sp-user-ip: 127.0.0.1' \\n  -d '{\\n  \\\"logins\\\": [\\n    {\\n      \\\"email\\\": \\\"test:::at:::synapsepay.com\\\"\\n    }\\n  ],\\n  \\\"phone_numbers\\\": [\\n    \\\"901.111.1111\\\",\\n    \\\"test@synapsepay.com\\\"\\n  ],\\n  \\\"legal_names\\\": [\\n    \\\"Test User\\\"\\n  ],\\n  \\\"documents\\\":[{\\n        \\\"email\\\":\\\"test@synapsepay.com\\\",\\n        \\\"phone_number\\\":\\\"901.111.1111\\\",\\n        \\\"ip\\\":\\\"::1\\\",\\n        \\\"name\\\":\\\"Test User\\\",\\n        \\\"alias\\\":\\\"Test\\\",\\n        \\\"entity_type\\\":\\\"M\\\",\\n        \\\"entity_scope\\\":\\\"Arts & Entertainment\\\",\\n        \\\"day\\\":2,\\n        \\\"month\\\":5,\\n        \\\"year\\\":1989,\\n        \\\"address_street\\\":\\\"1 Market St\\\",\\n        \\\"address_city\\\":\\\"SF\\\",\\n        \\\"address_subdivision\\\":\\\"CA\\\",\\n        \\\"address_postal_code\\\":\\\"94114\\\",\\n        \\\"address_country_code\\\":\\\"US\\\",\\n        \\\"virtual_docs\\\":[{\\n            \\\"document_value\\\":\\\"2222\\\",\\n            \\\"document_type\\\":\\\"SSN\\\"\\n        }]\\n    }],\\n  \\\"extra\\\": {\\n    \\\"supp_id\\\": \\\"122eddfgbeafrfvbbb\\\",\\n    \\\"cip_tag\\\":1,\\n    \\\"is_business\\\": false\\n  }\\n}'\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"{\\n    \\\"_id\\\": \\\"59499bc6838454002fd0c096\\\",\\n    \\\"_links\\\": {\\n        \\\"self\\\": {\\n            \\\"href\\\": \\\"https://uat-api.synapsefi.com/v3.1/users/59499bc6838454002fd0c096\\\"\\n        }\\n    },\\n    \\\"client\\\": {\\n        \\\"id\\\": \\\"5949989f23dbf000229bdbaf\\\",\\n        \\\"name\\\": \\\"Test Platform\\\"\\n    },\\n    \\\"doc_status\\\": {\\n        \\\"physical_doc\\\": \\\"MISSING|INVALID\\\",\\n        \\\"virtual_doc\\\": \\\"MISSING|INVALID\\\"\\n    },\\n    \\\"documents\\\": [\\n        {\\n            \\\"id\\\": \\\"dcd19da5fb2470984d0e316fb5551269e65c109730b0b45b32a8bb1eb83d6a72\\\",\\n            \\\"name\\\": \\\"Test User\\\",\\n            \\\"permission_scope\\\": \\\"UNVERIFIED\\\",\\n            \\\"physical_docs\\\": [],\\n            \\\"social_docs\\\": [\\n                {\\n                    \\\"document_type\\\": \\\"IP\\\",\\n                    \\\"id\\\": \\\"28d9177b22c127d9a51d8903893864accf6e553ac326704a4c0d585eaad2516a\\\",\\n                    \\\"last_updated\\\": 1497996229732,\\n                    \\\"status\\\": \\\"SUBMITTED|VALID\\\"\\n                },\\n                {\\n                    \\\"document_type\\\": \\\"PHONE_NUMBER\\\",\\n                    \\\"id\\\": \\\"fda60784d6375bc44edafaaeae149626c4c13dcb92e85a2a7a00eec2cdfd2b6f\\\",\\n                    \\\"last_updated\\\": 1497996229222,\\n                    \\\"status\\\": \\\"SUBMITTED|VALID\\\"\\n                },\\n                {\\n                    \\\"document_type\\\": \\\"EMAIL\\\",\\n                    \\\"id\\\": \\\"b886811ff9cbc150065c65eb5295951ac624e3a63e57d5e016cfddc03904f46b\\\",\\n                    \\\"last_updated\\\": 1497996228710,\\n                    \\\"status\\\": \\\"SUBMITTED|VALID\\\"\\n                }\\n            ],\\n            \\\"virtual_docs\\\": [\\n                {\\n                    \\\"document_type\\\": \\\"SSN\\\",\\n                    \\\"id\\\": \\\"ee596c2896dddc19b76c07a184fe7d3cf5a04b8e94b9108190cac7890739017f\\\",\\n                    \\\"last_updated\\\": 1497996228195,\\n                    \\\"status\\\": \\\"SUBMITTED|VALID\\\"\\n                }\\n            ]\\n        }\\n    ],\\n    \\\"emails\\\": [],\\n    \\\"extra\\\": {\\n        \\\"cip_tag\\\": 1,\\n        \\\"date_joined\\\": 1497996227163,\\n        \\\"extra_security\\\": false,\\n        \\\"is_business\\\": false,\\n        \\\"last_updated\\\": 1497996227163,\\n        \\\"public_note\\\": null,\\n        \\\"supp_id\\\": \\\"122eddfgbeafrfvbbb\\\"\\n    },\\n    \\\"is_hidden\\\": false,\\n    \\\"legal_names\\\": [\\n        \\\"Test User\\\"\\n    ],\\n    \\\"logins\\\": [\\n        {\\n            \\\"email\\\": \\\"test@synapsepay.com\\\",\\n            \\\"scope\\\": \\\"READ_AND_WRITE\\\"\\n        }\\n    ],\\n    \\\"permission\\\": \\\"UNVERIFIED\\\",\\n    \\\"phone_numbers\\\": [\\n        \\\"test@synapsepay.com\\\",\\n        \\\"901.111.1111\\\"\\n    ],\\n    \\\"photos\\\": [],\\n    \\\"refresh_token\\\": \\\"refresh_FBCt0DOU9NvcfKpe3lbr7ghisaoq2ImduPERx4nW\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Remember\",\n  \"body\": \"Please remember to store `_id` of the user in your database.\\n\\nWe manage refresh tokens for you, so no need to store them.\\n\\nIf you do not want to use 2FA, store the fingerprint used when creating the user and supply the fingerprint when performing actions with the user. This way the system will not detect a new device and no 2FAs will be triggered.\\n\\n> A good way to do so is to pass a hashed version of your `user_pk+client_id+client_secret`. That way the value is still somewhat secret, but you won't need to store it for each unique user.\"\n}\n[/block]\n## 2. Add KYC Info\n\nYou need to add a virtual document on both sender and receiver. A list of acceptable virtual documents can be found in the [User Resources](doc:user-resources) section. A complete list of documents that we are capable of verifying as virtual documents can be found [here](#virtual-document-types).\n\nBut you only need to add the physical document on the sender, a complete list of documents that we are capable of verifying as physical documents can be found [here](#physical-document-types).\n\nIf you wish to know what virtual and physical documents really mean, [go here](#customer-identification-program-cip--know-your-cus).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X PATCH -H \\\"Content-Type: application/json\\\" -H \\\"X-SP-GATEWAY: e3f19e4bd4022c86e7f2|11c94ba6bad74d24a0158bc707f0fc19a86dc08f\\\" -H \\\"X-SP-USER-IP: 216.3.128.12\\\" -H \\\"X-SP-USER: oauth-35dc926a-cf4d-43f6-b69b-c145efc66dd0|e716990e50b67a1177736960b6357524b22090ccab093d068b3d7a18dbde3f4c\\\" -d '{\\n    \\\"documents\\\":[{\\n        \\\"email\\\":\\\"test@test.com\\\",\\n        \\\"phone_number\\\":\\\"901-942-8167\\\",\\n        \\\"ip\\\":\\\"12134323\\\",\\n        \\\"name\\\":\\\"Charlie Brown\\\",\\n        \\\"alias\\\":\\\"Woof Woof\\\",\\n        \\\"entity_type\\\":\\\"M\\\",\\n        \\\"entity_scope\\\":\\\"Arts & Entertainment\\\",\\n        \\\"day\\\":2,\\n        \\\"month\\\":5,\\n        \\\"year\\\":2009,\\n        \\\"address_street\\\":\\\"Some Farm\\\",\\n        \\\"address_city\\\":\\\"SF\\\",\\n        \\\"address_subdivision\\\":\\\"CA\\\",\\n        \\\"address_postal_code\\\":\\\"94114\\\",\\n        \\\"address_country_code\\\":\\\"US\\\",\\n        \\\"virtual_docs\\\":[{\\n            \\\"document_value\\\":\\\"111-111-2222\\\",\\n            \\\"document_type\\\":\\\"SSN\\\"\\n        }],\\n        \\\"physical_docs\\\":[{\\n            \\\"document_value\\\":\\\"data:text/csv;base64,SUQs==\\\",\\n            \\\"document_type\\\":\\\"GOVT_ID\\\"\\n        }],\\n        \\\"social_docs\\\":[]\\n    }]\\n}' \\\"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445\\\"\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"{\\n  \\\"_id\\\": \\\"5739ea6386c27360899fd445\\\",\\n  \\\"_links\\\": {\\n    \\\"self\\\": {\\n      \\\"href\\\": \\\"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445\\\"\\n    }\\n  },\\n  \\\"client\\\": {\\n    \\\"id\\\": 844,\\n    \\\"name\\\": \\\"SynapsePay*Sandbox\\\"\\n  },\\n  \\\"doc_status\\\": {\\n    \\\"physical_doc\\\": \\\"SUBMITTED|VALID\\\",\\n    \\\"virtual_doc\\\": \\\"SUBMITTED|VALID\\\"\\n  },\\n  \\\"documents\\\": [\\n    {\\n      \\\"id\\\": \\\"ef4685f1dcf78b39a85c9d4da97652e114f3af054d43b29195978a1e4918beae\\\",\\n      \\\"name\\\": \\\"Charlie Brown\\\",\\n      \\\"permission_scope\\\": \\\"SEND|RECEIVE|5000|DAILY\\\",\\n      \\\"physical_docs\\\": [\\n        {\\n          \\\"document_type\\\": \\\"GOVT_ID\\\",\\n          \\\"id\\\": \\\"70d5a44dd55e3914870039deabb5405644016a5b56d0002ea0ec4e7952def9fd\\\",\\n          \\\"last_updated\\\": 1463413784808,\\n          \\\"status\\\": \\\"SUBMITTED|VALID\\\"\\n        }\\n      ],\\n      \\\"social_docs\\\": [\\n        {\\n          \\\"document_type\\\": \\\"EMAIL\\\",\\n          \\\"id\\\": \\\"2c45158f6431ca874bbe82f63d5905567854dde4d8b81539944e5779e5eee741\\\",\\n          \\\"last_updated\\\": 1463413785201,\\n          \\\"status\\\": \\\"SUBMITTED|VALID\\\"\\n        },\\n        {\\n          \\\"document_type\\\": \\\"PHONE_NUMBER\\\",\\n          \\\"id\\\": \\\"9dd593112385cfed22721355d279e79d33acd2c48cffe9c007b6c4acbfde826c\\\",\\n          \\\"last_updated\\\": 1463413785593,\\n          \\\"status\\\": \\\"SUBMITTED|VALID\\\"\\n        }\\n      ],\\n      \\\"virtual_docs\\\": [\\n        {\\n          \\\"document_type\\\": \\\"SSN\\\",\\n          \\\"id\\\": \\\"7cb85697d26e2c1010266fd64a22afd396167ca630a4bad21a9e8fcff865bb1c\\\",\\n          \\\"last_updated\\\": 1463413784258,\\n          \\\"status\\\": \\\"SUBMITTED|VALID\\\"\\n        }\\n      ]\\n    }\\n  ],\\n  \\\"extra\\\": {\\n    \\\"cip_tag\\\": 1,\\n    \\\"date_joined\\\": 1463413347832,\\n    \\\"extra_security\\\": true,\\n    \\\"is_business\\\": false,\\n    \\\"supp_id\\\": \\\"5303f4ddb4e7b810bf000173\\\"\\n  },\\n  \\\"is_hidden\\\": false,\\n  \\\"legal_names\\\": [\\n    \\\"Test User\\\"\\n  ],\\n  \\\"logins\\\": [\\n    {\\n      \\\"email\\\": \\\"test@test.com\\\",\\n      \\\"scope\\\": \\\"READ_AND_WRITE\\\"\\n    }\\n  ],\\n  \\\"permission\\\": \\\"SEND-AND-RECEIVE\\\",\\n  \\\"phone_numbers\\\": [\\n    \\\"9019428167\\\"\\n  ],\\n  \\\"photos\\\": [],\\n  \\\"refresh_token\\\": \\\"refresh-6281b092-a34c-4628-8dea-e02a22d4c718\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ]\n}\n[/block]\n## 3. Link Bank Accounts\n\nThere are two ways to link a bank account to users: via online banking logins OR account/routing numbers. You can read more about it in [Node Resources](doc:node-resources) section.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -H \\\"Content-Type: application/json\\\" -H \\\"X-SP-GATEWAY: e3f19e4bd4022c86e7f2|11c94ba6bad74d24a0158bc707f0fc19a86dc08f\\\" -H \\\"X-SP-USER-IP: 216.3.128.12\\\" -H \\\"X-SP-USER: oauth-35dc926a-cf4d-43f6-b69b-c145efc66dd0|e716990e50b67a1177736960b6357524b22090ccab093d068b3d7a18dbde3f4c\\\" -d '{\\n    \\\"type\\\":\\\"ACH-US\\\",\\n    \\\"info\\\":{\\n      \\\"bank_id\\\":\\\"synapse_nomfa\\\",\\n      \\\"bank_pw\\\":\\\"test1234\\\",\\n      \\\"bank_name\\\":\\\"bofa\\\"\\n    }\\n}' \\\"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445/nodes\\\"\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"{\\n  \\\"error_code\\\": \\\"0\\\",\\n  \\\"http_code\\\": \\\"200\\\",\\n  \\\"nodes\\\": [\\n    {\\n      \\\"_id\\\": \\\"5739eda886c2735cc02d55d1\\\",\\n      \\\"_links\\\": {\\n        \\\"self\\\": {\\n          \\\"href\\\": \\\"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445/nodes/5739eda886c2735cc02d55d1\\\"\\n        }\\n      },\\n      \\\"allowed\\\": \\\"CREDIT-AND-DEBIT\\\",\\n      \\\"extra\\\": {\\n        \\\"supp_id\\\": null\\n      },\\n      \\\"info\\\": {\\n        \\\"account_num\\\": \\\"8901\\\",\\n        \\\"balance\\\": {\\n          \\\"amount\\\": \\\"10000.00\\\",\\n          \\\"currency\\\": \\\"USD\\\"\\n        },\\n        \\\"bank_long_name\\\": \\\"ING DIRECT\\\",\\n        \\\"bank_name\\\": \\\"fake\\\",\\n        \\\"class\\\": \\\"CHECKING\\\",\\n        \\\"name_on_account\\\": \\\"Test User\\\",\\n        \\\"nickname\\\": \\\"SynapsePay Test Checking Account\\\",\\n        \\\"routing_num\\\": \\\"6110\\\",\\n        \\\"type\\\": \\\"PERSONAL\\\"\\n      },\\n      \\\"is_active\\\": true,\\n      \\\"type\\\": \\\"ACH-US\\\"\\n    },\\n    {\\n      ...\\n    },\\n    {\\n      ...\\n    }\\n  ],\\n  \\\"success\\\": true\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ]\n}\n[/block]\n## 4. Create a transaction\n\nUsing the sender's oauth credentials and node id, [Create Transaction](doc:create-transaction). You \ncan learn more about transactions and their processing times under [Transaction Resources](doc:trans-resources).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -H \\\"Content-Type: application/json\\\" -H \\\"X-SP-GATEWAY: e3f19e4bd4022c86e7f2|11c94ba6bad74d24a0158bc707f0fc19a86dc08f\\\" -H \\\"X-SP-USER-IP: 216.3.128.12\\\" -H \\\"X-SP-USER: oauth-35dc926a-cf4d-43f6-b69b-c145efc66dd0|e716990e50b67a1177736960b6357524b22090ccab093d068b3d7a18dbde3f4c\\\" -d '{\\n    \\\"to\\\":{\\n      \\\"type\\\":\\\"ACH-US\\\",\\n      \\\"id\\\":\\\"5739eda886c2735cc02d55d2\\\"\\n    },\\n    \\\"amount\\\":{\\n      \\\"amount\\\":1000,\\n      \\\"currency\\\":\\\"USD\\\"\\n    },\\n    \\\"extra\\\":{\\n      \\\"ip\\\":\\\"192.168.0.1\\\"\\n    }\\n}' \\\"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445/nodes/5739eda886c2735cc02d55d1/trans\\\"\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"{\\n  \\\"_id\\\": \\\"5739edeb86c2735cc02d55d3\\\",\\n  \\\"_links\\\": {\\n    \\\"self\\\": {\\n      \\\"href\\\": \\\"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445/nodes/5739eda886c2735cc02d55d1/trans/5739edeb86c2735cc02d55d3\\\"\\n    }\\n  },\\n  \\\"amount\\\": {\\n    \\\"amount\\\": 1000,\\n    \\\"currency\\\": \\\"USD\\\"\\n  },\\n  \\\"client\\\": {\\n    \\\"id\\\": 844,\\n    \\\"name\\\": \\\"SynapsePay*Sandbox\\\"\\n  },\\n  \\\"extra\\\": {\\n    \\\"created_on\\\": 1463414250500,\\n    \\\"ip\\\": \\\"192.168.0.1\\\",\\n    \\\"latlon\\\": \\\"0,0\\\",\\n    \\\"note\\\": \\\"\\\",\\n    \\\"other\\\": {},\\n    \\\"process_on\\\": 1463414250500,\\n    \\\"supp_id\\\": \\\"\\\",\\n    \\\"webhook\\\": \\\"\\\"\\n  },\\n  \\\"fees\\\": [\\n    {\\n      \\\"fee\\\": 0.2,\\n      \\\"note\\\": \\\"Synapse Facilitator Fee\\\",\\n      \\\"to\\\": {\\n        \\\"id\\\": \\\"559339aa86c273605ccd35df\\\"\\n      }\\n    }\\n  ],\\n  \\\"from\\\": {\\n    \\\"id\\\": \\\"5739eda886c2735cc02d55d1\\\",\\n    \\\"nickname\\\": \\\"SynapsePay Test Checking Account\\\",\\n    \\\"type\\\": \\\"ACH-US\\\",\\n    \\\"user\\\": {\\n      \\\"_id\\\": \\\"5739ea6386c27360899fd445\\\",\\n      \\\"legal_names\\\": [\\n        \\\"Test User\\\"\\n      ]\\n    }\\n  },\\n  \\\"recent_status\\\": {\\n    \\\"date\\\": 1463414250499,\\n    \\\"note\\\": \\\"Transaction created\\\",\\n    \\\"status\\\": \\\"CREATED\\\",\\n    \\\"status_id\\\": \\\"1\\\"\\n  },\\n  \\\"timeline\\\": [\\n    {\\n      \\\"date\\\": 1463414250499,\\n      \\\"note\\\": \\\"Transaction created\\\",\\n      \\\"status\\\": \\\"CREATED\\\",\\n      \\\"status_id\\\": \\\"1\\\"\\n    }\\n  ],\\n  \\\"to\\\": {\\n    \\\"id\\\": \\\"5739eda886c2735cc02d55d2\\\",\\n    \\\"nickname\\\": \\\"SynapsePay Test Savings Account\\\",\\n    \\\"type\\\": \\\"ACH-US\\\",\\n    \\\"user\\\": {\\n      \\\"_id\\\": \\\"5739ea6386c27360899fd445\\\",\\n      \\\"legal_names\\\": [\\n        \\\"Test User\\\"\\n      ]\\n    }\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ]\n}\n[/block]\n> The APIs are very general purpose & can be used to accommodate different use-cases (eg. ACH payments, FedWires, Automated Savings, etc.). If you need our help with mapping out an ideal flow for you, please [Contact us](doc:contact-us) and we will be happy to help.","excerpt":"Example Flow for Getting Started (includes API references)","slug":"common-flow","type":"basic","title":"Example Flow"}

Example Flow

Example Flow for Getting Started (includes API references)

Onboarding users (KYC) and payment flows are customized for every platform. We recommend [contacting us](doc:contact-us) before you start developing against our APIs. But if you are curious and still want to test out our APIs, this common flow can help. ## Example Flow 1) **Create a user account**: supply email, phone number and name and add KYC info. 2) **Link bank account**: supply account and routing number or supply online banking credentials to instantly link an account. 3) **Create a transaction**: once steps 1 and 2 are complete you can create a transaction. ## 1. Create Users [Create User](doc:create-a-user) objects for both the fund originator and the fund recipient. [block:callout] { "type": "info", "body": "User verification is async. If you do `GET` user after the `POST` user API call and all documents have been submitted and verified, the user will have `SEND-AND-RECEIVE` permissions.", "title": "Asynchronous User Verification" } [/block] [block:code] { "codes": [ { "code": "curl -X POST https://uat-api.synapsefi.com/v3.1/users -H 'content-type: application/json' -H 'x-sp-gateway: client_id_5p7x3zfEglJOGcR2beTCyNAKtLnVSFBXh6vdos4k|client_secret_nP213c0wuyWIdKZRXmjHTDC0FxNBkvLoVYfi6glt' -H 'x-sp-user: |e83cf6ddcf778e37bfe3d48fc78a6502062fc1030449628c699ef3c4ffa6f9a2000b8acc3c4c0addd8013285bb52c89e5267b628ca02fa84a6d71fe186b7cd5d' -H 'x-sp-user-ip: 127.0.0.1' \n -d '{\n \"logins\": [\n {\n \"email\": \"test@synapsepay.com\"\n }\n ],\n \"phone_numbers\": [\n \"901.111.1111\",\n \"test@synapsepay.com\"\n ],\n \"legal_names\": [\n \"Test User\"\n ],\n \"documents\":[{\n \"email\":\"test@synapsepay.com\",\n \"phone_number\":\"901.111.1111\",\n \"ip\":\"::1\",\n \"name\":\"Test User\",\n \"alias\":\"Test\",\n \"entity_type\":\"M\",\n \"entity_scope\":\"Arts & Entertainment\",\n \"day\":2,\n \"month\":5,\n \"year\":1989,\n \"address_street\":\"1 Market St\",\n \"address_city\":\"SF\",\n \"address_subdivision\":\"CA\",\n \"address_postal_code\":\"94114\",\n \"address_country_code\":\"US\",\n \"virtual_docs\":[{\n \"document_value\":\"2222\",\n \"document_type\":\"SSN\"\n }]\n }],\n \"extra\": {\n \"supp_id\": \"122eddfgbeafrfvbbb\",\n \"cip_tag\":1,\n \"is_business\": false\n }\n}'", "language": "curl" }, { "code": "{\n \"_id\": \"59499bc6838454002fd0c096\",\n \"_links\": {\n \"self\": {\n \"href\": \"https://uat-api.synapsefi.com/v3.1/users/59499bc6838454002fd0c096\"\n }\n },\n \"client\": {\n \"id\": \"5949989f23dbf000229bdbaf\",\n \"name\": \"Test Platform\"\n },\n \"doc_status\": {\n \"physical_doc\": \"MISSING|INVALID\",\n \"virtual_doc\": \"MISSING|INVALID\"\n },\n \"documents\": [\n {\n \"id\": \"dcd19da5fb2470984d0e316fb5551269e65c109730b0b45b32a8bb1eb83d6a72\",\n \"name\": \"Test User\",\n \"permission_scope\": \"UNVERIFIED\",\n \"physical_docs\": [],\n \"social_docs\": [\n {\n \"document_type\": \"IP\",\n \"id\": \"28d9177b22c127d9a51d8903893864accf6e553ac326704a4c0d585eaad2516a\",\n \"last_updated\": 1497996229732,\n \"status\": \"SUBMITTED|VALID\"\n },\n {\n \"document_type\": \"PHONE_NUMBER\",\n \"id\": \"fda60784d6375bc44edafaaeae149626c4c13dcb92e85a2a7a00eec2cdfd2b6f\",\n \"last_updated\": 1497996229222,\n \"status\": \"SUBMITTED|VALID\"\n },\n {\n \"document_type\": \"EMAIL\",\n \"id\": \"b886811ff9cbc150065c65eb5295951ac624e3a63e57d5e016cfddc03904f46b\",\n \"last_updated\": 1497996228710,\n \"status\": \"SUBMITTED|VALID\"\n }\n ],\n \"virtual_docs\": [\n {\n \"document_type\": \"SSN\",\n \"id\": \"ee596c2896dddc19b76c07a184fe7d3cf5a04b8e94b9108190cac7890739017f\",\n \"last_updated\": 1497996228195,\n \"status\": \"SUBMITTED|VALID\"\n }\n ]\n }\n ],\n \"emails\": [],\n \"extra\": {\n \"cip_tag\": 1,\n \"date_joined\": 1497996227163,\n \"extra_security\": false,\n \"is_business\": false,\n \"last_updated\": 1497996227163,\n \"public_note\": null,\n \"supp_id\": \"122eddfgbeafrfvbbb\"\n },\n \"is_hidden\": false,\n \"legal_names\": [\n \"Test User\"\n ],\n \"logins\": [\n {\n \"email\": \"test@synapsepay.com\",\n \"scope\": \"READ_AND_WRITE\"\n }\n ],\n \"permission\": \"UNVERIFIED\",\n \"phone_numbers\": [\n \"test@synapsepay.com\",\n \"901.111.1111\"\n ],\n \"photos\": [],\n \"refresh_token\": \"refresh_FBCt0DOU9NvcfKpe3lbr7ghisaoq2ImduPERx4nW\"\n}", "language": "json", "name": "Response" } ] } [/block] [block:callout] { "type": "info", "title": "Remember", "body": "Please remember to store `_id` of the user in your database.\n\nWe manage refresh tokens for you, so no need to store them.\n\nIf you do not want to use 2FA, store the fingerprint used when creating the user and supply the fingerprint when performing actions with the user. This way the system will not detect a new device and no 2FAs will be triggered.\n\n> A good way to do so is to pass a hashed version of your `user_pk+client_id+client_secret`. That way the value is still somewhat secret, but you won't need to store it for each unique user." } [/block] ## 2. Add KYC Info You need to add a virtual document on both sender and receiver. A list of acceptable virtual documents can be found in the [User Resources](doc:user-resources) section. A complete list of documents that we are capable of verifying as virtual documents can be found [here](#virtual-document-types). But you only need to add the physical document on the sender, a complete list of documents that we are capable of verifying as physical documents can be found [here](#physical-document-types). If you wish to know what virtual and physical documents really mean, [go here](#customer-identification-program-cip--know-your-cus). [block:code] { "codes": [ { "code": "curl -X PATCH -H \"Content-Type: application/json\" -H \"X-SP-GATEWAY: e3f19e4bd4022c86e7f2|11c94ba6bad74d24a0158bc707f0fc19a86dc08f\" -H \"X-SP-USER-IP: 216.3.128.12\" -H \"X-SP-USER: oauth-35dc926a-cf4d-43f6-b69b-c145efc66dd0|e716990e50b67a1177736960b6357524b22090ccab093d068b3d7a18dbde3f4c\" -d '{\n \"documents\":[{\n \"email\":\"test@test.com\",\n \"phone_number\":\"901-942-8167\",\n \"ip\":\"12134323\",\n \"name\":\"Charlie Brown\",\n \"alias\":\"Woof Woof\",\n \"entity_type\":\"M\",\n \"entity_scope\":\"Arts & Entertainment\",\n \"day\":2,\n \"month\":5,\n \"year\":2009,\n \"address_street\":\"Some Farm\",\n \"address_city\":\"SF\",\n \"address_subdivision\":\"CA\",\n \"address_postal_code\":\"94114\",\n \"address_country_code\":\"US\",\n \"virtual_docs\":[{\n \"document_value\":\"111-111-2222\",\n \"document_type\":\"SSN\"\n }],\n \"physical_docs\":[{\n \"document_value\":\"data:text/csv;base64,SUQs==\",\n \"document_type\":\"GOVT_ID\"\n }],\n \"social_docs\":[]\n }]\n}' \"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445\"", "language": "curl" }, { "code": "{\n \"_id\": \"5739ea6386c27360899fd445\",\n \"_links\": {\n \"self\": {\n \"href\": \"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445\"\n }\n },\n \"client\": {\n \"id\": 844,\n \"name\": \"SynapsePay*Sandbox\"\n },\n \"doc_status\": {\n \"physical_doc\": \"SUBMITTED|VALID\",\n \"virtual_doc\": \"SUBMITTED|VALID\"\n },\n \"documents\": [\n {\n \"id\": \"ef4685f1dcf78b39a85c9d4da97652e114f3af054d43b29195978a1e4918beae\",\n \"name\": \"Charlie Brown\",\n \"permission_scope\": \"SEND|RECEIVE|5000|DAILY\",\n \"physical_docs\": [\n {\n \"document_type\": \"GOVT_ID\",\n \"id\": \"70d5a44dd55e3914870039deabb5405644016a5b56d0002ea0ec4e7952def9fd\",\n \"last_updated\": 1463413784808,\n \"status\": \"SUBMITTED|VALID\"\n }\n ],\n \"social_docs\": [\n {\n \"document_type\": \"EMAIL\",\n \"id\": \"2c45158f6431ca874bbe82f63d5905567854dde4d8b81539944e5779e5eee741\",\n \"last_updated\": 1463413785201,\n \"status\": \"SUBMITTED|VALID\"\n },\n {\n \"document_type\": \"PHONE_NUMBER\",\n \"id\": \"9dd593112385cfed22721355d279e79d33acd2c48cffe9c007b6c4acbfde826c\",\n \"last_updated\": 1463413785593,\n \"status\": \"SUBMITTED|VALID\"\n }\n ],\n \"virtual_docs\": [\n {\n \"document_type\": \"SSN\",\n \"id\": \"7cb85697d26e2c1010266fd64a22afd396167ca630a4bad21a9e8fcff865bb1c\",\n \"last_updated\": 1463413784258,\n \"status\": \"SUBMITTED|VALID\"\n }\n ]\n }\n ],\n \"extra\": {\n \"cip_tag\": 1,\n \"date_joined\": 1463413347832,\n \"extra_security\": true,\n \"is_business\": false,\n \"supp_id\": \"5303f4ddb4e7b810bf000173\"\n },\n \"is_hidden\": false,\n \"legal_names\": [\n \"Test User\"\n ],\n \"logins\": [\n {\n \"email\": \"test@test.com\",\n \"scope\": \"READ_AND_WRITE\"\n }\n ],\n \"permission\": \"SEND-AND-RECEIVE\",\n \"phone_numbers\": [\n \"9019428167\"\n ],\n \"photos\": [],\n \"refresh_token\": \"refresh-6281b092-a34c-4628-8dea-e02a22d4c718\"\n}", "language": "json", "name": "Response" } ] } [/block] ## 3. Link Bank Accounts There are two ways to link a bank account to users: via online banking logins OR account/routing numbers. You can read more about it in [Node Resources](doc:node-resources) section. [block:code] { "codes": [ { "code": "curl -X POST -H \"Content-Type: application/json\" -H \"X-SP-GATEWAY: e3f19e4bd4022c86e7f2|11c94ba6bad74d24a0158bc707f0fc19a86dc08f\" -H \"X-SP-USER-IP: 216.3.128.12\" -H \"X-SP-USER: oauth-35dc926a-cf4d-43f6-b69b-c145efc66dd0|e716990e50b67a1177736960b6357524b22090ccab093d068b3d7a18dbde3f4c\" -d '{\n \"type\":\"ACH-US\",\n \"info\":{\n \"bank_id\":\"synapse_nomfa\",\n \"bank_pw\":\"test1234\",\n \"bank_name\":\"bofa\"\n }\n}' \"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445/nodes\"", "language": "curl" }, { "code": "{\n \"error_code\": \"0\",\n \"http_code\": \"200\",\n \"nodes\": [\n {\n \"_id\": \"5739eda886c2735cc02d55d1\",\n \"_links\": {\n \"self\": {\n \"href\": \"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445/nodes/5739eda886c2735cc02d55d1\"\n }\n },\n \"allowed\": \"CREDIT-AND-DEBIT\",\n \"extra\": {\n \"supp_id\": null\n },\n \"info\": {\n \"account_num\": \"8901\",\n \"balance\": {\n \"amount\": \"10000.00\",\n \"currency\": \"USD\"\n },\n \"bank_long_name\": \"ING DIRECT\",\n \"bank_name\": \"fake\",\n \"class\": \"CHECKING\",\n \"name_on_account\": \"Test User\",\n \"nickname\": \"SynapsePay Test Checking Account\",\n \"routing_num\": \"6110\",\n \"type\": \"PERSONAL\"\n },\n \"is_active\": true,\n \"type\": \"ACH-US\"\n },\n {\n ...\n },\n {\n ...\n }\n ],\n \"success\": true\n}", "language": "json", "name": "Response" } ] } [/block] ## 4. Create a transaction Using the sender's oauth credentials and node id, [Create Transaction](doc:create-transaction). You can learn more about transactions and their processing times under [Transaction Resources](doc:trans-resources). [block:code] { "codes": [ { "code": "curl -X POST -H \"Content-Type: application/json\" -H \"X-SP-GATEWAY: e3f19e4bd4022c86e7f2|11c94ba6bad74d24a0158bc707f0fc19a86dc08f\" -H \"X-SP-USER-IP: 216.3.128.12\" -H \"X-SP-USER: oauth-35dc926a-cf4d-43f6-b69b-c145efc66dd0|e716990e50b67a1177736960b6357524b22090ccab093d068b3d7a18dbde3f4c\" -d '{\n \"to\":{\n \"type\":\"ACH-US\",\n \"id\":\"5739eda886c2735cc02d55d2\"\n },\n \"amount\":{\n \"amount\":1000,\n \"currency\":\"USD\"\n },\n \"extra\":{\n \"ip\":\"192.168.0.1\"\n }\n}' \"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445/nodes/5739eda886c2735cc02d55d1/trans\"", "language": "curl" }, { "code": "{\n \"_id\": \"5739edeb86c2735cc02d55d3\",\n \"_links\": {\n \"self\": {\n \"href\": \"https://sandbox.synapsepay.com/api/3/users/5739ea6386c27360899fd445/nodes/5739eda886c2735cc02d55d1/trans/5739edeb86c2735cc02d55d3\"\n }\n },\n \"amount\": {\n \"amount\": 1000,\n \"currency\": \"USD\"\n },\n \"client\": {\n \"id\": 844,\n \"name\": \"SynapsePay*Sandbox\"\n },\n \"extra\": {\n \"created_on\": 1463414250500,\n \"ip\": \"192.168.0.1\",\n \"latlon\": \"0,0\",\n \"note\": \"\",\n \"other\": {},\n \"process_on\": 1463414250500,\n \"supp_id\": \"\",\n \"webhook\": \"\"\n },\n \"fees\": [\n {\n \"fee\": 0.2,\n \"note\": \"Synapse Facilitator Fee\",\n \"to\": {\n \"id\": \"559339aa86c273605ccd35df\"\n }\n }\n ],\n \"from\": {\n \"id\": \"5739eda886c2735cc02d55d1\",\n \"nickname\": \"SynapsePay Test Checking Account\",\n \"type\": \"ACH-US\",\n \"user\": {\n \"_id\": \"5739ea6386c27360899fd445\",\n \"legal_names\": [\n \"Test User\"\n ]\n }\n },\n \"recent_status\": {\n \"date\": 1463414250499,\n \"note\": \"Transaction created\",\n \"status\": \"CREATED\",\n \"status_id\": \"1\"\n },\n \"timeline\": [\n {\n \"date\": 1463414250499,\n \"note\": \"Transaction created\",\n \"status\": \"CREATED\",\n \"status_id\": \"1\"\n }\n ],\n \"to\": {\n \"id\": \"5739eda886c2735cc02d55d2\",\n \"nickname\": \"SynapsePay Test Savings Account\",\n \"type\": \"ACH-US\",\n \"user\": {\n \"_id\": \"5739ea6386c27360899fd445\",\n \"legal_names\": [\n \"Test User\"\n ]\n }\n }\n}", "language": "json", "name": "Response" } ] } [/block] > The APIs are very general purpose & can be used to accommodate different use-cases (eg. ACH payments, FedWires, Automated Savings, etc.). If you need our help with mapping out an ideal flow for you, please [Contact us](doc:contact-us) and we will be happy to help.