Buyer

A Buyer is just an alias of a User.

GET a list of buyers

Query a list of buyers. 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 buyers example

curl /v2/buyers?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 buyers by ID

Query a buyers object by ID.

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

Get a single buyers example

curl /v2/buyers/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": "buyer ID on payment gateway",
    "credential": "payment gateway auth",
    "misc": ""
}

POST a buyers

Create a buyers entity.

Field Type Description
xid int MisAuth buyer'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 buyer 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 buyers:

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

Successful return:

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

PUT a buyers

Update a buyers entity.

Update a buyers example

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

Successful return:

{
    "status": "OK"
}

DELETE a buyers

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

Delete a buyers example

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

Successful return:

{
    "status": "OK"
}

results matching ""

    No results matching ""