# Builderly API reference

Base URL: http://bulgariandebateassociation.max-media.io
Generated from the running server on 2026-11-09T16:55:29.707Z. Every mounted route is listed with the access it needs, the parameters its handler reads and the data models it uses.

## Authentication

Send `Authorization: Bearer <token>` where a route needs a token. Add `?ionic=true` to get JSON from routes that also render pages.

- **Admin token** (`admin`): Bearer token of a site admin (Authorization: Bearer <token>).
- **User token** (`user`): Bearer token of a signed-in user of the site.
- **Optional user** (`optional-user`): Works without a token; a user token personalises the answer.
- **User with access** (`user-priv`): A signed-in user whose plan grants access to the item.
- **Page access** (`page-priv`): Pages limited to some users check the token when one is sent.
- **Webhook signature** (`webhook`): Called by a provider; verified by its signature.
- **reCAPTCHA** (`recaptcha`): Needs a reCAPTCHA token from the site form.
- **System** (`system`): Internal - called by the platform itself.

### For AI assistants: getting a token

Public endpoints (Access: Public) need no token. Everything else - changing the site, or reading its orders, bookings, customers and other private data - needs the site owner's API token.

You cannot create a token yourself, and you must not ask for the owner's password. Ask the user for a token instead - you can send them this message as it is:

