USERS REST API

Change User Email

Changes email of an user. For security reasons make sure to include the current user password.

POST /users/email/change

Request Data

{ "email": "foo@example.com", "password": "secret" }

Response Data

{}

Signup User

Creates a new user and profile.

POST /users/signup

Request Data

{ "appPublishableKey": "ZGV2X2N1c19TVldsYnFGOGZCdG5aSGJ6dHozdncyLmRldl9hcHBfYVlZNUZTemExUi1CbExqOEJzTU1qSA==", "email": "foo@example.com", "password": "foo" }

Response Data

{ "userId": "dev_usr_GbxwFXCeVwj1VrFwip0eID" }

Logout User

Logs out user from current session.

POST /users/logout

Response Data

{}

Login User

Logs in user.

POST /users/login

Request Data

{ "appPublishableKey": "ZGV2X2N1c19TVldsYnFGOGZCdG5aSGJ6dHozdncyLmRldl9hcHBfYVlZNUZTemExUi1CbExqOEJzTU1qSA==", "email": "foo@example.com", "password": "foo" }

Response Data

{}

Update User Data

Updates the data of the user. Make sure to not include nested objects into the data field.

POST /users/data

Response Data

{}

Change User Password

Changes the password of an user. For security reasons the current password is required.

POST /users/password/change

Request Data

{ "newPassword": "newSecret", "oldPassword": "oldSecret" }

Response Data

{}

Retrieve User Data

Returns all data for the user.

GET /users/data

Response Data

{ "user": { "data": null, "email": { "id": "dev_eml_3_TDQ2qrO-s3uyCBCaRzVw", "userId": "dev_usr_NWE_qhE0ngEsSu0dLBRPdE", "createdAt": "2019-08-14T12:13:06.285032Z", "updatedAt": "2019-08-14T12:13:06.433312Z", "sentAt": "2019-08-14T12:13:06.406122Z", "address": "TUtbCylAuq@saaslet.baz", "state": "sent" }, "id": "dev_usr_NWE_qhE0ngEsSu0dLBRPdE", "subscriptions": [ { "id": "sub_FcaX8Gt11Ua0AH", "planId": "dev_pln_qmaajRelo0H1l_NC3nupcy", "state": "canceled", "data": { "subscription_end": "2019-09-14T14:13:21+02:00" }, "createdAt": "2019-08-14T14:13:21+02:00" } ] } }

List Invoices

List all invoices of an user

GET /users/invoices

Response Data

