Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickolasteixeira/fb7b55c74e58dfabc1efdbc5159756a8 to your computer and use it in GitHub Desktop.
Save nickolasteixeira/fb7b55c74e58dfabc1efdbc5159756a8 to your computer and use it in GitHub Desktop.
Create a Wyre Account (Bearer Token Auth)
################### Generate a secrey key ###################
# First generate your own secret key.
## Add code here to generate your own secret key
# Python: https://blog.miguelgrinberg.com/post/the-new-way-to-generate-secure-tokens-in-python
# Nodejs: https://stackoverflow.com/questions/8855687/secure-random-token-in-node-js (Make sure to change it to 25-35 characters)
#################### Get API Key ###################
# Next, send a post request with your secret key, which will return a api key
# In this example below, I'm using the test env. When you are ready, use the production url: https://api.sendwyre.com
curl -X POST -H "Content-Type: application/json" -d '{"secretKey":"GENERATE YOUR OWN SECRET KEY"}' https://api.testwyre.com/v2/sessions/auth/key
# Return should look something like this:
# {"apiKey":"AK-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX","authenticatedAs":null}
################### Create a Wyre Account ###################
# After receiving your secret key, your next step should be create an account.
# In this example below, I'm using the test env. When you are ready, use the production url: https://api.sendwyre.com
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-BEARER-TOKEN" \
-d '{"type":"INDIVIDUAL","country": "US","subaccount": true,"profileFields":[{"fieldId": "individualLegalName","value": "YOUR_NAME"},{"fieldId": "individualEmail","value": "YOUREMAIL@EMAIL.com"},{"fieldId": "individualResidenceAddress","value": {"street1": "1 Market St","street2": "Suite 402","city": "San Francisco","state": "CA","postalCode": "94105","country": "US"}}]}' \
https://api.testwyre.com/v3/accounts
# This will return a response like the example below:
# From there, you now have an individual account and will need to
{
"id":"AC_XXXXXXXX",
"status":"OPEN",
"type":"INDIVIDUAL",
"country":"US",
"createdAt":1553287486000,
"depositAddresses":{
"ETH":"0x454045d37c5e1855bad299fdcb5f9ade33ddc875",
"BTC":"1C7ZBdD1222Tea5VUDvWKg6FDEmW1DF6gr"
},
"totalBalances":{
},
"availableBalances":{
},
"profileFields":[
{
"fieldType":"CELLPHONE",
"value":null,
"note":null,
"status":"OPEN",
"fieldId":"individualCellphoneNumber"
},
{
"fieldType":"EMAIL",
"value":"YOUREMAIL@yolo.com",
"note":null,
"status":"OPEN",
"fieldId":"individualEmail"
},
{
"fieldType":"STRING",
"value":"YOUR NAME",
"note":null,
"status":"PENDING",
"fieldId":"individualLegalName"
},
{
"fieldType":"ADDRESS",
"value":{
"street1":"1 Market St",
"street2":"Suite 402",
"city":"San Francisco",
"state":"CA",
"postalCode":"94105",
"country":"US"
},
"note":null,
"status":"PENDING",
"fieldId":"individualResidenceAddress"
},
{
"fieldType":"DOCUMENT",
"value":[
],
"note":null,
"status":"OPEN",
"fieldId":"individualGovernmentId"
},
{
"fieldType":"PAYMENT_METHOD",
"value":null,
"note":"Payment method not yet submitted",
"status":"OPEN",
"fieldId":"individualSourceOfFunds"
},
{
"fieldType":"DOCUMENT",
"value":[
],
"note":null,
"status":"PENDING",
"fieldId":"individualProofOfAddress"
},
{
"fieldType":"STRING",
"value":null,
"note":null,
"status":"OPEN",
"fieldId":"individualSsn"
},
{
"fieldType":"DATE",
"value":null,
"note":null,
"status":"OPEN",
"fieldId":"individualDateOfBirth"
}
]
}
################### Play around with Wyre API ###################
# https://docs.sendwyre.com/docs/general
@JODIN1727
Copy link

Suriyawonh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment