User

A User can be a buyer, a merchant/seller owner, a manager or admin.

GET a list of users

Query a list of users. Parameters for pagination, query condition and sort order can be used for this method, see pagination and query pages for details.

Get a list of users example

curl /v2/users?page=1&per_page=20&filter=&sort=  -H "X-Api-Key:.." -H "Authorization:JWT .."

Successful return object:

{
    "page": 1,
    "per_page": 20,
    "data": []
}

GET a single users by ID

Query a users object by ID.

User roles: |Role|Description| |-|-| |B|Buyer| |M|Manager of a seller| |A|System Admin|

Get a single users example

curl /v2/users/1 -H "X-Api-Key:.." -H "Authorization:JWT .."

Successful return object:

{
    "id": 12,
    "xid": 1234,
    "first_name": "Adam",
    "last_name": "Alton",
    "email": "",
    "role": "B",
    "pay_id": "user ID on payment gateway",
    "credential": "payment gateway auth",
    "misc": ""
}

POST a users

Create a users entity.

Field Type Description
xid int MisAuth user's ID
first_name string
last_name string
email string
birthday string yyyy-mm-dd
country string country of residence like 'US'
nationality string 'US'
address string JSON text *
role string Buyer,Manager,or Admin
pay_id string Gateway user ID
credential string JSON object if any
misc string

*Address object:

Field Description
line1 flat, number
line2 street
city
county
country US
postcode

A buyer example:

{
    "xid": 1234,
    "first_name": "Adam",
    "last_name": "Wen",
    "email": "A@test.com",
    "birthday": "1999-01-01",
    "country": "GB",
    "nationality": "GB",
    "address": {
        "line1": "",
        "line2": "",
        "city": "Edinburgh",
        "county": "Midlothian",
        "country": "GB",
        "postcode": "EE1FF2"
    }
}

POST to create a users:

curl -X POST -d '{"xid":100,"first_name":"Ted"}' /v2/users -H "X-Api-Key:.." -H "Authorization:JWT .."

Successful return:

{
    "status": "OK",
    "id": 123
}

PUT a users

Update a users entity.

Update a users example

curl -X PUT -d '{"email":"make@it.so"}' /v2/users/1 -H "X-Api-Key:.." -H "Authorization:JWT .."

Successful return:

{
    "status": "OK"
}

DELETE a users

Delete a users entity. Only system admin role can make this request.

Delete a users example

curl -X DELETE /v2/users/1 -H "X-Api-Key:.." -H "Authorization:JWT .."

Successful return:

{
    "status": "OK"
}

results matching ""

    No results matching ""