---
title: "Update Payment invoice"
method: PUT
path: "/payment-intent/api/v1/direct/eInvoice"
---

# Update Payment invoice

`PUT /payment-intent/api/v1/direct/eInvoice`

## Request

- Base URL: `https://api.ksamerchant.geidea.net`
- URL: `https://api.ksamerchant.geidea.net/payment-intent/api/v1/direct/eInvoice`
- Auth: HTTP basic

API to update the Payment invoice

## Request body

- object
  - `paymentIntentId` string, required: Payment Intent ID generated when a new request was created.
  - `amount` number, double, required: Amount for which payment invoice is created. Amount must be greater than 0.01. Must be equal to [eInvoiceItems.price * eInvoiceItems.quantity]
  - `currency` 'EGP' | 'SAR' | 'AED' | 'QAR' | 'OMR' | 'BHD' | 'KWD' | 'USD' | 'GBP' | 'EUR', required: Currency for which payment invoice is created. Currency must be 3 characters in length. Acceptable currencies are: SAR, AED
  - `customer` object: Customer Object
    - `name` string, required: Customer Name
    - `email` string, required: Email of customer. One of email or phoneNumber must be present.
    - `phoneCountryCode` string, required: Country code of customer's phone number eg: "+971". If phoneNumber is passed, phoneCountryCode must be passed.
    - `phoneNumber` string, required: Customer's phone number eg: "511111111". If phoneCountryCode is passed, phoneNumber must be passed. One of email or phoneNumber must be present.
  - `eInvoiceDetails` object: e-Invoice details object
    - `eInvoiceItems` object[]: List of e-Invoice items
      - `eInvoiceItemId` string: e-Invoice item ID
      - `description` string: Item description. If not set in request, it is set to null automatically and the value is returned in response.
      - `price` number, double, required: Item Price
      - `quantity` integer, required: Quantity of item
      - `itemDiscountType` 'Amount' | 'Percentage': Type of discount applied on item
      - `taxType` 'Amount' | 'Percentage': Type of tax levied on item
      - `total` number, double, required: Total price including tax levied. Must be equal to [eInvoiceItems.price * eInvoiceItems.quantity]
      - `priceWithDiscount` number, double: Item price after discount is applied. If not set in request, it is set to value of eInvoiceItems.price automatically and the value is returned in response
      - `priceTax` number, double: Tax on Item Price. If not set in request, it is set to zero automatically and the value is returned in response.
      - `priceTotal` number, double: Total Price inclusive of Tax. If not set in request, it is set to value of eInvoiceItems.price automatically and the value is returned in response.
      - `sku` string: Item SKU. If not set in request, it is set to null automatically and the value is returned in response.
      - `itemDiscount` number, double: Discount applied on item. If not set in request, it is set to null automatically and the value is returned in response.
      - `tax` number, double: Tax on item. If not set in request, it is set to null automatically and the value is returned in response.
      - `totalWithoutTax` number, double: Total price of item without tax. If not set in request, it is set to value of amount automatically and the value is returned in response.
      - `totalTax` number, double: Tax for the item. If not set in request, it is set to zero automatically and the value is returned in response.
    - `subtotal` number, double, required: Subtotal inclusive of tax. Must be equal to [eInvoiceItems.price * eInvoiceItems.quantity]
    - `grandTotal` number, double, required: Grand Total. Must be equal to [eInvoiceItems.price * eInvoiceItems.quantity]. Must be same as amount.
    - `extraChargesType` 'Amount' | 'Percentage': Type of extra charges levied
    - `invoiceDiscountType` 'Amount' | 'Percentage': Type of discount applied on invoice
    - `type` 'Detailed' | 'Quick': Type of eInvoice. If not set in request, it is set to "Detailed" automatically and the value is returned in response.
    - `collectCustomersBillingShippingAddress` boolean: Flag indicating to capture Customer's billing and shipping addresses. If not set in request, it is set to false automatically and the value is returned in response
    - `preAuthorizeAmount` boolean: Flag indicating whether to preauthorize the amount. If not set in request, it is set to false automatically and the value is returned in response.
    - `subtotalWithoutTax` number, double: Subtotal exclusive of tax. Must be equal to [eInvoiceItems.price * eInvoiceItems.quantity] if passed. If not set in request, it is set to [eInvoiceItems.price * eInvoiceItems.quantity] value automatically and the value is returned in response.
    - `subtotalTax` number, double: Subtotal tax. If not set in request, it is set to zero automatically and the value is returned in response
    - `extraCharges` number, double: Extra charges levied. If not set in request, it is set to null automatically and the value is returned in response.
    - `chargeDescription` string: Description of charge levied. If not set in request, it is set to null automatically and the value is returned in response.
    - `merchantReferenceId` string: The merchant account identifier for which the payment invoice is created.
    - `invoiceDiscount` number, double: Discount applied on invoice. If not set in request, it is set to null automatically and the value is returned in response.
    - `language` 'EN' | 'AR': Language to be displayed in Payment Page. If not set in request, it is set to "EN" automatically and the value is returned in response.
  - `status` 'Created' | 'Incomplete' | 'Preauthorized' | 'Paid' | 'Expired' | 'SentToCustomer' | 'PartiallyCompleted': Status of the Payment Intent. Only SentToCustomer is allowed for merchant to change

