Skip to main content

GET /tenants/:tenantId/stripe-invoices

Request

Note: You and your company are soley responsible for invoices for the users (customers), as well as all tax obligations that result in any country for you and your company. Use the stripe test API to check your invoices before going into production. E.g., if all necessary data is displayed, as well as if the correct tax is applied, and so on.

Request Method:

  • GET

Base URL:

  • https://api.userdocks.com

End Point:

  • /v1/tenants/:tenantId/stripe-invoices
Path Variables:
VariableTypeRequiredDescription
:tenantIdStringtruethe UUID of the tenant
Query Parameters:
VariableTypeRequiredDescription
:userIdStringtruethe UUID of the tenant
:testBooleanfalseindicates if the stripe testing API is used or not
:limitNumberfalseif not set it will automatically be limited by 100 stripe invoices
:startingAfterStringfalsea stripe invoice ID
:startingbeforeStringfalsea stripe invoice ID

HTTP Headers:

Note: Never use API Keys on the client

Access from your server via API keys:

PropertyTypeRequiredAccessDescription
X-API-KEYStringtrueOnly access to AppApi key for the userdocks app
X-API-KEY-TYPEStringtrueOnly access to Appwrite
X-CLIENT-IDStringtrueOnly access to AppUUID of the userdocks app

Access from the client via an access token:

PropertyTypeRequiredAccessDescription
AuthorizationStringtrueOnly access to this tenantAccess Token for userdocks tenant

HTTP Body:

None

Response:

  • Object

Example:

try {
// call userdocks user management API
const response = await fetch('https://api.userdocks.com/v1/tenants/:tenantId/stripe-invoices?userId=String', {
method: 'GET',
headers: {
// 'Authorization': String, // when accessed from the client e.g. `Bearer ${accessToken}`
'X-API-KEY': String,
'X-CLIENT-ID': String,
'X-API-KEY-TYPE': 'read',
'Content-Type': 'application/json',
},
});
const { data } = await response.json();

// do something with the data
} catch (err) {
console.error(err);
// handle error
}

Successful Response:

Can have the following HTTP Status Codes:

  • 200 - OK
// GET /v1/tenants/:tenantId/stripe-invoices
{
"success": Boolean,
"message": String,
"error": null,
"data": null,
}

Error Response:

Can have the following HTTP Status Codes:

  • 400 - Bad Request
  • 401 - Unauthorized
  • 403 - Forbidden
  • 500 - Internal Server Error
// GET /v1/tenants/:tenantId/stripe-invoices
{
"success": Boolean,
"error": String,
"message": null,
"data": {
invoices: Object[], // https://stripe.com/docs/api/invoices/object?lang=node
}
}