First Payment
Getting Started

First Payment

Executing your first end-to-end payment creation and settlement on Testnet.

Follow this hands-on guide to execute an end-to-end payment creation and settlement on Testnet using either the Stellar CLI or the SplitPay web application.

Overview of the Payment Flow

Payment settlement in SplitPay occurs in two distinct operations:

  1. create_payment: Initiates a pending payment record on-chain with payment ID, pool ID, payer address, and gross amount.
  2. settle_payment: Authenticated by payer or pool owner. Atomically transfers funds and disburses allocations according to active shares.

CLI Execution Recipe

CONTRACT="CCOXHXGFTYVRRCJ7U32QZJCWXDTNQLRMDS3IAGW5MGFEWOUEXNYYKLHF"
# 1. Create a payment record (Payment ID: 1, Pool ID: 1, Amount: 1000000000 stroops = 100 XLM)
stellar contract invoke \
--id "$CONTRACT" \
--source payer_account \
--network testnet \
-- \
create_payment \
--payment_id 1 \
--pool_id 1 \
--payer "<PAYER_STELLAR_ADDRESS>" \
--amount 1000000000
# 2. Settle the payment atomically
stellar contract invoke \
--id "$CONTRACT" \
--source payer_account \
--network testnet \
-- \
settle_payment \
--payment_id 1

Web Interface Execution

  1. Open http://splitpay.samkiel.dev/payments/new.
  2. Select your pool from the dropdown.
  3. Enter the gross amount (e.g. 50 XLM).
  4. Inspect the interactive breakdown table showing exact amounts per member.
  5. Click Sign & Settle Payment to authorize the two-step transaction with Freighter.

Verifying Resulting Distributions

Query the resulting immutable distribution receipt on-chain:

stellar contract invoke \
--id "$CONTRACT" \
--source payer_account \
--network testnet \
-- \
get_distributions \
--payment_id 1

The contract returns a vector of Distribution structs indicating the exact amount transferred to each member.