PlusPayDevelopers

Multi-payment

Create a product-based order and pay it with one or more transactions.

startMultiPayment creates an order from a list of products and settles it with one or more transactions (e.g. part cash, part card). It returns a rich PPMultiPaymentResponseModel with computed totals, taxes, customer and document info.

Request

ParameterTypeRequiredDescription
changePaymentStatusboolyesWhether POS+ updates the order payment status
orderCodeStringyesYour unique order code
orderDateDateTimeyesOrder date/time
productsList<ProductModel>yesOrder line items
transactionsList<TransactionModel>yesPayments that settle the order
billingInformationPPBillingInfonoInvoice / billing details
groupCodeStringnoGroup code
noteStringnoFree-text note
discountAmountdoublenoOrder discount (default 0)
currencyPPCurrencyTypenoDefault TRY
deliveryTypePPDeliveryTypeEnumnoDefault CASH_ORDER
deliveryStatusPPDeliveryStatusEnumnoDelivery status
installmentintnoNumber of installments

ProductModel

id (int), sku (String), title (String), unit (PPQtyEnums), price (double), quantity (double), taxRate (int), vatInclude (bool), productType (PPProductTypeEnum), discountValue (double), and optional description, categoryCode, categoryName, discountType, exemptionCode.

TransactionModel

paymentType (PPPaymentType), totalAmount (double), optional paymentMethod (PPPaymentMethod).

Example

final result = await _pluspay.startMultiPayment(
  PPMultiPaymentRequest.toRequest(
    changePaymentStatus: true,
    orderCode: 'ORD-001',
    orderDate: DateTime.now(),
    products: [
      ProductModel(
        id: 1,
        sku: 'SKU001',
        unit: PPQtyEnums.ADET,
        price: 100.0,
        title: 'Product 1',
        quantity: 1,
        taxRate: 20,
        vatInclude: true,
        productType: PPProductTypeEnum.PHYSICALLY,
        discountValue: 0,
      ),
    ],
    transactions: [
      TransactionModel(
        paymentType: PPPaymentType.BANK_TRANSFER,
        totalAmount: 100.0,
        paymentMethod: PPPaymentMethod.NONE,
      ),
    ],
  ),
);

print(result.grandTotal);
print(result.status);   // PPOrderStatusEnum

You don't pass a device serial number or an auth token — POS+ uses its own registered device identity for the order.

Response highlights

PPMultiPaymentResponseModel includes id, orderCode, the computed grandTotal, subTotal, taxAmount, totalPaid, amountDue, status (PPOrderStatusEnum), the resolved products and transactions, tax breakdown taxs, optional customer, document and webhook info. See the full field list in the Reference.

Create an order without payment

createOrder (ORDER_CREATE) creates the order in POS+ but does not start a payment. Collect it later with startOrderPayment using the same orderCode. If the orderCode already exists in POS+, the order is updated instead.

The request takes the same fields as startMultiPayment, except transactions, changePaymentStatus, canTryAgain and startTime. The response, PPOrderCreateResponseModel, is the same order detail as PPMultiPaymentResponseModel. Available from Flutter 0.7.0 and React Native 0.3.0; not available in the native package.

await _pluspay.createOrder(
  PPOrderCreateRequest.toRequest(
    orderCode: 'ORD001',
    orderDate: DateTime.now(),
    products: [
      ProductModel(
        id: 1,
        sku: 'SKU-001',
        title: 'Product 1',
        price: 100.0,
        quantity: 1,
        taxRate: 10,
        unit: PPQtyEnums.ADET,
        vatInclude: true,
        productType: PPProductTypeEnum.PHYSICALLY,
        discountValue: 0,
      ),
    ],
  ),
);

// Collect it later:
await _pluspay.startOrderPayment(
  PPOrderPaymentRequestModel.toRequest(orderCode: 'ORD001'),
);