> To work with your site through its API, I need an API token from you:
> 1. Sign in to your Builderly admin: https://admin.max-media.io
> 2. Open Developers > API reference (or go straight to https://admin.max-media.io/tabs/site-builder/api-docs).
> 3. Press "Generate token", copy the token and paste it here.
> The token acts as you, so only share it in this chat. You can cancel it at any time by signing out of all devices.

Then send it with every request as `Authorization: Bearer <token>`, and add `?ionic=true` to get JSON. Calls go to the site's own address (its domain), not to the reference's.

The token acts as the user: say what you will change and wait for their yes before any request that creates, changes or deletes something, never repeat the token back, and never put it in a link or a file you share.

## Status codes

| Code | Name | Meaning |
| --- | --- | --- |
| 200 | OK | It worked. The answer is the object or list asked for. |
| 201 | Created | The object was created. Some endpoints send it back; others send an empty body. |
| 202 | Accepted | The work was started and finishes in the background - for example a video being processed ({ "status": "processing" }). Check back on the object. |
| 204 | No Content | It worked, and there is nothing to send back - for example after removing a staff member. |
| 301 | Moved Permanently | The address changed; follow the Location header. |
| 400 | Bad Request | The request was refused as sent: a required field is missing, a value has the wrong type or fails validation. The body says what - often as plain text. |
| 401 | Unauthorized | No token, or one that is invalid or signed out. Without ?ionic=true, some endpoints answer this with the HTML login page instead of JSON. |
| 402 | Payment Required | The content needs a subscription: the user has no price plan that unlocks it. |
| 403 | Forbidden | The token is valid but may not do this - the record belongs to someone else, or the user is not an admin. AI builder endpoints also answer 403 when the account is out of credits. |
| 404 | Not Found | No object with that ID or URL slug, or no such endpoint. |
| 409 | Conflict | It clashes with the current state: the item is already being processed, a version is already applied, or an AI plan or preview is no longer available. |
| 410 | Gone | It existed but is no longer there - for example a comment already deleted on the social network. |
| 412 | Precondition Failed | A rule the request must meet is not met - for example push notifications of the same type at least 48 hours apart. |
| 418 | I'm a teapot | An account confirmation or password reset link was used with an email that does not match it. |
| 421 | Misdirected Request | The domain is not a Builderly site. Call the site's own address. |
| 422 | Unprocessable Content | The request was understood but could not be done - for example the AI could not read the website it was asked to clone. The message says what to try instead. |
| 429 | Too Many Requests | Slow down: the site's request limit was reached, an AI chat already has a request running, or the hourly limit of AI search answers is used up. Wait and retry. |
| 500 | Internal Server Error | Something failed on the server. Retrying later may work; if it keeps failing, the request may be one the endpoint does not handle. |
| 502 | Bad Gateway | A service the request depends on failed - for example the address a redirect forwards to. |
| 503 | Service Unavailable | Used by the lead form when an order is below its minimum value, not only for outages: read the message. |

Errors do not share one shape: depending on the endpoint the body is plain text, { "error": "..." }, { "message": "..." } or empty. Rely on the status code, and show the body to the user as the reason.

## Endpoints

### Leads & forms

Leads are the enquiries visitors send - contact forms, custom forms and lead forms on pages - with where they came from.

#### Custom Form

##### List all custom forms
`GET /custom_forms`
The custom forms. Answers an array of every record.
- Access: Admin token
- Returns: a list of CustomForm objects.
- Status codes: 200, 401, 500
- Models: CustomForm

##### Retrieve a custom form
`GET /custom_forms/:id`
One custom form. 404 when there is no such record.
- Access: Admin token
- Path:
  - `id` (string): The ID of the custom form.
- Returns: the CustomForm object.
- Status codes: 200, 401, 404, 500
- Models: CustomForm

##### Update a custom form
`PATCH /custom_forms/:id`
Updates a custom form. Fields outside the allowed list are silently ignored. Answers the updated record, or 404.
- Access: Admin token
- Path:
  - `id` (string): The ID of the custom form.
- Returns: the CustomForm object.
- Status codes: 200, 400, 401, 404, 500
- Models: CustomForm

##### Delete a custom form
`DELETE /custom_forms/:id`
Deletes a custom form. Answers the deleted record, or 404. Records that point to it are not changed.
- Access: Admin token
- Path:
  - `id` (string): The ID of the custom form.
- Returns: an empty answer on success.
- Status codes: 200, 401, 404, 500
- Models: CustomForm

#### Form

##### List all forms
`GET /forms`
Form submissions. Answers an array of every record.
- Access: Admin token
- Returns: a list of Form objects.
- Status codes: 200, 401, 500
- Models: Form

##### Create a form
`POST /forms`
Creates a form submission. Multipart with up to 5 files (medias), behind reCAPTCHA. Emails the business; a sender who ticks newsletter (with name and email) is signed up. A website form is sent back to the page it came from.
- Access: reCAPTCHA
- Body:
  - `body` (string): Body of text.
  - `email` (string): An email address.
- Returns: the Form object.
- Status codes: 200, 400, 500
- Models: NewsletterContact, Form

##### Retrieve a form
`GET /forms/:id`
One form submission. 404 when there is no such record.
- Access: Admin token
- Path:
  - `id` (string): The ID of the form.
- Returns: the Form object.
- Status codes: 200, 401, 404, 500
- Models: Form

##### Update a form
`PATCH /forms/:id`
Updates a form submission. Fields outside the allowed list are silently ignored. Answers the updated record, or 404.
- Access: Admin token
- Path:
  - `id` (string): The ID of the form.
- Returns: the Form object.
- Status codes: 200, 400, 401, 404, 500
- Models: Form

##### Delete a form
`DELETE /forms/:id`
Deletes a form submission. Answers the deleted record, or 404. Records that point to it are not changed.
- Access: Admin token
- Path:
  - `id` (string): The ID of the form.
- Returns: an empty answer on success.
- Status codes: 200, 401, 404, 500
- Models: Form

#### Lead

##### List all leads
`GET /leads`
The customers. Answers an array of every record.
- Access: Admin token
- Returns: a list of Lead objects.
- Status codes: 200, 401, 500
- Models: Lead

##### Create a lead
`POST /leads`
Creates or updates a customer from a checkout or form, signing them up to the newsletter when asked. Matched by email, then by phone number, so a returning customer is updated rather than duplicated. Reads no token.
- Access: Public
- Body:
  - `owner_id` (string): The lead's owner id.
  - `split` (string): The lead's split.
  - `email` (string): An email address.
  - `phone_number` (string): Customer's phone number.
  - `organization_name` (string): Customer's company name.
  - `firstname` (string): Customer's first name.
  - `lastname` (string): Customer's last name.
  - `address` (string): Customer's address.
  - `city` (string): Customer's city.
  - `state` (string): Customer's state or region.
  - `country` (string): Customer's country.
  - `zip_code` (string): Customer's postal code.
  - `tax_identification_number` (string): Customer's tax number.
  - `notes` (string): Notes kept on the customer.
  - `tickets` (objectid[]): Ticket ids.
  - `products` (string[]): Product ids the customer bought.
  - `programs` (string[]): Program ids the customer bought.
  - `donations` (objectid[]): Donation ids.
  - `newsletter` (string): The lead's newsletter.
  - `name` (string): The lead's name.
  - `age` (string): The lead's age.
  - `products_obj` (object[]): The products bought, as they were when ordered.
  - `programs_obj` (object[]): The programs bought, as they were when ordered.
  - `value` (string): The lead's value.
  - `donations_str` (string): The lead's donations str.
- Returns: the Lead object.
- Status codes: 200, 400, 500, 503
- Models: Lead, NewsletterContact, Product, Shipping, SocialModeSettings, Ticket, PaymentMethod, Order

##### Retrieve a lead
`GET /leads/:id`
One customer. 404 when there is no such record.
- Access: Public
- Path:
  - `id` (string): The ID of the lead.
- Returns: the Lead object.
- Status codes: 200, 404, 500
- Models: Lead

##### Update a lead
`PATCH /leads/:id`
Updates a customer. Fields outside the allowed list are silently ignored. Answers the updated record, or 404.
- Access: Admin token
- Path:
  - `id` (string): The ID of the lead.
- Returns: the Lead object.
- Status codes: 200, 400, 401, 404, 500
- Models: Lead

##### Delete a lead
`DELETE /leads/:id`
Deletes a customer. Answers the deleted record, or 404. Records that point to it are not changed.
- Access: Admin token
- Path:
  - `id` (string): The ID of the lead.
- Returns: an empty answer on success.
- Status codes: 200, 401, 404, 500
- Models: Lead

#### Newsletter Contact

##### List all newsletter contacts
`GET /newsletter_contacts`
Newsletter subscribers. Answers an array of every record.
- Access: User token
- Returns: a list of NewsletterContact objects.
- Status codes: 200, 401, 500
- Models: NewsletterContact

##### Create a newsletter contact
`POST /newsletter_contacts`
Creates a newsletter subscriber. Behind reCAPTCHA. Answers 200, or 200 { already_subscribed: true }; a new subscriber gets the welcome email.
- Access: reCAPTCHA
- Body:
  - `name` (string): Subscriber's name.
  - `email` (string): An email address.
  - `age` (number): Subscriber's age.
  - `city` (string): Subscriber's city.
- Returns: the NewsletterContact object.
- Status codes: 200, 400, 500
- Models: Unsubscribed, NewsletterContact

##### Retrieve a newsletter contact
`GET /newsletter_contacts/:id`
One newsletter subscriber. 404 when there is no such record.
- Access: User token
- Path:
  - `id` (string): The ID of the newsletter contact.
- Returns: the NewsletterContact object.
- Status codes: 200, 401, 404, 500
- Models: NewsletterContact

##### Update a newsletter contact
`PATCH /newsletter_contacts/:id`
Updates a newsletter subscriber. Fields outside the allowed list are silently ignored. Answers the updated record, or 404.
- Access: User token
- Path:
  - `id` (string): The ID of the newsletter contact.
- Returns: the NewsletterContact object.
- Status codes: 200, 400, 401, 404, 500
- Models: NewsletterContact

##### Delete a newsletter contact
`DELETE /newsletter_contacts/:id`
Deletes a newsletter subscriber. Answers the deleted record, or 404. Records that point to it are not changed.
- Access: User token
- Path:
  - `id` (string): The ID of the newsletter contact.
- Returns: an empty answer on success.
- Status codes: 200, 401, 404, 500
- Models: NewsletterContact

#### Price Quote

##### Retrieve a download price quote
`GET /download-price-quote/:id/:translate/:filename`
Download price quote pdf. Answers the PDF; translate picks the second language. Reads no token.
- Access: Public
- Path:
  - `id` (string): The ID of the download price quote.
  - `translate` (string): The download price quote's translate.
  - `filename` (string): The download price quote's filename.
- Status codes: 200, 400, 500

##### Retrieve the price quote
`GET /price-quote`
The price quotes. Answers an array.
- Access: Admin token
- Returns: the PriceQuote object.
- Status codes: 200, 401, 500
- Models: PriceQuote

##### Create a price quote
`POST /price-quote`
Creates a price quote. Numbered from the invoice settings and emailed to the customer when asked. Answers 201 { id }.
- Access: Admin token
- Body:
  - `send` (string): The price quote's send.
- Returns: the PriceQuote object.
- Status codes: 201, 400, 401, 500
- Models: MyContact, Lead, PaymentMethod, User, PriceQuote

##### Retrieve a price quote
`GET /price-quote/:id`
One price quote. 404 when there is no such record.
- Access: Admin token
- Path:
  - `id` (string): The ID of the price quote.
- Returns: the PriceQuote object.
- Status codes: 200, 401, 404, 500
- Models: PriceQuote

##### Delete a price quote
`DELETE /price-quote/:id`
Deletes a price quote. Answers the deleted record, or 404. Records that point to it are not changed.
- Access: Admin token
- Path:
  - `id` (string): The ID of the price quote.
- Returns: an empty answer on success.
- Status codes: 200, 401, 404, 500
- Models: PriceQuote

#### Unsubscribed

##### Retrieve the unsubscribe
`GET /unsubscribe`
The unsubscribe page. Opened from the link in emails.
- Access: Optional user
- Status codes: 200

##### Retrieve the unsubscribed
`GET /unsubscribed-list`
Emails that opted out. Answers an array of every record.
- Access: Admin token
- Returns: the Unsubscribed object.
- Status codes: 200, 401, 500
- Models: Unsubscribed

##### Create an unsubscribed
`POST /unsubscribed-list`
Creates an opted-out email. Reads no token: the unsubscribe page calls it. 409 when the email has already opted out.
- Access: Public
- Body:
  - `email` (string): An email address.
- Returns: the Unsubscribed object.
- Status codes: 201, 400, 409, 500
- Models: Unsubscribed

##### Retrieve an unsubscribed
`GET /unsubscribed-list/:id`
One opted-out email. 404 when there is no such record.
- Access: Admin token
- Path:
  - `id` (string): The ID of the unsubscribed.
- Returns: the Unsubscribed object.
- Status codes: 200, 401, 404, 500
- Models: Unsubscribed

##### Update an unsubscribed
`PATCH /unsubscribed-list/:id`
Updates an opted-out email. Fields outside the allowed list are silently ignored. Answers the updated record, or 404.
- Access: Admin token
- Path:
  - `id` (string): The ID of the unsubscribed.
- Returns: the Unsubscribed object.
- Status codes: 200, 400, 401, 404, 500
- Models: Unsubscribed

##### Delete an unsubscribed
`DELETE /unsubscribed-list/:id`
Deletes an opted-out email. Answers the deleted record, or 404. Records that point to it are not changed.
- Access: Admin token
- Path:
  - `id` (string): The ID of the unsubscribed.
- Returns: an empty answer on success.
- Status codes: 200, 401, 404, 500
- Models: Unsubscribed

## Objects

### CustomForm

- `obj`: Mixed, required - Free object.
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### Form

- `name`: String - Name of sender.
- `email`: String - Email of sender.
- `subject`: String - Subject.
- `body`: String - Body of text.
- `medias`: Buffer[] - Files sent with the form.
- `additional`: Object[] - Additional fields - types - text field - 0, radio buttons - 1, single select - 2, multiple select - 3, media - 4.
  - `title`: String
  - `option`: String
  - `_id`: ObjectId
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### Lead

- `seq`: Number, default 0 - Running number of the customer.
- `organization_name`: String - Customer's company name.
- `firstname`: String, required - Customer's first name.
- `lastname`: String, required - Customer's last name.
- `email`: String, required - Customer's email.
- `phone_number`: String, required - Customer's phone number.
- `address`: String, required - Customer's address.
- `city`: String, required - Customer's city.
- `state`: String - Customer's state or region.
- `country`: String, required - Customer's country.
- `zip_code`: String, required - Customer's postal code.
- `tax_identification_number`: String - Customer's tax number.
- `vat_id`: String - Customer's VAT number.
- `notes`: String - Notes kept on the customer.
- `products`: String[] - Product ids the customer bought.
- `products_obj`: Object[] - The products bought, as they were when ordered.
  - `product_id`: ObjectId, → Product
  - `name`: String
  - `options`: String
  - `price`: Number
  - `quantity`: Number
  - `_id`: ObjectId
- `programs`: String[] - Program ids the customer bought.
- `programs_obj`: Object[] - The programs bought, as they were when ordered.
  - `program_id`: ObjectId, → Program
  - `title`: String
  - `price`: Number
  - `_id`: ObjectId
- `tickets`: ObjectId[], → Ticket - Ticket ids.
- `donations`: ObjectId[], → Donation - Donation ids.
- `donations_obj`: Object[] - The donations made.
  - `donation_id`: ObjectId, → Donation
  - `name`: String
  - `options`: String
  - `price`: Number
  - `quantity`: Number
  - `_id`: ObjectId
- `lifetime_value`: Number, default 0 - Everything the customer has spent.
- `last_order_value`: Number - Value of the customer's last order.
- `services`: ObjectId[], → Service - Service ids.
- `stripe_id`: String - The customer's id in Stripe.
- `delivery_method`: String - The customer's last delivery method.
- `shipping_option`: String, one of address | office, default "address" - One of: address, office.
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### MyContact

The site's name and contact details.

- `zip_code`: String, required - Postal/ZIP code.
- `city`: String, required - The city where the business is located.
- `address`: String, required - The street address.
- `contact`: String - Html format.
- `email`: String, required - The public contact email address.
- `google_app`: String - Link to the business's app on Google Play.
- `workhours`: String - Opening hours as text.
- `logo`: ObjectId - Media.id.
- `site_name`: String, required - The business/site name shown publicly.
- `domain`: String, required - The site's own domain.
- `stock_domain`: String - The platform subdomain the site always answers on.
- `isMarket`: Boolean, required, default false - The site is a marketplace.
- `forbidden_collections`: Object[] - Array of {collection_id}.
  - `collection_id`: ObjectId, → Collection
  - `_id`: ObjectId
- `isInit`: Boolean, default false - The site was set up from a template.
- `template`: String, default "0000" - The template the site was made from.
- `lang`: String - 2-letter language code (e.g. "en", "fr", "de").
- `allowedComponents.services`: Boolean, default true
- `allowedComponents.products`: Boolean, default true
- `allowedComponents.blogposts`: Boolean, default true
- `allowedComponents.programs`: Boolean, default true
- `favicon`: ObjectId - Media.id of the browser tab icon.
- `cacheEnabled`: Boolean - Pages are cached for faster loading.
- `has_completed_startup_prompt`: Boolean, default true - The owner went through the first AI prompt.
- `gmb_location`: String - The Google Business Profile location linked to the site.
- `ga_property`: String - The Google Analytics property linked to the site.
- `site_generated_at`: Date - When the AI builder first built this site (a plan that made the homepage). Written once (runPlan); starts the admin's 15-minute launch offer.
- `admin_first_opened_at`: Date - When the owner first opened the admin; with admin_last_opened_at it tells "never opened it" from "opened it and left".
- `admin_last_opened_at`: Date - When the owner last opened the admin.
- `admin_in_app_browser`: Boolean - The owner last opened the admin inside an app's browser.
- `domain_suggestions`: Mixed - Domain names suggested to the owner, kept so they are not suggested again.
- `_id`: ObjectId

### NewsletterContact

- `name`: String, required - Subscriber's name.
- `age`: Number - Subscriber's age.
- `email`: String, required - Subscriber's email.
- `city`: String - Subscriber's city.
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### Order

A completed purchase.

- `organization_name`: String - Customer's company name.
- `firstname`: String, required - Customer's first name.
- `lastname`: String, required - Customer's last name.
- `email`: String, required - Customer's email.
- `phone_number`: String, required - Customer's phone number.
- `address`: String, required - Delivery address.
- `city`: String, required - Delivery city.
- `state`: String - Delivery state or region.
- `country`: String, required - Delivery country.
- `zip_code`: String, required - Delivery postal code.
- `tax_identification_number`: String - Customer's tax number, for an invoice.
- `notes`: String - What the customer wrote with the order.
- `products`: String[] - Product ids ordered.
- `products_obj`: Object[] - The products ordered, as they were then: options, quantity and price.
  - `product_id`: ObjectId, → Product
  - `name`: String
  - `options`: String
  - `price`: Number
  - `quantity`: Number
  - `_id`: ObjectId
- `programs`: String[] - Program ids ordered.
- `programs_obj`: Object[] - The programs ordered, as they were then.
  - `program_id`: ObjectId, → Program
  - `title`: String
  - `price`: Number
  - `_id`: ObjectId
- `tickets`: ObjectId[], → Ticket - Ticket ids.
- `donations`: ObjectId[], → Donation - Donation ids.
- `donations_obj`: Object[] - The donations made with the order.
  - `donation_id`: ObjectId, → Donation
  - `name`: String
  - `options`: String
  - `price`: Number
  - `quantity`: Number
  - `_id`: ObjectId
- `value`: Number - Total of the order.
- `finalized`: Boolean, default false - Checkout was completed.
- `fulfilled`: Boolean, default false - The order was sent or handed over.
- `paid`: Boolean, default false - The order is paid.
- `delivery_method`: String - How it is delivered (courier, office, pickup...).
- `payment_method`: String - How it is paid (card, cash, invoice, PayPal).
- `shipping_cost`: Number - What delivery costs.
- `coupon_code`: String - The coupon used.
- `owner_id`: ObjectId, → User - User.id.
- `reference_id`: String - The order's id at the payment provider.
- `rating_mail_sent`: Boolean, default false - The email asking for a rating was sent.
- `shipping_label`: String - The courier's shipment label.
- `shipping_option`: String, one of address | office, default "address" - One of: address, office.
- `shipping_message`: String - The courier's last status message.
- `shipping_office`: String - The courier office it is delivered to.
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### PaymentMethod

- `has_cash`: Boolean, default false - Cash on delivery is offered.
- `cash_locale`: String, default "Pay by cash" - Label of the cash option.
- `cash_instructions`: String - Instructions shown for cash payment.
- `cash_increase`: Number, default 0 - Extra charged for cash payment.
- `has_card`: Boolean, default false - Card payment is offered.
- `card_locale`: String, default "Pay with credit card" - Label of the card option.
- `email`: String - The business's email for payments.
- `country`: String - The business's country for payments.
- `has_invoicing`: Boolean, default false - Payment by invoice is offered.
- `invoice_locale`: String, default "Pay via invoice" - Label of the invoice option.
- `invoicing_instructions`: String - Instructions shown for paying by invoice.
- `currency`: String, required - Currency prices are in.
- `agreedToTerms`: Boolean, default false - The owner accepted the payment terms.
- `agreedToTermsAt`: String - When the owner accepted them.
- `merchant_id`: String - The business's merchant id at the card processor.
- `has_paypal`: Boolean, default false - PayPal is offered.
- `paypal_increase`: Number, default 0 - Extra charged for PayPal.
- `paypal_id`: String - The business's PayPal id.
- `lock_currency`: Boolean, default false - Visitors cannot switch the currency.
- `commission_percentage`: Number, default 4.4 - The platform's commission on payments.
- `two_currencies`: Boolean, default false - Prices are shown in a second currency too.
- `second_currency`: String - The second currency.
- `calculate_rate`: Boolean, default false - The second price is converted at the current rate.
- `currency_rate`: Number - Fixed rate for the second currency, when not calculated.
- `_id`: ObjectId

### PriceQuote

- `customer_name`: String - Name of customer.
- `customer_address`: String - Address of customer.
- `customer_postal_code`: String - Postal code of customer.
- `customer_city`: String - City of customer.
- `customer_country`: String - Country of customer.
- `customer_phone`: String - Phone of customer.
- `customer_email`: String - Email of customer.
- `customer_tax_id`: String, required - Tax id of customer.
- `customer_vat_id`: String - Customer's VAT number.
- `customer_responsible_official`: String, required - Person responsible on the customer's side.
- `customer_organization_name`: String - Customer's company name.
- `billing_customer_address`: String - Address of billed customer.
- `billing_customer_postal_code`: String - Postal code billed of customer.
- `billing_customer_city`: String - City of billed customer.
- `billing_customer_country`: String - Country of billed customer.
- `billing_customer_phone`: String - Phone of billed customer.
- `subtotal`: Number - Invoice subtotal.
- `amount`: Number - Invoice amount.
- `day_of_issue`: String - Day of issue of invoice.
- `number`: Number - The quote's number.
- `foreign`: Boolean - Flag which shows if invoice is from foreign to company country.
- `home_tax`: Number, default 0 - Home country tax amount.
- `foreign_tax`: Number, default 0 - Foreign country tax amount.
- `items`: Object[] - Array of sold products which contains their name, cost, quantity and discount.
  - `id`: String
  - `name`: String
  - `qty`: Number
  - `unit_price`: Number
  - `discount`: Number
  - `amount`: Number
  - `_id`: ObjectId
- `grounds_for_transaction`: String - Legal grounds for the transaction.
- `description_of_transaction`: String - What it is for.
- `place_of_transaction`: String - Where it takes place.
- `payment`: String - How it would be paid.
- `dateDue`: String - Date the quote is valid until.
- `invoice_id`: ObjectId, → invoice - Id of invoice created from this price quote.
- `invoice_settings.number`: Number
- `invoice_settings.price_quote_number`: String
- `invoice_settings.bic`: String
- `invoice_settings.swift`: String
- `invoice_settings.tax_id`: String
- `invoice_settings.vat_id`: String
- `invoice_settings.logo`: ObjectId
- `invoice_settings.business_name`: String
- `invoice_settings.business_name_translated`: String
- `invoice_settings.responsible_official`: String
- `invoice_settings.responsible_official_translated`: String
- `invoice_settings.business_email`: String
- `invoice_settings.company_id`: String
- `invoice_settings.business_address`: String
- `invoice_settings.business_address_translated`: String
- `invoice_settings.business_phone_number`: String
- `invoice_settings.business_country`: String
- `invoice_settings.business_country_translated`: String
- `invoice_settings.footer`: String
- `invoice_settings.footer_translated`: String
- `invoice_settings.foreign_tax`: Number, default 0
- `invoice_settings.home_tax`: Number, default 0
- `invoice_settings.currency_symbol`: String
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### Product

An item the store sells, with its price, images, options and delivery details.

- `name`: String, required - Name of product.
- `url`: String, required - Generated from name, no need to set it manually.
- `static_url`: String - A fixed address kept when the url changes, so old links keep working.
- `ribbon`: String - Short label shown on the product's card, e.g. "New" or "-20%".
- `striked`: String - The old price, shown crossed out next to price: for a sale ("was 12, now 9") set price to 9 and striked to "12". Empty for no sale.
- `price`: Number, required - Price of the product in the site's currency.
- `description`: String - Description of product in html format.
- `product_informations`: Object[] - Extra details listed on the product page, each { name, description } ("Material": "Soy wax").
  - `name`: String, required
  - `description`: String, required
  - `_id`: ObjectId
- `product_options`: Object[] - The choices a buyer makes (Size, Colour): each { name, options: [{ option }] }. An option's text may carry a price change in brackets, "Large (+5)", added to price. Changing the options rebuilds the product's stock lines.
  - `name`: String, required
  - `options`: Object[]
    - `option`: String, required
    - `match_to_collection`: ObjectId, → Collection
    - `quantity`: Number
    - `badge`: String
    - `option_specific_media`: ObjectId, → Media
    - `_id`: ObjectId
  - `informations`: Object[]
    - `name`: String
    - `description`: String
    - `_id`: ObjectId
  - `_id`: ObjectId
- `published`: Boolean, default true - Shown on the site. False hides it from the store and lists without deleting it.
- `available_for_purchase`: Boolean, default true - The whole product can be bought; false stops every option of it. One option sold out ("the white mug ran out") is that option's stock line: quantity 0, tracked.
- `medias`: Object[] - Array of {media}.
  - `media`: ObjectId, → Media
  - `gcs_url`: String
  - `gcs_480_30_url`: String
  - `gcs_720_30_url`: String
  - `gcs_1080_30_url`: String
  - `duration`: Number
  - `vimeo_uri`: String
  - `vimeo_picture`: String
  - `vimeo_url`: String
  - `youtube_url`: String
  - `youtube_picture`: String
  - `thumbnail`: String
  - `_id`: ObjectId
- `collection_id`: ObjectId, → Collection - Collection.id.
- `grouping`: Object[] - The grouping/ filters it appears under inside its category: each { collection_id }.
  - `collection_id`: ObjectId, → Collection
  - `_id`: ObjectId
- `owner_id`: ObjectId, required, → User - User.id.
- `connected_account_owner_id`: ObjectId, → User - User.id.
- `qty`: Number, default 1 - Not the stock: nothing reads it as stock. Stock is kept per option in stock lines (Inventory): read GET /inventory/:product_id/:option, set it with PATCH /inventory/:id {quantity}.
- `origin_address`: String - Name of the address, taken from OriginAdress model, used for filtering.
- `selected`: Boolean, default false - Featured: the home page's highlighted products block shows these first.
- `custom_1`: String - Custom defined field 1.
- `custom_2`: String - Custom defined field 2.
- `custom_3`: String - Custom defined field 3.
- `about_page`: ObjectId, → AboutPage - Reference to AboutPage model, shown in product page.
- `is_digital`: Boolean, default false - Delivered as a download, not shipped.
- `digital_contents`: Object[] - The files a buyer gets.
  - `content`: ObjectId, → DigitalContent
  - `option`: String
  - `_id`: ObjectId
- `suitability_price_plans`: ObjectId[], → PricePlan - PricePlan ids: a signed-in user with one of them sees the product as suitable (isSuitable).
- `isSuitable`: Boolean - Set per request, not stored: whether the signed-in user's price plans match the product's suitability plans.
- `brand`: String - Name of the product brand.
- `brand_logo`: ObjectId, → Media - Logo of the brand, reference to Media model.
- `weight`: Number, default 0 - Weight of the product in kg, for delivery.
- `height`: Number, default 0 - Height of the product in cm, for delivery.
- `length`: Number, default 0 - Length of the product in cm, for delivery.
- `width`: Number, default 0 - Width of the product in cm, for delivery.
- `delivery_type`: String, default "parcel" - Used for delivery, default is parcel, allowed values are books, bulk, letter, parcel or parcel_letter.
- `reference_id`: String - Id of the record it was made from (an import or a clone).
- `secondary_cta.show`: Boolean, default false
- `secondary_cta.title`: String
- `secondary_cta.webUrl`: String
- `secondary_cta.appUrl`: String
- `wildcard_url`: Mixed - The wildcard route the product answers on, when it has one.
- `sku`: Mixed - Stock keeping unit code, when the product has one.
- `reviewed`: Boolean - A moderator reviewed it (marketplace).
- `approved`: Boolean - Approved to be listed (marketplace).
- `expired`: Boolean, default false - Past expires_on and no longer listed.
- `expires_on`: Date - When the listing expires.
- `expire_reminder_sent`: Boolean, default false - The owner was reminded it expires.
- `likes`: ObjectId[], → User - User ids.
- `views`: ObjectId[], → User - User ids.
- `total_views`: Number, default 0 - How many times it was opened.
- `saves`: ObjectId[], → User - User ids.
- `times_showed`: Number, default 0 - How many times it was shown in a list.
- `requiresLogin`: Boolean, default false - Only signed-in users can see it.
- `requiresSubscription`: Boolean, default false - Only subscribers can see it.
- `price_plan_ids`: String[] - Reference to PricePlan ids.
- `linked_products`: Object[] - List of products that are shown for quick add to cart in the product page.
  - `product`: ObjectId, → Product
  - `option`: String
  - `_id`: ObjectId
- `attached_priceplans.name`: String
- `attached_priceplans.priceplans`: ObjectId[], → PricePlan
- `about_section`: ObjectId, → AboutPage - Reference to AboutPage model, shown below the add to cart button.
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### Shipping

- `region`: String, required - The region this delivery setting is for.
- `has_store_pickup`: Boolean, default false - Customers can pick the order up at the pickup point instead of having it delivered.
- `pickup_title`: String - Name of the pickup point.
- `pickup_address`: String - Address of the pickup point.
- `pickup_available`: String - When pickup is possible.
- `pickup_instructions`: String - What customers should know about pickup.
- `delivery`: Object[] - The delivery options offered in this region, each { name, estimated_delivery_time, fixed_rate (its price), has_free_delivery, free_delivery_requirement }. Free delivery over an amount: has_free_delivery true and free_delivery_requirement the minimum order total (threshold) above which it costs nothing. Send the whole list: it replaces the old one.
  - `name`: String
  - `estimated_delivery_time`: String
  - `fixed_rate`: Number
  - `rate_per_total`: Number
  - `rate_per_unit`: Number
  - `has_free_delivery`: Boolean, default false
  - `free_delivery_requirement`: Number, default 0
  - `delivery_days`: Number, default 3
  - `hasIntegration`: Boolean, default true
  - `has_time_window`: Boolean, default false
  - `available_from`: String
  - `available_to`: String
  - `timezone`: String
  - `_id`: ObjectId
- `owner_id`: ObjectId, required, → User - User.id.
- `connected_account_owner_id`: ObjectId, → User - User.id.
- `min_order_value`: Number, default 0 - Smallest order delivery is offered for.
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### SocialModeSettings

The switches for the site's social app features: feed, posts, groups, chat, marketplace.

- `social_mode`: Boolean, default false - The site runs as a social network (feed, profiles).
- `allow_products`: Boolean, default false - Users can sell products.
- `allow_services`: Boolean, default false - Users can offer services.
- `allow_services_stp`: Boolean, default false - Users can take service payments themselves.
- `allow_blogposts`: Boolean, default false - Users can write blog posts.
- `allow_programs`: Boolean, default false - Users can sell programs.
- `allow_programs_stp`: Boolean, default false - Users can take program payments themselves.
- `allow_posts`: Boolean, default false - Users can post to the feed.
- `allow_ai`: Boolean, default false - AI features are on for users.
- `allow_bites`: Boolean, default false - Short videos are on.
- `allow_long_videos`: Boolean, default false - Long videos are on.
- `allow_explore`: Boolean, default false - The explore page is on.
- `allow_online_payments`: Boolean, default false - Users can take online payments.
- `allow_price_plans`: Boolean, default false - Users can sell subscriptions.
- `allow_boosting_posts`: Boolean, default false - Users can pay to boost posts.
- `allow_single_ai`: Boolean, default false - Users get the single-chat AI.
- `merchant_agreement`: ObjectId, → AboutPage - AboutPage.id.
- `verification_popup`: ObjectId, → AboutPage - AboutPage.id.
- `commission`: Number - Platform commission on users' sales, in percent.
- `home_page`: String, default "home" - What opens first (feed, store, about page...).
- `navigation_pages.bites`: Boolean, default true
- `navigation_pages.long_videos`: Boolean, default true
- `navigation_pages.vouchers`: Boolean, default true
- `navigation_pages.store`: Boolean, default true
- `navigation_pages.programs`: Boolean, default true
- `navigation_pages.services`: Boolean, default true
- `navigation_pages.blogposts`: Boolean, default true
- `navigation_pages.subscription`: Boolean, default true
- `navigation_pages.playlists`: Boolean, default true
- `navigation_pages.partners`: Boolean, default true
- `navigation_pages.contacts`: Boolean, default true
- `navigation_pages.tracker`: Boolean, default true
- `navigation_pages.more`: Boolean, default true
- `navigation_pages.claims`: Boolean, default true
- `navigation_pages.miniapps`: Boolean, default false
- `navigation_pages.events`: Boolean, default false
- `navigation_pages.professional_pages`: Boolean, default false
- `allow_google_login`: Boolean, default true - Sign in with Google is on.
- `use_cdn_for_medias`: Boolean, default false - Pictures and videos load from cdn_for_medias.
- `cdn_for_medias`: String - CDN address for media.
- `use_cdn_for_microservices`: Boolean, default false - Microservices are called through cdn_for_microservices.
- `cdn_for_microservices`: String - CDN address for microservices.
- `cdn_for_sockets`: String - Address of the socket server.
- `paywall.store.has_paywall`: Boolean, default false
- `paywall.store.priceplans`: ObjectId[], → PricePlan
- `paywall.programs.has_paywall`: Boolean, default false
- `paywall.programs.priceplans`: ObjectId[], → PricePlan
- `paywall.services.has_paywall`: Boolean, default false
- `paywall.services.priceplans`: ObjectId[], → PricePlan
- `paywall.blogposts.has_paywall`: Boolean, default false
- `paywall.blogposts.priceplans`: ObjectId[], → PricePlan
- `paywall.subscription.has_paywall`: Boolean, default false
- `paywall.subscription.priceplans`: ObjectId[], → PricePlan
- `paywall.post.has_paywall`: Boolean, default false
- `paywall.post.priceplans`: ObjectId[], → PricePlan
- `paywall.groups.has_paywall`: Boolean, default false
- `paywall.groups.priceplans`: ObjectId[], → PricePlan
- `paywall.professional_pages.has_paywall`: Boolean, default false
- `paywall.professional_pages.priceplans`: ObjectId[], → PricePlan
- `allow_chat`: Boolean, default true - Users can message each other.
- `allow_in_app_notifications`: Boolean, default true - In-app notifications are on.
- `dashboard_pages.following`: Boolean, default true
- `dashboard_pages.recent`: Boolean, default true
- `dashboard_pages.threads`: Boolean, default true
- `dashboard_pages.long_videos`: Boolean, default true
- `dashboard_pages.groups`: Boolean, default true
- `dashboard_pages.about_pages`: Boolean, default true
- `dashboard_pages.mini_apps`: Boolean, default true
- `dashboard_pages.blogposts`: Boolean, default true
- `dashboard_pages.products`: Boolean, default true
- `dashboard_pages.services`: Boolean, default true
- `dashboard_pages.price_plans`: Boolean, default true
- `dashboard_pages.programs`: Boolean, default true
- `dashboard_pages.claims`: Boolean, default true
- `dashboard_pages.bites`: Boolean, default true
- `dashboard_pages.playlists`: Boolean, default true
- `dashboard_pages.partners`: Boolean, default true
- `dashboard_pages.contacts`: Boolean, default true
- `dashboard_pages.tracker`: Boolean, default true
- `dashboard_pages.vouchers`: Boolean, default true
- `dashboard_pages.explore`: Boolean, default true
- `feed_menus`: String, default "grid" - Grid, row.
- `allow_miniapps`: Boolean, default false - Mini apps are on.
- `about_pages.groups`: ObjectId, → AboutPage
- `user_groups`: Boolean, default true - Users can create groups.
- `allow_professional_pages`: Boolean, default false - Professional accounts get their own pages.
- `allow_professional_account_registration`: Boolean, default false - Users can apply for a professional account.
- `locations_map.enabled`: Boolean, default false
- `use_companion_bookings`: Boolean, default false - Bookings are handled by the companion app.
- `confirm_bookings_call`: Boolean, default false - The AI phone agent calls to confirm bookings.
- `require_professional_account.services`: Boolean, default false
- `require_professional_account.products`: Boolean, default false
- `require_professional_account.programs`: Boolean, default false
- `require_professional_account.blogposts`: Boolean, default false
- `require_professional_account.subscriptions`: Boolean, default false
- `hide_feed_menus`: Boolean, default false - Feed menus are hidden.
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### Ticket

- `event`: ObjectId, required, → Event - Event.id.
- `date`: Number, required - Index of the event date.
- `section`: Number - Index of the section.
- `subsection`: Number - Index of the subsection.
- `row`: Number - Index of the row.
- `seat`: Number - Index of the seat.
- `row_index_formated`: Number - Row number as shown to the buyer.
- `seat_index_formated`: Number - Seat number as shown to the buyer.
- `lead_id`: ObjectId, → Lead - Lead.id.
- `socket_id`: String - The buyer's live connection, while the seat is held.
- `tier.name`: String
- `tier.price`: Number
- `status`: String, one of frozen | waiting-for-payment | paid | frozen-by-admin | bought-by-admin, default "frozen" - One of: frozen, waiting-for-payment, paid, frozen-by-admin, bought-by-admin.
- `expiration_time`: Date, required - When a held seat is released if not paid.
- `qr_code`: ObjectId, → QrCode - QrCode.id.
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### Unsubscribed

- `email`: String, required - Email that opted out of emails.
- `_id`: ObjectId

### User

A person with an account on the site - customer, staff member or admin.

- `name`: String - Display name.
- `email`: String, required - Email, used to sign in.
- `avatar`: ObjectId - Media.id of the profile picture.
- `social_avatar`: String - Profile picture from a social sign-in.
- `isAdmin`: Boolean, default false - Can use the admin.
- `isStaff`: Boolean, default false - A staff member who can be booked.
- `owner_id`: ObjectId - User.id of the admin who added this user.
- `organization_name`: String - Company name.
- `firstname`: String - First name.
- `lastname`: String - Last name.
- `phone_number`: String - Phone number.
- `address`: String - Address.
- `city`: String - City.
- `state`: String - State or region.
- `country`: String - Country.
- `zip_code`: String - Postal code.
- `tax_identification_number`: String - Tax number.
- `notes`: String - Notes kept on the user.
- `isConfirmed`: Boolean, default false - The email was confirmed.
- `number_of_sales`: Number, default 0 - How many sales the user made (marketplace).
- `stripe_id`: String - The user's id in Stripe.
- `paypal_id`: String - The user's PayPal id.
- `access_level`: Number - Admin permission level; 0 is full access.
- `can_edit.site`: Boolean, default true
- `can_edit.crm`: Boolean, default true
- `can_edit.store`: Boolean, default true
- `can_edit.payments`: Boolean, default true
- `can_edit.staff`: Boolean, default true
- `validation_code`: String - Code sent to confirm the email.
- `price_plans`: ObjectId[], → PricePlan - PricePlan ids.
- `emotion`: String - Positive, neutral, negative.
- `political_spectrum`: String - Far left, left, far right, right, middle.
- `language`: Mixed - Multiple objects inside - key: value - example - "EN": 5 (5 being the weight);.
- `interests`: Mixed - Multiple objects inside - key: value - example - "hobby": 5 (5 being the weight);.
- `app_category`: Mixed - Multiple objects inside - key: value - example - "hobby": 5 (5 being the weight);.
- `user_profile`: Mixed - Multiple objects inside - key: value - example - "intelligent": 5 (5 being the weight);.
- `user_economics`: String - Low, middle, high.
- `user_education`: String - Low, middle, high.
- `marital_status`: String - Single, married.
- `age`: String - 0-18, 18-25, 25-30, 30-35, 35-45, 45-60.
- `sex`: String - Male - female.
- `attractiveness`: String - Low, medium, high.
- `following`: ObjectId[], → User - User ids.
- `followers`: ObjectId[], → User - User ids.
- `handle`: String - Unique @handle.
- `saved_posts`: ObjectId[], → Post - Post ids.
- `blocked_users`: ObjectId[], → User - User ids.
- `blocked_by`: ObjectId[], → User - User ids.
- `bio`: String - About the user.
- `wallet`: Number, default 0 - Balance in the user's wallet.
- `ip_location.city`: String
- `ip_location.continent_name`: String
- `ip_location.country_name`: String
- `ip_location.country_subdivision`: String
- `ip_location.location_latitude`: Number
- `ip_location.location_longitude`: Number
- `ip_location.last_updated`: Date
- `ip_location.ip_address`: String
- `ip_location.zip_code`: String
- `ip_location.dialing_code`: String
- `location`: Embedded - The user's chosen location.
  - `type`: String, one of Point
  - `coordinates`: Number[]
  - `_id`: ObjectId
- `checkout_recovery_at`: Date - When we last emailed them about a Premium checkout they left (utils/checkout-recovery).
- `search_history`: String[] - What the user searched for.
- `isRestricted`: Boolean, default false - Restricted by a moderator.
- `isMonetized`: Boolean, default false - Earns from their content.
- `monetization_request.isRequested`: Boolean, default false
- `monetization_request.requested_on`: Date
- `sentFollowersEmail`: Date - When the followers summary email was last sent.
- `isShadowbanned`: Boolean, default false - Their content is hidden from others without telling them.
- `custom_url`: Object[] - Custom addresses for their profile.
  - `heading`: String
  - `url`: String
  - `_id`: ObjectId
- `isWhitelisted`: Boolean, default false - Skips moderation.
- `isReviewedWhitelist`: Boolean, default false - The whitelist request was reviewed.
- `advertiser_id`: String - Id as an advertiser.
- `selected_events`: String[] - Events the user follows.
- `profile_feed_style`: String, default "list" - How their profile feed looks (grid, list).
- `hidden_users`: ObjectId[], → User - User ids whose posts are hidden from this user's feed.
- `isVerified`: Boolean, default false - Shows the verified badge.
- `saved_products`: ObjectId[], → Product - Product ids the user saved.
- `saved_programs`: ObjectId[], → Program - Program ids the user saved.
- `saved_blogposts`: ObjectId[], → Blogpots - BlogPost ids the user saved.
- `saved_services`: ObjectId[], → Service - Service ids the user saved.
- `last_used_miniapps`: ObjectId[], → MiniApp - MiniApp ids.
- `has_disabled_seen`: Boolean, default false - Read receipts are off.
- `other_address`: Object[] - Other saved addresses.
  - `firstname`: String
  - `lastname`: String
  - `email`: String
  - `phone_number`: String
  - `address`: String
  - `city`: String
  - `state`: String
  - `country`: String
  - `zip_code`: String
  - `_id`: ObjectId
- `is_disabled`: Boolean, default false - The account is disabled.
- `delete_date`: Date - When the account will be deleted.
- `trial_price_plans`: Object[] - Price plans the user is trying, and until when.
  - `end_date`: Date
  - `start_date`: Date
  - `price_plan`: ObjectId, → PricePlan
  - `_id`: ObjectId
- `lastActivity`: Date - When the user was last active.
- `attached_dynamic_models`: Object[] - Records of custom models attached to the user.
  - `model`: ObjectId, → DynamicModel
  - `document`: ObjectId
  - `_id`: ObjectId
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date