{ "invoices": [ { "account_country": "DE", "account_name": "", "amount_due": 2345, "amount_paid": 2345, "amount_remaining": 0, "application_fee_amount": 0, "attempt_count": 1, "attempted": true, "auto_advance": false, "billing_reason": "subscription_create", "charge": { "amount": 0, "amount_refunded": 0, "application": null, "application_fee": null, "application_fee_amount": 0, "authorization_code": "", "balance_transaction": null, "billing_details": null, "captured": false, "created": 0, "currency": "", "customer": null, "description": "", "destination": null, "dispute": null, "failure_code": "", "failure_message": "", "fraud_details": null, "id": "ch_1F7LLzJAZyF2h10CrC57vyHN", "invoice": null, "level3": { "customer_reference": "", "line_items": null, "merchant_reference": "", "shipping_address_zip": "", "shipping_from_zip": "", "shipping_amount": 0 }, "livemode": false, "metadata": null, "on_behalf_of": null, "outcome": null, "paid": false, "payment_intent": "", "payment_method": "", "payment_method_details": null, "receipt_email": "", "receipt_number": "", "receipt_url": "", "refunded": false, "refunds": null, "review": null, "shipping": null, "source": null, "source_transfer": null, "statement_descriptor": "", "status": "", "transfer": null, "transfer_data": null, "transfer_group": "" }, "collection_method": "charge_automatically", "created": 1565784801, "currency": "usd", "custom_fields": null, "customer": { "address": { "city": "", "country": "", "line1": "", "line2": "", "postal_code": "", "state": "" }, "balance": 0, "created": 0, "currency": "", "default_source": null, "deleted": false, "delinquent": false, "description": "", "discount": null, "email": "foo@example.com", "id": "cus_FcaXdj3kDy8J5f", "invoice_prefix": "", "invoice_settings": null, "livemode": false, "metadata": null, "name": "", "phone": "", "preferred_locales": null, "shipping": null, "sources": null, "subscriptions": null, "tax_exempt": "", "tax_ids": null, "account_balance": 0, "tax_info": null, "tax_info_verification": null }, "customer_address": null, "customer_email": "TUtbCylAuq@saaslet.baz", "customer_name": null, "customer_phone": null, "customer_shipping": null, "customer_tax_exempt": "none", "customer_tax_ids": [], "default_payment_method": null, "default_source": null, "default_tax_rates": [], "description": "", "discount": null, "due_date": 0, "ending_balance": 0, "footer": "", "hosted_invoice_url": "https://pay.stripe.com/invoice/invst_RUmfUnVWgFeonpswrqS4FjkQ1a", "id": "in_1F7LLyJAZyF2h10CWUsMtRAW", "invoice_pdf": "https://pay.stripe.com/invoice/invst_RUmfUnVWgFeonpswrqS4FjkQ1a/pdf", "lines": { "has_more": false, "total_count": 1, "url": "/v1/invoices/in_1F7LLyJAZyF2h10CWUsMtRAW/lines", "data": [ { "amount": 2345, "currency": "usd", "description": "1 × foo plan (at $23.45 / month)", "discountable": true, "id": "sli_ac1428f3f05922", "live_mode": false, "metadata": { "planId": "dev_pln_qmaajRelo0H1l_NC3nupcy" }, "period": { "end": 1568463201, "start": 1565784801 }, "plan": { "active": true, "aggregate_usage": "", "amount": 2345, "billing_scheme": "per_unit", "created": 1565784796, "currency": "usd", "deleted": false, "id": "plan_FcaWfBG88zHGdS", "interval": "month", "interval_count": 1, "livemode": false, "metadata": { "key": "dev_pln_qmaajRelo0H1l_NC3nupcy" }, "nickname": "foo plan created by saaslet.com", "product": { "active": false, "attributes": null, "caption": "", "created": 0, "deactivate_on": null, "description": "", "id": "prod_FcaWsg1qlQDzkj", "images": null, "livemode": false, "metadata": null, "name": "", "package_dimensions": null, "shippable": false, "statement_descriptor": "", "type": "", "unit_label": "", "url": "", "updated": 0 }, "tiers": null, "tiers_mode": "", "transform_usage": null, "trial_period_days": 0, "usage_type": "licensed" }, "proration": false, "quantity": 1, "subscription": "sub_FcaX8Gt11Ua0AH", "subscription_item": "si_FcaXqsGTFCsXUI", "tax_amounts": [], "tax_rates": [], "type": "subscription", "unified_proration": false } ] }, "livemode": false, "metadata": {}, "next_payment_attempt": 0, "number": "03FDC816-0001", "paid": true, "payment_intent": { "amount": 0, "amount_capturable": 0, "amount_received": 0, "application": null, "application_fee": 0, "canceled_at": 0, "cancellation_reason": "", "capture_method": "", "charges": null, "client_secret": "", "confirmation_method": "", "created": 0, "currency": "", "customer": null, "description": "", "invoice": null, "last_payment_error": null, "livemode": false, "id": "pi_1F7LLyJAZyF2h10CxGqItMyf", "metadata": null, "next_action": null, "on_behalf_of": null, "payment_method": null, "payment_method_types": null, "receipt_email": "", "review": null, "setup_future_usage": "", "shipping": { "address": null, "carrier": "", "name": "", "phone": "", "tracking_number": "" }, "source": null, "statement_descriptor": "", "status": "", "transfer_data": null, "transfer_group": "" }, "period_end": 1565784801, "period_start": 1565784801, "post_payment_credit_notes_amount": 0, "pre_payment_credit_notes_amount": 0, "receipt_number": "", "starting_balance": 0, "statement_descriptor": "", "status": "paid", "status_transitions": { "finalized_at": 1565784802, "marked_uncollectible_at": 0, "paid_at": 1565784803, "voided_at": 0 }, "subscription": "sub_FcaX8Gt11Ua0AH", "subscription_proration_date": 0, "subtotal": 2345, "tax": 0, "threshold_reason": null, "total": 2345, "total_tax_amounts": [], "transfer_data": null, "webhooks_delivered_at": 1565784805, "Billing": "charge_automatically", "tax_percent": 0 } ] }

Retrieve Invoice

Retrieve a specific invoice for an user

GET /users/invoices/in_1F7LLyJAZyF2h10CWUsMtRAW

Response Data

