Developer : Users

Manage applications

The /users resource contains information about users that can be logged into a store. See Creating users for how to create users with the Goodsie API.

Resource URI

/api/v1/users

Method Scope Required
GET admin
POST admin

Properties

Property Methods Description
email GET, PUT, POST The email the user logs in with. Must be unique when compared to all other goodsie accounts
id GET The unique id of the user
password PUT, POST The password the user logs in with. Do not set passwords unless accessing the API with https. When not provided during user creation, a password-setting welcome email is automatically sent to the provided email address.
permissions GET, PUT, POST A list of permissions the user has. These determine what the user can do within the store. Select permissions from 'manage_orders', 'manage_products', 'manage_store_settings', 'manage_marketing', 'manage_users', 'view_stats'. If not provided when creating a user, the default is all permissions.

Subresources

Methods Path Description
GET, PUT, DELETE /api/v1/users/{id} A user

Example

curl -H "Authorization: Bearer ba125ac086" \
    https://goodsie.com/api/v1/users
[
    {
        'email': 'main-user@example.com',
        'id': 51537,
        'is_active': true,
        'permissions': [
            'manage_orders',
            'manage_products',
            'manage_store_settings',
            'manage_marketing',
            'manage_users',
            'view_stats'
        ]
    },
    {
        'email': 'sub-user@example.com',
        'id': 51538,
        'is_active': true,
        'permissions': [
            'view_stats'
        ]
    }
]

Creating users

To create a user, you must provide an email address. If a password has not been provided, goodsie will automatically send a password-setting welcome email. If permissions have not been provided, the user will be created wtih all permissions.

curl -H "Authorization: Bearer 5b3d4a9a09" -X POST \
    -F 'email=sub-user@example.com' \
    -F 'password=supersecure' \
    -F 'permissions=["view_stats"]' \
    https://goodsie.com/api/v1/users
{
    'email': 'sub-user@example.com',
    'id': 51538,
    'is_active': true,
    'permissions': [
        'view_stats'
    ]
}