Multi-Supplier Payments

Collect one payment for items from several suppliers, and let SADAD Pay split the money.

Multi-supplier payments let one customer pay one invoice for items that come from different suppliers, such as several shops on your marketplace. SADAD Pay collects the full amount, works out each supplier's share, takes the fee you set for that supplier, and records the split on every item.

📘

Turn on multi-supplier first

Multi-supplier payments are enabled per account. To turn them on, email [email protected] with your merchant name.

How it works

1. Add suppliers
SADAD Pay approves each one
→
2. Set supplier fees
Per payment method
→
3. Create the invoice
Each item has a supplierId
→
4. Customer pays once
SADAD Pay records each supplier's share

Step 1: Add your suppliers

  1. In the portal, go to Suppliers → Add Supplier.
  2. Enter the supplier's company details and bank account, and upload their documents.
  3. Submit. SADAD Pay checks the supplier, and their status changes to Approved.

You can only use Approved suppliers in invoices. Each supplier has a Supplier ID, shown in Suppliers. You send this ID with every item.

1254

Suppliers → Add Supplier: account details, contact, bank details, documents and payment methods

1254

The Suppliers list. The ID is the supplierId you send on invoice items; only Approved suppliers can be used.

Step 2: Set each supplier's fees

The supplier fee is what you keep from each supplier's share, for example your marketplace commission. You set it per supplier and per payment method.

  1. Go to Suppliers, find the supplier and click Manage.
  2. Open Payment Methods.
  3. For each payment method, choose the fee type and enter the values.
1568

Supplier fees for each payment method

Fee typeHow it worksExample
Fixed RateA fixed amount in KWD for each payment0.150 KWD for KNET
Rate %A percentage of the supplier's share0.75 % for cards
Fixed amount + PercentBoth together0.100 KWD + 1 %

You can also set a minimum and maximum fee for each method. On the same Manage page you can set a subscription for the supplier: target amount, annual charge, renewal amount and dates.

Step 3: Create the invoice with the API

Create the invoice as usual with POST /api/Invoice/insert, with two differences:

  • Set type to MultiVendorInvoice.
  • Give every item a supplierId.

All amounts are in KWD.

FieldTypeRequiredDescriptionExample
typestringYesMultiVendorInvoice"MultiVendorInvoice"
ref_NumberstringYesYour order number"ORDER-1001"
customer_NamestringYesThe customer's name"Ahmed Ali"
customer_Email / customer_MobilestringYes, one of themHow to reach the customer"[email protected]"
amountnumberYesThe invoice total. Must equal the total of all items.20.000
currency_CodestringYesKWD"KWD"
langstringNoen or ar"en"
itemsarrayYesThe items, from one or more suppliersSee below

Each item has:

FieldTypeRequiredDescriptionExample
namestringYesThe item name"Blue T-shirt"
quantityintegerYesHow many2
amountnumberYesPrice of one unit, in KWD4.000
supplierIdintegerYesThe Supplier ID of the supplier who sells this item10205
curl -X POST "https://apisandbox.sadadpay.net/api/Invoice/insert" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "invoices": [
      {
        "type": "MultiVendorInvoice",
        "ref_Number": "ORDER-1001",
        "customer_Name": "Ahmed Ali",
        "customer_Email": "[email protected]",
        "lang": "en",
        "currency_Code": "KWD",
        "amount": 20.000,
        "items": [
          { "name": "Leather wallet", "quantity": 1, "amount": 12.000, "supplierId": 20276 },
          { "name": "Blue T-shirt",   "quantity": 2, "amount": 4.000,  "supplierId": 10205 }
        ]
      }
    ]
  }'
{
  "isValid": true,
  "errorKey": null,
  "response": {
    "invoiceId": "92968"
  }
}

Get the payment link with GET /api/Invoice/getbyid?id={invoiceId}: the url field holds it, for example https://sandbox.sadadpay.net/pay/5527187292968. Send the customer there. They see one invoice and pay once.

🚧

Every item needs a supplier

If one item has no supplierId, or the ID is not one of your Approved suppliers, the whole invoice is rejected.

Step 4: See the split after payment

When the invoice is paid, GET /api/Invoice/getbyid?id={id} fills in the split on each item:

