Creating Users

There are multiple ways we can create and use Users to store and track User information. We can create a user with multiple pieces of information filled out or we can do this in multiple steps with multiple API calls.

Creating a User with Data Attached

When creating a user, we can specify the blockchains, profile fields, and the scope of the KYC check all in the same request

curl --location --request POST 'https://api.testwyre.com/v3/users' \
--header 'Authorization: Bearer SK-XXX-XXXXX-XXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "blockchains": [
        "ALGO"
    ],
    "immediate": false,
    "fields": {
        "firstName": "Deandre",
        "lastName": "Renoylds",
        "residenceAddress": {
            "street1": "1 Sunny Dr",
            "city": "Philadelphia",
            "state": "PA",
            "postalCode": "55555",
            "country": "US"
        },
        "dateOfBirth": "1990-01-01"
    },
    "scopes": [
        "TRANSFER"
    ]
}'
{
    "id": "US_QYAFJ98CQP7",
    "status": "APPROVED",
    "partnerId": "PT_UUEJLH74VEN",
    "type": "INDIVIDUAL",
    "createdAt": 1647322628036,
    "depositAddresses": {
        "ALGO": "K4AB4GLDITQKP54EJ5BDYOXIUU4JN3SJGQBDKNLCB22BCVKXKZYL5HYV3A"
    },
    "totalBalances": {},
    "availableBalances": {},
    "fields": {
        "firstName": {
            "value": "Deandre",
            "error": null,
            "status": "SUBMITTED"
        },
        "lastName": {
            "value": "Renoylds",
            "error": null,
            "status": "SUBMITTED"
        },
        "dateOfBirth": {
            "value": "1990-01-01",
            "error": null,
            "status": "SUBMITTED"
        },
        "residenceAddress": {
            "value": {
                "street1": "1 Sunny Dr",
                "city": "Philadelphia",
                "state": "PA",
                "postalCode": "55555",
                "country": "US"
            },
            "error": null,
            "status": "SUBMITTED"
        }
    }
}

Creating a User In Multiple Steps

We can generate a user with as many or with as little fields as possible depending on the use case that fits your needs.

curl --location --request POST 'https://api.testwyre.com/v3/users' \
--header 'Authorization: Bearer SK-XXX-XXXXX-XXXXXX' \
--data-raw ''
{
    "id": "US_3NJVALZ8CFH", //user id
    "status": "PENDING",
    "partnerId": "PT_UUEJLH74VEN", //your partner id
    "type": "INDIVIDUAL",
    "createdAt": 1647282723793,
    "depositAddresses": {},
    "totalBalances": {},
    "availableBalances": {},
    "fields": {}
}

Blank users with no specific scopes specified will qualify for all scopes that the partner is enrolled in.

Adding Data to a User's Profile

Data can be added to a user's profile at anytime using the update endpoint.

curl --location --request POST 'https://api.testwyre.com/v3/users/US_3NJVALZ8CFH' \
--header 'Authorization: Bearer SK-XXX-XXXXX-XXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "fields":{
        "firstName": "Demo",
        "lastName": "Test",
        "email": "[email protected]"
    }
}'
{
    "id": "US_3NJVALZ8CFH",
    "status": "APPROVED",
    "partnerId": "PT_UUEJLH74VEN",
    "type": "INDIVIDUAL",
    "createdAt": 1647282723793,
    "depositAddresses": {},
    "totalBalances": {},
    "availableBalances": {},
    "fields": {
        "legalName": {
            "value": null,
            "error": "Missing legalName",
            "status": "OPEN"
        },
        "firstName": {
            "value": "Demo",
            "error": null,
            "status": "SUBMITTED"
        },
        "lastName": {
            "value": "Test",
            "error": null,
            "status": "SUBMITTED"
        },
        "cellphoneNumber": {
            "value": null,
            "error": "Missing cellphoneNumber",
            "status": "OPEN"
        },
        "email": {
            "value": "[email protected]",
            "error": null,
            "status": "SUBMITTED"
        },
        "residenceAddress": {
            "value": null,
            "error": "Missing residenceAddress",
            "status": "OPEN"
        },
        "ssn": {
            "value": "REDACTED",
            "error": "Missing ssn",
            "status": "OPEN"
        }
    }
}

Adding Blockchain Addresses to a User

You can add blockchain addresses to users using our attach blockchain API service after creating them.

curl --location --request POST 'https://api.testwyre.com/v3/blockchain/attach' \
--header 'Authorization: Bearer SK-XXX-XXXXX-XXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "targetSrn" : "user:US_3NJVALZ8CFH",
    "blockchain": "ETH"
}'
{
    "ETH": "0x1099f9a39534f0cc2c242e073c0b690a553a5a9f"
}