- Table of Contents
Query parameters must be of type string
and follow the following pattern:
key=value&key=value&key=value
// Get Users with query parameters
data, err := client.GetUsers("per_page=3&page=2")
// Get User with full dehydrate
user, err := client.GetUser("5bec6ebebaabfc00ab168fa0", "TEST_FINGERPRINT", "127.0.0.1", "full_dehydrate=yes")
// credentials used to set headers for each method request
var client = synapse.New(
"client_id_1239ABCdefghijk1092312309",
"client_secret_1239ABCdefghijk1092312309",
"1023918209480asdf8341098",
"1.2.3.132",
)
Enable logging & turn off developer mode (developer mode is true by default)
var client = synapse.New(
"CLIENT_ID",
"CLIENT_SECRET",
"FINGERPRINT",
"IP_ADDRESS",
true, // set to `false` to disable logging
false, // set to `true` to enable developer mode
)
scope := "OAUTH|POST,USERS|POST,USERS|GET,USER|GET,USER|PATCH"
data, err := client.GetPublicKey(scope)
// (You can pass an optional user ID in the 2nd positional argument for a 24 hour key)
userId := "User ID Here"
data, err := client.GetPublicKey(scope, userId)
data, err := client.GetNodes()
data, err := client.GetTradeMarketData("AAPL")
data, err := client.GetCryptoMarketData()
data, err := client.GetCryptoQuotes()
data, err := client.GetInstitutions()
data, err = client.LocateATMs()
body := `{
"routing_num": "084008426",
"type": "ACH-US"
}`
data, err := client.VerifyRoutingNumber(body)
address := `{
"address_street": "170 St Germain St",
"address_city": "SF",
"address_subdivision": "CA",
"address_country_code": "US",
"address_postal_code": "94404"
}`
data, err := client.VerifyAddress(address)
data, err := client.GetSubscriptions()
subsID := "589b6adec83e17002122196c"
data, err := client.GetSubscription(subsID)
body := `{
"scope": [
"USERS|POST",
"USER|PATCH",
"NODES|POST",
"NODE|PATCH",
"TRANS|POST",
"TRAN|PATCH"
],
"url": "https://requestb.in/zp216zzp"
}`
idempotencykey := "123456789"
data, err := client.CreateSubscription(body, idempotencyKey)
subID := "589b6adec83e17002122196c"
body := `{
"scope": [
"USERS|POST",
"USER|PATCH",
"NODES|POST",
...
]
}`
data, err := client.UpdateSubscription(subID, body)
data, err := client.GetWebhookLogs()
data, err := client.GetTransactions()
data, err := client.GetUsers()
// set FullDehydrate to true
userID = "594e0fa2838454002ea317a0"
userFingerprint = "TEST_FINGERPRINT" // or client.Fingerprint
userIP = "127.0.0.1" // or client.IP
user, err := client.GetUser(userID, userFingerprint, userIP)
body := `{
"logins": [
{
"email": "[email protected]"
}
],
"phone_numbers": [
"901.111.1111",
"[email protected]"
],
"legal_names": [
"Test User"
],
...
}`
userFingerprint = "TEST_FINGERPRINT" // or client.Fingerprint
userIP = "127.0.0.1" // or client.IP
user, err := client.CreateUser(body, userFingerprint, userIP)
To perform user actions, users must be authenticated
- If performing user actions with a new user (i.e. created during the current session), further authentication is not necessary
- If performing user actions with any other user, please authenticate the user
- User authentication is only required at the start of a new session (
user.AuthKey == nil
), the wrapper will handle future authentication sessions
body := `{
"refresh_token":"refresh_Y5beJdBLtgvply3KIzrh72UxWMEqiTNoVAfDs98G",
"scope":[
"USER|PATCH",
"USER|GET",
...
]
}`
userFingerprint = "TEST_FINGERPRINT" // or client.Fingerprint
userIP = "127.0.0.1" // or client.IP
data, err := user.Authenticate(body, userFingerprint, userIP)
data, err := user.GetRefreshToken()
// Submit a new fingerprint to be registered for the user
data, err := user.RegisterFingerprint("NEW_FINGERPRINT")
/*
{
"error": {
en": "Fingerprint not registered. Please perform the MFA flow."
},
"error_code": "10",
"http_code": "202",
"phone_numbers": [
"[email protected]",
"901-111-2222"
],
"success": false
}
*/
// Submit a valid email address or phone number from "phone_numbers" list
data, err := user.Select2FA("[email protected]")
body := `{
"access_token":"fake_cd60680b9addc013ca7fb25b2b704ba82d3",
"mfa_answer":"test_answer"
}`
data, err := user.SubmitMFA(body)
// MFA sent to [email protected]
data, err := user.VerifyPIN("123456")
data, err := user.GetNodes()
nodeID := "594e606212e17a002f2e3251"
data, err := user.GetNode(nodeID)
Refer to the following docs for how to setup the payload for a specific Node type:
- Deposit Accounts
- Card Issuance
- ACH-US with Logins
- ACH-US MFA
- ACH-US with AC/RT
- INTERCHANGE-US
- CHECK-US
- CRYPTO-US
- WIRE-US
- WIRE-INT
- IOU
body := `{
"type": "DEPOSIT-US",
"info":{
"nickname":"My Checking"
}
}`
data, err := user.CreateNode(body)
body := `{
"type": "ACH-US",
"info":{
"bank_id":"synapse_good",
"bank_pw":"test1234",
"bank_name":"fake"
}
}`
data, err := user.CreateNode(body)
// parse `access_token` from `data`
// create MFA answer body
mfaBody := `{
"access_token":"fake_cd60680b9addc013ca7fb25b2b704ba82d3",
"mfa_answer":"test_answer"
}`
achData, achErr := user.SubmitMFA(mfaBody)
nodeID := "5ba05ed620b3aa005882c52a"
body := `{
"supp_id":"new_supp_id_1234"
}`
data, err := user.UpdateNode(nodeID, body)
nodeID := "594e606212e17a002f2e3251"
data, err := user.DeleteNode(nodeID)
nodeID := "5ba05ed620b3aa005882c52a"
body := `{
"micro":[0.1,0.1]
}`
data, err := user.VerifyMicroDeposit(nodeID, body)
nodeID := "5ba05ed620b3aa005882c52a"
data, err := user.ReinitiateMicroDeposits(nodeID)
nodeID := "5ba05ed620b3aa005882c52a"
body := `{
"fee_node_id":"5ba05e7920b3aa006482c5ad",
"expedite": True
}`
data, err := user.ShipCardNode(nodeID, body)
nodeID := "5ba05ed620b3aa005882c52a"
data, err := user.ResetCardNode(nodeID)
nodeID := "5ba05ed620b3aa005882c52a"
body = `{
"certificate": "your applepay cert",
"nonce": "9c02xxx2",
"nonce_signature": "4082f883ae62d0700c283e225ee9d286713ef74"
}`
data, err := user.GenerateApplePayToken(nodeID, body)
data, err := user.GetStatements()
nodeID := "594e606212e17a002f2e3251"
data, err := user.GetNodeStatements(nodeID)
nodeID := "5b4b2df145d1cc006d088f2e"
body := `{
"date_start": 1525132800000,
"date_end": 1525132800000,
"webhook": "https://wh.synapsefi.com/gen_me_statement_001"
}`
data, err := user.CreateNodeStatements(nodeID, body)
data, err := user.GetSubnets()
nodeID := "594e606212e17a002f2e3251"
data, err := user.GetNodeSubnets(nodeID, "page=4&per_page=10")
nodeID := "594e606212e17a002f2e3251"
subID := "59c9f77cd412960028b99d2b"
data, err := user.GetSubnet(nodeID, subID)
nodeID := "594e606212e17a002f2e3251"
body := `{
"nickname":"Test AC/RT"
}`
data, err := user.CreateSubnet(nodeID, body)
nodeID := "594e606212e17a002f2e3251"
subnetID := "5bc920f2fff373002bf0d51b"
body := `{
"preferences": {
"allow_foreign_transactions":true,
"daily_atm_withdrawal_limit":10,
"daily_transaction_limit":1000
}
}`
data, err := user.UpdateSubnet(nodeID, subnetID, body)
nodeID := "594e606212e17a002f2e3251"
subnetID := "5bc920f2fff373002bf0d51b"
body := `{
"fee_node_id":"5bba781485411800991b606b",
"expedite":false,
"card_style_id":"555"
}`
data, err := user.ShipCard(nodeID, subnetID, body)
nodeID := "594e606212e17a002f2e3251"
subnetID := "5bc920f2fff373002bf0d51b"
body := `{
"type": "APPLE_PUSH",
"nonce": "RH0jOQ==",
"nonce_signature": "QNyNZuyDO...EFg/Q",
"certificates": [
"MIICzD....OPQ7"
]
}`
data, err := user.PushToWallet(nodeID, subnetID, body)
nodeID := "594e606212e17a002f2e3251"
subnetID := "5bc920f2fff373002bf0d51b"
data, err := user.GetCardShipment(nodeID, subnetID)
data, err := user.GetTransactions()
nodeID := "594e606212e17a002f2e3251"
data, err := user.GetNodeTransactions(nodeID)
nodeID := "594e606212e17a002f2e3251"
transID := "594e72124599e8002fe62e4f"
data, err := user.GetTransaction(nodeID, transID)
nodeID := "594e606212e17a002f2e3251"
body := `{
"to": {
"type": "ACH-US",
"id": "594e6e6c12e17a002f2e39e4"
},
"amount": {
"amount": 20.1,
"currency": "USD"
},
"extra": {
"ip": "192.168.0.1"
}
}`
data, err := user.CreateTransaction(nodeID, body)
nodeID := "594e606212e17a002f2e3251"
transID := "594e72124599e8002fe62e4f"
data, err := user.CancelTransaction(nodeID, transID)
nodeID := "594e606212e17a002f2e3251"
transID := "594e72124599e8002fe62e4f"
data, err := user.CommentOnTransactionStatus(nodeID, transID, "Pending verification...")
nodeID := "594e606212e17a002f2e3251"
transID := "594e72124599e8002fe62e4f"
body := `{
"dispute_reason": "CHARGE_BACK"
}`
data, err := user.DisputeTransaction(nodeID, transID, body)
nodeID := "594e606212e17a002f2e3251"
queryParams := "is_credit=YES&type=INTERCHANGE&subnetid=5caac735e1232a0029ee649c&foreign_transaction=NO"
data, err := user.CreateDummyTransaction(nodeID, queryParams)
body := `{
"update":{
"login":{
"email":"[email protected]"
},
"remove_login":{
"email":"[email protected]"
},
"phone_number":"901-111-2222",
"remove_phone_number":"901.111.1111"
}
}`
data, err := user.Update(body)
body := `{
"entity_info": {
"cryptocurrency": True,
"msb": {
"federal": True,
"states": ["AL"]
},
"public_company": False,
"majority_owned_by_listed": False,
"registered_SEC": False,
"regulated_financial": False,
"gambling": False,
"document_id": "2a4a5957a3a62aaac1a0dd0edcae96ea2cdee688ec6337b20745eed8869e3ac8"
...
}`
data, err := user.CreateUBO(body)