Item fieldDescription
supplierIdThe supplier of this item
supplierVendorFeesThe fee you keep from this item, based on the supplier's fee settings
supplierFinalAmountWhat the supplier receives for this item, after your fee
supplierInvoiceIdThe ID of the supplier's own invoice for their share. It has type Supplier and status Paid.
supplierRefundTransactionIdFilled in when part of this item is refunded to the customer

Before payment these fields are 0 or empty.

{
  "id": 15444,
  "name": "Leather wallet",
  "quantity": 1,
  "amount": 12,
  "supplierId": 20276,
  "supplierVendorFees": 0.15,
  "supplierFinalAmount": 11.85,
  "supplierInvoiceId": 92965,
  "supplierRefundTransactionId": ""
}

In this example the customer paid by KNET, and supplier 20276 has a Fixed Rate fee of 0.150 KWD for KNET. You keep 0.150 KWD, and the supplier receives 11.850 KWD. A supplier with no fee set receives their full share, with supplierVendorFees of 0.

Confirm the payment as usual with Verify Payment Status or Webhooks.

Refund a supplier's item

To refund the customer for one supplier's items, use POST /api/Refund/InsertFoSupplier.

When a multi-supplier invoice is paid, SADAD Pay creates a separate invoice for each supplier, with the code INV-<invoice number>-<supplier ID> (for example INV-93281-10205). The refund is made against that supplier invoice, not the main invoice. Its ID is the supplierInvoiceId of the supplier's item: call GET /api/Invoice/getbyid with the main invoice ID to read it (see the item fields above).

FieldTypeRequiredDescriptionExample
invoice_IdintegerYesThe supplier invoice ID: supplierInvoiceId from the supplier's item. Not the main invoice ID.93283
supplierIdintegerYesThe supplier whose items you refund10205
amountnumberYesThe amount to refund, in KWD. No more than the supplier's share (supplierFinalAmount).0.500
refund_TypestringYesDeductFromBalance or PayAmount"DeductFromBalance"
currency_CodestringYesKWD"KWD"
feesAppliedOnstringNoWho bears the refund fees: Customer or Vendor"Vendor"
notestringNoThe reason for the refund"Item returned"
curl -X POST "https://apisandbox.sadadpay.net/api/Refund/InsertFoSupplier" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "invoice_Id": 93283,
    "supplierId": 10205,
    "amount": 0.500,
    "refund_Type": "DeductFromBalance",
    "currency_Code": "KWD",
    "feesAppliedOn": "Vendor",
    "note": "Item returned"
  }'

The refund is taken from the supplier's balance:

  • refund_Id in the response means the refund is complete.
  • invoice_Key means the supplier's balance was too low, so a refund invoice was created for the supplier to pay at https://sadadpay.net/pay/{invoice_Key} (Sandbox: https://sandbox.sadadpay.net/pay/{invoice_Key}). The refund completes once it is paid.
{
  "isValid": true,
  "errorKey": null,
  "response": { "invoice_Key": 4097146393287 }
}

You can also refund a supplier's full item in the portal: open the paid invoice and click Refund next to the item.

🚧

A 403 usually means the wrong invoice ID

Sending the main invoice ID returns UnauthorizedAccess (HTTP 403), the same error as a permission problem. Check that invoice_Id is the supplier invoice (supplierInvoiceId).

🚧

Sandbox: wait before testing refunds

In Sandbox, a refund sent shortly after a KNET payment can make KNET void the whole payment instead of refunding part of it. Wait a few minutes after paying before you test refunds.

Common errors

errorKeyCauseHow to fix
SuppliersItemsRequiredThe invoice is MultiVendorInvoice but an item has no supplierIdSend a supplierId with every item
SupplierNotExistForThisVendorA supplierId is not one of your suppliers, or is not Approved yetCheck the ID in Suppliers, and wait for SADAD Pay to approve new suppliers
InvoiceAmountMustEqualsToTotalItemsAmountamount is not the total of the itemsSend amount = sum of quantity × amount
UnauthorizedAccess (HTTP 403)Refund/InsertFoSupplier: supplier refunds are not enabled for your accountEmail [email protected]
InvalidAccessToken (HTTP 401)The Access Token is missing, wrong or expiredGenerate a new Access Token

Next steps