User

This section contains the endpoint for user management. You can also view information from Stripe about this user.

Suspend user

PUT {{BASE_URL}}/admin/api/users/{id}/suspend

Suspend a specific user. When this endpoint is executed, all user resources will be stopped.

Path Parameters

NameTypeDescription

id*

String

User ID

Headers

NameTypeDescription

Api-Key*

String

Admin api key

{
    "_id": "654a093e70c99a149c791faf",
    "status": 1,
    "balance": 0,
    "hubspotContactId": "206501",
    "emailVerified": true,
    "referrer": null,
    "name": "John Doe",
    "email": "john.doe@mail.com",
    "password": "$2b$08$xH5MUKNH7D8ZiNSsN1BBKeMA1dhO8C0ttTRuXiLvcV.SSsCbv60YO",
    "emailVerificationToken": "",
    "stripeId": "cus_OxhNYBXJyLjbnU",
    "createdAt": "2023-11-07T09:54:06.918Z",
    "updatedAt": "2023-11-07T13:26:54.191Z"
}

Activate user

PUT {{BASE_URL}}/admin/api/users/{id}/activate

Resume access to the application for a specific user.

Path Parameters

NameTypeDescription

id*

String

User ID

Headers

NameTypeDescription

Api-Key*

String

Admin api key

{
    "_id": "654a093e70c99a149c791faf",
    "status": 0,
    "balance": 0,
    "hubspotContactId": "206501",
    "emailVerified": true,
    "referrer": null,
    "name": "John Doe",
    "email": "john.doe@mail.com",
    "password": "$2b$08$xH5MUKNH7D8ZiNSsN1BBKeMA1dhO8C0ttTRuXiLvcV.SSsCbv60YO",
    "emailVerificationToken": "",
    "stripeId": "cus_OxhNYBXJyLjbnU",
    "createdAt": "2023-11-07T09:54:06.918Z",
    "updatedAt": "2023-11-07T13:27:37.298Z"
}

Deactivate user

PUT {{BASE_URL}}/admin/api/users/{id}/deactivate

Deactivate a specific user. When this endpoint is executed, all user resources will be deleted. The user will not be able to log in to the application.

Path Parameters

NameTypeDescription

id*

String

User ID

Headers

NameTypeDescription

Api-Key*

String

Admin api key

{
    "_id": "654a093e70c99a149c791faf",
    "status": 2,
    "balance": 0,
    "hubspotContactId": "206501",
    "emailVerified": true,
    "referrer": null,
    "name": "John Doe",
    "email": "john.doe@mail.com",
    "password": "$2b$08$xH5MUKNH7D8ZiNSsN1BBKeMA1dhO8C0ttTRuXiLvcV.SSsCbv60YO",
    "emailVerificationToken": "",
    "stripeId": "cus_OxhNYBXJyLjbnU",
    "createdAt": "2023-11-07T09:54:06.918Z",
    "updatedAt": "2023-11-07T13:28:03.505Z"
}

Delete user

DELETE {{BASE_URL}}/admin/api/users/{id}/delete

Delete a specific user. When this endpoint is executed, all user resources will be deleted.

Path Parameters

NameTypeDescription

id*

String

User ID

Headers

NameTypeDescription

Api-Key*

String

Admin api key

true

Get user payment methods

GET {{BASE_URL}}/admin/api/users/{id}/payment-methods

Get all possible payment methods from a specific user.

Path Parameters

NameTypeDescription

id*

String

User ID

Headers

NameTypeDescription

Api-Key*

String

Admin api key

{
    "object": "list",
    "data": [
        {
            "id": "pm_1O9OCiA0ZUrt0vQJ7GqrPclY",
            "object": "payment_method",
            "billing_details": {
                "address": {
                    "city": "Test",
                    "country": "DE",
                    "line1": "test",
                    "line2": "test",
                    "postal_code": "34334",
                    "state": "Test"
                },
                "email": "john.doe@mail.com",
                "name": "John Doe",
                "phone": null
            },
            "card": {
                "brand": "visa",
                "checks": {
                    "address_line1_check": "pass",
                    "address_postal_code_check": "pass",
                    "cvc_check": "pass"
                },
                "country": "US",
                "exp_month": 2,
                "exp_year": 2032,
                "fingerprint": "YxdxFzhKIAGEnLMN",
                "funding": "credit",
                "generated_from": null,
                "last4": "4242",
                "networks": {
                    "available": [
                        "visa"
                    ],
                    "preferred": null
                },
                "three_d_secure_usage": {
                    "supported": true
                },
                "wallet": null
            },
            "created": 1699259440,
            "customer": "cus_OxIokju2aarNVm",
            "livemode": false,
            "metadata": {},
            "type": "card"
        }
    ],
    "has_more": false,
    "url": "/v1/customers/cus_OxIokju2aarNVm/payment_methods"
}

Get STRIPE customer

GET {{BASE_URL}}/admin/api/users/{id}/retrieve

Retrieves a Customer object.

Path Parameters

NameTypeDescription

id*

String

User ID

Headers

NameTypeDescription

Api-Key*

String

Admin api key

{
    "id": "cus_OxIokju2aarNVm",
    "object": "customer",
    "address": {
        "city": "Test",
        "country": "Afghanistan",
        "line1": "Test",
        "line2": "test1",
        "postal_code": "34334",
        "state": "Test"
    },
    "balance": 0,
    "created": 1699259424,
    "currency": "usd",
    "default_source": null,
    "delinquent": false,
    "description": null,
    "discount": null,
    "email": "john.doe@mail.com",
    "invoice_prefix": "B96FCFF5",
    "invoice_settings": {
        "custom_fields": null,
        "default_payment_method": "pm_1O9OCiA0ZUrt0vQJ7GqrPclY",
        "footer": null,
        "rendering_options": null
    },
    "livemode": false,
    "metadata": {},
    "name": "John Doe",
    "phone": null,
    "preferred_locales": [],
    "shipping": null,
    "tax_exempt": "none",
    "test_clock": null
}

Last updated