API Reference

Create Supplier Invoice

Multi-vendors invoice

API Usage

You can use invoice insert API endpoint to create an invoice with one supplier or many suppliers. You can use the type parameter with value MultiVendorInvoice in invoice object. In addition to supplierId for each Item as shown in the following sample request.

Sample Request

{
  "invoices": [
    {
      "type": "MultiVendorInvoice",
      "currency_Code": "KWD",
      "customer_Name": "test test",
      "customer_Mobile": "813712",
      "customer_Email": "[email protected]",
      "lang": "En",
      "amount": 200,
      "ref_Number": "order_id",
      "items": [
        {
          "name": "items 1 for supplier 211",
          "quantity": 1,
          "amount": 60,
          "supplierId": 1
        },
        {
          "name": "item 2 for supplier 212",
          "quantity": 1,
          "amount": 140,
          "supplierId": 2
        }
      ]
    }
  ]
}

Response

{  
  "isValid": true,  
  "errorKey": null,  
  "response": {  
    "invoiceId": "created_sadad_invoice_id"  
  }  
}
{
  "isValid": false,
  "errorKey": "ERROR",
  "response": null
}

Invoice URL

In the response of Insert invoice, you will receive the Sadad invoice ID. Use this id to call the API endpoint GetById

In response of the call GetById, you will find a key value. Use this KEY value to redirect the customer to pay using below URL:

For sandbox: https://sandbox.sadadpay.net/pay/{KEY}

For production: https://sadadpay.net/pay/{KEY}