Selling

Orders, Payments & Fees

Capture the outcome of a sale as an order, apply configured fees, issue invoices, and record payment.

After an item is won (or sold directly), Basta can capture the outcome as an order, apply your configured fees, issue an invoice, and record payment. This page gives a high-level overview of those concepts and the operations available through the Management API.

All monetary amounts are in minor currency units (e.g. cents for USD). For example, 1000 = $10.00.

The order lifecycle

Text
DRAFT ──▶ OPEN ──▶ INVOICE_ISSUED ──▶ PAID
                └──▶ CANCELLED
StatusMeaning
DRAFTOrder is being assembled
OPENOrder has been placed / published
INVOICE_ISSUEDAn invoice has been issued to the buyer
PAIDThe order has been paid
CANCELLEDThe order was cancelled

An order belongs to a buyer and references the sale and item it came from. It is made up of one or more order lines — each line has an amount, a description, and any associated fees.

Common operations

OperationPurpose
createOrderCreate an order
updateOrderUpdate an order
cancelPaymentOrderCancel an order
publishPaymentOrderPublish an order
createOrderLine / updateOrderLine / deleteOrderLineManage line items
createInvoiceIssue an invoice for an order
createPaymentRecord a payment against an order
orders / userOrdersList orders for an account or a user

Example: fetch orders

GraphQL
query Orders {
  orders(accountId: "ACCOUNT_ID", first: 20) {
    edges {
      node {
        id
        title
        currency
        status
        orderLines {
          orderLineId
          amount
          description
          fees { description amount }
        }
        invoice { invoiceId dueDate url }
      }
    }
  }
}

Buyer's premiums

A buyer's premium is a charge the buyer pays on top of the hammer price. You define each premium once on the account, give it a ladder of bands, and then override it where needed for a genre, an item type or a single lot. Premiums are applied automatically when orders are created.

The old fee API is deprecated. createAccountFee, createSaleFee, createSaleItemFee, resetSaleFees and the Client API's Item.feeRules are replaced by the buyer's premium API below. New integrations should not use them.

A premium and its bands

A premium has a name (shown to buyers and on invoices), a currency, a calculation type, an optional minimum and maximum, and a ladder of bands. All amounts are in minor currency units.

FieldDescription
calculationTypeFLAT applies the band the amount falls in to the whole amount. PROGRESSIVE applies each band to its own portion of the amount and adds the results
minimum / maximumFloor and cap on the premium charged. 0 means no floor or no cap
Band lowerLimit / upperLteLimitThe part of the amount the band covers. Bands start at 0, join end to end, and the last one has no upper limit
Band type / valuePERCENTAGE in basis points (2500 is 25%) or AMOUNT, a fixed sum
externalIdOptional id from your own systems, used to reference the premium in sale imports

A premium charges nothing until it has bands. There is no way to delete one, because invoices already charged with it must keep their meaning; turn it off with setBuyerPremiumStatus instead. These mutations need an API key with the WRITE_BUYERS_PREMIUM permission.

Example: 25% up to $500,000, then 20%

GraphQL
mutation CreatePremium {
  createBuyerPremium(accountId: "ACCOUNT_ID", input: {
    name: "Buyer's Premium"
    currency: USD
    calculationType: PROGRESSIVE
    externalId: "bp-standard-usd"
  }) {
    id
  }
}

mutation SetBands {
  setBuyerPremiumBands(accountId: "ACCOUNT_ID", input: {
    buyerPremiumId: "PREMIUM_ID"
    bands: [
      { lowerLimit: 0, upperLteLimit: 50000000, type: PERCENTAGE, value: 2500 }
      { lowerLimit: 50000000, type: PERCENTAGE, value: 2000 }
    ]
  }) {
    id
    status
    bands { lowerLimit upperLteLimit type value }
  }
}

Levels

The premium set on the account is the default. You can restate it at a more specific level, and the most specific level wins:

Text
Account  →  Sale genre  →  Sale  →  Item type  →  Lot
LevelSet with
AccountcreateBuyerPremium, setBuyerPremiumBands
Sale genre (SALE_GENRE), item type (ITEM_TYPE) or lot (SALE_ITEM)setBuyerPremiumAtScope; remove an override with deleteBuyerPremiumAtScope
SaleSet when a sale is imported, by referencing premiums by externalId

An override restates the whole premium at that level: its calculation type, bounds and bands. Pass status: DISABLED to waive the premium there, for example on one lot.

GraphQL
# Waive the premium on one lot
mutation WaiveOnLot {
  setBuyerPremiumAtScope(accountId: "ACCOUNT_ID", input: {
    buyerPremiumId: "PREMIUM_ID"
    scope: { type: SALE_ITEM, id: "ITEM_ID", saleId: "SALE_ID" }
    calculationType: FLAT
    status: DISABLED
    bands: []
  }) {
    id
    status
    appliesAt   # SALE_ITEM
  }
}

Reading premiums

buyerPremiums is available on Account, SaleGenre, ItemType and SaleItem. Each premium reports appliesAt, the level its values came from. When a lot closes, its premiums are fixed: SaleItem.buyerPremiumsFixedAt is set, the lot keeps the premiums it was charged, and later changes to the levels above no longer affect it.

On the Client API, Item.buyerPremiums lists the premiums a buyer pays on a lot, so you can show them next to the bidding.

Payments

Basta integrates with a payment provider to collect funds and manage buyer payment methods. Where a provider session is needed (for example, to render a secure payment UI), the API issues short-lived provider session credentials rather than exposing sensitive details to the browser. Buyers can also be surfaced their saved payment methods and a default selection.

The specifics of payment collection depend on your account's configuration — contact us to enable and configure payments for your account.

Staying in sync

Order changes emit webhook events:

  • OrderCreated
  • OrderUpdated
  • OrderCancelled

See Webhooks for payloads and Managing Webhooks to subscribe.

Related documentation

Questions about orders, fees, or payments? Contact us at hi@basta.app.