API
Admin Resources

Accounts

This resource allows a caller to inspect basic information regarding the staff accounts in the store.

17 additions in V2, marked New

Everything marked New also works when you send X-Recharge-Version: 2021-11.

How Accounts relate to other resources

#The account object

An Account record represents a staff account details for the Store. One Store can have many staff's account.

Attributes

  • idinteger
    Unique numeric identifier for the Account.
  • user_idinteger
    The unique numeric identifier of the user associated to the Account.
    There can only be one Account per user per Store.
  • created_atdatetime
    The date and time when the Account was created.
  • invited_atdatetime
    The date and time the user was last invited to open their Account
    null for the store creator.
    If an invite to open an Account is re-issued for a user, invited_at will hold the timestamp of the most recent invite sent.
  • is_ownerboolean
    Flags whether this user is the store owner.
    A Store can have multiple owners.
  • last_login_atdatetime · nullableNew
    The date and time the user last logged in to the Account.
  • role_associationstring · nullableNew
    The role association recorded for the user of the Account.
  • role_departmentstring · nullableNew
    The department recorded for the user of the Account.
  • role_titlestring · nullableNew
    The job title recorded for the user of the Account.
  • role_partner_detailsobject · nullableNew
    An object with partner details recorded for the user of the Account.
  • permissionsarrayNew
    List of permission keys granted to the Account.
    Only returned for stores that have account permissions enabled in Accounts API responses.
  • includeobjectNew
    Related objects requested with the include query parameter.
    Only returned when the include query parameter is passed.
    Show child attributesHide child attributes11 new
    • storeobjectNew
      The Store the Account belongs to.
      Only returned when include=store is passed.
The account object
{
  "account": {
    "id": 3315125,
    "user_id": 2057785,
    "created_at": "2021-07-20T09:10:19+00:00",
    "invited_at": "2021-07-18T09:10:19+00:00",
    "is_owner": false,
    "last_login_at": null,
    "role_association": null,
    "role_department": null,
    "role_title": null,
    "role_partner_details": null
  }
}

#Retrieve an account

GET/accounts/{id}
Retrieves an account for the store.
Scoperead_accounts

Query parameters

  • includestringNew
    Include related objects in the response. Use store to embed the Store the Account belongs to under include.store.
    Possible values
    store
GET/accounts/{id}
curl 'https://api.rechargeapps.com/accounts/331512' \
  -H 'X-Recharge-Version: v2' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "account": {
    "id": 3315125,
    "user_id": 2057785,
    "created_at": "2021-07-20T09:10:19+00:00",
    "invited_at": "2021-07-18T09:10:19+00:00",
    "is_owner": false,
    "last_login_at": null,
    "role_association": null,
    "role_department": null,
    "role_title": null,
    "role_partner_details": null
  }
}

#List accounts

GET/accounts
Returns all accounts associated to the store.
Scoperead_accounts
The response includes next_cursor and previous_cursor.

Query parameters

  • user_idintegerNew
    Filter accounts by the unique numeric identifier of the associated user.
  • is_ownerbooleanNew
    Filter accounts by whether the user is the store owner.
  • When passed together with email_search, store owner accounts are returned in addition to the accounts matching the search.
  • includestringNew
    Include related objects in the response. Use store to embed the Store the Account belongs to under include.store.
    Possible values
    store
  • limitintegerNew
    Number of results to return. Defaults to 50; the maximum is 250.
  • pageintegerNew
    Page to show. Cannot be greater than 300. Page-based pagination can be disabled for a token, in which case cursors must be used.
  • cursorstringNew
    Return either the next or previous page of accounts using the next_cursor or previous_cursor value from a previous response. When cursor is passed, only limit may be passed with it.
GET/accounts
curl 'https://api.rechargeapps.com/accounts?limit=3' \
  -H 'X-Recharge-Version: v2' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "accounts": [
    {
      "id": 3315125,
      "user_id": 2057785,
      "created_at": "2021-07-20T09:10:19+00:00",
      "invited_at": "2021-07-18T09:10:19+00:00",
      "is_owner": false,
      "last_login_at": null,
      "role_association": null,
      "role_department": null,
      "role_title": null,
      "role_partner_details": null
    },
    {
      "id": 3316125,
      "user_id": 2056785,
      "created_at": "2021-05-20T09:10:19+00:00",
      "invited_at": null,
      "is_owner": true,
      "last_login_at": null,
      "role_association": null,
      "role_department": null,
      "role_title": null,
      "role_partner_details": null
    }
  ]
}