## Response `200`

200

- object
  - `paymentIntent` object
    - `invoiceId` string
    - `customer` object
      - `customerId` string
      - `email` string
      - `phoneNumber` string
      - `phoneCountryCode` string
      - `name` string
      - `updatedBy` string
      - `updatedDate` string
      - `addresses` unknown[]
        - unknown
    - `eInvoiceDetails` object
      - `type` string
      - `collectCustomersBillingShippingAddress` boolean
      - `preAuthorizeAmount` boolean
      - `subtotalWithoutTax` integer
      - `subtotalTax` integer
      - `subtotal` integer
      - `grandTotal` integer
      - `extraCharges` integer
      - `extraChargesType` string
      - `chargeDescription` string
      - `merchantReferenceId` string
      - `invoiceDiscount` integer
      - `invoiceDiscountType` string
      - `language` string
      - `eInvoiceItems` object[]
        - `eInvoiceItemId` string
        - `description` string
        - `price` integer
        - `priceWithDiscount` integer
        - `priceTax` integer
        - `priceTotal` integer
        - `quantity` integer
        - `sku` string
        - `itemDiscount` integer
        - `itemDiscountType` string
        - `tax` integer
        - `taxType` string
        - `totalWithoutTax` integer
        - `totalTax` integer
        - `total` integer
    - `eInvoiceSentinvoices` unknown[]
      - unknown
    - `paymentIntentId` string
    - `number` string
    - `urlSlug` string
    - `type` string
    - `amount` integer
    - `currency` string
    - `merchantId` string
    - `merchantPublicKey` string
    - `expiryDate` string
    - `activationDate` string
    - `status` string
    - `customerId` string
    - `eInvoiceUploadId` unknown
    - `staticPayinvoiceId` unknown
    - `subscriptionId` unknown
    - `subscriptionOccurrenceId` unknown
    - `orders` unknown[]
      - unknown
    - `isPending` boolean
    - `createdDate` string
    - `createdBy` string
    - `updatedDate` string
    - `updatedBy` string
  - `termsAndConditions` unknown
  - `responseMessage` string
  - `detailedResponseMessage` string
  - `language` string
  - `responseCode` string
  - `detailedResponseCode` string

---

[API](https://skmtc.dev/geidea/apis/pay-by-invoice-ksa.md) - [All operations](https://skmtc.dev/geidea/apis/pay-by-invoice-ksa/llms.txt) - [OpenAPI document](https://skmtc.dev/geidea/apis/pay-by-invoice-ksa/revisions/10d72283aa6f?raw)
