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
| Parameter | Type | Required | Description |
|---|---|---|---|
changePaymentStatus | bool | yes | Whether POS+ updates the order payment status |
orderCode | String | yes | Your unique order code |
orderDate | DateTime | yes | Order date/time |
products | List<ProductModel> | yes | Order line items |
transactions | List<TransactionModel> | yes | Payments that settle the order |
billingInformation | PPBillingInfo | no | Invoice / billing details |
groupCode | String | no | Group code |
note | String | no | Free-text note |
discountAmount | double | no | Order discount (default 0) |
currency | PPCurrencyType | no | Default TRY |
deliveryType | PPDeliveryTypeEnum | no | Default CASH_ORDER |
deliveryStatus | PPDeliveryStatusEnum | no | Delivery status |
installment | int | no | Number 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); // PPOrderStatusEnumYou 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'),
);
