Invoices

Update an invoice

Partially updates an invoice. Only DRAFT invoices can be edited. Sending items replaces the full line-item list.

patch/invoices/{id}

Request

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

Request body

customerIdstring
customerNamestring
customerPhonestring

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
dueDatestring date-time
notesstring

Example request

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

Response

Updated invoice

idstring
numberstring

Human-readable invoice number.

slugstring
isLiveboolean
customerIdstring nullable
customerNamestring
customerPhonestring
status'DRAFT' | 'ISSUED' | 'SENT' | 'PAID' | 'PARTIALLY_PAID' | 'OVERDUE' | 'CANCELLED'
source'WEB' | 'MOBILE' | 'API'

How the invoice was created. Invoices created via this API are always API.

deliveryChannel'WHATSAPP' | 'SMS' | 'API' | 'NONE'

How the pay-link was delivered. Invoices created via this API are always API (the response returns the pay-page URL; SwiftPayIQ does not message the customer).

sentAtstring date-time nullable
subtotalstring

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 nullable

Percentage that produced the discount; null for fixed discounts.

taxAmountstring

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

customerFeeAmountstring

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

totalstring

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

amountPaidstring

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

feeRatestring

Gateway fee rate snapshot at issue time, as a percentage.

feeAmountstring

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

customerFeeSharestring

Fraction of the fee the customer paid (0..1).

netAmountstring

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

dueDatestring date-time nullable
issuedAtstring date-time nullable
paidAtstring date-time nullable
notesstring nullable
createdByTypestring
collectionsobject[]

Installment collections linked to this invoice. Empty for invoices charged in full.

createdAtstring date-time
updatedAtstring date-time

Example response

{
  "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"
    }
  ]
}

Changes

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