%PDF- %PDF-
Direktori : /proc/self/root/usr/lib/node_modules/pm2/node_modules/@pm2/js-api/docs/ |
Current File : //proc/self/root/usr/lib/node_modules/pm2/node_modules/@pm2/js-api/docs/User.html |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>User - Documentation</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc.css"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav> <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="Actions.html">Actions</a><ul class='methods'><li data-type='method'><a href="Actions.html#triggerAction">triggerAction</a></li><li data-type='method'><a href="Actions.html#triggerPM2Action">triggerPM2Action</a></li><li data-type='method'><a href="Actions.html#triggerScopedAction">triggerScopedAction</a></li></ul></li><li><a href="Auth.html">Auth</a><ul class='methods'><li data-type='method'><a href="Auth.html#register">register</a></li><li data-type='method'><a href="Auth.html#revoke">revoke</a></li></ul></li><li><a href="Bucket.html">Bucket</a><ul class='methods'><li data-type='method'><a href="Bucket.html#claimTrial">claimTrial</a></li><li data-type='method'><a href="Bucket.html#destroy">destroy</a></li><li data-type='method'><a href="Bucket.html#removeInvitation">removeInvitation</a></li><li data-type='method'><a href="Bucket.html#removeUser">removeUser</a></li><li data-type='method'><a href="Bucket.html#retrieveCharges">retrieveCharges</a></li><li data-type='method'><a href="Bucket.html#sendFeedback">sendFeedback</a></li><li data-type='method'><a href="Bucket.html#setNotificationState">setNotificationState</a></li><li data-type='method'><a href="Bucket.html#setUserRole">setUserRole</a></li><li data-type='method'><a href="Bucket.html#transferOwnership">transferOwnership</a></li><li data-type='method'><a href="Bucket.html#update">update</a></li><li data-type='method'><a href="Bucket.html#updateUserOptions">updateUserOptions</a></li></ul></li><li><a href="Bucket.alert.html">alert</a><ul class='methods'><li data-type='method'><a href="Bucket.alert.html#create">create</a></li><li data-type='method'><a href="Bucket.alert.html#delete">delete</a></li><li data-type='method'><a href="Bucket.alert.html#deleteEvent">deleteEvent</a></li><li data-type='method'><a href="Bucket.alert.html#get">get</a></li><li data-type='method'><a href="Bucket.alert.html#list">list</a></li><li data-type='method'><a href="Bucket.alert.html#sendReport">sendReport</a></li><li data-type='method'><a href="Bucket.alert.html#triggerSample">triggerSample</a></li><li data-type='method'><a href="Bucket.alert.html#update">update</a></li><li data-type='method'><a href="Bucket.alert.html#updateAlert">updateAlert</a></li><li data-type='method'><a href="Bucket.alert.html#updateSlack">updateSlack</a></li><li data-type='method'><a href="Bucket.alert.html#updateWebhooks">updateWebhooks</a></li></ul></li><li><a href="Bucket.alert.analyzer.html">analyzer</a><ul class='methods'><li data-type='method'><a href="Bucket.alert.analyzer.html#editState">editState</a></li><li data-type='method'><a href="Bucket.alert.analyzer.html#list">list</a></li><li data-type='method'><a href="Bucket.alert.analyzer.html#updateConfig">updateConfig</a></li></ul></li><li><a href="Bucket.application.html">application</a><ul class='methods'><li data-type='method'><a href="Bucket.application.html#create">create</a></li><li data-type='method'><a href="Bucket.application.html#delete">delete</a></li><li data-type='method'><a href="Bucket.application.html#get">get</a></li><li data-type='method'><a href="Bucket.application.html#getPreview">getPreview</a></li><li data-type='method'><a href="Bucket.application.html#getReports">getReports</a></li><li data-type='method'><a href="Bucket.application.html#list">list</a></li><li data-type='method'><a href="Bucket.application.html#update">update</a></li></ul></li><li><a href="Bucket.billing.html">billing</a><ul class='methods'><li data-type='method'><a href="Bucket.billing.html#attachBankAccount">attachBankAccount</a></li><li data-type='method'><a href="Bucket.billing.html#attachCreditCard">attachCreditCard</a></li><li data-type='method'><a href="Bucket.billing.html#deleteBankAccount">deleteBankAccount</a></li><li data-type='method'><a href="Bucket.billing.html#deleteCreditCard">deleteCreditCard</a></li><li data-type='method'><a href="Bucket.billing.html#fetchBankAccount">fetchBankAccount</a></li><li data-type='method'><a href="Bucket.billing.html#fetchCreditCard">fetchCreditCard</a></li><li data-type='method'><a href="Bucket.billing.html#fetchCreditCards">fetchCreditCards</a></li><li data-type='method'><a href="Bucket.billing.html#fetchDefaultCreditCard">fetchDefaultCreditCard</a></li><li data-type='method'><a href="Bucket.billing.html#fetchMetadata">fetchMetadata</a></li><li data-type='method'><a href="Bucket.billing.html#getInvoices">getInvoices</a></li><li data-type='method'><a href="Bucket.billing.html#getReceipts">getReceipts</a></li><li data-type='method'><a href="Bucket.billing.html#getSubcription">getSubcription</a></li><li data-type='method'><a href="Bucket.billing.html#getSubcriptionState">getSubcriptionState</a></li><li data-type='method'><a href="Bucket.billing.html#paymentIntentSucceed">paymentIntentSucceed</a></li><li data-type='method'><a href="Bucket.billing.html#setDefaultCard">setDefaultCard</a></li><li data-type='method'><a href="Bucket.billing.html#startTrial">startTrial</a></li><li data-type='method'><a href="Bucket.billing.html#subscribe">subscribe</a></li><li data-type='method'><a href="Bucket.billing.html#updateCreditCard">updateCreditCard</a></li><li data-type='method'><a href="Bucket.billing.html#updateMetadata">updateMetadata</a></li></ul></li><li><a href="Bucket.server.html">server</a><ul class='methods'><li data-type='method'><a href="Bucket.server.html#deleteServer">deleteServer</a></li></ul></li><li><a href="Bucket.webcheck.html">webcheck</a><ul class='methods'><li data-type='method'><a href="Bucket.webcheck.html#create">create</a></li><li data-type='method'><a href="Bucket.webcheck.html#delete">delete</a></li><li data-type='method'><a href="Bucket.webcheck.html#get">get</a></li><li data-type='method'><a href="Bucket.webcheck.html#getMetrics">getMetrics</a></li><li data-type='method'><a href="Bucket.webcheck.html#list">list</a></li><li data-type='method'><a href="Bucket.webcheck.html#listMetrics">listMetrics</a></li><li data-type='method'><a href="Bucket.webcheck.html#listRegions">listRegions</a></li><li data-type='method'><a href="Bucket.webcheck.html#update">update</a></li></ul></li><li><a href="Dashboard.html">Dashboard</a><ul class='methods'><li data-type='method'><a href="Dashboard.html#create">create</a></li><li data-type='method'><a href="Dashboard.html#remove">remove</a></li><li data-type='method'><a href="Dashboard.html#retrieve">retrieve</a></li><li data-type='method'><a href="Dashboard.html#retrieveAll">retrieveAll</a></li><li data-type='method'><a href="Dashboard.html#update">update</a></li></ul></li><li><a href="Data.dependencies.html">dependencies</a><ul class='methods'><li data-type='method'><a href="Data.dependencies.html#retrieve">retrieve</a></li></ul></li><li><a href="Data.events.html">events</a><ul class='methods'><li data-type='method'><a href="Data.events.html#deleteAll">deleteAll</a></li><li data-type='method'><a href="Data.events.html#retrieve">retrieve</a></li><li data-type='method'><a href="Data.events.html#retrieveHistogram">retrieveHistogram</a></li><li data-type='method'><a href="Data.events.html#retrieveMetadatas">retrieveMetadatas</a></li></ul></li><li><a href="Data.issues.html">issues</a><ul class='methods'><li data-type='method'><a href="Data.issues.html#delete">delete</a></li><li data-type='method'><a href="Data.issues.html#deleteAll">deleteAll</a></li><li data-type='method'><a href="Data.issues.html#findOccurences">findOccurences</a></li><li data-type='method'><a href="Data.issues.html#getReplay">getReplay</a></li><li data-type='method'><a href="Data.issues.html#list">list</a></li><li data-type='method'><a href="Data.issues.html#listOccurencesForIdentifier">listOccurencesForIdentifier</a></li><li data-type='method'><a href="Data.issues.html#retrieveHistogram">retrieveHistogram</a></li><li data-type='method'><a href="Data.issues.html#search">search</a></li><li data-type='method'><a href="Data.issues.html#summary">summary</a></li></ul></li><li><a href="Data.logs.html">logs</a><ul class='methods'><li data-type='method'><a href="Data.logs.html#retrieve">retrieve</a></li><li data-type='method'><a href="Data.logs.html#retrieveHistogram">retrieveHistogram</a></li></ul></li><li><a href="Data.metrics.html">metrics</a><ul class='methods'><li data-type='method'><a href="Data.metrics.html#retrieveAggregations">retrieveAggregations</a></li><li data-type='method'><a href="Data.metrics.html#retrieveHistogram">retrieveHistogram</a></li><li data-type='method'><a href="Data.metrics.html#retrieveList">retrieveList</a></li><li data-type='method'><a href="Data.metrics.html#retrieveMetadatas">retrieveMetadatas</a></li></ul></li><li><a href="Data.notifications.html">notifications</a><ul class='methods'><li data-type='method'><a href="Data.notifications.html#list">list</a></li><li data-type='method'><a href="Data.notifications.html#retrieve">retrieve</a></li></ul></li><li><a href="Data.outliers.html">outliers</a><ul class='methods'><li data-type='method'><a href="Data.outliers.html#retrieve">retrieve</a></li></ul></li><li><a href="Data.processes.html">processes</a><ul class='methods'><li data-type='method'><a href="Data.processes.html#retrieveDeployments">retrieveDeployments</a></li><li data-type='method'><a href="Data.processes.html#retrieveEvents">retrieveEvents</a></li></ul></li><li><a href="Data.profiling.html">profiling</a><ul class='methods'><li data-type='method'><a href="Data.profiling.html#delete">delete</a></li><li data-type='method'><a href="Data.profiling.html#download">download</a></li><li data-type='method'><a href="Data.profiling.html#list">list</a></li><li data-type='method'><a href="Data.profiling.html#retrieve">retrieve</a></li></ul></li><li><a href="Data.status.html">status</a><ul class='methods'><li data-type='method'><a href="Data.status.html#retrieve">retrieve</a></li><li data-type='method'><a href="Data.status.html#retrieveBlacklisted">retrieveBlacklisted</a></li></ul></li><li><a href="Data.traces.html">traces</a><ul class='methods'><li data-type='method'><a href="Data.traces.html#getDurationAvg">getDurationAvg</a></li><li data-type='method'><a href="Data.traces.html#getHistogramByTag">getHistogramByTag</a></li><li data-type='method'><a href="Data.traces.html#getServices">getServices</a></li><li data-type='method'><a href="Data.traces.html#getTags">getTags</a></li><li data-type='method'><a href="Data.traces.html#getTagsValue">getTagsValue</a></li><li data-type='method'><a href="Data.traces.html#list">list</a></li><li data-type='method'><a href="Data.traces.html#retrieve">retrieve</a></li></ul></li><li><a href="Data.transactions.html">transactions</a><ul class='methods'><li data-type='method'><a href="Data.transactions.html#delete">delete</a></li><li data-type='method'><a href="Data.transactions.html#retrieveHistogram">retrieveHistogram</a></li><li data-type='method'><a href="Data.transactions.html#retrieveSummary">retrieveSummary</a></li></ul></li><li><a href="Misc.html">Misc</a><ul class='methods'><li data-type='method'><a href="Misc.html#listChangelogArticles">listChangelogArticles</a></li><li data-type='method'><a href="Misc.html#retrieveCompany">retrieveCompany</a></li><li data-type='method'><a href="Misc.html#retrieveCoupon">retrieveCoupon</a></li><li data-type='method'><a href="Misc.html#retrieveNodeRelease">retrieveNodeRelease</a></li><li data-type='method'><a href="Misc.html#retrievePlans">retrievePlans</a></li><li data-type='method'><a href="Misc.html#retrievePM2Version">retrievePM2Version</a></li><li data-type='method'><a href="Misc.html#retrieveVAT">retrieveVAT</a></li></ul></li><li><a href="Node.html">Node</a><ul class='methods'><li data-type='method'><a href="Node.html#getDefaultNode">getDefaultNode</a></li></ul></li><li><a href="Orchestration.html">Orchestration</a><ul class='methods'><li data-type='method'><a href="Orchestration.html#selfSend">selfSend</a></li></ul></li><li><a href="Tokens.html">Tokens</a><ul class='methods'><li data-type='method'><a href="Tokens.html#create">create</a></li><li data-type='method'><a href="Tokens.html#remove">remove</a></li><li data-type='method'><a href="Tokens.html#retrieve">retrieve</a></li></ul></li><li><a href="User.html">User</a><ul class='methods'><li data-type='method'><a href="User.html#attachCreditCard">attachCreditCard</a></li><li data-type='method'><a href="User.html#delete">delete</a></li><li data-type='method'><a href="User.html#deleteCreditCard">deleteCreditCard</a></li><li data-type='method'><a href="User.html#fetchCreditCard">fetchCreditCard</a></li><li data-type='method'><a href="User.html#fetchDefaultCreditCard">fetchDefaultCreditCard</a></li><li data-type='method'><a href="User.html#fetchMetadata">fetchMetadata</a></li><li data-type='method'><a href="User.html#listCharges">listCharges</a></li><li data-type='method'><a href="User.html#listSubscriptions">listSubscriptions</a></li><li data-type='method'><a href="User.html#setDefaultCard">setDefaultCard</a></li><li data-type='method'><a href="User.html#show">show</a></li><li data-type='method'><a href="User.html#update">update</a></li><li data-type='method'><a href="User.html#updateCreditCard">updateCreditCard</a></li><li data-type='method'><a href="User.html#updateMetadata">updateMetadata</a></li></ul></li><li><a href="User.otp.html">otp</a><ul class='methods'><li data-type='method'><a href="User.otp.html#disable">disable</a></li><li data-type='method'><a href="User.otp.html#enable">enable</a></li><li data-type='method'><a href="User.otp.html#retrieve">retrieve</a></li></ul></li><li><a href="User.providers.html">providers</a><ul class='methods'><li data-type='method'><a href="User.providers.html#add">add</a></li><li data-type='method'><a href="User.providers.html#remove">remove</a></li><li data-type='method'><a href="User.providers.html#retrieve">retrieve</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#setupServer">setupServer</a></li></ul> </nav> <div id="main"> <h1 class="page-title">User</h1> <section> <header> <h2> User </h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Namespaces</h3> <dl> <dt><a href="User.otp.html">otp</a></dt> <dd></dd> <dt><a href="User.providers.html">providers</a></dt> <dd></dd> </dl> <h3 class="subsection-title">Members</h3> <h4 class="name" id="retrieve"><span class="type-signature">(route) </span>retrieve<span class="type-signature"></span></h4> <dl class="details"> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/isLogged</td> </tr> </table> Retrieve user metadata <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">user</td> <td class="type">Object</td> <td class="description last">user model</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">200</td> <td class="description last">the user has been retrieved</td> </tr> </table> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="attachCreditCard"><span class="type-signature">(route) </span>attachCreditCard<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">POST</td> <td class="name last">/api/users/payment/</td> </tr> </table> Add a credit card to the user account <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Body Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">token</td> <td class="type">String</td> <td class="description last">card token generated by stripe</td> </tr> </table> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Object</td> <td class="description last">stripe credit card Object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">400</td> <td class="description last">missing parameters</td> </tr><tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully added the card</td> </tr> </table> </div> <h4 class="name" id="delete"><span class="type-signature">(route) </span>delete<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">DELETE</td> <td class="name last">/api/users/delete</td> </tr> </table> Delete the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">.</td> <td class="type">Object</td> <td class="description last">user object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">database error</td> </tr><tr> <td class="type">403</td> <td class="description last">permission denied (hold buckets)</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully deleted the user</td> </tr> </table> </div> <h4 class="name" id="deleteCreditCard"><span class="type-signature">(route) </span>deleteCreditCard<span class="signature">(:card_id)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">DELETE</td> <td class="name last">/api/users/payment/card/:card_id</td> </tr> </table> Delete a specific credit card of the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Route Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">:card_id</td> <td class="type">String</td> <td class="description last">the stripe id of the card</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">.</td> <td class="type">Object</td> <td class="description last">stripe card object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters card_id</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retieved the card</td> </tr><tr> <td class="type">403</td> <td class="description last">the user must have one card active when having a subscription</td> </tr> </table> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>:card_id</code></td> <td class="type"> </td> <td class="description last">the stripe id of the card</td> </tr> </tbody> </table> <h4 class="name" id="fetchCreditCard"><span class="type-signature">(route) </span>fetchCreditCard<span class="signature">(:card_id)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/payment/card/:card_id</td> </tr> </table> Fetch a specific credit card of the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Route Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">:card_id</td> <td class="type">String</td> <td class="description last">the stripe id of the card</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">stripe card object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters card_id</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retieved the card</td> </tr> </table> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>:card_id</code></td> <td class="type"> </td> <td class="description last">the stripe id of the card</td> </tr> </tbody> </table> <h4 class="name" id="fetchDefaultCreditCard"><span class="type-signature">(route) </span>fetchDefaultCreditCard<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/payment/card</td> </tr> </table> Fetch the default credit card of the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">stripe card object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">404</td> <td class="description last">the user doesn't have any default card</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retieved the card</td> </tr> </table> </div> <h4 class="name" id="fetchMetadata"><span class="type-signature">(route) </span>fetchMetadata<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/payment/card/stripe_metadata</td> </tr> </table> Fetch stripe metadata for a user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">.</td> <td class="type">Object</td> <td class="description last">stripe metadata object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters card_id</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retrieved the metadata</td> </tr> </table> </div> <h4 class="name" id="listCharges"><span class="type-signature">(route) </span>listCharges<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/payment/charges</td> </tr> </table> List the charges that the user have <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">list of stripe charges object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retieved the charges</td> </tr> </table> </div> <h4 class="name" id="listSubscriptions"><span class="type-signature">(route) </span>listSubscriptions<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/payment/subcriptions</td> </tr> </table> List the subscriptions that the user have <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">list of stripe subscriptions object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retrieved the charges</td> </tr> </table> </div> <h4 class="name" id="setDefaultCard"><span class="type-signature">(route) </span>setDefaultCard<span class="signature">(:card_id)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">POST</td> <td class="name last">/api/users/payment/card/:card_id/default</td> </tr> </table> Set a specific credit card as the user default card <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Route Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">:card_id</td> <td class="type">String</td> <td class="description last">the stripe id of the card</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Object</td> <td class="description last">stripe card object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters card_id</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully set the card as default</td> </tr> </table> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>:card_id</code></td> <td class="type"> </td> <td class="description last">the stripe id of the card</td> </tr> </tbody> </table> <h4 class="name" id="show"><span class="type-signature">(route) </span>show<span class="signature">(:id)</span><span class="type-signature"></span></h4> <dl class="details"> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/show/:id</td> </tr> </table> Show public data about a user <h5>Route Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">:id</td> <td class="type">String</td> <td class="description last">user id</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">String</td> <td class="type"></td> <td class="description last">email user email</td> </tr><tr> <td class="name">String</td> <td class="type"></td> <td class="description last">username user pseudo</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">database error</td> </tr><tr> <td class="type">400</td> <td class="description last">invalid parameters (no id provided)</td> </tr><tr> <td class="type">404</td> <td class="description last">no user account where found</td> </tr><tr> <td class="type">200</td> <td class="description last">the mail has been sent to the provided email</td> </tr> </table> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>:id</code></td> <td class="type"> </td> <td class="description last">user id</td> </tr> </tbody> </table> <h4 class="name" id="update"><span class="type-signature">(route) </span>update<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">POST</td> <td class="name last">/api/users/update</td> </tr> </table> Update metadata about the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Body Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">username</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">email</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">old_password</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">new_password</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">info</td> <td class="type">Object</td> <td class="attributes">optional</td> <td class="description last"></td> </tr> </table> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">.</td> <td class="type">Object</td> <td class="description last">user object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">database error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters, no data to update</td> </tr><tr> <td class="type">403</td> <td class="description last">when updating the password, it need a new one</td> </tr><tr> <td class="type">406</td> <td class="description last">when updating the password, the old one is false</td> </tr><tr> <td class="type">409</td> <td class="description last">when updating email or username another user already have one of those two</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully updated the card</td> </tr> </table> </div> <h4 class="name" id="updateCreditCard"><span class="type-signature">(route) </span>updateCreditCard<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">PUT</td> <td class="name last">/api/users/payment/card</td> </tr> </table> Update a credit card of the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Body Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">id</td> <td class="type">String</td> <td class="attributes"></td> <td class="description last">stripe card id</td> </tr><tr> <td class="name">metadata</td> <td class="type">Object</td> <td class="attributes">optional</td> <td class="description last">the metadata you can update</td> </tr><tr> <td class="name">metadata.address_line1</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">metadata.address_country</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">metadata.address_zip</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">metadata.address_city</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr> </table> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">stripe card object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters, you need to specify a card</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully updated the card</td> </tr> </table> </div> <h4 class="name" id="updateMetadata"><span class="type-signature">(route) </span>updateMetadata<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">PUT</td> <td class="name last">/api/users/payment/stripe_metadata</td> </tr> </table> Update a stripe metadata of the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Body Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">metadata</td> <td class="type">Object</td> <td class="attributes"></td> <td class="description last">the metadata you can update</td> </tr><tr> <td class="name">metadata.vat_number</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">metadata.company_name</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr> </table> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">stripe customer metadata object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters, you need to specify a card</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully updated the card</td> </tr> </table> </div> </article> </section> <section> <header> <h2> User </h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Namespaces</h3> <dl> <dt><a href="User.otp.html">otp</a></dt> <dd></dd> <dt><a href="User.providers.html">providers</a></dt> <dd></dd> </dl> <h3 class="subsection-title">Members</h3> <h4 class="name" id="retrieve"><span class="type-signature">(route) </span>retrieve<span class="type-signature"></span></h4> <dl class="details"> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/isLogged</td> </tr> </table> Retrieve user metadata <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">user</td> <td class="type">Object</td> <td class="description last">user model</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">200</td> <td class="description last">the user has been retrieved</td> </tr> </table> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="attachCreditCard"><span class="type-signature">(route) </span>attachCreditCard<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">POST</td> <td class="name last">/api/users/payment/</td> </tr> </table> Add a credit card to the user account <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Body Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">token</td> <td class="type">String</td> <td class="description last">card token generated by stripe</td> </tr> </table> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Object</td> <td class="description last">stripe credit card Object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">400</td> <td class="description last">missing parameters</td> </tr><tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully added the card</td> </tr> </table> </div> <h4 class="name" id="delete"><span class="type-signature">(route) </span>delete<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">DELETE</td> <td class="name last">/api/users/delete</td> </tr> </table> Delete the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">.</td> <td class="type">Object</td> <td class="description last">user object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">database error</td> </tr><tr> <td class="type">403</td> <td class="description last">permission denied (hold buckets)</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully deleted the user</td> </tr> </table> </div> <h4 class="name" id="deleteCreditCard"><span class="type-signature">(route) </span>deleteCreditCard<span class="signature">(:card_id)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">DELETE</td> <td class="name last">/api/users/payment/card/:card_id</td> </tr> </table> Delete a specific credit card of the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Route Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">:card_id</td> <td class="type">String</td> <td class="description last">the stripe id of the card</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">.</td> <td class="type">Object</td> <td class="description last">stripe card object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters card_id</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retieved the card</td> </tr><tr> <td class="type">403</td> <td class="description last">the user must have one card active when having a subscription</td> </tr> </table> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>:card_id</code></td> <td class="type"> </td> <td class="description last">the stripe id of the card</td> </tr> </tbody> </table> <h4 class="name" id="fetchCreditCard"><span class="type-signature">(route) </span>fetchCreditCard<span class="signature">(:card_id)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/payment/card/:card_id</td> </tr> </table> Fetch a specific credit card of the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Route Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">:card_id</td> <td class="type">String</td> <td class="description last">the stripe id of the card</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">stripe card object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters card_id</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retieved the card</td> </tr> </table> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>:card_id</code></td> <td class="type"> </td> <td class="description last">the stripe id of the card</td> </tr> </tbody> </table> <h4 class="name" id="fetchDefaultCreditCard"><span class="type-signature">(route) </span>fetchDefaultCreditCard<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/payment/card</td> </tr> </table> Fetch the default credit card of the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">stripe card object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">404</td> <td class="description last">the user doesn't have any default card</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retieved the card</td> </tr> </table> </div> <h4 class="name" id="fetchMetadata"><span class="type-signature">(route) </span>fetchMetadata<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/payment/card/stripe_metadata</td> </tr> </table> Fetch stripe metadata for a user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">.</td> <td class="type">Object</td> <td class="description last">stripe metadata object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters card_id</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retrieved the metadata</td> </tr> </table> </div> <h4 class="name" id="listCharges"><span class="type-signature">(route) </span>listCharges<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/payment/charges</td> </tr> </table> List the charges that the user have <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">list of stripe charges object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retieved the charges</td> </tr> </table> </div> <h4 class="name" id="listSubscriptions"><span class="type-signature">(route) </span>listSubscriptions<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/payment/subcriptions</td> </tr> </table> List the subscriptions that the user have <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">list of stripe subscriptions object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully retrieved the charges</td> </tr> </table> </div> <h4 class="name" id="setDefaultCard"><span class="type-signature">(route) </span>setDefaultCard<span class="signature">(:card_id)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">POST</td> <td class="name last">/api/users/payment/card/:card_id/default</td> </tr> </table> Set a specific credit card as the user default card <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Route Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">:card_id</td> <td class="type">String</td> <td class="description last">the stripe id of the card</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Object</td> <td class="description last">stripe card object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters card_id</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully set the card as default</td> </tr> </table> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>:card_id</code></td> <td class="type"> </td> <td class="description last">the stripe id of the card</td> </tr> </tbody> </table> <h4 class="name" id="show"><span class="type-signature">(route) </span>show<span class="signature">(:id)</span><span class="type-signature"></span></h4> <dl class="details"> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">GET</td> <td class="name last">/api/users/show/:id</td> </tr> </table> Show public data about a user <h5>Route Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">:id</td> <td class="type">String</td> <td class="description last">user id</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">String</td> <td class="type"></td> <td class="description last">email user email</td> </tr><tr> <td class="name">String</td> <td class="type"></td> <td class="description last">username user pseudo</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">database error</td> </tr><tr> <td class="type">400</td> <td class="description last">invalid parameters (no id provided)</td> </tr><tr> <td class="type">404</td> <td class="description last">no user account where found</td> </tr><tr> <td class="type">200</td> <td class="description last">the mail has been sent to the provided email</td> </tr> </table> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>:id</code></td> <td class="type"> </td> <td class="description last">user id</td> </tr> </tbody> </table> <h4 class="name" id="update"><span class="type-signature">(route) </span>update<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">POST</td> <td class="name last">/api/users/update</td> </tr> </table> Update metadata about the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Body Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">username</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">email</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">old_password</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">new_password</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">info</td> <td class="type">Object</td> <td class="attributes">optional</td> <td class="description last"></td> </tr> </table> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">.</td> <td class="type">Object</td> <td class="description last">user object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">database error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters, no data to update</td> </tr><tr> <td class="type">403</td> <td class="description last">when updating the password, it need a new one</td> </tr><tr> <td class="type">406</td> <td class="description last">when updating the password, the old one is false</td> </tr><tr> <td class="type">409</td> <td class="description last">when updating email or username another user already have one of those two</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully updated the card</td> </tr> </table> </div> <h4 class="name" id="updateCreditCard"><span class="type-signature">(route) </span>updateCreditCard<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">PUT</td> <td class="name last">/api/users/payment/card</td> </tr> </table> Update a credit card of the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Body Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">id</td> <td class="type">String</td> <td class="attributes"></td> <td class="description last">stripe card id</td> </tr><tr> <td class="name">metadata</td> <td class="type">Object</td> <td class="attributes">optional</td> <td class="description last">the metadata you can update</td> </tr><tr> <td class="name">metadata.address_line1</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">metadata.address_country</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">metadata.address_zip</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">metadata.address_city</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr> </table> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">stripe card object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters, you need to specify a card</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully updated the card</td> </tr> </table> </div> <h4 class="name" id="updateMetadata"><span class="type-signature">(route) </span>updateMetadata<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> </dl> <div class="description"> <h5>Route:</h5> <table class="params"> <thead><tr><th>Method</th><th class="last">Path</th></tr></thead> <tr> <td class="type">PUT</td> <td class="name last">/api/users/payment/stripe_metadata</td> </tr> </table> Update a stripe metadata of the user <h5>Authentication</h5> <p>A authentication is needed to access this endpoint</p> <h5>Body Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">metadata</td> <td class="type">Object</td> <td class="attributes"></td> <td class="description last">the metadata you can update</td> </tr><tr> <td class="name">metadata.vat_number</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr><tr> <td class="name">metadata.company_name</td> <td class="type">String</td> <td class="attributes">optional</td> <td class="description last"></td> </tr> </table> <h5>Header Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">Authorization</td> <td class="type">String</td> <td class="description last">bearer access token issued for the user</td> </tr> </table> <h5>Response:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="name">data</td> <td class="type">Array</td> <td class="description last">stripe customer metadata object</td> </tr> </table> <h5>Response Code:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tr> <td class="type">500</td> <td class="description last">stripe error</td> </tr><tr> <td class="type">400</td> <td class="description last">missing parameters, you need to specify a card</td> </tr><tr> <td class="type">200</td> <td class="description last">succesfully updated the card</td> </tr> </table> </div> </article> </section> </div> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Jun 13 2019 12:24:19 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. </footer> <script>prettyPrint();</script> <script src="scripts/linenumber.js"></script> </body> </html>