diff --git a/Gemfile.lock b/Gemfile.lock
index 983647a..0cd5723 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -13,15 +13,11 @@ GEM
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.17.1-arm64-darwin)
- ffi (1.17.1-x64-mingw-ucrt)
ffi (1.17.1-x86_64-linux-gnu)
forwardable-extended (2.6.0)
google-protobuf (4.30.2-arm64-darwin)
bigdecimal
rake (>= 13)
- google-protobuf (4.30.2-x64-mingw-ucrt)
- bigdecimal
- rake (>= 13)
google-protobuf (4.30.2-x86_64-linux)
bigdecimal
rake (>= 13)
@@ -82,8 +78,6 @@ GEM
safe_yaml (1.0.5)
sass-embedded (1.87.0-arm64-darwin)
google-protobuf (~> 4.30)
- sass-embedded (1.87.0-x64-mingw-ucrt)
- google-protobuf (~> 4.30)
sass-embedded (1.87.0-x86_64-linux-gnu)
google-protobuf (~> 4.30)
terminal-table (3.0.2)
@@ -93,7 +87,6 @@ GEM
PLATFORMS
arm64-darwin
- x64-mingw-ucrt
x86_64-linux-gnu
DEPENDENCIES
diff --git a/_config.yml b/_config.yml
index 7a4eee8..4fd4007 100644
--- a/_config.yml
+++ b/_config.yml
@@ -1,4 +1,4 @@
-title: Quant Flow Doc
+title: Quant Flow Docs
description: The comprehensive documentation for Quant Flow, Payscript and the Sandbox.
theme: just-the-docs
@@ -9,6 +9,7 @@ url: https://just-the-docs.github.io
aux_links:
Quant: https://quant.network/
Quant Flow: https://quant.network/quant-flow/
+ Sandbox: https://programmable-payments.payments.quantnetwork.net
favicon_ico: "/assets/images/favicon.ico"
diff --git a/docs/connect_to_bank_accounts/get_consent.md b/docs/connect_to_bank_accounts/get_consent.md
deleted file mode 100644
index 38e1d17..0000000
--- a/docs/connect_to_bank_accounts/get_consent.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: Get Consent for a Bank Account
-parent: Connect Your Bank Accounts
-layout: default
-nav_order: 1
----
-
-# Step 1: Get Consent for a Bank Account
-
-Providing consent is the essential first step to securely connecting your bank to Quant Flow. This process, often facilitated by Open Banking, is a regulatory requirement that gives you control and security.
-
-## What is Consent?
-
-Consent is your formal authorization for Quant Flow to access specific financial data from your bank, such as transaction histories and account details. This is done through a secure portal directly with your bank, meaning your login credentials are never shared with or seen by Quant Flow.
-
-## How to Get Consent
-
-1. Navigate to the **Bank Accounts** section in your Quant Flow dashboard.
-2. Click **"Connect New Bank Account"**.
-3. Select your bank from the list of supported institutions.
-4. You will be securely redirected to your own bank's website or app.
-5. Authenticate yourself directly with your bank (e.g., using your mobile banking app, card reader, or password).
-6. Your bank will clearly show what data you are sharing and for how long. Review and confirm this request.
-
-## Consent Expiry (UK Accounts)
-
-For accounts based in the United Kingdom, regulations require that access consents are renewed every **90 days**. Quant Flow will notify your Admin Users well before a consent expires to ensure a seamless, uninterrupted service.
\ No newline at end of file
diff --git a/docs/connect_to_bank_accounts/index.md b/docs/connect_to_bank_accounts/index.md
deleted file mode 100644
index f603c9f..0000000
--- a/docs/connect_to_bank_accounts/index.md
+++ /dev/null
@@ -1,43 +0,0 @@
----
-title: Connect Your Bank Accounts
-layout: page
-nav_order: 3
----
-
-# Connect Your Bank Accounts to Quant Flow
-
-Welcome to the heart of your financial automation. Connecting your bank accounts is a secure and straightforward process that unlocks the full power of Quant Flow for your company.
-
-Once connected, you can automate payments, reconcile transactions, and gain real-time financial insights—all from a single dashboard.
-
-## How It Works: A Simple Three-Step Process
-
-Linking a new bank account to your company's Quant Flow profile is designed to be quick and compliant.
-
-1. **Grant Consent (Authorize)**
- * **What it is:** You securely provide Quant Flow with permission to access transaction data from your bank. This is a standard regulatory requirement known as Open Banking (in the UK/Europe) or similar frameworks globally.
- * **Who does it:** Any Admin User for your company. The authorization is given for the entire company, not just an individual user.
-
-2. **Link & Activate**
- * **What it is:** Once consent is granted, you "activate" the bank account for use within Quant Flow. This is when the magic starts.
- * **Who does it:** An Admin User decides which consented accounts to activate.
- * **The Key:** The number of bank accounts you can actively **link and use** is determined by your **Quant Flow User Plan**. Think of your plan as defining how many simultaneous automation streams you can have.
-
-3. **Manage & Automate**
- * **What it is:** With an active bank account linked, you can now create powerful automations (like rule-based payments, cash flow forecasts, and reconciliation scripts) that run seamlessly.
- * **You are in control:** You can view connection status, extend consents, or deactivate accounts at any time from your dashboard.
-
-## Key Things to Know
-
-* **Company-Wide Access:** All Admin Users under your `CompanyID` can view and manage your company's bank connections. This ensures transparency and collaborative financial management.
-* **Your Plan, Your Capacity:** Your subscription plan defines the number of bank accounts you can have **active and automated** at once. You can always upgrade your plan to link more accounts.
-* **Secure by Design:** We use robust, bank-level security and never store your online banking credentials.
-
----
-
-**Ready to get started?** Explore the guides below to learn about each step in detail.
-{: .note .p-3 }
-
-* [How to Get Consent for a Bank Account](./get_consent)
-* [How to Link and Activate a Bank Account](./link_account)
-* [Managing Your Connected Accounts](./manage_consents)
diff --git a/docs/connect_to_bank_accounts/link_account.md b/docs/connect_to_bank_accounts/link_account.md
deleted file mode 100644
index ec426b2..0000000
--- a/docs/connect_to_bank_accounts/link_account.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: Link and Activate a Bank Account
-parent: Connect Your Bank Accounts
-layout: default
-nav_order: 2
----
-
-# Step 2: Link and Activate a Bank Account
-
-After you have successfully granted consent, the next step is to activate the bank account within Quant Flow to start building automations.
-
-## Consent vs. Activation
-
-* **Consent:** The *permission* to access the data. A company can have consent for many bank accounts.
-* **Linking/Activation:** The *action* of using that consented account within your automations. The number of accounts you can activate is limited by your User Plan.
-
-## How to Link an Account
-
-1. Go to **Bank Accounts**. You will see a list of all accounts for which your company has given consent. They are going to be separated in two sections **"Active bank account"s, "Inactive bank accounts"**
-2. Find the account you wish to use in the **"Inactive bank accounts"** and click **"Activate"**.
-3. The system will check if you have available slots in your current User Plan.
-4. If you do, the account will become active and its status will change to **"Active"**. You can now create automations that use this account.
-5. If you have reached your plan's limit, you will be prompted to **upgrade your plan** before you can activate the new account.
\ No newline at end of file
diff --git a/docs/connect_to_bank_accounts/manage_consents.md b/docs/connect_to_bank_accounts/manage_consents.md
deleted file mode 100644
index f9bf302..0000000
--- a/docs/connect_to_bank_accounts/manage_consents.md
+++ /dev/null
@@ -1,41 +0,0 @@
----
-title: Manage Your Connected Accounts
-parent: Connect Your Bank Accounts
-layout: default
-nav_order: 3
----
-
-# Managing Consents and Connected Accounts
-
-You have full visibility and control over all your company's bank connections from the Quant Flow dashboard.
-
-## Viewing Connected Accounts
-
-The **Bank Accounts** overview page shows all accounts associated with your `CompanyID`, including:
-* **Account Name/Nickname**
-* **Bank Name**
-* **Account Number** (masked for security)
-* **Status:** (e.g., `Active`, `Inactive`, `Expired`, `Authorised`, `Revoked`)
-* **Consent Expiry Date**
-
-## Extending Consent
-
-For UK accounts, you must renew consent every 90 days.
-1. The system will show an **"In X days your bank account will expire, please extend"** warning next to relevant accounts.
-2. An Admin User can click **"Extend"** button.
-3. You will be guided through the same secure authentication process with your bank to grant a new 90-day consent. Your existing automations will continue to run without interruption.
-
-## Deactivating an Account
-
-You can deactivate an account at any time.
-1. Find the active account and select **"Deactivate"**.
-2. **Important Consideration:** Deactivating an account will pause **all automations** associated with it. This may disrupt scheduled payments, data feeds, or reconciliation processes. You will be asked to confirm this action.
-3. The account will move to an **"Inactive"** state but will retain its consent, allowing you to easily reactivate it later without going through the full bank authorization again (as long as the consent is still valid).
-
-## Revoking Consent Entirely
-
-If you wish to permanently remove Quant Flow's access to an account:
-1. You can **"Revoke Consent"** from either an Active or Inactive account.
-2. This action is irreversible and severs the connection to your bank.
-3. All automations for this account will be permanently halted.
-4. To use this account again in the future, you will need to start from the beginning of the consent process.
\ No newline at end of file
diff --git a/docs/payscript/example_scripts/automatedTransfer.groovy b/docs/payscript/example_scripts/automatedTransfer.groovy
new file mode 100644
index 0000000..41469fc
--- /dev/null
+++ b/docs/payscript/example_scripts/automatedTransfer.groovy
@@ -0,0 +1,23 @@
+trigger = "on_demand";
+
+def payer = ${payer:scan};
+def payee = ${payee:scan};
+def amount = ${amount:decimal};
+
+def payment = PaymentInfo.builder()
+ .payer(AccountInfo.builder()
+ .type(AccountIdentifierType.SCAN)
+ .identifier(payer)
+ .build())
+ .payee(AccountInfo.builder()
+ .type(AccountIdentifierType.SCAN)
+ .identifier(payee)
+ .build())
+ .amountInfo(AmountInfo.builder()
+ .currency(CurrencyEnum.GBP)
+ .amount(amount)
+ .build())
+ .paymentReference("Automated transfer")
+ .build();
+
+def newPaymentId = createPayment(payment);
\ No newline at end of file
diff --git a/docs/payscript/example_scripts/automated_transfer.md b/docs/payscript/example_scripts/automated_transfer.md
new file mode 100644
index 0000000..1f043e5
--- /dev/null
+++ b/docs/payscript/example_scripts/automated_transfer.md
@@ -0,0 +1,16 @@
+---
+title: Automated Transfer
+parent: Example Scripts
+layout: page
+---
+
+# Automated Transfer
+This script makes a transfer on demand.
+
+
+[Download](automatedTransfer.groovy){: .btn }
+
+
+{% highlight groovy %}
+{% include_relative automatedTransfer.groovy %}
+{% endhighlight %}
diff --git a/docs/payscript/example_scripts/cashflow_optimisation.groovy b/docs/payscript/example_scripts/cashflow_optimisation.groovy
deleted file mode 100644
index 44174d4..0000000
--- a/docs/payscript/example_scripts/cashflow_optimisation.groovy
+++ /dev/null
@@ -1,29 +0,0 @@
-trigger = "time";
-
-var savingsAccount = ${savingsAccount:AccountInfo};
-var minAmount = ${minimumAccountBalance:decimal};
-var maxAmount = ${maximumAccountBalance:decimal};
-
-var bankAccount = getAutomationOwnerAccountInfo();
-var bankAccountBalance = getBalance(bankAccount);
-var bankAccountBalanceAmount = bankAccountBalance.availableBalance;
-
-if (bankAccountBalanceAmount.compareTo(minAmount) > 0) {
- def transferAmount = bankAccountBalanceAmount.subtract(minAmount);
- if (transferAmount.compareTo(maxAmount) > 0) {
- transferAmount = maxAmount;
- }
- var transferFromCurrentToSaving = PaymentInfo.builder()
- .payer(bankAccount)
- .payee(savingsAccount)
- .amount(AmountInfo.builder()
- .currency(Currency.GBP)
- .amount(transferAmount)
- .build())
- .reason("Cash-flow management")
- .build();
- var payment = createPayment("502652ac-8643-40ee-8275-fd89d449e88f", transferFromCurrentToSaving);
- logMessage("Cash-flow management completed successfully with amount" + transferAmount + "with payment ID: " + payment.paymentId);
-} else {
- logMessage("Cash-flow management: the balance (" + bankAccountBalanceAmount + ") doesn't meet the threshold (" + minAmount + ")");
-}
diff --git a/docs/payscript/example_scripts/cashflow_optimisation.md b/docs/payscript/example_scripts/cashflow_optimisation.md
deleted file mode 100644
index 8c8558c..0000000
--- a/docs/payscript/example_scripts/cashflow_optimisation.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: Cash-Flow Optimisation
-parent: Example Scripts
-layout: page
----
-
-# Cash-Flow Optimisation
-This automation ensures that funds are always available in the right accounts at the right time - helping corporate customers cover upcoming expenses, avoid overdrafts, and maintain optimal liquidity without manual intervention.
-
-Automatically detect surplus cash above a certain threshold. Transfer surplus into high-interest savings or investment accounts. Trigger cash movement based on account balance thresholds.
-
-
-[Download](cashflow_optimisation.groovy){: .btn }
-
-
-{% highlight groovy %}
-{% include_relative cashflow_optimisation.groovy %}
-{% endhighlight %}
diff --git a/docs/payscript/example_scripts/credit_optimisation.groovy b/docs/payscript/example_scripts/credit_optimisation.groovy
deleted file mode 100644
index 0766ad6..0000000
--- a/docs/payscript/example_scripts/credit_optimisation.groovy
+++ /dev/null
@@ -1,25 +0,0 @@
-trigger = "transaction";
-
-var savingsAccount = ${savingsAccount:AccountInfo};
-var percentageToTransfer = ${percentageToTransfer:decimal};
-var saveOnTransactionsOver = ${saveOnTransactionsOver:decimal};
-
-var incomingPaymentAmount = getTriggerTransactionDetails().getAmount().getAmount();
-
-if (incomingPaymentAmount.compareTo(saveOnTransactionsOver) < 0) {
- return;
-}
-
-var amountToTransfer = incomingPaymentAmount.multiply(percentageToTransfer).divide(100);
-var currentAccount = getAutomationOwnerAccountInfo();
-var transfer = PaymentInfo.builder()
- .payer(currentAccount)
- .payee(savingsAccount)
- .amount(AmountInfo.builder()
- .currency(Currency.GBP)
- .amount(amountToTransfer)
- .build())
- .reason("Credit Optimisation")
- .build();
-
-createPayment("e70fefd2-c52a-46c2-848d-cd7a6d9bcacd",transfer);
diff --git a/docs/payscript/example_scripts/credit_optimisation.md b/docs/payscript/example_scripts/credit_optimisation.md
deleted file mode 100644
index 0560a55..0000000
--- a/docs/payscript/example_scripts/credit_optimisation.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: Credit Optimisation
-parent: Example Scripts
-layout: page
----
-
-# Credit Optimisation
-This automation ensures that funds are always available in the right accounts at the right time - helping corporate customers cover upcoming expenses, avoid overdrafts, and maintain optimal liquidity without manual intervention.
-
-Continuously track an account for surplus cash beyond regular business needs. When surplus funds are available, automatically apply extra payments towards any credit account. Turn spare cash into smart repayments - no effort required.
-
-
-[Download](credit_optimisation.groovy){: .btn }
-
-
-{% highlight groovy %}
-{% include_relative cashflow_optimisation.groovy %}
-{% endhighlight %}
diff --git a/docs/payscript/example_scripts/helloWorld.groovy b/docs/payscript/example_scripts/helloWorld.groovy
new file mode 100644
index 0000000..14fbdb8
--- /dev/null
+++ b/docs/payscript/example_scripts/helloWorld.groovy
@@ -0,0 +1,2 @@
+trigger = "on_demand";
+logMessage("Hello, world!");
\ No newline at end of file
diff --git a/docs/payscript/example_scripts/hello_world.md b/docs/payscript/example_scripts/hello_world.md
new file mode 100644
index 0000000..b8af25b
--- /dev/null
+++ b/docs/payscript/example_scripts/hello_world.md
@@ -0,0 +1,16 @@
+---
+title: Hello World
+parent: Example Scripts
+layout: page
+---
+
+# Hello World
+This script prints "Hello, World!" to the logs.
+
+
+[Download](helloWorld.groovy){: .btn }
+
+
+{% highlight groovy %}
+{% include_relative helloWorld.groovy %}
+{% endhighlight %}
diff --git a/docs/payscript/example_scripts/reserveFunds.groovy b/docs/payscript/example_scripts/reserveFunds.groovy
new file mode 100644
index 0000000..3cb5271
--- /dev/null
+++ b/docs/payscript/example_scripts/reserveFunds.groovy
@@ -0,0 +1,8 @@
+trigger="on_demand";
+
+def fromAccount = new Scan(${sortCode:string}, ${accountNumber:string});
+def toReserve = ${toReserve:string};
+def amount = ${amount:decimal};
+def reference = ${reference:string?};
+
+addFundsToReserve(fromAccount, toReserve, amount, reference);
\ No newline at end of file
diff --git a/docs/payscript/example_scripts/reserve_funds.md b/docs/payscript/example_scripts/reserve_funds.md
new file mode 100644
index 0000000..2491b01
--- /dev/null
+++ b/docs/payscript/example_scripts/reserve_funds.md
@@ -0,0 +1,16 @@
+---
+title: Reserve Funds
+parent: Example Scripts
+layout: page
+---
+
+# Reserve Funds
+This script adds an amount of funds to a reserve.
+
+
+[Download](reserveFunds.groovy){: .btn }
+
+
+{% highlight groovy %}
+{% include_relative reserveFunds.groovy %}
+{% endhighlight %}
diff --git a/docs/payscript/example_scripts/tax_optimisation.groovy b/docs/payscript/example_scripts/tax_optimisation.groovy
deleted file mode 100644
index e87a123..0000000
--- a/docs/payscript/example_scripts/tax_optimisation.groovy
+++ /dev/null
@@ -1,29 +0,0 @@
-trigger = transaction(payer = anyExcept(), payee=OWNER);
-
-var savingsAccount = ${savingsAccount:AccountInfo};
-var taxPercentage = ${taxPercentage:decimal};
-
-if(taxPercentage <=BigDecimal.ZERO ||taxPercentage >BigDecimal.valueOf(100)){
- throw new IllegalArgumentException("Invalid taxPercentage:"+taxPercentage +" Must be > 0 and ≤ 100.");
-}
-
-var triggerTransactionAmount = getTriggerTransactionDetails().getAmount().getAmount();
-var currentAccount = getAutomationOwnerAccountInfo();
-
-var saveTaxAmount = triggerTransactionAmount
- .multiply(taxPercentage)
- .divide(BigDecimal.valueOf(100));
-
-var payment = PaymentInfo.builder()
- .payer(currentAccount)
- .payee(savingsAccount)
- .amount(AmountInfo.builder()
- .currency(Currency.GBP)
- .amount(saveTaxAmount)
- .build())
- .reason("Save Tax")
- .build();
-
-var newPaymentId = createPayment("69c47867-49f6-481e-a8a9-248d75349f47", payment);
-
-logMessage("Saving tax completed successfully with paymentId:"+newPaymentId +" ");
diff --git a/docs/payscript/example_scripts/tax_optimisation.md b/docs/payscript/example_scripts/tax_optimisation.md
deleted file mode 100644
index 60c4628..0000000
--- a/docs/payscript/example_scripts/tax_optimisation.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: Tax optimisation
-parent: Example Scripts
-layout: page
----
-
-# Tax optimisation
-This automation allows you to allocate a percentage of incoming payments to a designated tax account - helping you to consistently set aside funds for future tax bills and reducing stress during tax season.
-
-Trigger a payment on every incoming transaction. Calculate a specified % amount of tax on the incoming transaction. Automatically transfer the calculated amount to a specified account.
-
-
-[Download](tax_optimisation.groovy){: .btn }
-
-
-{% highlight groovy %}
-{% include_relative tax_optimisation.groovy %}
-{% endhighlight %}
diff --git a/docs/payscript/example_scripts/topup.groovy b/docs/payscript/example_scripts/topup.groovy
new file mode 100644
index 0000000..f02bc05
--- /dev/null
+++ b/docs/payscript/example_scripts/topup.groovy
@@ -0,0 +1,26 @@
+trigger = "time";
+
+def account_parent = ${account_parent:scan};
+def account_child = ${account_child:scan};
+def topUpGoal = ${topUpGoal:decimal};
+
+balance = getBalance(account_child);
+
+if (balance < topUpGoal) {
+ def payment = PaymentInfo.builder()
+ .payer(AccountInfo.builder()
+ .type(AccountIdentifierType.SCAN)
+ .identifier(account_parent)
+ .build())
+ .payee(AccountInfo.builder()
+ .type(AccountIdentifierType.SCAN)
+ .identifier(account_child)
+ .build())
+ .amountInfo(AmountInfo.builder()
+ .currency(CurrencyEnum.GBP)
+ .amount(topUpGoal - balance)
+ .build())
+ .paymentReference("Top-up payment.")
+ .build();
+ createPayment(payment);
+}
\ No newline at end of file
diff --git a/docs/payscript/example_scripts/topup.md b/docs/payscript/example_scripts/topup.md
new file mode 100644
index 0000000..7325ba4
--- /dev/null
+++ b/docs/payscript/example_scripts/topup.md
@@ -0,0 +1,16 @@
+---
+title: Top-up
+parent: Example Scripts
+layout: page
+---
+
+# Top-up
+This script runs periodically to top up another account with funds up to a specified amount.
+
+
+[Download](topup.groovy){: .btn }
+
+
+{% highlight groovy %}
+{% include_relative topup.groovy %}
+{% endhighlight %}
diff --git a/docs/sandbox/get_sandbox_access.md b/docs/sandbox/get_sandbox_access.md
new file mode 100644
index 0000000..d4177e9
--- /dev/null
+++ b/docs/sandbox/get_sandbox_access.md
@@ -0,0 +1,9 @@
+---
+title: Get Access
+layout: page
+parent: Sandbox
+---
+
+# Get Access to the Sandbox
+Request a demo from us at [Quant network](https://quant.network)
+
diff --git a/docs/sandbox/index.md b/docs/sandbox/index.md
new file mode 100644
index 0000000..5eb5eb6
--- /dev/null
+++ b/docs/sandbox/index.md
@@ -0,0 +1,19 @@
+---
+title: Sandbox
+layout: page
+nav_order: 3
+---
+
+# Sandbox
+The Quant Flow programmable payments Sandbox is an environment to validate business cases by allowing customers to explore Payscript. It allows accelerated innovation through a risk-free environment for quick iteration, trial and learning.
+
+## Core Features:
+- Account and Customer journeys
+- API endpoints and webhooks for U.I.
+- Complete Banking Simulator
+- User Access Control
+- Customer experience simulation U.I.
+- Fully standalone SaaS environment
+- PayScript templates
+- Technical support
+
diff --git a/docs/tutorials/index.md b/docs/tutorials/index.md
new file mode 100644
index 0000000..4a9e680
--- /dev/null
+++ b/docs/tutorials/index.md
@@ -0,0 +1,5 @@
+---
+title: Tutorials
+layout: page
+nav_order: 5
+---
diff --git a/docs/tutorials/tutorial_automated_transfer.md b/docs/tutorials/tutorial_automated_transfer.md
new file mode 100644
index 0000000..257561f
--- /dev/null
+++ b/docs/tutorials/tutorial_automated_transfer.md
@@ -0,0 +1,98 @@
+---
+title: Automated Transfer
+parent: Tutorials
+layout: page
+nav_order: 2
+---
+
+# Automated Transfer
+This tutorial will guide you through deploying and running your first payscript which will make a transaction between two customer accounts.
+We will use the [Sandbox][sandbox] environment to deploy a script, create an automation and run it.
+
+### Prerequisites:
+- Have a Sandbox account
+
+## The script
+Please take a look at the script we will use:
+
+```groovy
+trigger = "on_demand";
+
+
+def payer = ${payer:scan};
+def payee = ${payee:scan};
+def amount = ${amount:decimal};
+
+def payment = PaymentInfo.builder()
+ .payer(AccountInfo.builder()
+ .type(AccountIdentifierType.SCAN)
+ .identifier(payer)
+ .build())
+ .payee(AccountInfo.builder()
+ .type(AccountIdentifierType.SCAN)
+ .identifier(payee)
+ .build())
+ .amountInfo(AmountInfo.builder()
+ .currency(CurrencyEnum.GBP)
+ .amount(amount)
+ .build())
+ .paymentReference("Automated transfer")
+ .build();
+
+def newPaymentId = createPayment(payment);
+```
+
+On the first line, we define the trigger type; "on_demand" will allow us to run the automation with the click of a button.
+In the next block, the syntax `${name:type}` defines the parameters that will be used in the script, which in this case are the [SCAN][scan] of the payer and the payee, as well as the amount to be payed.
+Next up is the logic. We use the builder pattern to construct the data structure of the Payment using the parameters, and then we create the payment with that data on the last line.
+
+## Deployment
+In order for the customers to create automations, the script must be deployed first. To do this, log in to the Sandbox environment and navigate to the developer tab.
+
+
+

+
+
+
+

+
+
+Click the Import Button and fill in the information for the script you are deploying:
+- Name and Description: The name and description of the script as will be seen by customers.
+- Category: a purely organizational category for the script
+- Upload file: select the file you created in the previous step.
+
+After uploading, your script should appear in the list. The Actions column has the green rocket button. Click that one to deploy the script, and make it available for customers.
+
+This ends the work necessary from a developer's perspective.
+
+## Creating an automation
+From now on we will be using the system as a customer; select the customer view from the top tab, and choose a customer to "log in" as.
+
+
+

+
+Go to the Automations tab and click the button to create a new automation.
+
+
+
+Choose a name for this automation, that makes sense to the customer who owns it. Select which script will be used in this automation, which in this case should be the script we deployed in previous steps. (If you don't see it here, you probably forgot to click the deploy button in the developer view.)
+Check the box to activate it.
+
+## Run the automation
+Because the automation we just deployed uses a script with an "on_demand" trigger, we can run it in the Automations tab in the customer's account, by clicking on the green triangle button.
+
+
+
+## Success!
+With this basic example you were able to deploy a payscript in the Sandbox and understand how it can be used by a customer, giving you a broad idea of all the possibilities.
+In the next tutorial we will introduce the concept of consent, which will be necessary to perform actions on behalf of a different customer such as making a transfer or checking their balance.
+
+
+# Next:
+- [Top-up]
+
+[Top-up]: /docs/tutorials/tutorial_topup
+
+[sandbox]: /docs/sandbox
+[scan]: /docs/payscript/built_in_functions#scan
\ No newline at end of file
diff --git a/docs/tutorials/tutorial_deploying_a_script.md b/docs/tutorials/tutorial_deploying_a_script.md
new file mode 100644
index 0000000..a9201a2
--- /dev/null
+++ b/docs/tutorials/tutorial_deploying_a_script.md
@@ -0,0 +1,120 @@
+
+
+# Deploying a script
+This tutorial will guide you through deploying and running your first payscript which will allow the customer to move funds to a reserve.
+We will use the [sandbox](sandbox) environment to deploy a script, create an automation and run it.
+
+### Prerequisites:
+- Have a Sandbox account
+
+
+## The script
+Please take a look at the script we will use:
+```groovy
+trigger="on_demand";
+
+def fromAccount = new Scan(${sortCode:string}, ${accountNumber:string});
+def toReserve = ${toReserve:string};
+def amount = ${amount:decimal};
+def reference = ${reference:string?};
+
+addFundsToReserve(fromAccount, toReserve, amount, reference);
+```
+It consists of three parts.
+The first part of any script is the [trigger]. It defines what type of conditions will cause the script to run. This script will run "on demand" which means we will be able to trigger it by clicking a button, however different trigger types can allow the script to be run on a schedule, whenever a transaction happens, or even triggered by other scripts.
+The second part is the parameter definitions. In payscript, the sequence `${parameterName:type}` defines a script parameter, which is information that is required to be filled by the user in order to create an automation from this script.
+The third part is the script's logic, which in this example is simply one call of a built-in function to add funds to a reserve.
+
+Save this script in your computer as `funds_to_reserve.groovy`
+
+## Deployment
+In order for the customers to create automations, the script must be deployed first. To do this, log in to the Sandbox environment and navigate to the developer tab.
+
+
+
+Click the Import Button and fill in the information for the script you are deploying:
+- Name and Description: The name and description of the script as will be seen by customers.
+- Category: a purely organizational category for the script
+- Upload file: select the file you created in the previous step.
+
+
+
+After uploading, your script should appear like this at the top of the list. The Actions column has the green rocket button. Click that one to deploy the script, and make it available for customers.
+
+This ends the work necessary from a developer's perspective.
+
+## Creating a reserve
+From now on we will be using the system as a customer; select the customer view from the top tab, and choose a customer to "log in" as.
+
+
+
+
+

+
+
+Under the customer's reserves tab, create a new reserve if the customer doesn't already have one.
+
+
+

+
+
+Once the reserve is created you are able to view information about it by selecting it from the list. On this page you can get the reserve ID by clicking the Copy icon. You will need this ID to create the automation, as well as the account holder's sort code and account number.
+
+## Creating an automation
+
+
+

+
+Go to the Automations tab and click the button to create a new automation.
+
+
+

+
+Choose a name for this automation, that makes sense to the customer who owns it. Select which script will be used in this automation, which in this case should be the script we deployed in previous steps. (If you don't see it here, you probably forgot to click the deploy button in the developer view.)
+
+
+

+
+
+Fill in the details to be used in the automation:
+- Account Number & Sort Code: The bank details of the account which is funding the reserve.
+- Amount: The amount that will be transfered every time the automation runs.
+- Reference: The transaction reference, a string that is registered on each transaction made, to help identify its purpose.
+- To Reserve: The ID of the reserve that will receive the funds. You can get this from the reserve page.
+
+
+

+
+
+After selecting the script, fill the script parameters. Choose a value for the amount. The payer account number and sort code should be those from the customer account who is deploying the script. For the payee choose any other account.
+
+
+
+
+Now the automation is created! Because its trigger type is "on demand", you can click the green triangle button to run it whenever you wish.
+
+Once run, you will see the transaction it created in the transaction history of the customer's account.
+
+
+
+

+
+
+Success!
+
+With this basic example you were able to deploy a payscript in the Sandbox and understand how it can be used by a customer, giving you a broad idea of all the possibilities.
+
+In the next tutorial we will introduce the concept of consent, which will be necessary to perform transactions on behalf of a different customer.
+
+# Next:
+- [2 - Consent]
+
+[2 - Consent]: /docs/tutorials/tutorial2
+
+[sandbox]: /docs/sandbox
+[trigger]: /docs/payscript/language_reference.html#triggers
diff --git a/docs/tutorials/tutorial_hello_world.md b/docs/tutorials/tutorial_hello_world.md
new file mode 100644
index 0000000..fdcc113
--- /dev/null
+++ b/docs/tutorials/tutorial_hello_world.md
@@ -0,0 +1,64 @@
+---
+title: Hello World
+parent: Tutorials
+layout: page
+nav_order: 1
+---
+
+# Hello World
+Follow these steps to run a simple PayScript to see it print a message to the logs.
+We will use the [sandbox](sandbox) environment to deploy a script, create an automation and run it.
+
+```groovy
+trigger = "on_demand";
+logMessage("Hello, world!");
+```
+
+The first line defines an on-demand trigger, which is a type of trigger that can be run manually by pressing a button. The trigger definition can be considered anologous to the entry point in other languages.
+
+The second line calls the [built-in function][built-in function] `logMessage` to display the message on the logs.
+
+## 1. Download the script
+You can download the hello world script from the [example scripts][hello world] page. Alternatively, you can copy the code and save it yourself. Make sure it has the `.groovy` extension.
+
+## 2. Deploy the script
+
+

+
+
+In the developer tab of the Sandbox, import the script through the import button. You will be prompted for a name and description, category, and the file itself. The category is merely descriptive and organizational, so for now you may select "OTHER".
+
+Once the script has been imported into the Sandbox, it needs to be deployed. You can do this by clicking the green rocket button under the "ACTIONS" column. You should see the script's value in the "Status" column change from "Not Deployed" to "Deployed".
+
+## 3. Create an automation
+Select the customer view from the top tab.
+
+
+

+
+Go to the Automations tab and click the button to create a new automation.
+
+

+
+
+Name it "Hello world" and, on the next page, tick the Activate Automation on Save box before submitting.
+
+

+
+
+You should see your automation listed as above.
+
+# 4. Run it
+Click the green button to run the automation. Once you are notified that the automation has been run successfully, you should see the results of the execution by clicking on the logs button, beside the green button.
+
+

+
+
+# Next:
+- [Automated transfer]
+
+[Automated transfer]: /docs/tutorials/tutorial_automated_transfer
+
+[sandbox]: /docs/sandbox
+[hello world]: /docs/payscript/example_scripts/hello_world
+[built-in function]: /docs/payscript/built_in_functions
\ No newline at end of file
diff --git a/docs/tutorials/tutorial_reserves.md b/docs/tutorials/tutorial_reserves.md
new file mode 100644
index 0000000..383ea36
--- /dev/null
+++ b/docs/tutorials/tutorial_reserves.md
@@ -0,0 +1,15 @@
+---
+title: Reserves
+parent: Tutorials
+layout: page
+nav_order: 4
+---
+
+# Reserves
+Reserves are an abstract segregation of funds that can be used to help manage an account's funds. Funds that are moved to a reserve are still in that acconut, and count toward its total balance, however they won't count towards their available balance and won't be able to be used until it is moved out of the reserve.
+
+
+

+
+
+Reserves also keep a history of the transactions made to and from them.
\ No newline at end of file
diff --git a/docs/tutorials/tutorial_topup.md b/docs/tutorials/tutorial_topup.md
new file mode 100644
index 0000000..f69183f
--- /dev/null
+++ b/docs/tutorials/tutorial_topup.md
@@ -0,0 +1,82 @@
+---
+title: Top-Up
+parent: Tutorials
+layout: page
+nav_order: 3
+---
+
+# Top-Up
+This tutorial will introduce the concept of Consent, guiding you through the example case of a parent setting up an automation to top up their child's account at the end of the month. We will use the [Sandbox][sandbox] environment to create an automation and run it.
+
+### Prerequisites:
+- Knowledge of how to deploy a script and create an Automation
+- Access to the sandbox
+
+## The script
+Please take a look at the script used:
+
+```groovy
+trigger = "time";
+
+def account_parent = ${account_parent:scan};
+def account_child = ${account_child:scan};
+
+balance = getBalance(account_child);
+
+if (balance < 100) {
+ def payment = PaymentInfo.builder()
+ .payer(AccountInfo.builder()
+ .type(AccountIdentifierType.SCAN)
+ .identifier(account_parent)
+ .build())
+ .payee(AccountInfo.builder()
+ .type(AccountIdentifierType.SCAN)
+ .identifier(account_child)
+ .build())
+ .amountInfo(AmountInfo.builder()
+ .currency(CurrencyEnum.GBP)
+ .amount(100 - balance)
+ .build())
+ .paymentReference("Top-up payment.")
+ .build();
+ createPayment(payment);
+}
+```
+
+- `trigger = "time";`
+Here the trigger is defined as a time type, indicating that it will run on a scheduled determined by the automation. For example, on the first day of the month.
+
+- `def funds_source = ${funds_source:scan};`
+`def acc_to_top_up = ${account_to_top_up:scan};`
+Two SCAN-type script parameters, composed of the account number and sort code of each account, which will be provided in the automation. This will be used for the payment.
+
+- `balance = getBalance(acc_to_top_up);`
+This [built-in function][builtinfunction] is responsible for obtaining the balance of the child's account. This is used to determine how much needs to be transfered in order to top-up the child's account to the desired balance.
+
+Importantly, the `getBalance` function requires **consent** to be given, from the account whose balance is being checked, to the account running the automation trying to check the balance. If the automation tries to run, and consent has not been granted, the run will fail and the error will be logged.
+
+## Requesting and Granting Consent
+To request consent during the creation of an Automation, click the `Manage Consent` button.
+
+
+

+
+
+In the newly displayed area you will be able to select another account holder, and the types of consent, and then submit the request with the `Request` button.
+
+Then, navigating to the user whose consent you requested, you will see the request in the consents given tab, and be able to give it.
+
+
+

+
+
+After this, you can run the automation and see the desired effects.
+
+# Next:
+- [Reserves]
+
+[Reserves]: /docs/tutorials/tutorial_reserves
+
+
+[builtinfunction]: /docs/payscript/built_in_functions
+[sandbox]: /docs/sandbox
\ No newline at end of file
diff --git a/index.md b/index.md
index 0a244f5..5fc0871 100644
--- a/index.md
+++ b/index.md
@@ -10,3 +10,18 @@ This is the extensive documentation for Quant Flow, a suite of products that ena
## Payscript
Quant Flow is powered by [Payscript] is a Domain Specific Language (DSL) focused on the financial services domain. It implements functions such as transfers, checks, and scheduling, while inherently respecting regulatory constraints. The language is built atop [Groovy], being syntax-compatible with both it and Java, which eases its adoption by development teams.
+
+## Sandbox
+The [Payscript Sandbox][sandbox] is a test environment that offers the possibility of seeing Quant Flow’s features in action, both while prospecting whether Quant Flow fits your use case, or during the early stages of adoption to help development. Once you are granted access, the sandbox will show you what Quant Flow might look like in action, and be able to freely manage the test data, implement functionality and see it in action.
+
+---
+
+#### Next Steps:
+- [Tutorial 1: Deploying a script]
+- [Language Reference]
+
+[Payscript]: docs/payscript/language_reference
+[sandbox]: docs/sandbox
+[Tutorial 1: Deploying a script]: docs/tutorials/tutorial1
+[Language Reference]: docs/payscript/language_reference
+[Groovy]: https://groovy-lang.org/
\ No newline at end of file