Invoices

Create an invoice

Creates an invoice from line items and issues it immediately. SwiftPayIQ does not message the customer for you over this API — there is no WhatsApp/SMS channel. Instead the response returns payPage.url, the hosted checkout page; deliver that link to your customer however you like (your own email/SMS, a redirect, a QR code, etc.). API-created invoices come back with status: SENT, source: API, and deliveryChannel: API.

post/invoices

Request

  • Base URL: https://api.swiftpayiq.com/api/v1
  • URL: https://api.swiftpayiq.com/api/v1/invoices
  • Auth: HTTP bearer

Request body

customerIdstring

Optional existing customer id.

customerNamestring required

Snapshot kept on the invoice even if the customer row changes later.

customerPhonestring required

A valid Iraqi phone number in E.164 form.

taxAmountstring

An amount in IQD (no decimals), serialized as an integer string to preserve precision.

discountstring

An amount in IQD (no decimals), serialized as an integer string to preserve precision.

discountPercentagestring

Percentage discount (0–99.99, up to 2 decimals). Mutually exclusive with discount.

dueDatestring date-time

ISO-8601 (YYYY-MM-DD or full timestamp).

notesstring

Example request

{
  "customerPhone": "+9647801234567",
  "items": [
    {
      "unitPrice": "50000"
    }
  ],
  "taxAmount": "50000",
  "discount": "50000",
  "discountPercentage": "10"
}

Response

Invoice created and issued

Example response

{
  "invoice": {
    "subtotal": "50000",
    "discount": "50000",
    "discountPercentage": "10.00",
    "taxAmount": "50000",
    "customerFeeAmount": "50000",
    "total": "50000",
    "amountPaid": "50000",
    "feeRate": "0.60325",
    "feeAmount": "50000",
    "customerFeeShare": "0.5000",
    "netAmount": "50000",
    "createdByType": "API_KEY",
    "items": [
      {
        "unitPrice": "50000",
        "lineTotal": "50000"
      }
    ],
    "payments": [
      {
        "provider": "ALQASEH",
        "amount": "50000",
        "feeAmount": "50000",
        "netAmount": "50000"
      }
    ]
  },
  "payPage": {
    "url": "https://swiftpayiq.com/pay?slug=xa7fi5brv1"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.