{ "invoice": { "account_country": "DE", "account_name": "", "amount_due": 2345, "amount_paid": 2345, "amount_remaining": 0, "application_fee_amount": 0, "attempt_count": 1, "attempted": true, "auto_advance": false, "billing_reason": "subscription_create", "charge": { "amount": 0, "amount_refunded": 0, "application": null, "application_fee": null, "application_fee_amount": 0, "authorization_code": "", "balance_transaction": null, "billing_details": null, "captured": false, "created": 0, "currency": "", "customer": null, "description": "", "destination": null, "dispute": null, "failure_code": "", "failure_message": "", "fraud_details": null, "id": "ch_1F7LLzJAZyF2h10CrC57vyHN", "invoice": null, "level3": { "customer_reference": "", "line_items": null, "merchant_reference": "", "shipping_address_zip": "", "shipping_from_zip": "", "shipping_amount": 0 }, "livemode": false, "metadata": null, "on_behalf_of": null, "outcome": null, "paid": false, "payment_intent": "", "payment_method": "", "payment_method_details": null, "receipt_email": "", "receipt_number": "", "receipt_url": "", "refunded": false, "refunds": null, "review": null, "shipping": null, "source": null, "source_transfer": null, "statement_descriptor": "", "status": "", "transfer": null, "transfer_data": null, "transfer_group": "" }, "collection_method": "charge_automatically", "created": 1565784801, "currency": "usd", "custom_fields": null, "customer": { "address": { "city": "", "country": "", "line1": "", "line2": "", "postal_code": "", "state": "" }, "balance": 0, "created": 0, "currency": "", "default_source": null, "deleted": false, "delinquent": false, "description": "", "discount": null, "email": "foo@example.com", "id": "cus_FcaXdj3kDy8J5f", "invoice_prefix": "", "invoice_settings": null, "livemode": false, "metadata": null, "name": "", "phone": "", "preferred_locales": null, "shipping": null, "sources": null, "subscriptions": null, "tax_exempt": "", "tax_ids": null, "account_balance": 0, "tax_info": null, "tax_info_verification": null }, "customer_address": null, "customer_email": "TUtbCylAuq@saaslet.baz", "customer_name": null, "customer_phone": null, "customer_shipping": null, "customer_tax_exempt": "none", "customer_tax_ids": [], "default_payment_method": null, "default_source": null, "default_tax_rates": [], "description": "", "discount": null, "due_date": 0, "ending_balance": 0, "footer": "", "hosted_invoice_url": "https://pay.stripe.com/invoice/invst_RUmfUnVWgFeonpswrqS4FjkQ1a", "id": "in_1F7LLyJAZyF2h10CWUsMtRAW", "invoice_pdf": "https://pay.stripe.com/invoice/invst_RUmfUnVWgFeonpswrqS4FjkQ1a/pdf", "lines": { "has_more": false, "total_count": 1, "url": "/v1/invoices/in_1F7LLyJAZyF2h10CWUsMtRAW/lines", "data": [ { "amount": 2345, "currency": "usd", "description": "1 × foo plan (at $23.45 / month)", "discountable": true, "id": "sli_ac1428f3f05922", "live_mode": false, "metadata": { "planId": "dev_pln_qmaajRelo0H1l_NC3nupcy" }, "period": { "end": 1568463201, "start": 1565784801 }, "plan": { "active": true, "aggregate_usage": "", "amount": 2345, "billing_scheme": "per_unit", "created": 1565784796, "currency": "usd", "deleted": false, "id": "plan_FcaWfBG88zHGdS", "interval": "month", "interval_count": 1, "livemode": false, "metadata": { "key": "dev_pln_qmaajRelo0H1l_NC3nupcy" }, "nickname": "foo plan created by saaslet.com", "product": { "active": false, "attributes": null, "caption": "", "created": 0, "deactivate_on": null, "description": "", "id": "prod_FcaWsg1qlQDzkj", "images": null, "livemode": false, "metadata": null, "name": "", "package_dimensions": null, "shippable": false, "statement_descriptor": "", "type": "", "unit_label": "", "url": "", "updated": 0 }, "tiers": null, "tiers_mode": "", "transform_usage": null, "trial_period_days": 0, "usage_type": "licensed" }, "proration": false, "quantity": 1, "subscription": "sub_FcaX8Gt11Ua0AH", "subscription_item": "si_FcaXqsGTFCsXUI", "tax_amounts": [], "tax_rates": [], "type": "subscription", "unified_proration": false } ] }, "livemode": false, "metadata": {}, "next_payment_attempt": 0, "number": "03FDC816-0001", "paid": true, "payment_intent": { "amount": 0, "amount_capturable": 0, "amount_received": 0, "application": null, "application_fee": 0, "canceled_at": 0, "cancellation_reason": "", "capture_method": "", "charges": null, "client_secret": "", "confirmation_method": "", "created": 0, "currency": "", "customer": null, "description": "", "invoice": null, "last_payment_error": null, "livemode": false, "id": "pi_1F7LLyJAZyF2h10CxGqItMyf", "metadata": null, "next_action": null, "on_behalf_of": null, "payment_method": null, "payment_method_types": null, "receipt_email": "", "review": null, "setup_future_usage": "", "shipping": { "address": null, "carrier": "", "name": "", "phone": "", "tracking_number": "" }, "source": null, "statement_descriptor": "", "status": "", "transfer_data": null, "transfer_group": "" }, "period_end": 1565784801, "period_start": 1565784801, "post_payment_credit_notes_amount": 0, "pre_payment_credit_notes_amount": 0, "receipt_number": "", "starting_balance": 0, "statement_descriptor": "", "status": "paid", "status_transitions": { "finalized_at": 1565784802, "marked_uncollectible_at": 0, "paid_at": 1565784803, "voided_at": 0 }, "subscription": "sub_FcaX8Gt11Ua0AH", "subscription_proration_date": 0, "subtotal": 2345, "tax": 0, "threshold_reason": null, "total": 2345, "total_tax_amounts": [], "transfer_data": null, "webhooks_delivered_at": 1565784805, "Billing": "charge_automatically", "tax_percent": 0 } }

on this page: