# Invoice API

Ottu provides businesses and developers with the capability to incorporate its Invoice functionality into their existing systems, streamlining the process of invoice generation for both online and walk-in customers.

**But what exactly is an Invoice?** An invoice is a document dispatched by a seller to a buyer, itemizing not only the quantity and cost of products or services rendered by the seller but also detailing any applicable taxes, discounts, and shipping costs. Whether issued for a traditional walk-in customer at a brick-and-mortar establishment or an online purchaser, the invoice stands as both a record of the sale and a call for payment.

Imagine you're a business owner selling a range of products online. As orders pour in, you're faced with the arduous task of creating, sending, and tracking invoices manually. This not only consumes precious time but can also lead to errors, missed payments, and dissatisfied customers.

With Ottu's advanced `Invoice API`, these challenges become a thing of the past. This robust system automates invoicing, ensuring timely dispatch, clear communication, and streamlined payment collection. Whether you're billing for a one-time purchase, tracking bulk orders, or managing advance payments, the `Invoice API` has got you covered. Through its intuitive integration, you can elevate the efficiency of your business operations and enhance the overall customer experience.

Additionally, it's worth noting that this API bears significant similarities to Ottu's [Checkout API,](checkout-api) offering seamless integration and familiarity for businesses already leveraging Ottu's suite of tools.

## [Setup](#setup)

Before you can integrate with Ottu's `Invoice API`, several prerequisites need to be fulfilled. These prerequisites are essential to ensure that the `Invoice API` functions correctly and securely.&#x20;

1. **Payment Gateway:**\
   The `Invoice API` operates seamlessly with a [Payment Gateway](../user-guide/payment-gateway). Think of this gateway as the essential bridge that authorizes and facilitates transactions between your establishment and your customers. However, it's crucial to know that the `Invoice API` is explicitly tailored for a **Purchase** Payment Gateway and does not support the Authorize type.\
   For a comprehensive understanding of Payment Gateways and their inner workings, do give our [Payment Gateway](../user-guide/payment-gateway) User Guide a read. It provides valuable insights and clarifications.\

2. **Optional:** `round` function\
   When offering customer-facing invoice generation, it's essential to display precise figures supported by clear formulas. The `round` function is pivotal in achieving this accuracy.&#x20;

#### How `round` funtion works?

In order to ensure the precision and consistency of the financial calculations across various international transactions, Ottu relies on a standardized rounding method known as "[ROUND\_HALF\_UP](https://docs.python.org/3.8/library/decimal.html#decimal.ROUND_HALF_UP)" from Python. This method adheres to specific standards established by reputable international organizations:

* [**SIX Financial Information:** ](https://www.six-group.com/en/products-services/financial-information/data-standards.html#scrollTo=current-historical-lists)Ottu relies on currency decimal specifications provided by the SIX Group through SIX Financial Information.
* [**ISO 4217 Currency Codes:**](https://www.iso.org/iso-4217-currency-codes.html) ISO 4217 provides currency codes and their corresponding minor units, indicating the decimal precision.

The "`ROUND_HALF_UP`" method follows a careful procedure to ensure precision:

1. Establish Precision: Begin by determining the number of decimal digits permitted for the currency involved, according to [**ISO 4217 Currency Codes**](https://www.iso.org/iso-4217-currency-codes.html)**.**
2. Identify the Rounding Digit: Locate the digit immediately to the right of the desired precision. This digit is pivotal in determining the rounding outcome.
3. Apply Rounding Criteria:
   * If the digit to the right of the rounding digit is 5 or greater, the rounding digit is increased by one to ensure rounding up.
   * Conversely, if the digit to the right of the rounding digit is less than 5, the rounding digit remains unchanged, maintaining the current value.

**Why round Matters for Your Interface:** Ottu's backend utilizes round for precise financial workings. For merchants building a frontend for this Endpoint, it's vital to mirror round in real-time calculations. This ensures users will avoid discrepancy errors when interfacing with Ottu's backend. Certain optional fields in the API are designed to maintain this alignment between frontend input and backend processing, streamlining user experience and bolstering trust.\
Sources of Decimal Standards:

3. **Optional:** `Payment Methods API`\
   The [Payment Methods API](payment-methods) serves as an initial phase aimed at collecting dynamic parameters, particularly the [pg\_codes](../checkout-api#pg_codes-array-required), essential for subsequent calls to the [Checkout API](checkout-api). Consider it a preparatory API call that furnishes you with the necessary information for the primary transactional API.\
   **Why is it considered optional?** If you are already familiar with the specific `pg_code` you plan to use consistently, you have the option to skip this step by directly storing that `pg_code` in your system. However, utilizing the `Payment Methods API` guarantees that you stay informed about the most recent payment gateways available or any modifications in the configuration. This dynamic approach ensures a more robust and adaptable integration with Ottu.

Once you've fulfilled these prerequisites, you're ready to integrate the Invoice API. The following sections of this document will guide you through the authentication process and the usage of various API endpoints.

### [Boost Your Integration](#boost-your-integration)

Optimize your integration with the `Invoice API` using our official packages, designed to significantly simplify the process. These packages efficiently handle the complexities of API integration, allowing you to focus on the critical elements of your project.

**Available Packages:**

* **Python SDK:** Enhances access to invoice functionalities through a Pythonic interface, effectively abstracting the intricacies of API interactions to boost developer efficiency. [Learn more](https://github.com/ottuco/ottu-py?tab=readme-ov-file#ottu-py)
* **Django SDK:** Seamlessly integrates invoice features into Django-based applications, providing Django-specific enhancements that streamline invoice transactions. [Continue exploring](https://github.com/ottuco/ottu-py?tab=readme-ov-file#django-integration)

While these packages enhance speed and convenience, understanding the foundational concepts detailed in the documentation is essential for robust and sustainable integration.&#x20;

## [Authentication](#authentication)

**Supported Methods**

* [Private API Key](../authentication#private-key-api-key)
* [Basic Authentication](../authentication#basic-authentication)

For detailed information on authentication procedures, please refer to the [Authentication documentation](#authentication).

## [Permissions](#permissions)

Below, we are explaining how permissions are managed using [Basic Authentication](../authentication#basic-authentication) and [Private API Key](../authentication#private-key-api-key).

**When using Basic Authentication,** it is important to ensure that the appropriate level of permissions is assigned to each user or application using the APIs. This can help to prevent unauthorized access to sensitive data.

Ottu `Invoice API` supports different levels of permissions for the [Payment Request](../../user-guide/plugins#payment-request) and[ E-Commerce](../../user-guide/plugins#e-commerce) plugins.

To create a transaction, user requires specific permissions that vary depending on the plugin in use:

* “**Can add payment requests**” for the Payment Request plugin
* “**Can add e-commerce payments**” for the E-Commerce plugin

And also needs permission to use the required Payment Gateway

* "**Can use `pg_code`**”

To add invoice, user needs to have below permission:

* “**Can add Invoice**”&#x20;

**When using the Private API Key**, all permissions are granted by default, as the private `API-Key` is considered to have admin permissions.\
\
It is recommended to regularly rotate `API keys` and follow secure password storage practices when using `Basic Authentication`.

## [How it Works](#how-it-works)

The Ottu Invoice API serves as a robust mechanism for merchants to seamlessly issue invoices and manage transactions on the Ottu platform. Here's a detailed breakdown of how the Ottu `Invoice API` functions:

1. **Initiating the Invoice:**
   * Merchants utilize the `Invoice API`, passing the necessary parameters to initiate the creation of an invoice. Please check [Invoice API Parameters Specifications](#invoice-api-parameters-specification).
2. **Integration with Ottu Checkout API:**
   * `Invoice API` seamlessly integrates with the Ottu [Checkout API](checkout-api) to generate a [checkout\_url](../checkout-api#checkout_short_url-string-conditional).
3. **Communication to Customers:**
   * Merchants can choose to send the `checkout_url` to customers via Email or SMS using Ottu's communication channels.
   * Alternatively, merchants have the flexibility to handle the communication from their internal systems.
4. **Customer Interaction:**
   * Customers receive the `checkout_url` and, upon clicking, are redirected to Ottu's Checkout Page.
   * Here, customers can conveniently view and download the detailed invoice and proceed to make a direct payment.
5. **Transaction Completion:**
   * After completing the transaction, Ottu posts a response to the designated [webhook\_url](../checkout-api#webhook_url-string-optional), providing real-time updates on the transaction status. Please refer to [Payment Webhooks](webhooks/payment-notification).
6. **Post-Transaction Customer Experience:**
   * Following transaction completion, customers are redirected either to Ottu's Response Page or a specified [redirect\_url](../checkout-api#redirect_url-string-optional). Please refer to [Redirectional Diagram](../webhooks/payment-notification#redirectional-diagram).
   * Ottu's Response Page offers customers the option to download the invoice along with the payment receipt for their records.

This end-to-end process ensures a seamless and secure transaction experience for both merchants and customers, integrating Ottu's `Invoice API` with Ottu `Checkout API` for efficient invoice generation, and payment processing.

### [Invoice Information](#invoice-information)

In this section, we delve into the comprehensive details encompassing the creation of an invoice through Ottu's robust system. The invoicing process involves multiple layers, each designed to provide flexibility and customization to the merchant. Here's a breakdown of the key components:

**Header/Seller Information:** Merchants have the opportunity to tailor the invoice header, adding a distinctive touch to their brand. This customization includes the provision of a logo of their choice, seamlessly incorporated into the invoice.

**Invoice Information:** The essence of the invoice lies in the information provided by the merchant, encompassing Mandatory, Optional, or Calculated values.This information is systematically organized at two distinct levels—the [Item level](#item-level) and the [Invoice level](#invoice-level).

#### What do the Calculated values encompass?

These values, referred as `VAL CALC`, serve as validators to ensure that the real-time calculations, typically conducted by the client-side system or application, align with the values computed by Ottu's backend system. Validating these fields at both the item and invoice levels helps identify any disparities between the two, thereby ensuring accuracy and reliability throughout the invoicing process.

* #### **Item Level:**
  * Mandator&#x79;_:_ Stock Keeping Unit (SKU), Description, Quantity, Unit Price.
  * Optiona&#x6C;_:_ Tax Rate, Discount Amount, Discount Percentage.
  * VAL CAL&#x43;_:_ Total Excluding Tax, Total Including Tax, Tax Amount.
* #### **Invoice Level:**
  * Mandator&#x79;_:_ Type, Currency Code, PG Codes, Invoice Number, Due Date.
  * Optiona&#x6C;_:_ Tax Rate, Discount Amount, Discount Percentage, Shipping Excluding Tax, Shipping Method, Shipping Tax Rate.
  * VAL CAL&#x43;_:_ Total Excluding Tax, Total Including Tax, Tax Amount, Shipping Including Tax, Subtotal, Amount.

**Address Information:** Similar to the [Checkout AP](checkout-api)I, Ottu's invoicing system supports both [Billing ](../checkout-api#billing_address-object-optional)and [Shipping](../checkout-api#shipping_address-object-optional) addresses, providing a seamless and unified experience for users.

**Buyer Information:** Tailored to accommodate diverse business needs, the Buyer Information section allows for custom fields configured based on the type of the invoice `payment_request`, `e_commerce`. This flexibility ensures that merchants can capture essential buyer details relevant to their specific invoicing context.

<figure><img src="https://2847651520-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiUKrMb9zLt5ZzGPUYDsK%2Fuploads%2Fbvk0qYy2jVG8CVPpRSxp%2Finvoice%20API%201.png?alt=media&#x26;token=6a215795-79da-497b-8143-b641af442853" alt=""><figcaption></figcaption></figure>

### [**Invoice API Parameters Specification**](#invoice-api-parameters-specification)

In the previous section, we discussed the different sections and levels of invoice information, where details are sourced either from the merchant's input in the `Invoice API` request or calculated automatically. Below table categorizes the parameters in the Invoice API based on whether they are mandatory, optional, or calculated automatically ([VAL CALC](#what-do-the-calculated-values-encompass)), at both the item and invoice levels.

{% hint style="info" %}
Details at the item level are encapsulated within the `invoice_items` object. The merchant can append as many items to this object as there are distinct products or items that the customer purchases.
{% endhint %}

<table data-full-width="true"><thead><tr><th width="120">Level</th><th width="211">   Mandatory Fields</th><th width="244">            VAL CALC</th><th width="330">                              Optional </th></tr></thead><tbody><tr><td>Invoice</td><td><ul><li><code>type</code></li><li><code>currency_code</code></li><li><code>pg_codes</code></li><li><code>invoice_number</code></li><li><code>due_date</code></li></ul></td><td><ul><li><code>tax_amount</code></li><li><code>shipping_inc_tax</code></li><li><code>total_excl_tax</code></li><li><code>total_incl_tax</code></li><li><code>subtotal</code></li><li><code>amount</code></li></ul></td><td><ul><li><code>company_name</code></li><li><code>tax_rate</code></li><li><code>discount_amount</code></li><li><code>discount_percentage</code></li><li><code>shipping_excl_tax</code></li><li><code>shipping_tax_rate</code></li><li><code>shipping_method</code></li></ul></td></tr><tr><td>Item</td><td><ul><li><code>sku</code></li><li><code>description</code></li><li><code>quantity</code></li><li><code>unit_price</code></li></ul></td><td><ul><li><code>tax_amount</code></li><li><code>total_excl_tax</code></li><li><code>total_incl_tax</code></li></ul></td><td><ul><li><code>tax_rate</code></li><li><code>discount_amount</code></li><li><code>discount_percentage</code></li></ul></td></tr></tbody></table>

\


**It's important to note that:**

* For optional properties, if they are not relevant, exclude them entirely from the payload. Avoid sending null or zero values; it's better to omit the property altogether if unnecessary.
* All rate or percentage-related fields are limited to two decimal places. For other monetary fields, the number of decimal places is determined by the currency of the invoice, generally according to [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html).&#x20;
* The `Invoice API` differs from the [Checkout API](checkout-api) in that it does not support the [`PATCH`](../checkout-api#update-payment-transaction) method. Once an invoice is created, it is immutable and cannot be modified. Should any updates be necessary, a new invoice must be created in place of the original.

For a more detailed technical understanding and the implementation specifics of these operations, please refer to the OpenAPI schema in the API Schema Reference section below.

## Create a new Invoice

> Create a new Invoice

OpenAPI:

```json
{"openapi":"3.1.1","info":{"title":"Ottu API","version":"1.0.0"},"servers":[{"url":"https://sandbox.ottu.net"}],"paths":{"/b/invoice/v1/invoice/":{"post":{"operationId":"create_invoice","description":"Create a new Invoice","summary":"Create a new Invoice","parameters":[{"in":"header","name":"Authorization","schema":{"type":"string","default":"Api-Key vSUmxsXx.V81oYvOWFMcIywaOu57Utx6VSCmG11lo"},"description":"Private API key to be provided in the format `Api-Key <key>`.","required":true}],"tags":["Invoice API"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"Serializer class for `Invoice` instances, inheriting from `BaseInvoiceSerializer` and\n`CheckoutSerializer`. It provides methods for creating invoices, invoice items, and transactions.","properties":{"currency_code":{"type":"string","description":"The specified currency represents the denomination of the transaction.Nevertheless, it doesn't necessarily mandate payment in this exact currency.Due to potential currency conversions or exchanges, the final charge may be in a different currency."},"due_date":{"type":"string","format":"date","description":"The date by which the customer is expected to make payment for the invoice."},"invoice_items":{"type":"array","items":{"type":"object","description":"Serializer to use for `InvoiceItem` instances.\n\nThe unit_price, quantity, description and sku fields are required.\nThe rest are optional.\n\nThe class includes a method to calculate the discount on the invoice and another to calculate the total values.","properties":{"id":{"type":"integer","readOnly":true},"invoice":{"type":["integer","null"],"description":"Associated invoice."},"sku":{"type":"string","description":"Unique identifier for the invoice item.","maxLength":255},"description":{"type":"string","description":"Product name or a brief description of the item.","maxLength":255},"quantity":{"type":"string","format":"decimal","description":"Number of units of the product."},"unit_price":{"type":"string","format":"decimal","description":"Price per unit of the product, excluding tax."},"tax_rate":{"type":"string","format":"decimal","description":"Tax rate applied to the invoice item."},"tax_amount":{"type":"string","format":"decimal","description":"Total tax amount for the invoice item."},"discount_percentage":{"type":"string","format":"decimal","description":"Percentage-based discount applied to the invoice item. The calculated discount cannot exceed theitem's total value, including tax."},"discount_amount":{"type":"string","format":"decimal","description":"Fixed amount discount applied to the invoice item. The discount cannot exceed the item's total value, including tax."},"total_excl_tax":{"type":"string","format":"decimal","description":"Total value of the invoice item, excluding tax. This is calculated as (unit_price * quantity) - discount."},"total_incl_tax":{"type":"string","format":"decimal","description":"Total value of the invoice item, including tax. This is calculated as (unit_price * quantity) - discount + applicable tax."},"currency_code":{"type":"string","description":"For internal purposes: it'll be overridden by the main currency_code"}},"required":["currency_code","description","id","quantity","sku","unit_price"]},"description":"The list of items for the invoice."},"invoice_number":{"type":"string","description":"A unique identifier for the invoice, typically used for tracking and referencing purposes.","maxLength":255},"pg_codes":{"type":"array","items":{"type":"string"},"title":"Gateway","description":"The list of payment gateway codes from which a customer can select to perform the payment"},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction. This field represents the purpose of the payment and can be one of several pre-defined choices.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"billing_address":{"type":"object","description":"Nested serializer to save Address data into PaymentTransaction","properties":{"line1":{"type":"string","maxLength":128},"line2":{"type":"string","maxLength":128},"city":{"type":"string","maxLength":40},"state":{"type":"string","maxLength":40},"country":{"enum":["AF","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","HR","CU","CW","CY","CZ","CI","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RO","RU","RW","RE","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TM","TC","TV","TR","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","AX"],"type":"string","description":"* `AF` - Afghanistan\n* `AL` - Albania\n* `DZ` - Algeria\n* `AS` - American Samoa\n* `AD` - Andorra\n* `AO` - Angola\n* `AI` - Anguilla\n* `AQ` - Antarctica\n* `AG` - Antigua and Barbuda\n* `AR` - Argentina\n* `AM` - Armenia\n* `AW` - Aruba\n* `AU` - Australia\n* `AT` - Austria\n* `AZ` - Azerbaijan\n* `BS` - Bahamas\n* `BH` - Bahrain\n* `BD` - Bangladesh\n* `BB` - Barbados\n* `BY` - Belarus\n* `BE` - Belgium\n* `BZ` - Belize\n* `BJ` - Benin\n* `BM` - Bermuda\n* `BT` - Bhutan\n* `BO` - Bolivia, Plurinational State of\n* `BQ` - Bonaire, Sint Eustatius and Saba\n* `BA` - Bosnia and Herzegovina\n* `BW` - Botswana\n* `BV` - Bouvet Island\n* `BR` - Brazil\n* `IO` - British Indian Ocean Territory\n* `BN` - Brunei Darussalam\n* `BG` - Bulgaria\n* `BF` - Burkina Faso\n* `BI` - Burundi\n* `CV` - Cabo Verde\n* `KH` - Cambodia\n* `CM` - Cameroon\n* `CA` - Canada\n* `KY` - Cayman Islands\n* `CF` - Central African Republic\n* `TD` - Chad\n* `CL` - Chile\n* `CN` - China\n* `CX` - Christmas Island\n* `CC` - Cocos (Keeling) Islands\n* `CO` - Colombia\n* `KM` - Comoros\n* `CG` - Congo\n* `CD` - Congo, The Democratic Republic of the\n* `CK` - Cook Islands\n* `CR` - Costa Rica\n* `HR` - Croatia\n* `CU` - Cuba\n* `CW` - Curaçao\n* `CY` - Cyprus\n* `CZ` - Czechia\n* `CI` - Côte d'Ivoire\n* `DK` - Denmark\n* `DJ` - Djibouti\n* `DM` - Dominica\n* `DO` - Dominican Republic\n* `EC` - Ecuador\n* `EG` - Egypt\n* `SV` - El Salvador\n* `GQ` - Equatorial Guinea\n* `ER` - Eritrea\n* `EE` - Estonia\n* `SZ` - Eswatini\n* `ET` - Ethiopia\n* `FK` - Falkland Islands (Malvinas)\n* `FO` - Faroe Islands\n* `FJ` - Fiji\n* `FI` - Finland\n* `FR` - France\n* `GF` - French Guiana\n* `PF` - French Polynesia\n* `TF` - French Southern Territories\n* `GA` - Gabon\n* `GM` - Gambia\n* `GE` - Georgia\n* `DE` - Germany\n* `GH` - Ghana\n* `GI` - Gibraltar\n* `GR` - Greece\n* `GL` - Greenland\n* `GD` - Grenada\n* `GP` - Guadeloupe\n* `GU` - Guam\n* `GT` - Guatemala\n* `GG` - Guernsey\n* `GN` - Guinea\n* `GW` - Guinea-Bissau\n* `GY` - Guyana\n* `HT` - Haiti\n* `HM` - Heard Island and McDonald Islands\n* `VA` - Holy See (Vatican City State)\n* `HN` - Honduras\n* `HK` - Hong Kong\n* `HU` - Hungary\n* `IS` - Iceland\n* `IN` - India\n* `ID` - Indonesia\n* `IR` - Iran, Islamic Republic of\n* `IQ` - Iraq\n* `IE` - Ireland\n* `IM` - Isle of Man\n* `IL` - Israel\n* `IT` - Italy\n* `JM` - Jamaica\n* `JP` - Japan\n* `JE` - Jersey\n* `JO` - Jordan\n* `KZ` - Kazakhstan\n* `KE` - Kenya\n* `KI` - Kiribati\n* `KP` - Korea, Democratic People's Republic of\n* `KR` - Korea, Republic of\n* `KW` - Kuwait\n* `KG` - Kyrgyzstan\n* `LA` - Lao People's Democratic Republic\n* `LV` - Latvia\n* `LB` - Lebanon\n* `LS` - Lesotho\n* `LR` - Liberia\n* `LY` - Libya\n* `LI` - Liechtenstein\n* `LT` - Lithuania\n* `LU` - Luxembourg\n* `MO` - Macao\n* `MG` - Madagascar\n* `MW` - Malawi\n* `MY` - Malaysia\n* `MV` - Maldives\n* `ML` - Mali\n* `MT` - Malta\n* `MH` - Marshall Islands\n* `MQ` - Martinique\n* `MR` - Mauritania\n* `MU` - Mauritius\n* `YT` - Mayotte\n* `MX` - Mexico\n* `FM` - Micronesia, Federated States of\n* `MD` - Moldova, Republic of\n* `MC` - Monaco\n* `MN` - Mongolia\n* `ME` - Montenegro\n* `MS` - Montserrat\n* `MA` - Morocco\n* `MZ` - Mozambique\n* `MM` - Myanmar\n* `NA` - Namibia\n* `NR` - Nauru\n* `NP` - Nepal\n* `NL` - Netherlands\n* `NC` - New Caledonia\n* `NZ` - New Zealand\n* `NI` - Nicaragua\n* `NE` - Niger\n* `NG` - Nigeria\n* `NU` - Niue\n* `NF` - Norfolk Island\n* `MK` - North Macedonia\n* `MP` - Northern Mariana Islands\n* `NO` - Norway\n* `OM` - Oman\n* `PK` - Pakistan\n* `PW` - Palau\n* `PS` - Palestine, State of\n* `PA` - Panama\n* `PG` - Papua New Guinea\n* `PY` - Paraguay\n* `PE` - Peru\n* `PH` - Philippines\n* `PN` - Pitcairn\n* `PL` - Poland\n* `PT` - Portugal\n* `PR` - Puerto Rico\n* `QA` - Qatar\n* `RO` - Romania\n* `RU` - Russian Federation\n* `RW` - Rwanda\n* `RE` - Réunion\n* `BL` - Saint Barthélemy\n* `SH` - Saint Helena, Ascension and Tristan da Cunha\n* `KN` - Saint Kitts and Nevis\n* `LC` - Saint Lucia\n* `MF` - Saint Martin (French part)\n* `PM` - Saint Pierre and Miquelon\n* `VC` - Saint Vincent and the Grenadines\n* `WS` - Samoa\n* `SM` - San Marino\n* `ST` - Sao Tome and Principe\n* `SA` - Saudi Arabia\n* `SN` - Senegal\n* `RS` - Serbia\n* `SC` - Seychelles\n* `SL` - Sierra Leone\n* `SG` - Singapore\n* `SX` - Sint Maarten (Dutch part)\n* `SK` - Slovakia\n* `SI` - Slovenia\n* `SB` - Solomon Islands\n* `SO` - Somalia\n* `ZA` - South Africa\n* `GS` - South Georgia and the South Sandwich Islands\n* `SS` - South Sudan\n* `ES` - Spain\n* `LK` - Sri Lanka\n* `SD` - Sudan\n* `SR` - Suriname\n* `SJ` - Svalbard and Jan Mayen\n* `SE` - Sweden\n* `CH` - Switzerland\n* `SY` - Syrian Arab Republic\n* `TW` - Taiwan, Province of China\n* `TJ` - Tajikistan\n* `TZ` - Tanzania, United Republic of\n* `TH` - Thailand\n* `TL` - Timor-Leste\n* `TG` - Togo\n* `TK` - Tokelau\n* `TO` - Tonga\n* `TT` - Trinidad and Tobago\n* `TN` - Tunisia\n* `TM` - Turkmenistan\n* `TC` - Turks and Caicos Islands\n* `TV` - Tuvalu\n* `TR` - Türkiye\n* `UG` - Uganda\n* `UA` - Ukraine\n* `AE` - United Arab Emirates\n* `GB` - United Kingdom\n* `US` - United States\n* `UM` - United States Minor Outlying Islands\n* `UY` - Uruguay\n* `UZ` - Uzbekistan\n* `VU` - Vanuatu\n* `VE` - Venezuela, Bolivarian Republic of\n* `VN` - Viet Nam\n* `VG` - Virgin Islands, British\n* `VI` - Virgin Islands, U.S.\n* `WF` - Wallis and Futuna\n* `EH` - Western Sahara\n* `YE` - Yemen\n* `ZM` - Zambia\n* `ZW` - Zimbabwe\n* `AX` - Åland Islands"},"postal_code":{"type":"string","maxLength":12}},"required":["city","country","line1"]},"shipping_address":{"type":"object","description":"Nested serializer to save Address data into PaymentTransaction","properties":{"line1":{"type":"string","maxLength":128},"line2":{"type":"string","maxLength":128},"city":{"type":"string","maxLength":40},"state":{"type":"string","maxLength":40},"country":{"enum":["AF","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","HR","CU","CW","CY","CZ","CI","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RO","RU","RW","RE","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TM","TC","TV","TR","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","AX"],"type":"string","description":"* `AF` - Afghanistan\n* `AL` - Albania\n* `DZ` - Algeria\n* `AS` - American Samoa\n* `AD` - Andorra\n* `AO` - Angola\n* `AI` - Anguilla\n* `AQ` - Antarctica\n* `AG` - Antigua and Barbuda\n* `AR` - Argentina\n* `AM` - Armenia\n* `AW` - Aruba\n* `AU` - Australia\n* `AT` - Austria\n* `AZ` - Azerbaijan\n* `BS` - Bahamas\n* `BH` - Bahrain\n* `BD` - Bangladesh\n* `BB` - Barbados\n* `BY` - Belarus\n* `BE` - Belgium\n* `BZ` - Belize\n* `BJ` - Benin\n* `BM` - Bermuda\n* `BT` - Bhutan\n* `BO` - Bolivia, Plurinational State of\n* `BQ` - Bonaire, Sint Eustatius and Saba\n* `BA` - Bosnia and Herzegovina\n* `BW` - Botswana\n* `BV` - Bouvet Island\n* `BR` - Brazil\n* `IO` - British Indian Ocean Territory\n* `BN` - Brunei Darussalam\n* `BG` - Bulgaria\n* `BF` - Burkina Faso\n* `BI` - Burundi\n* `CV` - Cabo Verde\n* `KH` - Cambodia\n* `CM` - Cameroon\n* `CA` - Canada\n* `KY` - Cayman Islands\n* `CF` - Central African Republic\n* `TD` - Chad\n* `CL` - Chile\n* `CN` - China\n* `CX` - Christmas Island\n* `CC` - Cocos (Keeling) Islands\n* `CO` - Colombia\n* `KM` - Comoros\n* `CG` - Congo\n* `CD` - Congo, The Democratic Republic of the\n* `CK` - Cook Islands\n* `CR` - Costa Rica\n* `HR` - Croatia\n* `CU` - Cuba\n* `CW` - Curaçao\n* `CY` - Cyprus\n* `CZ` - Czechia\n* `CI` - Côte d'Ivoire\n* `DK` - Denmark\n* `DJ` - Djibouti\n* `DM` - Dominica\n* `DO` - Dominican Republic\n* `EC` - Ecuador\n* `EG` - Egypt\n* `SV` - El Salvador\n* `GQ` - Equatorial Guinea\n* `ER` - Eritrea\n* `EE` - Estonia\n* `SZ` - Eswatini\n* `ET` - Ethiopia\n* `FK` - Falkland Islands (Malvinas)\n* `FO` - Faroe Islands\n* `FJ` - Fiji\n* `FI` - Finland\n* `FR` - France\n* `GF` - French Guiana\n* `PF` - French Polynesia\n* `TF` - French Southern Territories\n* `GA` - Gabon\n* `GM` - Gambia\n* `GE` - Georgia\n* `DE` - Germany\n* `GH` - Ghana\n* `GI` - Gibraltar\n* `GR` - Greece\n* `GL` - Greenland\n* `GD` - Grenada\n* `GP` - Guadeloupe\n* `GU` - Guam\n* `GT` - Guatemala\n* `GG` - Guernsey\n* `GN` - Guinea\n* `GW` - Guinea-Bissau\n* `GY` - Guyana\n* `HT` - Haiti\n* `HM` - Heard Island and McDonald Islands\n* `VA` - Holy See (Vatican City State)\n* `HN` - Honduras\n* `HK` - Hong Kong\n* `HU` - Hungary\n* `IS` - Iceland\n* `IN` - India\n* `ID` - Indonesia\n* `IR` - Iran, Islamic Republic of\n* `IQ` - Iraq\n* `IE` - Ireland\n* `IM` - Isle of Man\n* `IL` - Israel\n* `IT` - Italy\n* `JM` - Jamaica\n* `JP` - Japan\n* `JE` - Jersey\n* `JO` - Jordan\n* `KZ` - Kazakhstan\n* `KE` - Kenya\n* `KI` - Kiribati\n* `KP` - Korea, Democratic People's Republic of\n* `KR` - Korea, Republic of\n* `KW` - Kuwait\n* `KG` - Kyrgyzstan\n* `LA` - Lao People's Democratic Republic\n* `LV` - Latvia\n* `LB` - Lebanon\n* `LS` - Lesotho\n* `LR` - Liberia\n* `LY` - Libya\n* `LI` - Liechtenstein\n* `LT` - Lithuania\n* `LU` - Luxembourg\n* `MO` - Macao\n* `MG` - Madagascar\n* `MW` - Malawi\n* `MY` - Malaysia\n* `MV` - Maldives\n* `ML` - Mali\n* `MT` - Malta\n* `MH` - Marshall Islands\n* `MQ` - Martinique\n* `MR` - Mauritania\n* `MU` - Mauritius\n* `YT` - Mayotte\n* `MX` - Mexico\n* `FM` - Micronesia, Federated States of\n* `MD` - Moldova, Republic of\n* `MC` - Monaco\n* `MN` - Mongolia\n* `ME` - Montenegro\n* `MS` - Montserrat\n* `MA` - Morocco\n* `MZ` - Mozambique\n* `MM` - Myanmar\n* `NA` - Namibia\n* `NR` - Nauru\n* `NP` - Nepal\n* `NL` - Netherlands\n* `NC` - New Caledonia\n* `NZ` - New Zealand\n* `NI` - Nicaragua\n* `NE` - Niger\n* `NG` - Nigeria\n* `NU` - Niue\n* `NF` - Norfolk Island\n* `MK` - North Macedonia\n* `MP` - Northern Mariana Islands\n* `NO` - Norway\n* `OM` - Oman\n* `PK` - Pakistan\n* `PW` - Palau\n* `PS` - Palestine, State of\n* `PA` - Panama\n* `PG` - Papua New Guinea\n* `PY` - Paraguay\n* `PE` - Peru\n* `PH` - Philippines\n* `PN` - Pitcairn\n* `PL` - Poland\n* `PT` - Portugal\n* `PR` - Puerto Rico\n* `QA` - Qatar\n* `RO` - Romania\n* `RU` - Russian Federation\n* `RW` - Rwanda\n* `RE` - Réunion\n* `BL` - Saint Barthélemy\n* `SH` - Saint Helena, Ascension and Tristan da Cunha\n* `KN` - Saint Kitts and Nevis\n* `LC` - Saint Lucia\n* `MF` - Saint Martin (French part)\n* `PM` - Saint Pierre and Miquelon\n* `VC` - Saint Vincent and the Grenadines\n* `WS` - Samoa\n* `SM` - San Marino\n* `ST` - Sao Tome and Principe\n* `SA` - Saudi Arabia\n* `SN` - Senegal\n* `RS` - Serbia\n* `SC` - Seychelles\n* `SL` - Sierra Leone\n* `SG` - Singapore\n* `SX` - Sint Maarten (Dutch part)\n* `SK` - Slovakia\n* `SI` - Slovenia\n* `SB` - Solomon Islands\n* `SO` - Somalia\n* `ZA` - South Africa\n* `GS` - South Georgia and the South Sandwich Islands\n* `SS` - South Sudan\n* `ES` - Spain\n* `LK` - Sri Lanka\n* `SD` - Sudan\n* `SR` - Suriname\n* `SJ` - Svalbard and Jan Mayen\n* `SE` - Sweden\n* `CH` - Switzerland\n* `SY` - Syrian Arab Republic\n* `TW` - Taiwan, Province of China\n* `TJ` - Tajikistan\n* `TZ` - Tanzania, United Republic of\n* `TH` - Thailand\n* `TL` - Timor-Leste\n* `TG` - Togo\n* `TK` - Tokelau\n* `TO` - Tonga\n* `TT` - Trinidad and Tobago\n* `TN` - Tunisia\n* `TM` - Turkmenistan\n* `TC` - Turks and Caicos Islands\n* `TV` - Tuvalu\n* `TR` - Türkiye\n* `UG` - Uganda\n* `UA` - Ukraine\n* `AE` - United Arab Emirates\n* `GB` - United Kingdom\n* `US` - United States\n* `UM` - United States Minor Outlying Islands\n* `UY` - Uruguay\n* `UZ` - Uzbekistan\n* `VU` - Vanuatu\n* `VE` - Venezuela, Bolivarian Republic of\n* `VN` - Viet Nam\n* `VG` - Virgin Islands, British\n* `VI` - Virgin Islands, U.S.\n* `WF` - Wallis and Futuna\n* `EH` - Western Sahara\n* `YE` - Yemen\n* `ZM` - Zambia\n* `ZW` - Zimbabwe\n* `AX` - Åland Islands"},"postal_code":{"type":"string","maxLength":12},"first_name":{"type":"string","maxLength":64},"last_name":{"type":"string","maxLength":64},"email":{"type":"string","format":"email","maxLength":128},"phone":{"type":"string","maxLength":16}},"required":["city","country","email","first_name","last_name","line1","phone"]},"agreement":{"allOf":[{"type":"object","description":"Serializer to hold the recurring data information.\nThis is required for being able to create recurring payments and the PGs\nrequire this information.","properties":{"id":{"type":"string","description":"A unique identifier for the agreement established with the payer. This ID links to the specific terms and conditions the payer has authorized for processing their stored card details. Use cases include: \n1. Recurring Payments: Periodic debits, e.g., gym memberships. \n2. Installment Payments: Multiple charges for a single purchase over time. \n3. Unscheduled: Future payments as required, e.g., account top-ups. \n4. Industry Practice: Standard business practices related to an original payment, e.g., hotel charges after checkout.","maxLength":128},"amount_variability":{"enum":["fixed","variable"],"type":"string","description":"Indicates if all payments within the agreement use the same amount or if the amount differs between the payments.\n\n* `fixed` - Fixed\n* `variable` - Variable"},"start_date":{"type":"string","format":"date","description":"Date on which the agreement with the payer to process payments starts."},"expiry_date":{"type":"string","format":"date","description":"Date on which your agreement with the payer to process payments expires."},"max_amount_per_cycle":{"type":"string","format":"decimal","description":"The maximum amount for a single payment in the series as agreed with the payer."},"cycle_interval_days":{"type":"integer","maximum":366,"minimum":1,"description":"The minimum number of days between payments agreed with the payer."},"total_cycles":{"type":"integer","maximum":999,"minimum":1,"description":"The number of merchant-initiated payments within the recurring payment agreement."},"frequency":{"enum":["irregular","daily","weekly","semi_monthly","monthly","quarterly","semi_annually","yearly","other"],"type":"string","description":"The frequency of the payments within the series as agreed with the payer.\n\n* `irregular` - Irregular\n* `daily` - Daily\n* `weekly` - Weekly\n* `semi_monthly` - Semi Monthly\n* `monthly` - Monthly\n* `quarterly` - Quarterly\n* `semi_annually` - Semi Annually\n* `yearly` - Yearly\n* `other` - Other"},"type":{"enum":["event_based","installment","recurring","unscheduled","other"],"type":"string","default":"recurring","description":"The type of commercial agreement that the payer has with the merchant.\n\n *Note*: For `unscheduled` agreements, the allowed values should be configured as follows: \n\n `id` - Accepts any value. \n\n `frequency`. \n\n `type`.\n\n This configuration ensures that only specific values are permitted for each field when the `type` is `Unscheduled`.\n\n *Note*: For `recurring` agreements, the following fields are mandatory as follows: \n\n `amount_variability` \n\n `cycle_interval_days` \n\n `expiry_date` \n\n ` `requency` \n\n `id` \n\n  `total_cycles` \n\n This configuration ensures that the required values are mandatory for each field when the `type` is `Recurring`.\n\n* `event_based` - Event Based\n* `installment` - Installment\n* `recurring` - Recurring\n* `unscheduled` - Unscheduled\n* `other` - Other"},"seller":{"allOf":[{"type":"object","properties":{"name":{"type":"string","description":"The retailer's trading name.","maxLength":128},"short_name":{"type":"string","description":"Abbreviation of the retailer's trading name, suitable for payer's statement display.","maxLength":64},"category_code":{"type":"string","description":"A 4-digit code classifying the retailer's business by the type of goods or services it offers.","maxLength":64}}}],"description":"Details about the retailer, if the agreement is for installment payments."},"extra_params":{"allOf":[{"type":"object","properties":{"payment_processing_day":{"type":"integer","maximum":31,"minimum":1,"description":"Day of the month on which the payment must be processed. Not required for unscheduled payment agreements."}}}],"description":"Additional parameters related to the agreement."}}}],"description":"An established contractual arrangement with the payer, which authorizes you to securely store and subsequently utilize their payment information for specific purposes. This could encompass arrangements like recurring payments for services such as mobile subscriptions, installment-based payments for purchases, arrangements for ad-hoc charges like account top-ups, or for standard industry practices like penalty charges for missed appointments. \n\nNote: If your intention is solely to store payment details for transactions initiated by the payer in the future, then this parameter group should not be used."},"amount":{"type":"string","format":"decimal","description":"Represents the total amount of the payment transaction, which includes the cost of the purchased items or services but excludes any additional fees or charges"},"attachment":{"type":"string","format":"uri","description":"A writable field that accepts an attachment file to be included in email notifications sent to the customer regarding their payment, and also be available for download on the checkout page. This field may be used to provide the customer with additional information or documentation related to their purchase. The value of this field should be a file object. Upon successful submission, the API will return the URL for downloading the attached file. "},"attachment_short_url":{"type":"string","format":"uri","readOnly":true,"description":"A short URL that links to the attachment associated with this payment. This URL may be included in email/sms notifications sent to the customer regarding their payment or displayed on the checkout page to allow the customer to easily access the attachment."},"attachment_upload_url":{"type":"string","description":"A writable field that accepts an attachment that has already been uploaded to the server.","pattern":"(?:pdf|jpeg|png|doc|docx|jpg|xls|xlsx|txt)$"},"card_acceptance_criteria":{"allOf":[{"type":"object","properties":{"min_expiry_time":{"type":"integer","maximum":365,"minimum":1,"description":"Specifies the minimum required validity period, in days, for a card to be eligible for payment. If set to 30 days, for example, cards set to expire within the next month would be declined. This ensures short-lived cards nearing their expiration date are filtered out, reducing chances of payment failures. When implementing, balance your operational needs with customer convenience. Setting it too stringent might increase payment declines, while a lenient approach could risk future payment failures.\n\nAdditionally, it defaults to 30 days when the `payment_type` is `auto_debit`. If any other payment type is selected, no default value is set."}}}],"description":"This field allows you to define specific rules and conditions that a card must meet to be eligible for payment. These stipulations apply regardless of whether a customer chooses to pay using a saved card or opts to add a new card for the transaction. By leveraging the `card_acceptance_criteria`, you gain the power to fine-tune your payment processing strategy, tailoring acceptance rules to align with your business needs, security standards, and risk management policies.\n\n**Example**: If you run an exclusive service that caters predominantly to premium customers, you might set criteria that only allow transactions from high-tier credit cards like VISA Platinum. This ensures that payments align with the exclusivity and branding of your services. Remember to configure these criteria thoughtfully. Striking the right balance between security, risk mitigation, and user experience is paramount.\n\n**Note**: The `card_acceptance_criteria` field is applicable only for direct payments and not for hosted session payments."},"checkout_short_url":{"type":"string","format":"uri","readOnly":true,"description":"A short URL link that, when opened, redirects to the checkout page for this payment. This URL may be shared with the customer to allow them to easily access and complete the payment. This field is only available if the `shortify_checkout_url` field is set to True."},"checkout_url":{"type":"string","format":"uri","readOnly":true,"description":"URL that directs the customer to the Ottu Checkout Page where they can see the payment details and available payment methods for the transaction. If you need to share the payment link over SMS or WhatsApp, use `checkout_short_url` instead."},"company_name":{"type":"string","description":"The company name is used for invoice API.","maxLength":64},"customer_birthdate":{"type":"string","format":"date","title":"Customer Date of Birth","description":"Customer's date of birth in YYYY-MM-DD format.This field can be used for age verification or compliance purposes during payment processing."},"customer_email":{"type":"string","format":"email","description":"The email address of the customer that is used to send payment notifications and receipts, and can be used for fraud prevention. This field is mandatory and is always sent to the payment gateway. It may also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":128},"customer_first_name":{"type":"string","description":"The first name of the recipient of the payment. This field is used for various communications such as the invoice, receipt, email, SMS, or displayed on the payment page. It may also be sent to the payment gateway if necessary.","maxLength":64},"customer_id":{"type":"string","description":"The customer ID is a unique identifier for the customer within the merchant's system. It is also used as a merchant identifier for the customer and plays a critical role in tokenization. All the customer's cards will be associated with this ID.","maxLength":64},"customer_last_name":{"type":"string","description":"The last name of the recipient of the payment. This field is used for various communications such as the invoice, receipt, email, SMS, or displayed on the payment page. It may also be sent to the payment gateway if necessary.","maxLength":64},"customer_phone":{"type":"string","description":"Customer phone number associated with the payment. This might be sent to the payment gateway and depending on the gateway, it may trigger a click to pay process on the payment page. The phone number will also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":16},"customer_phone_2":{"type":"string","title":"Customer additional phone","description":"The customer's additional phone number, if any. This field can be updated by the customer on the payment page or in the Checkout SDK.","maxLength":16},"discount_amount":{"type":"string","format":"decimal","description":"The fixed amount discount applied to the full invoice amount, including taxes. If set, the discount_percentage field will be set to null. Both discount_amount and discount_percentage cannot be set simultaneously. The discount cannot be higher than the `total_excl_tax` field."},"discount_percentage":{"type":"string","format":"decimal","description":"The percentage-based discount applied to the full invoice amount, including taxes. If set, the discount_amount field will be automatically calculated. Both discount_amount and discount_percentage cannot be set simultaneously. The discount cannot be higher than the `total_excl_tax` field."},"due_datetime":{"type":"string","format":"date-time","title":"Due date and time","description":"The date and time by which the payment is due. This field may be used to help remind the customer to complete the payment before the due date."},"email_recipients":{"type":"array","items":{"type":"string","format":"email"},"description":"A comma-separated list of email addresses for internal recipients who will receive customer emails. These recipients will be included in email notifications sent to the customer regarding their payment."},"expiration_time":{"type":"string","description":"If defined, any payment transactions created more than the specified period of time ago will be invalidated or expired if the customer attempts to complete them. By default, this expiration period is set to 24 hours from the time of transaction creation. This feature helps ensure that payment transactions are processed promptly."},"extra":{"allOf":[{"type":"object","description":"Serializer for extra data aka dynamic fields.\nExtra data can accept any value by default. However,\nif the merchant wants to enforce a specific type, they can\nuse the plugins.Field class to do so. All CUSTOM fields are\nvalidated inside extra field.\n\nImplementation:\n    - requires to have a config property in the parent\n    serializer which has to return a PluginConfig instance,\n    to which fields are attached.","properties":{"payment_category_name":{"type":"string"},"payment_category_amount":{"type":"string"},"month":{"enum":["january","february"],"type":"string","description":"* `january` - January\n* `february` - February"},"full_name":{"type":"string"},"booking_reference":{"type":"string"}},"required":["month"]}],"description":"The extra information for the payment details, which the merchant has sent it in key value form."},"generate_qr_code":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to true, the `qr_code_url` field will be present in the response. Upon scanning it, the customer will be redirected to the checkout_url, which is the Ottu Checkout page."},"include_sdk_setup_preload":{"type":"boolean","writeOnly":true,"default":false,"description":"Set this to true to include the 'sdk_setup_preload_payload' payload in the API response. This payload is only generated and added when this parameter is explicitly set to true. By default, it is false and the 'sdk_setup_preload_payload' payload will not be included."},"initiator_id":{"type":"integer","title":"initiator","description":"The user who initiated the creation of this payment transaction, if available. This field is optional and may be used to track who created the payment transaction. Note that if the payment transaction was using API Key auth initiator_id can be set to any value that corresponds to an existing ACTIVE user in the system"},"invoice_id":{"type":"integer","readOnly":true},"language":{"enum":["en","ar"],"type":"string","default":"en","description":"This field specifies the language to be used for communication with the customer, including the payment page, receipt, invoice, email, SMS, and any other communications related to the payment transaction.\n\n* `en` - English\n* `ar` - Arabic"},"notifications":{"allOf":[{"type":"object","properties":{"email":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized","voided","refunded","captured"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized\n* `voided` - Voided\n* `refunded` - Refunded\n* `captured` - Captured"}},"sms":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized","voided","refunded","captured"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized\n* `voided` - Voided\n* `refunded` - Refunded\n* `captured` - Captured"}},"whatsapp":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized"}}}}],"title":"Notification settings","description":"A JSON field that contains the notification settings for this payment transaction, including SMS and email notifications, as well as the events for which they will be sent (e.g., 'created', 'paid', 'refund', 'canceled', etc.). This field may be used to configure and customize the notifications sent to customers and internal recipients throughout the payment process."},"operation":{"type":"string","readOnly":true,"description":"Specifies the type of operation to be performed by the payment gateway. If set to `purchase`, the payment source will be directly charged. If set to `authorize`, the payment source will only be authorized and the actual charge will be made at a later time."},"order_no":{"type":"string","description":"The unique identifier assigned to this payment transaction. It is used for tracking purposes and is set by the merchant or the system.","maxLength":128},"payment_methods":{"allOf":[{"type":"object","properties":{"code":{"type":"string","description":"The slug code of the payment method.","pattern":"^[-a-zA-Z0-9_]+$"},"name":{"type":"string","description":"The name of the payment method."},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"amount":{"type":"string","description":"The total amount to be charged, including fees."},"currency_code":{"type":"string","description":"The currency code for the payment method represented as an ISO 4217 code.","maxLength":3},"fee":{"type":"string","description":"The fee charged by the payment gateway."},"fee_description":{"type":"string","description":"This field provides the label for any additional transaction fee. In the SDK, this label will be displayed prominently during the checkout process to inform the payer about the nature of the fee. Ensure to incorporate this field in a clear and visible manner within the checkout UI to maintain transparency with the end-users."},"icon":{"type":"string","format":"uri","description":"The svg URL of the icon for the payment method."},"icons":{"allOf":[{"type":"object","properties":{"webp":{"type":"string","format":"uri","description":"The webp URL of the icon for the payment method."},"svg":{"type":"string","format":"uri","description":"The svg URL of the icon for the payment method."}},"required":["svg","webp"]}],"description":"The URLs of the icon for the payment method."},"pg_icons":{"allOf":[{"type":"object","description":"Serializer for PG logo with custom logo URL resolution.","properties":{"svg":{"type":["string","null"],"format":"uri","readOnly":true,"description":"`Optional` field. Upload a logo in SVG format only. If provided and no WebP image is uploaded, a WebP version will be automatically generated. Only .svg files are accepted. Do not upload any other format."},"webp":{"type":"string","readOnly":true,"description":"`Mandatory` field. This must be provided either by uploading a WebP image directly, or it will be auto-generated from the SVG file (if provided). This field does not accept SVG files — only raster images like PNG or JPEG that will be converted to WebP."},"label":{"type":"string","description":"The display name of the logo (translatable in EN and AR).","maxLength":255}},"required":["label","svg","webp"]}],"description":"Represents list of mid icons configured for `pgmid` settings"},"flow":{"type":"string","default":"redirect","description":"The flow type of the payment method."},"redirect_url":{"type":["string","null"],"format":"uri","description":"The URL where the customer should be redirected to perform the payment."}},"required":["amount","code","currency_code","fee","fee_description","icon","icons","name","type"]}],"readOnly":true,"description":"An array containing all the payment methods derived from the `pg_codes` input. Each object in the array contains information about a single payment gateway, including its icon and the `redirect_url` that will redirect the customer to the payment gateway's payment page."},"payment_type":{"enum":["one_off","auto_debit","save_card"],"type":"string","default":"one_off","description":"Type of payment. Choose `one_off` for payments that occur only once without future commitments. Choose `auto_debit` for payments that are automatically deducted, such as recurring subscriptions, installments, or unscheduled auto-debits. \n\nChoose `save_card` if you want to perform a card tokenization operation.\n\nNOTE: If `auto_debit` is selected: \n1. `agreement` and `customer_id` parameters will also be mandatory. \n2. Only PG codes supporting tokenization can be selected. \nAs a side effect, the card used for the payment will be associated with the supplied `agreement.id`. This card will be locked, preventing the customer from deleting it from the system until an alternate card is chosen for auto-debit payments.\n\nNOTE: If `save_card` is selected: \n1. The amount must be zero for the save card operation. \n2. The selected MID(pg_code) must support tokenization to enable the save card operation. \n3. Please note that the save card operation is considered successful without any funds being charged.\n4. Once a card is created, Ottu will send a webhook containing the card details to the merchant's webhook URL.\n5. When the transaction type is `save_card`, all previously saved cards returned in the sdk_preload_payload should be hidden since the user is saving a new card and does not need to select from existing ones.\n\n* `one_off` - One Off\n* `auto_debit` - Auto Debit\n* `save_card` - Save Card"},"product_type":{"type":"string","description":"The type of product or service being purchased. This field may be used for tracking and reporting purposes.","maxLength":128},"qr_code_url":{"type":"string","format":"uri","readOnly":true,"description":"A QR code that, when scanned, redirects to the checkout page for this payment. This QR code may be displayed on invoices, receipts, or other documents to allow customers to easily access the checkout page and make a payment. This parameter is only present when `generate_qr_code` is set to true."},"redirect_url":{"type":"string","format":"uri","description":"The URL where the customer will be redirected after the payment stage only if the webhook URL returns a success status. `order_no`, `reference_number` and `session_id` will be appended to the redirect URL as query parameters.","maxLength":2000},"sdk_setup_preload_payload":{"allOf":[{"type":"object","description":"Serialize data for SDK init.\nThe SDK will use this data to initialize the payment process and\nto display the payment methods.","properties":{"amount":{"type":"string","format":"decimal","description":"Represents the total amount of the payment transaction, which includes the cost of the purchased items or services but excludes any additional fees or charges"},"cards":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"List of saved tokenized cards for customer payments, which can be used for transactions. Render alongside `payment_methods` for customers to choose from.","readOnly":true},"customer_id":{"type":"string","description":"The customer ID is a unique identifier for the customer within the merchant's system. It is also used as a merchant identifier for the customer and plays a critical role in tokenization. All the customer's cards will be associated with this ID.","maxLength":64},"customer_phone":{"type":"string","description":"Customer phone number associated with the payment. This might be sent to the payment gateway and depending on the gateway, it may trigger a click to pay process on the payment page. The phone number will also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":16},"currency_code":{"type":"string","description":"The specified currency represents the denomination of the transaction.Nevertheless, it doesn't necessarily mandate payment in this exact currency.Due to potential currency conversions or exchanges, the final charge may be in a different currency."},"language":{"enum":["en","ar"],"type":"string","default":"en","description":"This field specifies the language to be used for communication with the customer, including the payment page, receipt, invoice, email, SMS, and any other communications related to the payment transaction.\n\n* `en` - English\n* `ar` - Arabic"},"operation":{"type":"string","readOnly":true,"description":"Specifies the type of operation to be performed by the payment gateway. If set to `purchase`, the payment source will be directly charged. If set to `authorize`, the payment source will only be authorized and the actual charge will be made at a later time."},"payment_type":{"enum":["one_off","auto_debit","save_card"],"type":"string","default":"one_off","description":"Type of payment. Choose `one_off` for payments that occur only once without future commitments. Choose `auto_debit` for payments that are automatically deducted, such as recurring subscriptions, installments, or unscheduled auto-debits. \n\nChoose `save_card` if you want to perform a card tokenization operation.\n\nNOTE: If `auto_debit` is selected: \n1. `agreement` and `customer_id` parameters will also be mandatory. \n2. Only PG codes supporting tokenization can be selected. \nAs a side effect, the card used for the payment will be associated with the supplied `agreement.id`. This card will be locked, preventing the customer from deleting it from the system until an alternate card is chosen for auto-debit payments.\n\nNOTE: If `save_card` is selected: \n1. The amount must be zero for the save card operation. \n2. The selected MID(pg_code) must support tokenization to enable the save card operation. \n3. Please note that the save card operation is considered successful without any funds being charged.\n4. Once a card is created, Ottu will send a webhook containing the card details to the merchant's webhook URL.\n5. When the transaction type is `save_card`, all previously saved cards returned in the sdk_preload_payload should be hidden since the user is saving a new card and does not need to select from existing ones.\n\n* `one_off` - One Off\n* `auto_debit` - Auto Debit\n* `save_card` - Save Card"},"payment_methods":{"type":"array","items":{},"description":"The provided documentation describes the `payment_methods` field.\n\n Detailing the types of payment methods included and their functionality \nas well as backward compatibility considerations for removed methods. \n\nThe `payment_methods` field includes various payment options available to customers\nexcluding device-specific methods like `apple_pay`, `google_pay`and `flex_methods` represented in flex methods section\nit primarily supports methods requiring a redirect flow\nwhere users complete transactions on an external webpage.\n\n`Functionality`: users are redirected to an external \nsite mostly to gateway payment page \nusing `redirect_url` where they can complete the payment flow\n\n**The dynamic nature of the payment_methods**:`payment_methods` type is an array of objects \nand it's type allows it to accommodate an unlimited variety of payment options\nas each object represents a gateway payment option but strictly associated to redirect payment flow\n\n**Backward Compatibility Notice:**\n\n`stc_pay`: \nprevious Inclusion, `stc_pay` was formerly listed within the `payment_methods` array\nit has been removed in favor of a more streamlined integration within the SDK\nsimilar to the approach for `payment_services`.\n\n**Backward Compatibility:** \n\nThe SDK must still support STC Pay for applications relying on older API versions.\nAlthough it will not appear in current and future versions\nthe SDK will manage its inclusion internally\n\nto ensure a seamless transition and consistent user experience\nacross different API versions, without disrupting existing integrations.\n","readOnly":true},"payment_services":{"type":"array","items":{},"description":"Dedicated to singular, prominently featured payment options\n\nsuch as `apple_pay`, `google_pay`, `samsung_pay`, `stc_pay`, etc.,\nthe `payment_services` field presents these methods in a distinctive manner.\n\nUnlike `payment_methods`, payment services are intended to be displayed uniquely,\nTypically represented by dedicated buttons or interfaces within the payment page.\n\nThis ensures that each payment service,\nidentifiable by its unique flow ie: (`apple_pay`, `stc_pay`)\nis presented no more than once to the user\nmaintaining clarity and simplicity in the payment selection process.\n\n**Backward Compatibility Notice**:\nhistorically, the availability of (`apple_pay`, `google_pay`) \nwas indicated through the `apple_pay_available` and `google_pay_available` flags\nat the root level of the API response.\n\nWith the evolution of the API, these flags have been deprecated, \nand the respective payment methods have been integrated into the `payment_services` array.\n\nDespite this restructuring, backward compatibility for these payment methods\nis preserved in the SDK to accommodate previous API versions,\nensuring a seamless transition for existing implementations.\n","readOnly":true},"flex_methods":{"type":"array","items":{},"description":"The `flex_methods` field encompasses a comprehensive array\nof payment options available to customers,\nexplicitly excluding device-specific methods such as `apple_pay`\n`google_pay`, redirect flow `payment_methods` and tokenized card solutions\notherwise it represents the flexible payment methods ie:(`tamara`, `tabby`)\npayment options that necessitate dynamic flows\nwhere SDK might need to fetch some `pre-payment-check` API calls then\nusers are guided to an external webpage to finalize their payment transactions.\n\nIt's important to note that the flex_methods array is dynamic\nand can accommodate an unlimited array of payment methods.\neach method listed should be individually rendered within the user interface with a separated flow.\n","readOnly":true},"response":{"type":"object","additionalProperties":{},"description":"**What is a payment gateway response?**\n\nA payment gateway response is the feedback received\nfrom payment gateway after a user has completed a payment\nthis response provides information on whether the payment was successful or if it was canceled or failed.\n\n**When do we receive the response?**\n\nWe receive the payment gateway response immediately after the user has made a payment\nor after n of minutes defined for a gateway inquiry request initiated by ottu core\nto fetch the transaction status after the defined time for each gateway.\n\n**Which attempt do we get the response for?**\n\nthe response we provide is from the most recent payment attempt.\nthis ensures that the information reflects the latest status of the transaction.\n\n**Structure of the response**: \n\nThe response structure is managed by our SDK,\nwhich updates the payment details and triggers one of three callbacks\nbased on the status provided in the response:\n\n`successCallback`: Triggered if the response.status indicates a successful payment.\n\n`cancelCallback`: Triggered if the response.status indicates a canceled payment.\n\n`errorCallback`: Triggered if the response.status indicates a error payment.\n\n","readOnly":true},"state":{"enum":["created","pending","attempted","authorized","paid","failed","canceled","expired","invalided","refunded","cod"],"type":"string","readOnly":true,"description":"The current state of the payment transaction, it helps to understand the progress of the payment.\n\n* `created` - Created\n* `pending` - Pending\n* `attempted` - Attempted\n* `authorized` - Authorized\n* `paid` - Paid\n* `failed` - Failed\n* `canceled` - Canceled\n* `expired` - Expired\n* `invalided` - Invalided\n* `refunded` - Refunded\n* `cod` - Cash on Delivery"},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction. This field represents the purpose of the payment and can be one of several pre-defined choices.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"is_amount_editable":{"type":"boolean","readOnly":true,"title":"Editable amount","description":"This field specifies whether the customer can modify the payment amount and choose the amount he wishes to pay."},"session_id":{"type":"string","readOnly":true,"description":"A unique identifier for each payment transaction, used to maintain the session state during the payment process."},"cancel_url":{"type":"string","format":"uri","readOnly":true,"description":"This endpoint used to cancel the transaction using the merchant cancellation flow, \nto ensure the transaction cannot be paid again \nand trigger the webhook notification \n"}},"required":["amount","cancel_url","cards","currency_code","flex_methods","is_amount_editable","operation","payment_methods","payment_services","response","session_id","state","type"]}],"readOnly":true,"default":false,"description":"A JSON object containing preloaded data required to initialize the checkout interface.This includes essential details such as customer information, available payment methods.and specific transaction details, all formatted according to the Checkout SDK's initialization specifications.This field streamlines the checkout process by providing necessary information upfront.enhancing user experience and efficiency."},"session_id":{"type":"string","readOnly":true,"description":"A unique identifier for each payment transaction, used to maintain the session state during the payment process."},"settled_pg_code":{"type":"string","readOnly":true,"title":"Final Payment Gateway","description":"The code of the payment gateway used for completing the transaction. This field indicates the specific gateway that processed and settled the payment, providing clarity on which payment service was ultimately utilized for this transaction."},"shipping_excl_tax":{"type":"string","format":"decimal","title":"Shipping Excl. Tax","description":"The cost of shipping for the invoice, excluding taxes."},"shipping_incl_tax":{"type":"string","format":"decimal","title":"Shipping Incl. Tax","description":"The cost of shipping for the invoice, including all applicable taxes."},"shipping_method":{"type":"string","description":"The method or service used for shipping the items associated with the invoice."},"shipping_tax_rate":{"type":"string","format":"decimal","description":"The tax rate applied to the shipping cost, expressed as a percentage. "},"shortify_attachment_url":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to True, the URL of the uploaded attachment will be shortened using a URL shortener service. This should be used when sharing the attachment URL via SMS or WhatsApp."},"shortify_checkout_url":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to True, the checkout URL will be shortened using a URL shortener service. This should be used when sharing the payment URL via SMS or WhatsApp."},"state":{"enum":["created","pending","attempted","authorized","paid","failed","canceled","expired","invalided","refunded","cod"],"type":"string","readOnly":true,"description":"The current state of the payment transaction, it helps to understand the progress of the payment.\n\n* `created` - Created\n* `pending` - Pending\n* `attempted` - Attempted\n* `authorized` - Authorized\n* `paid` - Paid\n* `failed` - Failed\n* `canceled` - Canceled\n* `expired` - Expired\n* `invalided` - Invalided\n* `refunded` - Refunded\n* `cod` - Cash on Delivery"},"status":{"enum":["sent","paid","overdue","canceled"],"type":"string","readOnly":true,"description":"Current status of the invoice. Can be one of the following: `sent`, `paid`, `overdue`, `canceled`.\n\n* `sent` - Sent\n* `paid` - Paid\n* `overdue` - Overdue\n* `canceled` - Canceled"},"subtotal":{"type":"string","format":"decimal","description":"Sum of total_incl_tax's of all invoice items."},"tax_amount":{"type":"string","format":"decimal","description":"The total amount of tax applied to the invoice."},"tax_rate":{"type":"string","format":"decimal","title":"Tax","description":"The tax rate applied to the invoice, expressed as a percentage."},"total_excl_tax":{"type":"string","format":"decimal","title":"Total Excl. Tax","description":"The total amount of the invoice, excluding taxes."},"total_incl_tax":{"type":"string","format":"decimal","title":"Total Incl. Tax","description":"The total amount of the invoice, including all applicable taxes."},"unit_code":{"type":"string","writeOnly":true,"title":"Unit","description":"The slug of the unit to be used for the transaction."},"vendor_name":{"type":"string","description":"The name of the vendor or merchant associated with this payment. This field may be used for accounting and reporting purposes.","maxLength":64},"webhook_url":{"type":"string","format":"uri","description":"URL where the payment result will be sent via a POST request after the customer has completed the payment session. The payment result will be included in the request body. ","maxLength":2000}},"required":["attachment_short_url","checkout_short_url","checkout_url","currency_code","due_date","invoice_id","invoice_items","invoice_number","operation","payment_methods","pg_codes","qr_code_url","sdk_setup_preload_payload","session_id","settled_pg_code","state","status","type"]}},"application/x-www-form-urlencoded":{"schema":{"type":"object","description":"Serializer class for `Invoice` instances, inheriting from `BaseInvoiceSerializer` and\n`CheckoutSerializer`. It provides methods for creating invoices, invoice items, and transactions.","properties":{"currency_code":{"type":"string","description":"The specified currency represents the denomination of the transaction.Nevertheless, it doesn't necessarily mandate payment in this exact currency.Due to potential currency conversions or exchanges, the final charge may be in a different currency."},"due_date":{"type":"string","format":"date","description":"The date by which the customer is expected to make payment for the invoice."},"invoice_items":{"type":"array","items":{"type":"object","description":"Serializer to use for `InvoiceItem` instances.\n\nThe unit_price, quantity, description and sku fields are required.\nThe rest are optional.\n\nThe class includes a method to calculate the discount on the invoice and another to calculate the total values.","properties":{"id":{"type":"integer","readOnly":true},"invoice":{"type":["integer","null"],"description":"Associated invoice."},"sku":{"type":"string","description":"Unique identifier for the invoice item.","maxLength":255},"description":{"type":"string","description":"Product name or a brief description of the item.","maxLength":255},"quantity":{"type":"string","format":"decimal","description":"Number of units of the product."},"unit_price":{"type":"string","format":"decimal","description":"Price per unit of the product, excluding tax."},"tax_rate":{"type":"string","format":"decimal","description":"Tax rate applied to the invoice item."},"tax_amount":{"type":"string","format":"decimal","description":"Total tax amount for the invoice item."},"discount_percentage":{"type":"string","format":"decimal","description":"Percentage-based discount applied to the invoice item. The calculated discount cannot exceed theitem's total value, including tax."},"discount_amount":{"type":"string","format":"decimal","description":"Fixed amount discount applied to the invoice item. The discount cannot exceed the item's total value, including tax."},"total_excl_tax":{"type":"string","format":"decimal","description":"Total value of the invoice item, excluding tax. This is calculated as (unit_price * quantity) - discount."},"total_incl_tax":{"type":"string","format":"decimal","description":"Total value of the invoice item, including tax. This is calculated as (unit_price * quantity) - discount + applicable tax."},"currency_code":{"type":"string","description":"For internal purposes: it'll be overridden by the main currency_code"}},"required":["currency_code","description","id","quantity","sku","unit_price"]},"description":"The list of items for the invoice."},"invoice_number":{"type":"string","description":"A unique identifier for the invoice, typically used for tracking and referencing purposes.","maxLength":255},"pg_codes":{"type":"array","items":{"type":"string"},"title":"Gateway","description":"The list of payment gateway codes from which a customer can select to perform the payment"},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction. This field represents the purpose of the payment and can be one of several pre-defined choices.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"billing_address":{"type":"object","description":"Nested serializer to save Address data into PaymentTransaction","properties":{"line1":{"type":"string","maxLength":128},"line2":{"type":"string","maxLength":128},"city":{"type":"string","maxLength":40},"state":{"type":"string","maxLength":40},"country":{"enum":["AF","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","HR","CU","CW","CY","CZ","CI","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RO","RU","RW","RE","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TM","TC","TV","TR","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","AX"],"type":"string","description":"* `AF` - Afghanistan\n* `AL` - Albania\n* `DZ` - Algeria\n* `AS` - American Samoa\n* `AD` - Andorra\n* `AO` - Angola\n* `AI` - Anguilla\n* `AQ` - Antarctica\n* `AG` - Antigua and Barbuda\n* `AR` - Argentina\n* `AM` - Armenia\n* `AW` - Aruba\n* `AU` - Australia\n* `AT` - Austria\n* `AZ` - Azerbaijan\n* `BS` - Bahamas\n* `BH` - Bahrain\n* `BD` - Bangladesh\n* `BB` - Barbados\n* `BY` - Belarus\n* `BE` - Belgium\n* `BZ` - Belize\n* `BJ` - Benin\n* `BM` - Bermuda\n* `BT` - Bhutan\n* `BO` - Bolivia, Plurinational State of\n* `BQ` - Bonaire, Sint Eustatius and Saba\n* `BA` - Bosnia and Herzegovina\n* `BW` - Botswana\n* `BV` - Bouvet Island\n* `BR` - Brazil\n* `IO` - British Indian Ocean Territory\n* `BN` - Brunei Darussalam\n* `BG` - Bulgaria\n* `BF` - Burkina Faso\n* `BI` - Burundi\n* `CV` - Cabo Verde\n* `KH` - Cambodia\n* `CM` - Cameroon\n* `CA` - Canada\n* `KY` - Cayman Islands\n* `CF` - Central African Republic\n* `TD` - Chad\n* `CL` - Chile\n* `CN` - China\n* `CX` - Christmas Island\n* `CC` - Cocos (Keeling) Islands\n* `CO` - Colombia\n* `KM` - Comoros\n* `CG` - Congo\n* `CD` - Congo, The Democratic Republic of the\n* `CK` - Cook Islands\n* `CR` - Costa Rica\n* `HR` - Croatia\n* `CU` - Cuba\n* `CW` - Curaçao\n* `CY` - Cyprus\n* `CZ` - Czechia\n* `CI` - Côte d'Ivoire\n* `DK` - Denmark\n* `DJ` - Djibouti\n* `DM` - Dominica\n* `DO` - Dominican Republic\n* `EC` - Ecuador\n* `EG` - Egypt\n* `SV` - El Salvador\n* `GQ` - Equatorial Guinea\n* `ER` - Eritrea\n* `EE` - Estonia\n* `SZ` - Eswatini\n* `ET` - Ethiopia\n* `FK` - Falkland Islands (Malvinas)\n* `FO` - Faroe Islands\n* `FJ` - Fiji\n* `FI` - Finland\n* `FR` - France\n* `GF` - French Guiana\n* `PF` - French Polynesia\n* `TF` - French Southern Territories\n* `GA` - Gabon\n* `GM` - Gambia\n* `GE` - Georgia\n* `DE` - Germany\n* `GH` - Ghana\n* `GI` - Gibraltar\n* `GR` - Greece\n* `GL` - Greenland\n* `GD` - Grenada\n* `GP` - Guadeloupe\n* `GU` - Guam\n* `GT` - Guatemala\n* `GG` - Guernsey\n* `GN` - Guinea\n* `GW` - Guinea-Bissau\n* `GY` - Guyana\n* `HT` - Haiti\n* `HM` - Heard Island and McDonald Islands\n* `VA` - Holy See (Vatican City State)\n* `HN` - Honduras\n* `HK` - Hong Kong\n* `HU` - Hungary\n* `IS` - Iceland\n* `IN` - India\n* `ID` - Indonesia\n* `IR` - Iran, Islamic Republic of\n* `IQ` - Iraq\n* `IE` - Ireland\n* `IM` - Isle of Man\n* `IL` - Israel\n* `IT` - Italy\n* `JM` - Jamaica\n* `JP` - Japan\n* `JE` - Jersey\n* `JO` - Jordan\n* `KZ` - Kazakhstan\n* `KE` - Kenya\n* `KI` - Kiribati\n* `KP` - Korea, Democratic People's Republic of\n* `KR` - Korea, Republic of\n* `KW` - Kuwait\n* `KG` - Kyrgyzstan\n* `LA` - Lao People's Democratic Republic\n* `LV` - Latvia\n* `LB` - Lebanon\n* `LS` - Lesotho\n* `LR` - Liberia\n* `LY` - Libya\n* `LI` - Liechtenstein\n* `LT` - Lithuania\n* `LU` - Luxembourg\n* `MO` - Macao\n* `MG` - Madagascar\n* `MW` - Malawi\n* `MY` - Malaysia\n* `MV` - Maldives\n* `ML` - Mali\n* `MT` - Malta\n* `MH` - Marshall Islands\n* `MQ` - Martinique\n* `MR` - Mauritania\n* `MU` - Mauritius\n* `YT` - Mayotte\n* `MX` - Mexico\n* `FM` - Micronesia, Federated States of\n* `MD` - Moldova, Republic of\n* `MC` - Monaco\n* `MN` - Mongolia\n* `ME` - Montenegro\n* `MS` - Montserrat\n* `MA` - Morocco\n* `MZ` - Mozambique\n* `MM` - Myanmar\n* `NA` - Namibia\n* `NR` - Nauru\n* `NP` - Nepal\n* `NL` - Netherlands\n* `NC` - New Caledonia\n* `NZ` - New Zealand\n* `NI` - Nicaragua\n* `NE` - Niger\n* `NG` - Nigeria\n* `NU` - Niue\n* `NF` - Norfolk Island\n* `MK` - North Macedonia\n* `MP` - Northern Mariana Islands\n* `NO` - Norway\n* `OM` - Oman\n* `PK` - Pakistan\n* `PW` - Palau\n* `PS` - Palestine, State of\n* `PA` - Panama\n* `PG` - Papua New Guinea\n* `PY` - Paraguay\n* `PE` - Peru\n* `PH` - Philippines\n* `PN` - Pitcairn\n* `PL` - Poland\n* `PT` - Portugal\n* `PR` - Puerto Rico\n* `QA` - Qatar\n* `RO` - Romania\n* `RU` - Russian Federation\n* `RW` - Rwanda\n* `RE` - Réunion\n* `BL` - Saint Barthélemy\n* `SH` - Saint Helena, Ascension and Tristan da Cunha\n* `KN` - Saint Kitts and Nevis\n* `LC` - Saint Lucia\n* `MF` - Saint Martin (French part)\n* `PM` - Saint Pierre and Miquelon\n* `VC` - Saint Vincent and the Grenadines\n* `WS` - Samoa\n* `SM` - San Marino\n* `ST` - Sao Tome and Principe\n* `SA` - Saudi Arabia\n* `SN` - Senegal\n* `RS` - Serbia\n* `SC` - Seychelles\n* `SL` - Sierra Leone\n* `SG` - Singapore\n* `SX` - Sint Maarten (Dutch part)\n* `SK` - Slovakia\n* `SI` - Slovenia\n* `SB` - Solomon Islands\n* `SO` - Somalia\n* `ZA` - South Africa\n* `GS` - South Georgia and the South Sandwich Islands\n* `SS` - South Sudan\n* `ES` - Spain\n* `LK` - Sri Lanka\n* `SD` - Sudan\n* `SR` - Suriname\n* `SJ` - Svalbard and Jan Mayen\n* `SE` - Sweden\n* `CH` - Switzerland\n* `SY` - Syrian Arab Republic\n* `TW` - Taiwan, Province of China\n* `TJ` - Tajikistan\n* `TZ` - Tanzania, United Republic of\n* `TH` - Thailand\n* `TL` - Timor-Leste\n* `TG` - Togo\n* `TK` - Tokelau\n* `TO` - Tonga\n* `TT` - Trinidad and Tobago\n* `TN` - Tunisia\n* `TM` - Turkmenistan\n* `TC` - Turks and Caicos Islands\n* `TV` - Tuvalu\n* `TR` - Türkiye\n* `UG` - Uganda\n* `UA` - Ukraine\n* `AE` - United Arab Emirates\n* `GB` - United Kingdom\n* `US` - United States\n* `UM` - United States Minor Outlying Islands\n* `UY` - Uruguay\n* `UZ` - Uzbekistan\n* `VU` - Vanuatu\n* `VE` - Venezuela, Bolivarian Republic of\n* `VN` - Viet Nam\n* `VG` - Virgin Islands, British\n* `VI` - Virgin Islands, U.S.\n* `WF` - Wallis and Futuna\n* `EH` - Western Sahara\n* `YE` - Yemen\n* `ZM` - Zambia\n* `ZW` - Zimbabwe\n* `AX` - Åland Islands"},"postal_code":{"type":"string","maxLength":12}},"required":["city","country","line1"]},"shipping_address":{"type":"object","description":"Nested serializer to save Address data into PaymentTransaction","properties":{"line1":{"type":"string","maxLength":128},"line2":{"type":"string","maxLength":128},"city":{"type":"string","maxLength":40},"state":{"type":"string","maxLength":40},"country":{"enum":["AF","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","HR","CU","CW","CY","CZ","CI","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RO","RU","RW","RE","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TM","TC","TV","TR","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","AX"],"type":"string","description":"* `AF` - Afghanistan\n* `AL` - Albania\n* `DZ` - Algeria\n* `AS` - American Samoa\n* `AD` - Andorra\n* `AO` - Angola\n* `AI` - Anguilla\n* `AQ` - Antarctica\n* `AG` - Antigua and Barbuda\n* `AR` - Argentina\n* `AM` - Armenia\n* `AW` - Aruba\n* `AU` - Australia\n* `AT` - Austria\n* `AZ` - Azerbaijan\n* `BS` - Bahamas\n* `BH` - Bahrain\n* `BD` - Bangladesh\n* `BB` - Barbados\n* `BY` - Belarus\n* `BE` - Belgium\n* `BZ` - Belize\n* `BJ` - Benin\n* `BM` - Bermuda\n* `BT` - Bhutan\n* `BO` - Bolivia, Plurinational State of\n* `BQ` - Bonaire, Sint Eustatius and Saba\n* `BA` - Bosnia and Herzegovina\n* `BW` - Botswana\n* `BV` - Bouvet Island\n* `BR` - Brazil\n* `IO` - British Indian Ocean Territory\n* `BN` - Brunei Darussalam\n* `BG` - Bulgaria\n* `BF` - Burkina Faso\n* `BI` - Burundi\n* `CV` - Cabo Verde\n* `KH` - Cambodia\n* `CM` - Cameroon\n* `CA` - Canada\n* `KY` - Cayman Islands\n* `CF` - Central African Republic\n* `TD` - Chad\n* `CL` - Chile\n* `CN` - China\n* `CX` - Christmas Island\n* `CC` - Cocos (Keeling) Islands\n* `CO` - Colombia\n* `KM` - Comoros\n* `CG` - Congo\n* `CD` - Congo, The Democratic Republic of the\n* `CK` - Cook Islands\n* `CR` - Costa Rica\n* `HR` - Croatia\n* `CU` - Cuba\n* `CW` - Curaçao\n* `CY` - Cyprus\n* `CZ` - Czechia\n* `CI` - Côte d'Ivoire\n* `DK` - Denmark\n* `DJ` - Djibouti\n* `DM` - Dominica\n* `DO` - Dominican Republic\n* `EC` - Ecuador\n* `EG` - Egypt\n* `SV` - El Salvador\n* `GQ` - Equatorial Guinea\n* `ER` - Eritrea\n* `EE` - Estonia\n* `SZ` - Eswatini\n* `ET` - Ethiopia\n* `FK` - Falkland Islands (Malvinas)\n* `FO` - Faroe Islands\n* `FJ` - Fiji\n* `FI` - Finland\n* `FR` - France\n* `GF` - French Guiana\n* `PF` - French Polynesia\n* `TF` - French Southern Territories\n* `GA` - Gabon\n* `GM` - Gambia\n* `GE` - Georgia\n* `DE` - Germany\n* `GH` - Ghana\n* `GI` - Gibraltar\n* `GR` - Greece\n* `GL` - Greenland\n* `GD` - Grenada\n* `GP` - Guadeloupe\n* `GU` - Guam\n* `GT` - Guatemala\n* `GG` - Guernsey\n* `GN` - Guinea\n* `GW` - Guinea-Bissau\n* `GY` - Guyana\n* `HT` - Haiti\n* `HM` - Heard Island and McDonald Islands\n* `VA` - Holy See (Vatican City State)\n* `HN` - Honduras\n* `HK` - Hong Kong\n* `HU` - Hungary\n* `IS` - Iceland\n* `IN` - India\n* `ID` - Indonesia\n* `IR` - Iran, Islamic Republic of\n* `IQ` - Iraq\n* `IE` - Ireland\n* `IM` - Isle of Man\n* `IL` - Israel\n* `IT` - Italy\n* `JM` - Jamaica\n* `JP` - Japan\n* `JE` - Jersey\n* `JO` - Jordan\n* `KZ` - Kazakhstan\n* `KE` - Kenya\n* `KI` - Kiribati\n* `KP` - Korea, Democratic People's Republic of\n* `KR` - Korea, Republic of\n* `KW` - Kuwait\n* `KG` - Kyrgyzstan\n* `LA` - Lao People's Democratic Republic\n* `LV` - Latvia\n* `LB` - Lebanon\n* `LS` - Lesotho\n* `LR` - Liberia\n* `LY` - Libya\n* `LI` - Liechtenstein\n* `LT` - Lithuania\n* `LU` - Luxembourg\n* `MO` - Macao\n* `MG` - Madagascar\n* `MW` - Malawi\n* `MY` - Malaysia\n* `MV` - Maldives\n* `ML` - Mali\n* `MT` - Malta\n* `MH` - Marshall Islands\n* `MQ` - Martinique\n* `MR` - Mauritania\n* `MU` - Mauritius\n* `YT` - Mayotte\n* `MX` - Mexico\n* `FM` - Micronesia, Federated States of\n* `MD` - Moldova, Republic of\n* `MC` - Monaco\n* `MN` - Mongolia\n* `ME` - Montenegro\n* `MS` - Montserrat\n* `MA` - Morocco\n* `MZ` - Mozambique\n* `MM` - Myanmar\n* `NA` - Namibia\n* `NR` - Nauru\n* `NP` - Nepal\n* `NL` - Netherlands\n* `NC` - New Caledonia\n* `NZ` - New Zealand\n* `NI` - Nicaragua\n* `NE` - Niger\n* `NG` - Nigeria\n* `NU` - Niue\n* `NF` - Norfolk Island\n* `MK` - North Macedonia\n* `MP` - Northern Mariana Islands\n* `NO` - Norway\n* `OM` - Oman\n* `PK` - Pakistan\n* `PW` - Palau\n* `PS` - Palestine, State of\n* `PA` - Panama\n* `PG` - Papua New Guinea\n* `PY` - Paraguay\n* `PE` - Peru\n* `PH` - Philippines\n* `PN` - Pitcairn\n* `PL` - Poland\n* `PT` - Portugal\n* `PR` - Puerto Rico\n* `QA` - Qatar\n* `RO` - Romania\n* `RU` - Russian Federation\n* `RW` - Rwanda\n* `RE` - Réunion\n* `BL` - Saint Barthélemy\n* `SH` - Saint Helena, Ascension and Tristan da Cunha\n* `KN` - Saint Kitts and Nevis\n* `LC` - Saint Lucia\n* `MF` - Saint Martin (French part)\n* `PM` - Saint Pierre and Miquelon\n* `VC` - Saint Vincent and the Grenadines\n* `WS` - Samoa\n* `SM` - San Marino\n* `ST` - Sao Tome and Principe\n* `SA` - Saudi Arabia\n* `SN` - Senegal\n* `RS` - Serbia\n* `SC` - Seychelles\n* `SL` - Sierra Leone\n* `SG` - Singapore\n* `SX` - Sint Maarten (Dutch part)\n* `SK` - Slovakia\n* `SI` - Slovenia\n* `SB` - Solomon Islands\n* `SO` - Somalia\n* `ZA` - South Africa\n* `GS` - South Georgia and the South Sandwich Islands\n* `SS` - South Sudan\n* `ES` - Spain\n* `LK` - Sri Lanka\n* `SD` - Sudan\n* `SR` - Suriname\n* `SJ` - Svalbard and Jan Mayen\n* `SE` - Sweden\n* `CH` - Switzerland\n* `SY` - Syrian Arab Republic\n* `TW` - Taiwan, Province of China\n* `TJ` - Tajikistan\n* `TZ` - Tanzania, United Republic of\n* `TH` - Thailand\n* `TL` - Timor-Leste\n* `TG` - Togo\n* `TK` - Tokelau\n* `TO` - Tonga\n* `TT` - Trinidad and Tobago\n* `TN` - Tunisia\n* `TM` - Turkmenistan\n* `TC` - Turks and Caicos Islands\n* `TV` - Tuvalu\n* `TR` - Türkiye\n* `UG` - Uganda\n* `UA` - Ukraine\n* `AE` - United Arab Emirates\n* `GB` - United Kingdom\n* `US` - United States\n* `UM` - United States Minor Outlying Islands\n* `UY` - Uruguay\n* `UZ` - Uzbekistan\n* `VU` - Vanuatu\n* `VE` - Venezuela, Bolivarian Republic of\n* `VN` - Viet Nam\n* `VG` - Virgin Islands, British\n* `VI` - Virgin Islands, U.S.\n* `WF` - Wallis and Futuna\n* `EH` - Western Sahara\n* `YE` - Yemen\n* `ZM` - Zambia\n* `ZW` - Zimbabwe\n* `AX` - Åland Islands"},"postal_code":{"type":"string","maxLength":12},"first_name":{"type":"string","maxLength":64},"last_name":{"type":"string","maxLength":64},"email":{"type":"string","format":"email","maxLength":128},"phone":{"type":"string","maxLength":16}},"required":["city","country","email","first_name","last_name","line1","phone"]},"agreement":{"allOf":[{"type":"object","description":"Serializer to hold the recurring data information.\nThis is required for being able to create recurring payments and the PGs\nrequire this information.","properties":{"id":{"type":"string","description":"A unique identifier for the agreement established with the payer. This ID links to the specific terms and conditions the payer has authorized for processing their stored card details. Use cases include: \n1. Recurring Payments: Periodic debits, e.g., gym memberships. \n2. Installment Payments: Multiple charges for a single purchase over time. \n3. Unscheduled: Future payments as required, e.g., account top-ups. \n4. Industry Practice: Standard business practices related to an original payment, e.g., hotel charges after checkout.","maxLength":128},"amount_variability":{"enum":["fixed","variable"],"type":"string","description":"Indicates if all payments within the agreement use the same amount or if the amount differs between the payments.\n\n* `fixed` - Fixed\n* `variable` - Variable"},"start_date":{"type":"string","format":"date","description":"Date on which the agreement with the payer to process payments starts."},"expiry_date":{"type":"string","format":"date","description":"Date on which your agreement with the payer to process payments expires."},"max_amount_per_cycle":{"type":"string","format":"decimal","description":"The maximum amount for a single payment in the series as agreed with the payer."},"cycle_interval_days":{"type":"integer","maximum":366,"minimum":1,"description":"The minimum number of days between payments agreed with the payer."},"total_cycles":{"type":"integer","maximum":999,"minimum":1,"description":"The number of merchant-initiated payments within the recurring payment agreement."},"frequency":{"enum":["irregular","daily","weekly","semi_monthly","monthly","quarterly","semi_annually","yearly","other"],"type":"string","description":"The frequency of the payments within the series as agreed with the payer.\n\n* `irregular` - Irregular\n* `daily` - Daily\n* `weekly` - Weekly\n* `semi_monthly` - Semi Monthly\n* `monthly` - Monthly\n* `quarterly` - Quarterly\n* `semi_annually` - Semi Annually\n* `yearly` - Yearly\n* `other` - Other"},"type":{"enum":["event_based","installment","recurring","unscheduled","other"],"type":"string","default":"recurring","description":"The type of commercial agreement that the payer has with the merchant.\n\n *Note*: For `unscheduled` agreements, the allowed values should be configured as follows: \n\n `id` - Accepts any value. \n\n `frequency`. \n\n `type`.\n\n This configuration ensures that only specific values are permitted for each field when the `type` is `Unscheduled`.\n\n *Note*: For `recurring` agreements, the following fields are mandatory as follows: \n\n `amount_variability` \n\n `cycle_interval_days` \n\n `expiry_date` \n\n ` `requency` \n\n `id` \n\n  `total_cycles` \n\n This configuration ensures that the required values are mandatory for each field when the `type` is `Recurring`.\n\n* `event_based` - Event Based\n* `installment` - Installment\n* `recurring` - Recurring\n* `unscheduled` - Unscheduled\n* `other` - Other"},"seller":{"allOf":[{"type":"object","properties":{"name":{"type":"string","description":"The retailer's trading name.","maxLength":128},"short_name":{"type":"string","description":"Abbreviation of the retailer's trading name, suitable for payer's statement display.","maxLength":64},"category_code":{"type":"string","description":"A 4-digit code classifying the retailer's business by the type of goods or services it offers.","maxLength":64}}}],"description":"Details about the retailer, if the agreement is for installment payments."},"extra_params":{"allOf":[{"type":"object","properties":{"payment_processing_day":{"type":"integer","maximum":31,"minimum":1,"description":"Day of the month on which the payment must be processed. Not required for unscheduled payment agreements."}}}],"description":"Additional parameters related to the agreement."}}}],"description":"An established contractual arrangement with the payer, which authorizes you to securely store and subsequently utilize their payment information for specific purposes. This could encompass arrangements like recurring payments for services such as mobile subscriptions, installment-based payments for purchases, arrangements for ad-hoc charges like account top-ups, or for standard industry practices like penalty charges for missed appointments. \n\nNote: If your intention is solely to store payment details for transactions initiated by the payer in the future, then this parameter group should not be used."},"amount":{"type":"string","format":"decimal","description":"Represents the total amount of the payment transaction, which includes the cost of the purchased items or services but excludes any additional fees or charges"},"attachment":{"type":"string","format":"uri","description":"A writable field that accepts an attachment file to be included in email notifications sent to the customer regarding their payment, and also be available for download on the checkout page. This field may be used to provide the customer with additional information or documentation related to their purchase. The value of this field should be a file object. Upon successful submission, the API will return the URL for downloading the attached file. "},"attachment_short_url":{"type":"string","format":"uri","readOnly":true,"description":"A short URL that links to the attachment associated with this payment. This URL may be included in email/sms notifications sent to the customer regarding their payment or displayed on the checkout page to allow the customer to easily access the attachment."},"attachment_upload_url":{"type":"string","description":"A writable field that accepts an attachment that has already been uploaded to the server.","pattern":"(?:pdf|jpeg|png|doc|docx|jpg|xls|xlsx|txt)$"},"card_acceptance_criteria":{"allOf":[{"type":"object","properties":{"min_expiry_time":{"type":"integer","maximum":365,"minimum":1,"description":"Specifies the minimum required validity period, in days, for a card to be eligible for payment. If set to 30 days, for example, cards set to expire within the next month would be declined. This ensures short-lived cards nearing their expiration date are filtered out, reducing chances of payment failures. When implementing, balance your operational needs with customer convenience. Setting it too stringent might increase payment declines, while a lenient approach could risk future payment failures.\n\nAdditionally, it defaults to 30 days when the `payment_type` is `auto_debit`. If any other payment type is selected, no default value is set."}}}],"description":"This field allows you to define specific rules and conditions that a card must meet to be eligible for payment. These stipulations apply regardless of whether a customer chooses to pay using a saved card or opts to add a new card for the transaction. By leveraging the `card_acceptance_criteria`, you gain the power to fine-tune your payment processing strategy, tailoring acceptance rules to align with your business needs, security standards, and risk management policies.\n\n**Example**: If you run an exclusive service that caters predominantly to premium customers, you might set criteria that only allow transactions from high-tier credit cards like VISA Platinum. This ensures that payments align with the exclusivity and branding of your services. Remember to configure these criteria thoughtfully. Striking the right balance between security, risk mitigation, and user experience is paramount.\n\n**Note**: The `card_acceptance_criteria` field is applicable only for direct payments and not for hosted session payments."},"checkout_short_url":{"type":"string","format":"uri","readOnly":true,"description":"A short URL link that, when opened, redirects to the checkout page for this payment. This URL may be shared with the customer to allow them to easily access and complete the payment. This field is only available if the `shortify_checkout_url` field is set to True."},"checkout_url":{"type":"string","format":"uri","readOnly":true,"description":"URL that directs the customer to the Ottu Checkout Page where they can see the payment details and available payment methods for the transaction. If you need to share the payment link over SMS or WhatsApp, use `checkout_short_url` instead."},"company_name":{"type":"string","description":"The company name is used for invoice API.","maxLength":64},"customer_birthdate":{"type":"string","format":"date","title":"Customer Date of Birth","description":"Customer's date of birth in YYYY-MM-DD format.This field can be used for age verification or compliance purposes during payment processing."},"customer_email":{"type":"string","format":"email","description":"The email address of the customer that is used to send payment notifications and receipts, and can be used for fraud prevention. This field is mandatory and is always sent to the payment gateway. It may also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":128},"customer_first_name":{"type":"string","description":"The first name of the recipient of the payment. This field is used for various communications such as the invoice, receipt, email, SMS, or displayed on the payment page. It may also be sent to the payment gateway if necessary.","maxLength":64},"customer_id":{"type":"string","description":"The customer ID is a unique identifier for the customer within the merchant's system. It is also used as a merchant identifier for the customer and plays a critical role in tokenization. All the customer's cards will be associated with this ID.","maxLength":64},"customer_last_name":{"type":"string","description":"The last name of the recipient of the payment. This field is used for various communications such as the invoice, receipt, email, SMS, or displayed on the payment page. It may also be sent to the payment gateway if necessary.","maxLength":64},"customer_phone":{"type":"string","description":"Customer phone number associated with the payment. This might be sent to the payment gateway and depending on the gateway, it may trigger a click to pay process on the payment page. The phone number will also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":16},"customer_phone_2":{"type":"string","title":"Customer additional phone","description":"The customer's additional phone number, if any. This field can be updated by the customer on the payment page or in the Checkout SDK.","maxLength":16},"discount_amount":{"type":"string","format":"decimal","description":"The fixed amount discount applied to the full invoice amount, including taxes. If set, the discount_percentage field will be set to null. Both discount_amount and discount_percentage cannot be set simultaneously. The discount cannot be higher than the `total_excl_tax` field."},"discount_percentage":{"type":"string","format":"decimal","description":"The percentage-based discount applied to the full invoice amount, including taxes. If set, the discount_amount field will be automatically calculated. Both discount_amount and discount_percentage cannot be set simultaneously. The discount cannot be higher than the `total_excl_tax` field."},"due_datetime":{"type":"string","format":"date-time","title":"Due date and time","description":"The date and time by which the payment is due. This field may be used to help remind the customer to complete the payment before the due date."},"email_recipients":{"type":"array","items":{"type":"string","format":"email"},"description":"A comma-separated list of email addresses for internal recipients who will receive customer emails. These recipients will be included in email notifications sent to the customer regarding their payment."},"expiration_time":{"type":"string","description":"If defined, any payment transactions created more than the specified period of time ago will be invalidated or expired if the customer attempts to complete them. By default, this expiration period is set to 24 hours from the time of transaction creation. This feature helps ensure that payment transactions are processed promptly."},"extra":{"allOf":[{"type":"object","description":"Serializer for extra data aka dynamic fields.\nExtra data can accept any value by default. However,\nif the merchant wants to enforce a specific type, they can\nuse the plugins.Field class to do so. All CUSTOM fields are\nvalidated inside extra field.\n\nImplementation:\n    - requires to have a config property in the parent\n    serializer which has to return a PluginConfig instance,\n    to which fields are attached.","properties":{"payment_category_name":{"type":"string"},"payment_category_amount":{"type":"string"},"month":{"enum":["january","february"],"type":"string","description":"* `january` - January\n* `february` - February"},"full_name":{"type":"string"},"booking_reference":{"type":"string"}},"required":["month"]}],"description":"The extra information for the payment details, which the merchant has sent it in key value form."},"generate_qr_code":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to true, the `qr_code_url` field will be present in the response. Upon scanning it, the customer will be redirected to the checkout_url, which is the Ottu Checkout page."},"include_sdk_setup_preload":{"type":"boolean","writeOnly":true,"default":false,"description":"Set this to true to include the 'sdk_setup_preload_payload' payload in the API response. This payload is only generated and added when this parameter is explicitly set to true. By default, it is false and the 'sdk_setup_preload_payload' payload will not be included."},"initiator_id":{"type":"integer","title":"initiator","description":"The user who initiated the creation of this payment transaction, if available. This field is optional and may be used to track who created the payment transaction. Note that if the payment transaction was using API Key auth initiator_id can be set to any value that corresponds to an existing ACTIVE user in the system"},"invoice_id":{"type":"integer","readOnly":true},"language":{"enum":["en","ar"],"type":"string","default":"en","description":"This field specifies the language to be used for communication with the customer, including the payment page, receipt, invoice, email, SMS, and any other communications related to the payment transaction.\n\n* `en` - English\n* `ar` - Arabic"},"notifications":{"allOf":[{"type":"object","properties":{"email":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized","voided","refunded","captured"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized\n* `voided` - Voided\n* `refunded` - Refunded\n* `captured` - Captured"}},"sms":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized","voided","refunded","captured"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized\n* `voided` - Voided\n* `refunded` - Refunded\n* `captured` - Captured"}},"whatsapp":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized"}}}}],"title":"Notification settings","description":"A JSON field that contains the notification settings for this payment transaction, including SMS and email notifications, as well as the events for which they will be sent (e.g., 'created', 'paid', 'refund', 'canceled', etc.). This field may be used to configure and customize the notifications sent to customers and internal recipients throughout the payment process."},"operation":{"type":"string","readOnly":true,"description":"Specifies the type of operation to be performed by the payment gateway. If set to `purchase`, the payment source will be directly charged. If set to `authorize`, the payment source will only be authorized and the actual charge will be made at a later time."},"order_no":{"type":"string","description":"The unique identifier assigned to this payment transaction. It is used for tracking purposes and is set by the merchant or the system.","maxLength":128},"payment_methods":{"allOf":[{"type":"object","properties":{"code":{"type":"string","description":"The slug code of the payment method.","pattern":"^[-a-zA-Z0-9_]+$"},"name":{"type":"string","description":"The name of the payment method."},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"amount":{"type":"string","description":"The total amount to be charged, including fees."},"currency_code":{"type":"string","description":"The currency code for the payment method represented as an ISO 4217 code.","maxLength":3},"fee":{"type":"string","description":"The fee charged by the payment gateway."},"fee_description":{"type":"string","description":"This field provides the label for any additional transaction fee. In the SDK, this label will be displayed prominently during the checkout process to inform the payer about the nature of the fee. Ensure to incorporate this field in a clear and visible manner within the checkout UI to maintain transparency with the end-users."},"icon":{"type":"string","format":"uri","description":"The svg URL of the icon for the payment method."},"icons":{"allOf":[{"type":"object","properties":{"webp":{"type":"string","format":"uri","description":"The webp URL of the icon for the payment method."},"svg":{"type":"string","format":"uri","description":"The svg URL of the icon for the payment method."}},"required":["svg","webp"]}],"description":"The URLs of the icon for the payment method."},"pg_icons":{"allOf":[{"type":"object","description":"Serializer for PG logo with custom logo URL resolution.","properties":{"svg":{"type":["string","null"],"format":"uri","readOnly":true,"description":"`Optional` field. Upload a logo in SVG format only. If provided and no WebP image is uploaded, a WebP version will be automatically generated. Only .svg files are accepted. Do not upload any other format."},"webp":{"type":"string","readOnly":true,"description":"`Mandatory` field. This must be provided either by uploading a WebP image directly, or it will be auto-generated from the SVG file (if provided). This field does not accept SVG files — only raster images like PNG or JPEG that will be converted to WebP."},"label":{"type":"string","description":"The display name of the logo (translatable in EN and AR).","maxLength":255}},"required":["label","svg","webp"]}],"description":"Represents list of mid icons configured for `pgmid` settings"},"flow":{"type":"string","default":"redirect","description":"The flow type of the payment method."},"redirect_url":{"type":["string","null"],"format":"uri","description":"The URL where the customer should be redirected to perform the payment."}},"required":["amount","code","currency_code","fee","fee_description","icon","icons","name","type"]}],"readOnly":true,"description":"An array containing all the payment methods derived from the `pg_codes` input. Each object in the array contains information about a single payment gateway, including its icon and the `redirect_url` that will redirect the customer to the payment gateway's payment page."},"payment_type":{"enum":["one_off","auto_debit","save_card"],"type":"string","default":"one_off","description":"Type of payment. Choose `one_off` for payments that occur only once without future commitments. Choose `auto_debit` for payments that are automatically deducted, such as recurring subscriptions, installments, or unscheduled auto-debits. \n\nChoose `save_card` if you want to perform a card tokenization operation.\n\nNOTE: If `auto_debit` is selected: \n1. `agreement` and `customer_id` parameters will also be mandatory. \n2. Only PG codes supporting tokenization can be selected. \nAs a side effect, the card used for the payment will be associated with the supplied `agreement.id`. This card will be locked, preventing the customer from deleting it from the system until an alternate card is chosen for auto-debit payments.\n\nNOTE: If `save_card` is selected: \n1. The amount must be zero for the save card operation. \n2. The selected MID(pg_code) must support tokenization to enable the save card operation. \n3. Please note that the save card operation is considered successful without any funds being charged.\n4. Once a card is created, Ottu will send a webhook containing the card details to the merchant's webhook URL.\n5. When the transaction type is `save_card`, all previously saved cards returned in the sdk_preload_payload should be hidden since the user is saving a new card and does not need to select from existing ones.\n\n* `one_off` - One Off\n* `auto_debit` - Auto Debit\n* `save_card` - Save Card"},"product_type":{"type":"string","description":"The type of product or service being purchased. This field may be used for tracking and reporting purposes.","maxLength":128},"qr_code_url":{"type":"string","format":"uri","readOnly":true,"description":"A QR code that, when scanned, redirects to the checkout page for this payment. This QR code may be displayed on invoices, receipts, or other documents to allow customers to easily access the checkout page and make a payment. This parameter is only present when `generate_qr_code` is set to true."},"redirect_url":{"type":"string","format":"uri","description":"The URL where the customer will be redirected after the payment stage only if the webhook URL returns a success status. `order_no`, `reference_number` and `session_id` will be appended to the redirect URL as query parameters.","maxLength":2000},"sdk_setup_preload_payload":{"allOf":[{"type":"object","description":"Serialize data for SDK init.\nThe SDK will use this data to initialize the payment process and\nto display the payment methods.","properties":{"amount":{"type":"string","format":"decimal","description":"Represents the total amount of the payment transaction, which includes the cost of the purchased items or services but excludes any additional fees or charges"},"cards":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"List of saved tokenized cards for customer payments, which can be used for transactions. Render alongside `payment_methods` for customers to choose from.","readOnly":true},"customer_id":{"type":"string","description":"The customer ID is a unique identifier for the customer within the merchant's system. It is also used as a merchant identifier for the customer and plays a critical role in tokenization. All the customer's cards will be associated with this ID.","maxLength":64},"customer_phone":{"type":"string","description":"Customer phone number associated with the payment. This might be sent to the payment gateway and depending on the gateway, it may trigger a click to pay process on the payment page. The phone number will also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":16},"currency_code":{"type":"string","description":"The specified currency represents the denomination of the transaction.Nevertheless, it doesn't necessarily mandate payment in this exact currency.Due to potential currency conversions or exchanges, the final charge may be in a different currency."},"language":{"enum":["en","ar"],"type":"string","default":"en","description":"This field specifies the language to be used for communication with the customer, including the payment page, receipt, invoice, email, SMS, and any other communications related to the payment transaction.\n\n* `en` - English\n* `ar` - Arabic"},"operation":{"type":"string","readOnly":true,"description":"Specifies the type of operation to be performed by the payment gateway. If set to `purchase`, the payment source will be directly charged. If set to `authorize`, the payment source will only be authorized and the actual charge will be made at a later time."},"payment_type":{"enum":["one_off","auto_debit","save_card"],"type":"string","default":"one_off","description":"Type of payment. Choose `one_off` for payments that occur only once without future commitments. Choose `auto_debit` for payments that are automatically deducted, such as recurring subscriptions, installments, or unscheduled auto-debits. \n\nChoose `save_card` if you want to perform a card tokenization operation.\n\nNOTE: If `auto_debit` is selected: \n1. `agreement` and `customer_id` parameters will also be mandatory. \n2. Only PG codes supporting tokenization can be selected. \nAs a side effect, the card used for the payment will be associated with the supplied `agreement.id`. This card will be locked, preventing the customer from deleting it from the system until an alternate card is chosen for auto-debit payments.\n\nNOTE: If `save_card` is selected: \n1. The amount must be zero for the save card operation. \n2. The selected MID(pg_code) must support tokenization to enable the save card operation. \n3. Please note that the save card operation is considered successful without any funds being charged.\n4. Once a card is created, Ottu will send a webhook containing the card details to the merchant's webhook URL.\n5. When the transaction type is `save_card`, all previously saved cards returned in the sdk_preload_payload should be hidden since the user is saving a new card and does not need to select from existing ones.\n\n* `one_off` - One Off\n* `auto_debit` - Auto Debit\n* `save_card` - Save Card"},"payment_methods":{"type":"array","items":{},"description":"The provided documentation describes the `payment_methods` field.\n\n Detailing the types of payment methods included and their functionality \nas well as backward compatibility considerations for removed methods. \n\nThe `payment_methods` field includes various payment options available to customers\nexcluding device-specific methods like `apple_pay`, `google_pay`and `flex_methods` represented in flex methods section\nit primarily supports methods requiring a redirect flow\nwhere users complete transactions on an external webpage.\n\n`Functionality`: users are redirected to an external \nsite mostly to gateway payment page \nusing `redirect_url` where they can complete the payment flow\n\n**The dynamic nature of the payment_methods**:`payment_methods` type is an array of objects \nand it's type allows it to accommodate an unlimited variety of payment options\nas each object represents a gateway payment option but strictly associated to redirect payment flow\n\n**Backward Compatibility Notice:**\n\n`stc_pay`: \nprevious Inclusion, `stc_pay` was formerly listed within the `payment_methods` array\nit has been removed in favor of a more streamlined integration within the SDK\nsimilar to the approach for `payment_services`.\n\n**Backward Compatibility:** \n\nThe SDK must still support STC Pay for applications relying on older API versions.\nAlthough it will not appear in current and future versions\nthe SDK will manage its inclusion internally\n\nto ensure a seamless transition and consistent user experience\nacross different API versions, without disrupting existing integrations.\n","readOnly":true},"payment_services":{"type":"array","items":{},"description":"Dedicated to singular, prominently featured payment options\n\nsuch as `apple_pay`, `google_pay`, `samsung_pay`, `stc_pay`, etc.,\nthe `payment_services` field presents these methods in a distinctive manner.\n\nUnlike `payment_methods`, payment services are intended to be displayed uniquely,\nTypically represented by dedicated buttons or interfaces within the payment page.\n\nThis ensures that each payment service,\nidentifiable by its unique flow ie: (`apple_pay`, `stc_pay`)\nis presented no more than once to the user\nmaintaining clarity and simplicity in the payment selection process.\n\n**Backward Compatibility Notice**:\nhistorically, the availability of (`apple_pay`, `google_pay`) \nwas indicated through the `apple_pay_available` and `google_pay_available` flags\nat the root level of the API response.\n\nWith the evolution of the API, these flags have been deprecated, \nand the respective payment methods have been integrated into the `payment_services` array.\n\nDespite this restructuring, backward compatibility for these payment methods\nis preserved in the SDK to accommodate previous API versions,\nensuring a seamless transition for existing implementations.\n","readOnly":true},"flex_methods":{"type":"array","items":{},"description":"The `flex_methods` field encompasses a comprehensive array\nof payment options available to customers,\nexplicitly excluding device-specific methods such as `apple_pay`\n`google_pay`, redirect flow `payment_methods` and tokenized card solutions\notherwise it represents the flexible payment methods ie:(`tamara`, `tabby`)\npayment options that necessitate dynamic flows\nwhere SDK might need to fetch some `pre-payment-check` API calls then\nusers are guided to an external webpage to finalize their payment transactions.\n\nIt's important to note that the flex_methods array is dynamic\nand can accommodate an unlimited array of payment methods.\neach method listed should be individually rendered within the user interface with a separated flow.\n","readOnly":true},"response":{"type":"object","additionalProperties":{},"description":"**What is a payment gateway response?**\n\nA payment gateway response is the feedback received\nfrom payment gateway after a user has completed a payment\nthis response provides information on whether the payment was successful or if it was canceled or failed.\n\n**When do we receive the response?**\n\nWe receive the payment gateway response immediately after the user has made a payment\nor after n of minutes defined for a gateway inquiry request initiated by ottu core\nto fetch the transaction status after the defined time for each gateway.\n\n**Which attempt do we get the response for?**\n\nthe response we provide is from the most recent payment attempt.\nthis ensures that the information reflects the latest status of the transaction.\n\n**Structure of the response**: \n\nThe response structure is managed by our SDK,\nwhich updates the payment details and triggers one of three callbacks\nbased on the status provided in the response:\n\n`successCallback`: Triggered if the response.status indicates a successful payment.\n\n`cancelCallback`: Triggered if the response.status indicates a canceled payment.\n\n`errorCallback`: Triggered if the response.status indicates a error payment.\n\n","readOnly":true},"state":{"enum":["created","pending","attempted","authorized","paid","failed","canceled","expired","invalided","refunded","cod"],"type":"string","readOnly":true,"description":"The current state of the payment transaction, it helps to understand the progress of the payment.\n\n* `created` - Created\n* `pending` - Pending\n* `attempted` - Attempted\n* `authorized` - Authorized\n* `paid` - Paid\n* `failed` - Failed\n* `canceled` - Canceled\n* `expired` - Expired\n* `invalided` - Invalided\n* `refunded` - Refunded\n* `cod` - Cash on Delivery"},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction. This field represents the purpose of the payment and can be one of several pre-defined choices.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"is_amount_editable":{"type":"boolean","readOnly":true,"title":"Editable amount","description":"This field specifies whether the customer can modify the payment amount and choose the amount he wishes to pay."},"session_id":{"type":"string","readOnly":true,"description":"A unique identifier for each payment transaction, used to maintain the session state during the payment process."},"cancel_url":{"type":"string","format":"uri","readOnly":true,"description":"This endpoint used to cancel the transaction using the merchant cancellation flow, \nto ensure the transaction cannot be paid again \nand trigger the webhook notification \n"}},"required":["amount","cancel_url","cards","currency_code","flex_methods","is_amount_editable","operation","payment_methods","payment_services","response","session_id","state","type"]}],"readOnly":true,"default":false,"description":"A JSON object containing preloaded data required to initialize the checkout interface.This includes essential details such as customer information, available payment methods.and specific transaction details, all formatted according to the Checkout SDK's initialization specifications.This field streamlines the checkout process by providing necessary information upfront.enhancing user experience and efficiency."},"session_id":{"type":"string","readOnly":true,"description":"A unique identifier for each payment transaction, used to maintain the session state during the payment process."},"settled_pg_code":{"type":"string","readOnly":true,"title":"Final Payment Gateway","description":"The code of the payment gateway used for completing the transaction. This field indicates the specific gateway that processed and settled the payment, providing clarity on which payment service was ultimately utilized for this transaction."},"shipping_excl_tax":{"type":"string","format":"decimal","title":"Shipping Excl. Tax","description":"The cost of shipping for the invoice, excluding taxes."},"shipping_incl_tax":{"type":"string","format":"decimal","title":"Shipping Incl. Tax","description":"The cost of shipping for the invoice, including all applicable taxes."},"shipping_method":{"type":"string","description":"The method or service used for shipping the items associated with the invoice."},"shipping_tax_rate":{"type":"string","format":"decimal","description":"The tax rate applied to the shipping cost, expressed as a percentage. "},"shortify_attachment_url":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to True, the URL of the uploaded attachment will be shortened using a URL shortener service. This should be used when sharing the attachment URL via SMS or WhatsApp."},"shortify_checkout_url":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to True, the checkout URL will be shortened using a URL shortener service. This should be used when sharing the payment URL via SMS or WhatsApp."},"state":{"enum":["created","pending","attempted","authorized","paid","failed","canceled","expired","invalided","refunded","cod"],"type":"string","readOnly":true,"description":"The current state of the payment transaction, it helps to understand the progress of the payment.\n\n* `created` - Created\n* `pending` - Pending\n* `attempted` - Attempted\n* `authorized` - Authorized\n* `paid` - Paid\n* `failed` - Failed\n* `canceled` - Canceled\n* `expired` - Expired\n* `invalided` - Invalided\n* `refunded` - Refunded\n* `cod` - Cash on Delivery"},"status":{"enum":["sent","paid","overdue","canceled"],"type":"string","readOnly":true,"description":"Current status of the invoice. Can be one of the following: `sent`, `paid`, `overdue`, `canceled`.\n\n* `sent` - Sent\n* `paid` - Paid\n* `overdue` - Overdue\n* `canceled` - Canceled"},"subtotal":{"type":"string","format":"decimal","description":"Sum of total_incl_tax's of all invoice items."},"tax_amount":{"type":"string","format":"decimal","description":"The total amount of tax applied to the invoice."},"tax_rate":{"type":"string","format":"decimal","title":"Tax","description":"The tax rate applied to the invoice, expressed as a percentage."},"total_excl_tax":{"type":"string","format":"decimal","title":"Total Excl. Tax","description":"The total amount of the invoice, excluding taxes."},"total_incl_tax":{"type":"string","format":"decimal","title":"Total Incl. Tax","description":"The total amount of the invoice, including all applicable taxes."},"unit_code":{"type":"string","writeOnly":true,"title":"Unit","description":"The slug of the unit to be used for the transaction."},"vendor_name":{"type":"string","description":"The name of the vendor or merchant associated with this payment. This field may be used for accounting and reporting purposes.","maxLength":64},"webhook_url":{"type":"string","format":"uri","description":"URL where the payment result will be sent via a POST request after the customer has completed the payment session. The payment result will be included in the request body. ","maxLength":2000}},"required":["attachment_short_url","checkout_short_url","checkout_url","currency_code","due_date","invoice_id","invoice_items","invoice_number","operation","payment_methods","pg_codes","qr_code_url","sdk_setup_preload_payload","session_id","settled_pg_code","state","status","type"]}},"multipart/form-data":{"schema":{"type":"object","description":"Serializer class for `Invoice` instances, inheriting from `BaseInvoiceSerializer` and\n`CheckoutSerializer`. It provides methods for creating invoices, invoice items, and transactions.","properties":{"currency_code":{"type":"string","description":"The specified currency represents the denomination of the transaction.Nevertheless, it doesn't necessarily mandate payment in this exact currency.Due to potential currency conversions or exchanges, the final charge may be in a different currency."},"due_date":{"type":"string","format":"date","description":"The date by which the customer is expected to make payment for the invoice."},"invoice_items":{"type":"array","items":{"type":"object","description":"Serializer to use for `InvoiceItem` instances.\n\nThe unit_price, quantity, description and sku fields are required.\nThe rest are optional.\n\nThe class includes a method to calculate the discount on the invoice and another to calculate the total values.","properties":{"id":{"type":"integer","readOnly":true},"invoice":{"type":["integer","null"],"description":"Associated invoice."},"sku":{"type":"string","description":"Unique identifier for the invoice item.","maxLength":255},"description":{"type":"string","description":"Product name or a brief description of the item.","maxLength":255},"quantity":{"type":"string","format":"decimal","description":"Number of units of the product."},"unit_price":{"type":"string","format":"decimal","description":"Price per unit of the product, excluding tax."},"tax_rate":{"type":"string","format":"decimal","description":"Tax rate applied to the invoice item."},"tax_amount":{"type":"string","format":"decimal","description":"Total tax amount for the invoice item."},"discount_percentage":{"type":"string","format":"decimal","description":"Percentage-based discount applied to the invoice item. The calculated discount cannot exceed theitem's total value, including tax."},"discount_amount":{"type":"string","format":"decimal","description":"Fixed amount discount applied to the invoice item. The discount cannot exceed the item's total value, including tax."},"total_excl_tax":{"type":"string","format":"decimal","description":"Total value of the invoice item, excluding tax. This is calculated as (unit_price * quantity) - discount."},"total_incl_tax":{"type":"string","format":"decimal","description":"Total value of the invoice item, including tax. This is calculated as (unit_price * quantity) - discount + applicable tax."},"currency_code":{"type":"string","description":"For internal purposes: it'll be overridden by the main currency_code"}},"required":["currency_code","description","id","quantity","sku","unit_price"]},"description":"The list of items for the invoice."},"invoice_number":{"type":"string","description":"A unique identifier for the invoice, typically used for tracking and referencing purposes.","maxLength":255},"pg_codes":{"type":"array","items":{"type":"string"},"title":"Gateway","description":"The list of payment gateway codes from which a customer can select to perform the payment"},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction. This field represents the purpose of the payment and can be one of several pre-defined choices.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"billing_address":{"type":"object","description":"Nested serializer to save Address data into PaymentTransaction","properties":{"line1":{"type":"string","maxLength":128},"line2":{"type":"string","maxLength":128},"city":{"type":"string","maxLength":40},"state":{"type":"string","maxLength":40},"country":{"enum":["AF","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","HR","CU","CW","CY","CZ","CI","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RO","RU","RW","RE","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TM","TC","TV","TR","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","AX"],"type":"string","description":"* `AF` - Afghanistan\n* `AL` - Albania\n* `DZ` - Algeria\n* `AS` - American Samoa\n* `AD` - Andorra\n* `AO` - Angola\n* `AI` - Anguilla\n* `AQ` - Antarctica\n* `AG` - Antigua and Barbuda\n* `AR` - Argentina\n* `AM` - Armenia\n* `AW` - Aruba\n* `AU` - Australia\n* `AT` - Austria\n* `AZ` - Azerbaijan\n* `BS` - Bahamas\n* `BH` - Bahrain\n* `BD` - Bangladesh\n* `BB` - Barbados\n* `BY` - Belarus\n* `BE` - Belgium\n* `BZ` - Belize\n* `BJ` - Benin\n* `BM` - Bermuda\n* `BT` - Bhutan\n* `BO` - Bolivia, Plurinational State of\n* `BQ` - Bonaire, Sint Eustatius and Saba\n* `BA` - Bosnia and Herzegovina\n* `BW` - Botswana\n* `BV` - Bouvet Island\n* `BR` - Brazil\n* `IO` - British Indian Ocean Territory\n* `BN` - Brunei Darussalam\n* `BG` - Bulgaria\n* `BF` - Burkina Faso\n* `BI` - Burundi\n* `CV` - Cabo Verde\n* `KH` - Cambodia\n* `CM` - Cameroon\n* `CA` - Canada\n* `KY` - Cayman Islands\n* `CF` - Central African Republic\n* `TD` - Chad\n* `CL` - Chile\n* `CN` - China\n* `CX` - Christmas Island\n* `CC` - Cocos (Keeling) Islands\n* `CO` - Colombia\n* `KM` - Comoros\n* `CG` - Congo\n* `CD` - Congo, The Democratic Republic of the\n* `CK` - Cook Islands\n* `CR` - Costa Rica\n* `HR` - Croatia\n* `CU` - Cuba\n* `CW` - Curaçao\n* `CY` - Cyprus\n* `CZ` - Czechia\n* `CI` - Côte d'Ivoire\n* `DK` - Denmark\n* `DJ` - Djibouti\n* `DM` - Dominica\n* `DO` - Dominican Republic\n* `EC` - Ecuador\n* `EG` - Egypt\n* `SV` - El Salvador\n* `GQ` - Equatorial Guinea\n* `ER` - Eritrea\n* `EE` - Estonia\n* `SZ` - Eswatini\n* `ET` - Ethiopia\n* `FK` - Falkland Islands (Malvinas)\n* `FO` - Faroe Islands\n* `FJ` - Fiji\n* `FI` - Finland\n* `FR` - France\n* `GF` - French Guiana\n* `PF` - French Polynesia\n* `TF` - French Southern Territories\n* `GA` - Gabon\n* `GM` - Gambia\n* `GE` - Georgia\n* `DE` - Germany\n* `GH` - Ghana\n* `GI` - Gibraltar\n* `GR` - Greece\n* `GL` - Greenland\n* `GD` - Grenada\n* `GP` - Guadeloupe\n* `GU` - Guam\n* `GT` - Guatemala\n* `GG` - Guernsey\n* `GN` - Guinea\n* `GW` - Guinea-Bissau\n* `GY` - Guyana\n* `HT` - Haiti\n* `HM` - Heard Island and McDonald Islands\n* `VA` - Holy See (Vatican City State)\n* `HN` - Honduras\n* `HK` - Hong Kong\n* `HU` - Hungary\n* `IS` - Iceland\n* `IN` - India\n* `ID` - Indonesia\n* `IR` - Iran, Islamic Republic of\n* `IQ` - Iraq\n* `IE` - Ireland\n* `IM` - Isle of Man\n* `IL` - Israel\n* `IT` - Italy\n* `JM` - Jamaica\n* `JP` - Japan\n* `JE` - Jersey\n* `JO` - Jordan\n* `KZ` - Kazakhstan\n* `KE` - Kenya\n* `KI` - Kiribati\n* `KP` - Korea, Democratic People's Republic of\n* `KR` - Korea, Republic of\n* `KW` - Kuwait\n* `KG` - Kyrgyzstan\n* `LA` - Lao People's Democratic Republic\n* `LV` - Latvia\n* `LB` - Lebanon\n* `LS` - Lesotho\n* `LR` - Liberia\n* `LY` - Libya\n* `LI` - Liechtenstein\n* `LT` - Lithuania\n* `LU` - Luxembourg\n* `MO` - Macao\n* `MG` - Madagascar\n* `MW` - Malawi\n* `MY` - Malaysia\n* `MV` - Maldives\n* `ML` - Mali\n* `MT` - Malta\n* `MH` - Marshall Islands\n* `MQ` - Martinique\n* `MR` - Mauritania\n* `MU` - Mauritius\n* `YT` - Mayotte\n* `MX` - Mexico\n* `FM` - Micronesia, Federated States of\n* `MD` - Moldova, Republic of\n* `MC` - Monaco\n* `MN` - Mongolia\n* `ME` - Montenegro\n* `MS` - Montserrat\n* `MA` - Morocco\n* `MZ` - Mozambique\n* `MM` - Myanmar\n* `NA` - Namibia\n* `NR` - Nauru\n* `NP` - Nepal\n* `NL` - Netherlands\n* `NC` - New Caledonia\n* `NZ` - New Zealand\n* `NI` - Nicaragua\n* `NE` - Niger\n* `NG` - Nigeria\n* `NU` - Niue\n* `NF` - Norfolk Island\n* `MK` - North Macedonia\n* `MP` - Northern Mariana Islands\n* `NO` - Norway\n* `OM` - Oman\n* `PK` - Pakistan\n* `PW` - Palau\n* `PS` - Palestine, State of\n* `PA` - Panama\n* `PG` - Papua New Guinea\n* `PY` - Paraguay\n* `PE` - Peru\n* `PH` - Philippines\n* `PN` - Pitcairn\n* `PL` - Poland\n* `PT` - Portugal\n* `PR` - Puerto Rico\n* `QA` - Qatar\n* `RO` - Romania\n* `RU` - Russian Federation\n* `RW` - Rwanda\n* `RE` - Réunion\n* `BL` - Saint Barthélemy\n* `SH` - Saint Helena, Ascension and Tristan da Cunha\n* `KN` - Saint Kitts and Nevis\n* `LC` - Saint Lucia\n* `MF` - Saint Martin (French part)\n* `PM` - Saint Pierre and Miquelon\n* `VC` - Saint Vincent and the Grenadines\n* `WS` - Samoa\n* `SM` - San Marino\n* `ST` - Sao Tome and Principe\n* `SA` - Saudi Arabia\n* `SN` - Senegal\n* `RS` - Serbia\n* `SC` - Seychelles\n* `SL` - Sierra Leone\n* `SG` - Singapore\n* `SX` - Sint Maarten (Dutch part)\n* `SK` - Slovakia\n* `SI` - Slovenia\n* `SB` - Solomon Islands\n* `SO` - Somalia\n* `ZA` - South Africa\n* `GS` - South Georgia and the South Sandwich Islands\n* `SS` - South Sudan\n* `ES` - Spain\n* `LK` - Sri Lanka\n* `SD` - Sudan\n* `SR` - Suriname\n* `SJ` - Svalbard and Jan Mayen\n* `SE` - Sweden\n* `CH` - Switzerland\n* `SY` - Syrian Arab Republic\n* `TW` - Taiwan, Province of China\n* `TJ` - Tajikistan\n* `TZ` - Tanzania, United Republic of\n* `TH` - Thailand\n* `TL` - Timor-Leste\n* `TG` - Togo\n* `TK` - Tokelau\n* `TO` - Tonga\n* `TT` - Trinidad and Tobago\n* `TN` - Tunisia\n* `TM` - Turkmenistan\n* `TC` - Turks and Caicos Islands\n* `TV` - Tuvalu\n* `TR` - Türkiye\n* `UG` - Uganda\n* `UA` - Ukraine\n* `AE` - United Arab Emirates\n* `GB` - United Kingdom\n* `US` - United States\n* `UM` - United States Minor Outlying Islands\n* `UY` - Uruguay\n* `UZ` - Uzbekistan\n* `VU` - Vanuatu\n* `VE` - Venezuela, Bolivarian Republic of\n* `VN` - Viet Nam\n* `VG` - Virgin Islands, British\n* `VI` - Virgin Islands, U.S.\n* `WF` - Wallis and Futuna\n* `EH` - Western Sahara\n* `YE` - Yemen\n* `ZM` - Zambia\n* `ZW` - Zimbabwe\n* `AX` - Åland Islands"},"postal_code":{"type":"string","maxLength":12}},"required":["city","country","line1"]},"shipping_address":{"type":"object","description":"Nested serializer to save Address data into PaymentTransaction","properties":{"line1":{"type":"string","maxLength":128},"line2":{"type":"string","maxLength":128},"city":{"type":"string","maxLength":40},"state":{"type":"string","maxLength":40},"country":{"enum":["AF","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","HR","CU","CW","CY","CZ","CI","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RO","RU","RW","RE","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TM","TC","TV","TR","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","AX"],"type":"string","description":"* `AF` - Afghanistan\n* `AL` - Albania\n* `DZ` - Algeria\n* `AS` - American Samoa\n* `AD` - Andorra\n* `AO` - Angola\n* `AI` - Anguilla\n* `AQ` - Antarctica\n* `AG` - Antigua and Barbuda\n* `AR` - Argentina\n* `AM` - Armenia\n* `AW` - Aruba\n* `AU` - Australia\n* `AT` - Austria\n* `AZ` - Azerbaijan\n* `BS` - Bahamas\n* `BH` - Bahrain\n* `BD` - Bangladesh\n* `BB` - Barbados\n* `BY` - Belarus\n* `BE` - Belgium\n* `BZ` - Belize\n* `BJ` - Benin\n* `BM` - Bermuda\n* `BT` - Bhutan\n* `BO` - Bolivia, Plurinational State of\n* `BQ` - Bonaire, Sint Eustatius and Saba\n* `BA` - Bosnia and Herzegovina\n* `BW` - Botswana\n* `BV` - Bouvet Island\n* `BR` - Brazil\n* `IO` - British Indian Ocean Territory\n* `BN` - Brunei Darussalam\n* `BG` - Bulgaria\n* `BF` - Burkina Faso\n* `BI` - Burundi\n* `CV` - Cabo Verde\n* `KH` - Cambodia\n* `CM` - Cameroon\n* `CA` - Canada\n* `KY` - Cayman Islands\n* `CF` - Central African Republic\n* `TD` - Chad\n* `CL` - Chile\n* `CN` - China\n* `CX` - Christmas Island\n* `CC` - Cocos (Keeling) Islands\n* `CO` - Colombia\n* `KM` - Comoros\n* `CG` - Congo\n* `CD` - Congo, The Democratic Republic of the\n* `CK` - Cook Islands\n* `CR` - Costa Rica\n* `HR` - Croatia\n* `CU` - Cuba\n* `CW` - Curaçao\n* `CY` - Cyprus\n* `CZ` - Czechia\n* `CI` - Côte d'Ivoire\n* `DK` - Denmark\n* `DJ` - Djibouti\n* `DM` - Dominica\n* `DO` - Dominican Republic\n* `EC` - Ecuador\n* `EG` - Egypt\n* `SV` - El Salvador\n* `GQ` - Equatorial Guinea\n* `ER` - Eritrea\n* `EE` - Estonia\n* `SZ` - Eswatini\n* `ET` - Ethiopia\n* `FK` - Falkland Islands (Malvinas)\n* `FO` - Faroe Islands\n* `FJ` - Fiji\n* `FI` - Finland\n* `FR` - France\n* `GF` - French Guiana\n* `PF` - French Polynesia\n* `TF` - French Southern Territories\n* `GA` - Gabon\n* `GM` - Gambia\n* `GE` - Georgia\n* `DE` - Germany\n* `GH` - Ghana\n* `GI` - Gibraltar\n* `GR` - Greece\n* `GL` - Greenland\n* `GD` - Grenada\n* `GP` - Guadeloupe\n* `GU` - Guam\n* `GT` - Guatemala\n* `GG` - Guernsey\n* `GN` - Guinea\n* `GW` - Guinea-Bissau\n* `GY` - Guyana\n* `HT` - Haiti\n* `HM` - Heard Island and McDonald Islands\n* `VA` - Holy See (Vatican City State)\n* `HN` - Honduras\n* `HK` - Hong Kong\n* `HU` - Hungary\n* `IS` - Iceland\n* `IN` - India\n* `ID` - Indonesia\n* `IR` - Iran, Islamic Republic of\n* `IQ` - Iraq\n* `IE` - Ireland\n* `IM` - Isle of Man\n* `IL` - Israel\n* `IT` - Italy\n* `JM` - Jamaica\n* `JP` - Japan\n* `JE` - Jersey\n* `JO` - Jordan\n* `KZ` - Kazakhstan\n* `KE` - Kenya\n* `KI` - Kiribati\n* `KP` - Korea, Democratic People's Republic of\n* `KR` - Korea, Republic of\n* `KW` - Kuwait\n* `KG` - Kyrgyzstan\n* `LA` - Lao People's Democratic Republic\n* `LV` - Latvia\n* `LB` - Lebanon\n* `LS` - Lesotho\n* `LR` - Liberia\n* `LY` - Libya\n* `LI` - Liechtenstein\n* `LT` - Lithuania\n* `LU` - Luxembourg\n* `MO` - Macao\n* `MG` - Madagascar\n* `MW` - Malawi\n* `MY` - Malaysia\n* `MV` - Maldives\n* `ML` - Mali\n* `MT` - Malta\n* `MH` - Marshall Islands\n* `MQ` - Martinique\n* `MR` - Mauritania\n* `MU` - Mauritius\n* `YT` - Mayotte\n* `MX` - Mexico\n* `FM` - Micronesia, Federated States of\n* `MD` - Moldova, Republic of\n* `MC` - Monaco\n* `MN` - Mongolia\n* `ME` - Montenegro\n* `MS` - Montserrat\n* `MA` - Morocco\n* `MZ` - Mozambique\n* `MM` - Myanmar\n* `NA` - Namibia\n* `NR` - Nauru\n* `NP` - Nepal\n* `NL` - Netherlands\n* `NC` - New Caledonia\n* `NZ` - New Zealand\n* `NI` - Nicaragua\n* `NE` - Niger\n* `NG` - Nigeria\n* `NU` - Niue\n* `NF` - Norfolk Island\n* `MK` - North Macedonia\n* `MP` - Northern Mariana Islands\n* `NO` - Norway\n* `OM` - Oman\n* `PK` - Pakistan\n* `PW` - Palau\n* `PS` - Palestine, State of\n* `PA` - Panama\n* `PG` - Papua New Guinea\n* `PY` - Paraguay\n* `PE` - Peru\n* `PH` - Philippines\n* `PN` - Pitcairn\n* `PL` - Poland\n* `PT` - Portugal\n* `PR` - Puerto Rico\n* `QA` - Qatar\n* `RO` - Romania\n* `RU` - Russian Federation\n* `RW` - Rwanda\n* `RE` - Réunion\n* `BL` - Saint Barthélemy\n* `SH` - Saint Helena, Ascension and Tristan da Cunha\n* `KN` - Saint Kitts and Nevis\n* `LC` - Saint Lucia\n* `MF` - Saint Martin (French part)\n* `PM` - Saint Pierre and Miquelon\n* `VC` - Saint Vincent and the Grenadines\n* `WS` - Samoa\n* `SM` - San Marino\n* `ST` - Sao Tome and Principe\n* `SA` - Saudi Arabia\n* `SN` - Senegal\n* `RS` - Serbia\n* `SC` - Seychelles\n* `SL` - Sierra Leone\n* `SG` - Singapore\n* `SX` - Sint Maarten (Dutch part)\n* `SK` - Slovakia\n* `SI` - Slovenia\n* `SB` - Solomon Islands\n* `SO` - Somalia\n* `ZA` - South Africa\n* `GS` - South Georgia and the South Sandwich Islands\n* `SS` - South Sudan\n* `ES` - Spain\n* `LK` - Sri Lanka\n* `SD` - Sudan\n* `SR` - Suriname\n* `SJ` - Svalbard and Jan Mayen\n* `SE` - Sweden\n* `CH` - Switzerland\n* `SY` - Syrian Arab Republic\n* `TW` - Taiwan, Province of China\n* `TJ` - Tajikistan\n* `TZ` - Tanzania, United Republic of\n* `TH` - Thailand\n* `TL` - Timor-Leste\n* `TG` - Togo\n* `TK` - Tokelau\n* `TO` - Tonga\n* `TT` - Trinidad and Tobago\n* `TN` - Tunisia\n* `TM` - Turkmenistan\n* `TC` - Turks and Caicos Islands\n* `TV` - Tuvalu\n* `TR` - Türkiye\n* `UG` - Uganda\n* `UA` - Ukraine\n* `AE` - United Arab Emirates\n* `GB` - United Kingdom\n* `US` - United States\n* `UM` - United States Minor Outlying Islands\n* `UY` - Uruguay\n* `UZ` - Uzbekistan\n* `VU` - Vanuatu\n* `VE` - Venezuela, Bolivarian Republic of\n* `VN` - Viet Nam\n* `VG` - Virgin Islands, British\n* `VI` - Virgin Islands, U.S.\n* `WF` - Wallis and Futuna\n* `EH` - Western Sahara\n* `YE` - Yemen\n* `ZM` - Zambia\n* `ZW` - Zimbabwe\n* `AX` - Åland Islands"},"postal_code":{"type":"string","maxLength":12},"first_name":{"type":"string","maxLength":64},"last_name":{"type":"string","maxLength":64},"email":{"type":"string","format":"email","maxLength":128},"phone":{"type":"string","maxLength":16}},"required":["city","country","email","first_name","last_name","line1","phone"]},"agreement":{"allOf":[{"type":"object","description":"Serializer to hold the recurring data information.\nThis is required for being able to create recurring payments and the PGs\nrequire this information.","properties":{"id":{"type":"string","description":"A unique identifier for the agreement established with the payer. This ID links to the specific terms and conditions the payer has authorized for processing their stored card details. Use cases include: \n1. Recurring Payments: Periodic debits, e.g., gym memberships. \n2. Installment Payments: Multiple charges for a single purchase over time. \n3. Unscheduled: Future payments as required, e.g., account top-ups. \n4. Industry Practice: Standard business practices related to an original payment, e.g., hotel charges after checkout.","maxLength":128},"amount_variability":{"enum":["fixed","variable"],"type":"string","description":"Indicates if all payments within the agreement use the same amount or if the amount differs between the payments.\n\n* `fixed` - Fixed\n* `variable` - Variable"},"start_date":{"type":"string","format":"date","description":"Date on which the agreement with the payer to process payments starts."},"expiry_date":{"type":"string","format":"date","description":"Date on which your agreement with the payer to process payments expires."},"max_amount_per_cycle":{"type":"string","format":"decimal","description":"The maximum amount for a single payment in the series as agreed with the payer."},"cycle_interval_days":{"type":"integer","maximum":366,"minimum":1,"description":"The minimum number of days between payments agreed with the payer."},"total_cycles":{"type":"integer","maximum":999,"minimum":1,"description":"The number of merchant-initiated payments within the recurring payment agreement."},"frequency":{"enum":["irregular","daily","weekly","semi_monthly","monthly","quarterly","semi_annually","yearly","other"],"type":"string","description":"The frequency of the payments within the series as agreed with the payer.\n\n* `irregular` - Irregular\n* `daily` - Daily\n* `weekly` - Weekly\n* `semi_monthly` - Semi Monthly\n* `monthly` - Monthly\n* `quarterly` - Quarterly\n* `semi_annually` - Semi Annually\n* `yearly` - Yearly\n* `other` - Other"},"type":{"enum":["event_based","installment","recurring","unscheduled","other"],"type":"string","default":"recurring","description":"The type of commercial agreement that the payer has with the merchant.\n\n *Note*: For `unscheduled` agreements, the allowed values should be configured as follows: \n\n `id` - Accepts any value. \n\n `frequency`. \n\n `type`.\n\n This configuration ensures that only specific values are permitted for each field when the `type` is `Unscheduled`.\n\n *Note*: For `recurring` agreements, the following fields are mandatory as follows: \n\n `amount_variability` \n\n `cycle_interval_days` \n\n `expiry_date` \n\n ` `requency` \n\n `id` \n\n  `total_cycles` \n\n This configuration ensures that the required values are mandatory for each field when the `type` is `Recurring`.\n\n* `event_based` - Event Based\n* `installment` - Installment\n* `recurring` - Recurring\n* `unscheduled` - Unscheduled\n* `other` - Other"},"seller":{"allOf":[{"type":"object","properties":{"name":{"type":"string","description":"The retailer's trading name.","maxLength":128},"short_name":{"type":"string","description":"Abbreviation of the retailer's trading name, suitable for payer's statement display.","maxLength":64},"category_code":{"type":"string","description":"A 4-digit code classifying the retailer's business by the type of goods or services it offers.","maxLength":64}}}],"description":"Details about the retailer, if the agreement is for installment payments."},"extra_params":{"allOf":[{"type":"object","properties":{"payment_processing_day":{"type":"integer","maximum":31,"minimum":1,"description":"Day of the month on which the payment must be processed. Not required for unscheduled payment agreements."}}}],"description":"Additional parameters related to the agreement."}}}],"description":"An established contractual arrangement with the payer, which authorizes you to securely store and subsequently utilize their payment information for specific purposes. This could encompass arrangements like recurring payments for services such as mobile subscriptions, installment-based payments for purchases, arrangements for ad-hoc charges like account top-ups, or for standard industry practices like penalty charges for missed appointments. \n\nNote: If your intention is solely to store payment details for transactions initiated by the payer in the future, then this parameter group should not be used."},"amount":{"type":"string","format":"decimal","description":"Represents the total amount of the payment transaction, which includes the cost of the purchased items or services but excludes any additional fees or charges"},"attachment":{"type":"string","format":"uri","description":"A writable field that accepts an attachment file to be included in email notifications sent to the customer regarding their payment, and also be available for download on the checkout page. This field may be used to provide the customer with additional information or documentation related to their purchase. The value of this field should be a file object. Upon successful submission, the API will return the URL for downloading the attached file. "},"attachment_short_url":{"type":"string","format":"uri","readOnly":true,"description":"A short URL that links to the attachment associated with this payment. This URL may be included in email/sms notifications sent to the customer regarding their payment or displayed on the checkout page to allow the customer to easily access the attachment."},"attachment_upload_url":{"type":"string","description":"A writable field that accepts an attachment that has already been uploaded to the server.","pattern":"(?:pdf|jpeg|png|doc|docx|jpg|xls|xlsx|txt)$"},"card_acceptance_criteria":{"allOf":[{"type":"object","properties":{"min_expiry_time":{"type":"integer","maximum":365,"minimum":1,"description":"Specifies the minimum required validity period, in days, for a card to be eligible for payment. If set to 30 days, for example, cards set to expire within the next month would be declined. This ensures short-lived cards nearing their expiration date are filtered out, reducing chances of payment failures. When implementing, balance your operational needs with customer convenience. Setting it too stringent might increase payment declines, while a lenient approach could risk future payment failures.\n\nAdditionally, it defaults to 30 days when the `payment_type` is `auto_debit`. If any other payment type is selected, no default value is set."}}}],"description":"This field allows you to define specific rules and conditions that a card must meet to be eligible for payment. These stipulations apply regardless of whether a customer chooses to pay using a saved card or opts to add a new card for the transaction. By leveraging the `card_acceptance_criteria`, you gain the power to fine-tune your payment processing strategy, tailoring acceptance rules to align with your business needs, security standards, and risk management policies.\n\n**Example**: If you run an exclusive service that caters predominantly to premium customers, you might set criteria that only allow transactions from high-tier credit cards like VISA Platinum. This ensures that payments align with the exclusivity and branding of your services. Remember to configure these criteria thoughtfully. Striking the right balance between security, risk mitigation, and user experience is paramount.\n\n**Note**: The `card_acceptance_criteria` field is applicable only for direct payments and not for hosted session payments."},"checkout_short_url":{"type":"string","format":"uri","readOnly":true,"description":"A short URL link that, when opened, redirects to the checkout page for this payment. This URL may be shared with the customer to allow them to easily access and complete the payment. This field is only available if the `shortify_checkout_url` field is set to True."},"checkout_url":{"type":"string","format":"uri","readOnly":true,"description":"URL that directs the customer to the Ottu Checkout Page where they can see the payment details and available payment methods for the transaction. If you need to share the payment link over SMS or WhatsApp, use `checkout_short_url` instead."},"company_name":{"type":"string","description":"The company name is used for invoice API.","maxLength":64},"customer_birthdate":{"type":"string","format":"date","title":"Customer Date of Birth","description":"Customer's date of birth in YYYY-MM-DD format.This field can be used for age verification or compliance purposes during payment processing."},"customer_email":{"type":"string","format":"email","description":"The email address of the customer that is used to send payment notifications and receipts, and can be used for fraud prevention. This field is mandatory and is always sent to the payment gateway. It may also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":128},"customer_first_name":{"type":"string","description":"The first name of the recipient of the payment. This field is used for various communications such as the invoice, receipt, email, SMS, or displayed on the payment page. It may also be sent to the payment gateway if necessary.","maxLength":64},"customer_id":{"type":"string","description":"The customer ID is a unique identifier for the customer within the merchant's system. It is also used as a merchant identifier for the customer and plays a critical role in tokenization. All the customer's cards will be associated with this ID.","maxLength":64},"customer_last_name":{"type":"string","description":"The last name of the recipient of the payment. This field is used for various communications such as the invoice, receipt, email, SMS, or displayed on the payment page. It may also be sent to the payment gateway if necessary.","maxLength":64},"customer_phone":{"type":"string","description":"Customer phone number associated with the payment. This might be sent to the payment gateway and depending on the gateway, it may trigger a click to pay process on the payment page. The phone number will also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":16},"customer_phone_2":{"type":"string","title":"Customer additional phone","description":"The customer's additional phone number, if any. This field can be updated by the customer on the payment page or in the Checkout SDK.","maxLength":16},"discount_amount":{"type":"string","format":"decimal","description":"The fixed amount discount applied to the full invoice amount, including taxes. If set, the discount_percentage field will be set to null. Both discount_amount and discount_percentage cannot be set simultaneously. The discount cannot be higher than the `total_excl_tax` field."},"discount_percentage":{"type":"string","format":"decimal","description":"The percentage-based discount applied to the full invoice amount, including taxes. If set, the discount_amount field will be automatically calculated. Both discount_amount and discount_percentage cannot be set simultaneously. The discount cannot be higher than the `total_excl_tax` field."},"due_datetime":{"type":"string","format":"date-time","title":"Due date and time","description":"The date and time by which the payment is due. This field may be used to help remind the customer to complete the payment before the due date."},"email_recipients":{"type":"array","items":{"type":"string","format":"email"},"description":"A comma-separated list of email addresses for internal recipients who will receive customer emails. These recipients will be included in email notifications sent to the customer regarding their payment."},"expiration_time":{"type":"string","description":"If defined, any payment transactions created more than the specified period of time ago will be invalidated or expired if the customer attempts to complete them. By default, this expiration period is set to 24 hours from the time of transaction creation. This feature helps ensure that payment transactions are processed promptly."},"extra":{"allOf":[{"type":"object","description":"Serializer for extra data aka dynamic fields.\nExtra data can accept any value by default. However,\nif the merchant wants to enforce a specific type, they can\nuse the plugins.Field class to do so. All CUSTOM fields are\nvalidated inside extra field.\n\nImplementation:\n    - requires to have a config property in the parent\n    serializer which has to return a PluginConfig instance,\n    to which fields are attached.","properties":{"payment_category_name":{"type":"string"},"payment_category_amount":{"type":"string"},"month":{"enum":["january","february"],"type":"string","description":"* `january` - January\n* `february` - February"},"full_name":{"type":"string"},"booking_reference":{"type":"string"}},"required":["month"]}],"description":"The extra information for the payment details, which the merchant has sent it in key value form."},"generate_qr_code":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to true, the `qr_code_url` field will be present in the response. Upon scanning it, the customer will be redirected to the checkout_url, which is the Ottu Checkout page."},"include_sdk_setup_preload":{"type":"boolean","writeOnly":true,"default":false,"description":"Set this to true to include the 'sdk_setup_preload_payload' payload in the API response. This payload is only generated and added when this parameter is explicitly set to true. By default, it is false and the 'sdk_setup_preload_payload' payload will not be included."},"initiator_id":{"type":"integer","title":"initiator","description":"The user who initiated the creation of this payment transaction, if available. This field is optional and may be used to track who created the payment transaction. Note that if the payment transaction was using API Key auth initiator_id can be set to any value that corresponds to an existing ACTIVE user in the system"},"invoice_id":{"type":"integer","readOnly":true},"language":{"enum":["en","ar"],"type":"string","default":"en","description":"This field specifies the language to be used for communication with the customer, including the payment page, receipt, invoice, email, SMS, and any other communications related to the payment transaction.\n\n* `en` - English\n* `ar` - Arabic"},"notifications":{"allOf":[{"type":"object","properties":{"email":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized","voided","refunded","captured"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized\n* `voided` - Voided\n* `refunded` - Refunded\n* `captured` - Captured"}},"sms":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized","voided","refunded","captured"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized\n* `voided` - Voided\n* `refunded` - Refunded\n* `captured` - Captured"}},"whatsapp":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized"}}}}],"title":"Notification settings","description":"A JSON field that contains the notification settings for this payment transaction, including SMS and email notifications, as well as the events for which they will be sent (e.g., 'created', 'paid', 'refund', 'canceled', etc.). This field may be used to configure and customize the notifications sent to customers and internal recipients throughout the payment process."},"operation":{"type":"string","readOnly":true,"description":"Specifies the type of operation to be performed by the payment gateway. If set to `purchase`, the payment source will be directly charged. If set to `authorize`, the payment source will only be authorized and the actual charge will be made at a later time."},"order_no":{"type":"string","description":"The unique identifier assigned to this payment transaction. It is used for tracking purposes and is set by the merchant or the system.","maxLength":128},"payment_methods":{"allOf":[{"type":"object","properties":{"code":{"type":"string","description":"The slug code of the payment method.","pattern":"^[-a-zA-Z0-9_]+$"},"name":{"type":"string","description":"The name of the payment method."},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"amount":{"type":"string","description":"The total amount to be charged, including fees."},"currency_code":{"type":"string","description":"The currency code for the payment method represented as an ISO 4217 code.","maxLength":3},"fee":{"type":"string","description":"The fee charged by the payment gateway."},"fee_description":{"type":"string","description":"This field provides the label for any additional transaction fee. In the SDK, this label will be displayed prominently during the checkout process to inform the payer about the nature of the fee. Ensure to incorporate this field in a clear and visible manner within the checkout UI to maintain transparency with the end-users."},"icon":{"type":"string","format":"uri","description":"The svg URL of the icon for the payment method."},"icons":{"allOf":[{"type":"object","properties":{"webp":{"type":"string","format":"uri","description":"The webp URL of the icon for the payment method."},"svg":{"type":"string","format":"uri","description":"The svg URL of the icon for the payment method."}},"required":["svg","webp"]}],"description":"The URLs of the icon for the payment method."},"pg_icons":{"allOf":[{"type":"object","description":"Serializer for PG logo with custom logo URL resolution.","properties":{"svg":{"type":["string","null"],"format":"uri","readOnly":true,"description":"`Optional` field. Upload a logo in SVG format only. If provided and no WebP image is uploaded, a WebP version will be automatically generated. Only .svg files are accepted. Do not upload any other format."},"webp":{"type":"string","readOnly":true,"description":"`Mandatory` field. This must be provided either by uploading a WebP image directly, or it will be auto-generated from the SVG file (if provided). This field does not accept SVG files — only raster images like PNG or JPEG that will be converted to WebP."},"label":{"type":"string","description":"The display name of the logo (translatable in EN and AR).","maxLength":255}},"required":["label","svg","webp"]}],"description":"Represents list of mid icons configured for `pgmid` settings"},"flow":{"type":"string","default":"redirect","description":"The flow type of the payment method."},"redirect_url":{"type":["string","null"],"format":"uri","description":"The URL where the customer should be redirected to perform the payment."}},"required":["amount","code","currency_code","fee","fee_description","icon","icons","name","type"]}],"readOnly":true,"description":"An array containing all the payment methods derived from the `pg_codes` input. Each object in the array contains information about a single payment gateway, including its icon and the `redirect_url` that will redirect the customer to the payment gateway's payment page."},"payment_type":{"enum":["one_off","auto_debit","save_card"],"type":"string","default":"one_off","description":"Type of payment. Choose `one_off` for payments that occur only once without future commitments. Choose `auto_debit` for payments that are automatically deducted, such as recurring subscriptions, installments, or unscheduled auto-debits. \n\nChoose `save_card` if you want to perform a card tokenization operation.\n\nNOTE: If `auto_debit` is selected: \n1. `agreement` and `customer_id` parameters will also be mandatory. \n2. Only PG codes supporting tokenization can be selected. \nAs a side effect, the card used for the payment will be associated with the supplied `agreement.id`. This card will be locked, preventing the customer from deleting it from the system until an alternate card is chosen for auto-debit payments.\n\nNOTE: If `save_card` is selected: \n1. The amount must be zero for the save card operation. \n2. The selected MID(pg_code) must support tokenization to enable the save card operation. \n3. Please note that the save card operation is considered successful without any funds being charged.\n4. Once a card is created, Ottu will send a webhook containing the card details to the merchant's webhook URL.\n5. When the transaction type is `save_card`, all previously saved cards returned in the sdk_preload_payload should be hidden since the user is saving a new card and does not need to select from existing ones.\n\n* `one_off` - One Off\n* `auto_debit` - Auto Debit\n* `save_card` - Save Card"},"product_type":{"type":"string","description":"The type of product or service being purchased. This field may be used for tracking and reporting purposes.","maxLength":128},"qr_code_url":{"type":"string","format":"uri","readOnly":true,"description":"A QR code that, when scanned, redirects to the checkout page for this payment. This QR code may be displayed on invoices, receipts, or other documents to allow customers to easily access the checkout page and make a payment. This parameter is only present when `generate_qr_code` is set to true."},"redirect_url":{"type":"string","format":"uri","description":"The URL where the customer will be redirected after the payment stage only if the webhook URL returns a success status. `order_no`, `reference_number` and `session_id` will be appended to the redirect URL as query parameters.","maxLength":2000},"sdk_setup_preload_payload":{"allOf":[{"type":"object","description":"Serialize data for SDK init.\nThe SDK will use this data to initialize the payment process and\nto display the payment methods.","properties":{"amount":{"type":"string","format":"decimal","description":"Represents the total amount of the payment transaction, which includes the cost of the purchased items or services but excludes any additional fees or charges"},"cards":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"List of saved tokenized cards for customer payments, which can be used for transactions. Render alongside `payment_methods` for customers to choose from.","readOnly":true},"customer_id":{"type":"string","description":"The customer ID is a unique identifier for the customer within the merchant's system. It is also used as a merchant identifier for the customer and plays a critical role in tokenization. All the customer's cards will be associated with this ID.","maxLength":64},"customer_phone":{"type":"string","description":"Customer phone number associated with the payment. This might be sent to the payment gateway and depending on the gateway, it may trigger a click to pay process on the payment page. The phone number will also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":16},"currency_code":{"type":"string","description":"The specified currency represents the denomination of the transaction.Nevertheless, it doesn't necessarily mandate payment in this exact currency.Due to potential currency conversions or exchanges, the final charge may be in a different currency."},"language":{"enum":["en","ar"],"type":"string","default":"en","description":"This field specifies the language to be used for communication with the customer, including the payment page, receipt, invoice, email, SMS, and any other communications related to the payment transaction.\n\n* `en` - English\n* `ar` - Arabic"},"operation":{"type":"string","readOnly":true,"description":"Specifies the type of operation to be performed by the payment gateway. If set to `purchase`, the payment source will be directly charged. If set to `authorize`, the payment source will only be authorized and the actual charge will be made at a later time."},"payment_type":{"enum":["one_off","auto_debit","save_card"],"type":"string","default":"one_off","description":"Type of payment. Choose `one_off` for payments that occur only once without future commitments. Choose `auto_debit` for payments that are automatically deducted, such as recurring subscriptions, installments, or unscheduled auto-debits. \n\nChoose `save_card` if you want to perform a card tokenization operation.\n\nNOTE: If `auto_debit` is selected: \n1. `agreement` and `customer_id` parameters will also be mandatory. \n2. Only PG codes supporting tokenization can be selected. \nAs a side effect, the card used for the payment will be associated with the supplied `agreement.id`. This card will be locked, preventing the customer from deleting it from the system until an alternate card is chosen for auto-debit payments.\n\nNOTE: If `save_card` is selected: \n1. The amount must be zero for the save card operation. \n2. The selected MID(pg_code) must support tokenization to enable the save card operation. \n3. Please note that the save card operation is considered successful without any funds being charged.\n4. Once a card is created, Ottu will send a webhook containing the card details to the merchant's webhook URL.\n5. When the transaction type is `save_card`, all previously saved cards returned in the sdk_preload_payload should be hidden since the user is saving a new card and does not need to select from existing ones.\n\n* `one_off` - One Off\n* `auto_debit` - Auto Debit\n* `save_card` - Save Card"},"payment_methods":{"type":"array","items":{},"description":"The provided documentation describes the `payment_methods` field.\n\n Detailing the types of payment methods included and their functionality \nas well as backward compatibility considerations for removed methods. \n\nThe `payment_methods` field includes various payment options available to customers\nexcluding device-specific methods like `apple_pay`, `google_pay`and `flex_methods` represented in flex methods section\nit primarily supports methods requiring a redirect flow\nwhere users complete transactions on an external webpage.\n\n`Functionality`: users are redirected to an external \nsite mostly to gateway payment page \nusing `redirect_url` where they can complete the payment flow\n\n**The dynamic nature of the payment_methods**:`payment_methods` type is an array of objects \nand it's type allows it to accommodate an unlimited variety of payment options\nas each object represents a gateway payment option but strictly associated to redirect payment flow\n\n**Backward Compatibility Notice:**\n\n`stc_pay`: \nprevious Inclusion, `stc_pay` was formerly listed within the `payment_methods` array\nit has been removed in favor of a more streamlined integration within the SDK\nsimilar to the approach for `payment_services`.\n\n**Backward Compatibility:** \n\nThe SDK must still support STC Pay for applications relying on older API versions.\nAlthough it will not appear in current and future versions\nthe SDK will manage its inclusion internally\n\nto ensure a seamless transition and consistent user experience\nacross different API versions, without disrupting existing integrations.\n","readOnly":true},"payment_services":{"type":"array","items":{},"description":"Dedicated to singular, prominently featured payment options\n\nsuch as `apple_pay`, `google_pay`, `samsung_pay`, `stc_pay`, etc.,\nthe `payment_services` field presents these methods in a distinctive manner.\n\nUnlike `payment_methods`, payment services are intended to be displayed uniquely,\nTypically represented by dedicated buttons or interfaces within the payment page.\n\nThis ensures that each payment service,\nidentifiable by its unique flow ie: (`apple_pay`, `stc_pay`)\nis presented no more than once to the user\nmaintaining clarity and simplicity in the payment selection process.\n\n**Backward Compatibility Notice**:\nhistorically, the availability of (`apple_pay`, `google_pay`) \nwas indicated through the `apple_pay_available` and `google_pay_available` flags\nat the root level of the API response.\n\nWith the evolution of the API, these flags have been deprecated, \nand the respective payment methods have been integrated into the `payment_services` array.\n\nDespite this restructuring, backward compatibility for these payment methods\nis preserved in the SDK to accommodate previous API versions,\nensuring a seamless transition for existing implementations.\n","readOnly":true},"flex_methods":{"type":"array","items":{},"description":"The `flex_methods` field encompasses a comprehensive array\nof payment options available to customers,\nexplicitly excluding device-specific methods such as `apple_pay`\n`google_pay`, redirect flow `payment_methods` and tokenized card solutions\notherwise it represents the flexible payment methods ie:(`tamara`, `tabby`)\npayment options that necessitate dynamic flows\nwhere SDK might need to fetch some `pre-payment-check` API calls then\nusers are guided to an external webpage to finalize their payment transactions.\n\nIt's important to note that the flex_methods array is dynamic\nand can accommodate an unlimited array of payment methods.\neach method listed should be individually rendered within the user interface with a separated flow.\n","readOnly":true},"response":{"type":"object","additionalProperties":{},"description":"**What is a payment gateway response?**\n\nA payment gateway response is the feedback received\nfrom payment gateway after a user has completed a payment\nthis response provides information on whether the payment was successful or if it was canceled or failed.\n\n**When do we receive the response?**\n\nWe receive the payment gateway response immediately after the user has made a payment\nor after n of minutes defined for a gateway inquiry request initiated by ottu core\nto fetch the transaction status after the defined time for each gateway.\n\n**Which attempt do we get the response for?**\n\nthe response we provide is from the most recent payment attempt.\nthis ensures that the information reflects the latest status of the transaction.\n\n**Structure of the response**: \n\nThe response structure is managed by our SDK,\nwhich updates the payment details and triggers one of three callbacks\nbased on the status provided in the response:\n\n`successCallback`: Triggered if the response.status indicates a successful payment.\n\n`cancelCallback`: Triggered if the response.status indicates a canceled payment.\n\n`errorCallback`: Triggered if the response.status indicates a error payment.\n\n","readOnly":true},"state":{"enum":["created","pending","attempted","authorized","paid","failed","canceled","expired","invalided","refunded","cod"],"type":"string","readOnly":true,"description":"The current state of the payment transaction, it helps to understand the progress of the payment.\n\n* `created` - Created\n* `pending` - Pending\n* `attempted` - Attempted\n* `authorized` - Authorized\n* `paid` - Paid\n* `failed` - Failed\n* `canceled` - Canceled\n* `expired` - Expired\n* `invalided` - Invalided\n* `refunded` - Refunded\n* `cod` - Cash on Delivery"},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction. This field represents the purpose of the payment and can be one of several pre-defined choices.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"is_amount_editable":{"type":"boolean","readOnly":true,"title":"Editable amount","description":"This field specifies whether the customer can modify the payment amount and choose the amount he wishes to pay."},"session_id":{"type":"string","readOnly":true,"description":"A unique identifier for each payment transaction, used to maintain the session state during the payment process."},"cancel_url":{"type":"string","format":"uri","readOnly":true,"description":"This endpoint used to cancel the transaction using the merchant cancellation flow, \nto ensure the transaction cannot be paid again \nand trigger the webhook notification \n"}},"required":["amount","cancel_url","cards","currency_code","flex_methods","is_amount_editable","operation","payment_methods","payment_services","response","session_id","state","type"]}],"readOnly":true,"default":false,"description":"A JSON object containing preloaded data required to initialize the checkout interface.This includes essential details such as customer information, available payment methods.and specific transaction details, all formatted according to the Checkout SDK's initialization specifications.This field streamlines the checkout process by providing necessary information upfront.enhancing user experience and efficiency."},"session_id":{"type":"string","readOnly":true,"description":"A unique identifier for each payment transaction, used to maintain the session state during the payment process."},"settled_pg_code":{"type":"string","readOnly":true,"title":"Final Payment Gateway","description":"The code of the payment gateway used for completing the transaction. This field indicates the specific gateway that processed and settled the payment, providing clarity on which payment service was ultimately utilized for this transaction."},"shipping_excl_tax":{"type":"string","format":"decimal","title":"Shipping Excl. Tax","description":"The cost of shipping for the invoice, excluding taxes."},"shipping_incl_tax":{"type":"string","format":"decimal","title":"Shipping Incl. Tax","description":"The cost of shipping for the invoice, including all applicable taxes."},"shipping_method":{"type":"string","description":"The method or service used for shipping the items associated with the invoice."},"shipping_tax_rate":{"type":"string","format":"decimal","description":"The tax rate applied to the shipping cost, expressed as a percentage. "},"shortify_attachment_url":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to True, the URL of the uploaded attachment will be shortened using a URL shortener service. This should be used when sharing the attachment URL via SMS or WhatsApp."},"shortify_checkout_url":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to True, the checkout URL will be shortened using a URL shortener service. This should be used when sharing the payment URL via SMS or WhatsApp."},"state":{"enum":["created","pending","attempted","authorized","paid","failed","canceled","expired","invalided","refunded","cod"],"type":"string","readOnly":true,"description":"The current state of the payment transaction, it helps to understand the progress of the payment.\n\n* `created` - Created\n* `pending` - Pending\n* `attempted` - Attempted\n* `authorized` - Authorized\n* `paid` - Paid\n* `failed` - Failed\n* `canceled` - Canceled\n* `expired` - Expired\n* `invalided` - Invalided\n* `refunded` - Refunded\n* `cod` - Cash on Delivery"},"status":{"enum":["sent","paid","overdue","canceled"],"type":"string","readOnly":true,"description":"Current status of the invoice. Can be one of the following: `sent`, `paid`, `overdue`, `canceled`.\n\n* `sent` - Sent\n* `paid` - Paid\n* `overdue` - Overdue\n* `canceled` - Canceled"},"subtotal":{"type":"string","format":"decimal","description":"Sum of total_incl_tax's of all invoice items."},"tax_amount":{"type":"string","format":"decimal","description":"The total amount of tax applied to the invoice."},"tax_rate":{"type":"string","format":"decimal","title":"Tax","description":"The tax rate applied to the invoice, expressed as a percentage."},"total_excl_tax":{"type":"string","format":"decimal","title":"Total Excl. Tax","description":"The total amount of the invoice, excluding taxes."},"total_incl_tax":{"type":"string","format":"decimal","title":"Total Incl. Tax","description":"The total amount of the invoice, including all applicable taxes."},"unit_code":{"type":"string","writeOnly":true,"title":"Unit","description":"The slug of the unit to be used for the transaction."},"vendor_name":{"type":"string","description":"The name of the vendor or merchant associated with this payment. This field may be used for accounting and reporting purposes.","maxLength":64},"webhook_url":{"type":"string","format":"uri","description":"URL where the payment result will be sent via a POST request after the customer has completed the payment session. The payment result will be included in the request body. ","maxLength":2000}},"required":["attachment_short_url","checkout_short_url","checkout_url","currency_code","due_date","invoice_id","invoice_items","invoice_number","operation","payment_methods","pg_codes","qr_code_url","sdk_setup_preload_payload","session_id","settled_pg_code","state","status","type"]}}},"required":true},"security":[{"SSO_BasicAuth":[]},{"basicAuth":[]},{"SSO_JWT_Auth":[]},{"jwtAuth":[]}],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object","description":"Serializer class for `Invoice` instances, inheriting from `BaseInvoiceSerializer` and\n`CheckoutSerializer`. It provides methods for creating invoices, invoice items, and transactions.","properties":{"currency_code":{"type":"string","description":"The specified currency represents the denomination of the transaction.Nevertheless, it doesn't necessarily mandate payment in this exact currency.Due to potential currency conversions or exchanges, the final charge may be in a different currency."},"due_date":{"type":"string","format":"date","description":"The date by which the customer is expected to make payment for the invoice."},"invoice_items":{"type":"array","items":{"type":"object","description":"Serializer to use for `InvoiceItem` instances.\n\nThe unit_price, quantity, description and sku fields are required.\nThe rest are optional.\n\nThe class includes a method to calculate the discount on the invoice and another to calculate the total values.","properties":{"id":{"type":"integer","readOnly":true},"invoice":{"type":["integer","null"],"description":"Associated invoice."},"sku":{"type":"string","description":"Unique identifier for the invoice item.","maxLength":255},"description":{"type":"string","description":"Product name or a brief description of the item.","maxLength":255},"quantity":{"type":"string","format":"decimal","description":"Number of units of the product."},"unit_price":{"type":"string","format":"decimal","description":"Price per unit of the product, excluding tax."},"tax_rate":{"type":"string","format":"decimal","description":"Tax rate applied to the invoice item."},"tax_amount":{"type":"string","format":"decimal","description":"Total tax amount for the invoice item."},"discount_percentage":{"type":"string","format":"decimal","description":"Percentage-based discount applied to the invoice item. The calculated discount cannot exceed theitem's total value, including tax."},"discount_amount":{"type":"string","format":"decimal","description":"Fixed amount discount applied to the invoice item. The discount cannot exceed the item's total value, including tax."},"total_excl_tax":{"type":"string","format":"decimal","description":"Total value of the invoice item, excluding tax. This is calculated as (unit_price * quantity) - discount."},"total_incl_tax":{"type":"string","format":"decimal","description":"Total value of the invoice item, including tax. This is calculated as (unit_price * quantity) - discount + applicable tax."},"currency_code":{"type":"string","description":"For internal purposes: it'll be overridden by the main currency_code"}},"required":["currency_code","description","id","quantity","sku","unit_price"]},"description":"The list of items for the invoice."},"invoice_number":{"type":"string","description":"A unique identifier for the invoice, typically used for tracking and referencing purposes.","maxLength":255},"pg_codes":{"type":"array","items":{"type":"string"},"title":"Gateway","description":"The list of payment gateway codes from which a customer can select to perform the payment"},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction. This field represents the purpose of the payment and can be one of several pre-defined choices.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"billing_address":{"type":"object","description":"Nested serializer to save Address data into PaymentTransaction","properties":{"line1":{"type":"string","maxLength":128},"line2":{"type":"string","maxLength":128},"city":{"type":"string","maxLength":40},"state":{"type":"string","maxLength":40},"country":{"enum":["AF","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","HR","CU","CW","CY","CZ","CI","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RO","RU","RW","RE","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TM","TC","TV","TR","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","AX"],"type":"string","description":"* `AF` - Afghanistan\n* `AL` - Albania\n* `DZ` - Algeria\n* `AS` - American Samoa\n* `AD` - Andorra\n* `AO` - Angola\n* `AI` - Anguilla\n* `AQ` - Antarctica\n* `AG` - Antigua and Barbuda\n* `AR` - Argentina\n* `AM` - Armenia\n* `AW` - Aruba\n* `AU` - Australia\n* `AT` - Austria\n* `AZ` - Azerbaijan\n* `BS` - Bahamas\n* `BH` - Bahrain\n* `BD` - Bangladesh\n* `BB` - Barbados\n* `BY` - Belarus\n* `BE` - Belgium\n* `BZ` - Belize\n* `BJ` - Benin\n* `BM` - Bermuda\n* `BT` - Bhutan\n* `BO` - Bolivia, Plurinational State of\n* `BQ` - Bonaire, Sint Eustatius and Saba\n* `BA` - Bosnia and Herzegovina\n* `BW` - Botswana\n* `BV` - Bouvet Island\n* `BR` - Brazil\n* `IO` - British Indian Ocean Territory\n* `BN` - Brunei Darussalam\n* `BG` - Bulgaria\n* `BF` - Burkina Faso\n* `BI` - Burundi\n* `CV` - Cabo Verde\n* `KH` - Cambodia\n* `CM` - Cameroon\n* `CA` - Canada\n* `KY` - Cayman Islands\n* `CF` - Central African Republic\n* `TD` - Chad\n* `CL` - Chile\n* `CN` - China\n* `CX` - Christmas Island\n* `CC` - Cocos (Keeling) Islands\n* `CO` - Colombia\n* `KM` - Comoros\n* `CG` - Congo\n* `CD` - Congo, The Democratic Republic of the\n* `CK` - Cook Islands\n* `CR` - Costa Rica\n* `HR` - Croatia\n* `CU` - Cuba\n* `CW` - Curaçao\n* `CY` - Cyprus\n* `CZ` - Czechia\n* `CI` - Côte d'Ivoire\n* `DK` - Denmark\n* `DJ` - Djibouti\n* `DM` - Dominica\n* `DO` - Dominican Republic\n* `EC` - Ecuador\n* `EG` - Egypt\n* `SV` - El Salvador\n* `GQ` - Equatorial Guinea\n* `ER` - Eritrea\n* `EE` - Estonia\n* `SZ` - Eswatini\n* `ET` - Ethiopia\n* `FK` - Falkland Islands (Malvinas)\n* `FO` - Faroe Islands\n* `FJ` - Fiji\n* `FI` - Finland\n* `FR` - France\n* `GF` - French Guiana\n* `PF` - French Polynesia\n* `TF` - French Southern Territories\n* `GA` - Gabon\n* `GM` - Gambia\n* `GE` - Georgia\n* `DE` - Germany\n* `GH` - Ghana\n* `GI` - Gibraltar\n* `GR` - Greece\n* `GL` - Greenland\n* `GD` - Grenada\n* `GP` - Guadeloupe\n* `GU` - Guam\n* `GT` - Guatemala\n* `GG` - Guernsey\n* `GN` - Guinea\n* `GW` - Guinea-Bissau\n* `GY` - Guyana\n* `HT` - Haiti\n* `HM` - Heard Island and McDonald Islands\n* `VA` - Holy See (Vatican City State)\n* `HN` - Honduras\n* `HK` - Hong Kong\n* `HU` - Hungary\n* `IS` - Iceland\n* `IN` - India\n* `ID` - Indonesia\n* `IR` - Iran, Islamic Republic of\n* `IQ` - Iraq\n* `IE` - Ireland\n* `IM` - Isle of Man\n* `IL` - Israel\n* `IT` - Italy\n* `JM` - Jamaica\n* `JP` - Japan\n* `JE` - Jersey\n* `JO` - Jordan\n* `KZ` - Kazakhstan\n* `KE` - Kenya\n* `KI` - Kiribati\n* `KP` - Korea, Democratic People's Republic of\n* `KR` - Korea, Republic of\n* `KW` - Kuwait\n* `KG` - Kyrgyzstan\n* `LA` - Lao People's Democratic Republic\n* `LV` - Latvia\n* `LB` - Lebanon\n* `LS` - Lesotho\n* `LR` - Liberia\n* `LY` - Libya\n* `LI` - Liechtenstein\n* `LT` - Lithuania\n* `LU` - Luxembourg\n* `MO` - Macao\n* `MG` - Madagascar\n* `MW` - Malawi\n* `MY` - Malaysia\n* `MV` - Maldives\n* `ML` - Mali\n* `MT` - Malta\n* `MH` - Marshall Islands\n* `MQ` - Martinique\n* `MR` - Mauritania\n* `MU` - Mauritius\n* `YT` - Mayotte\n* `MX` - Mexico\n* `FM` - Micronesia, Federated States of\n* `MD` - Moldova, Republic of\n* `MC` - Monaco\n* `MN` - Mongolia\n* `ME` - Montenegro\n* `MS` - Montserrat\n* `MA` - Morocco\n* `MZ` - Mozambique\n* `MM` - Myanmar\n* `NA` - Namibia\n* `NR` - Nauru\n* `NP` - Nepal\n* `NL` - Netherlands\n* `NC` - New Caledonia\n* `NZ` - New Zealand\n* `NI` - Nicaragua\n* `NE` - Niger\n* `NG` - Nigeria\n* `NU` - Niue\n* `NF` - Norfolk Island\n* `MK` - North Macedonia\n* `MP` - Northern Mariana Islands\n* `NO` - Norway\n* `OM` - Oman\n* `PK` - Pakistan\n* `PW` - Palau\n* `PS` - Palestine, State of\n* `PA` - Panama\n* `PG` - Papua New Guinea\n* `PY` - Paraguay\n* `PE` - Peru\n* `PH` - Philippines\n* `PN` - Pitcairn\n* `PL` - Poland\n* `PT` - Portugal\n* `PR` - Puerto Rico\n* `QA` - Qatar\n* `RO` - Romania\n* `RU` - Russian Federation\n* `RW` - Rwanda\n* `RE` - Réunion\n* `BL` - Saint Barthélemy\n* `SH` - Saint Helena, Ascension and Tristan da Cunha\n* `KN` - Saint Kitts and Nevis\n* `LC` - Saint Lucia\n* `MF` - Saint Martin (French part)\n* `PM` - Saint Pierre and Miquelon\n* `VC` - Saint Vincent and the Grenadines\n* `WS` - Samoa\n* `SM` - San Marino\n* `ST` - Sao Tome and Principe\n* `SA` - Saudi Arabia\n* `SN` - Senegal\n* `RS` - Serbia\n* `SC` - Seychelles\n* `SL` - Sierra Leone\n* `SG` - Singapore\n* `SX` - Sint Maarten (Dutch part)\n* `SK` - Slovakia\n* `SI` - Slovenia\n* `SB` - Solomon Islands\n* `SO` - Somalia\n* `ZA` - South Africa\n* `GS` - South Georgia and the South Sandwich Islands\n* `SS` - South Sudan\n* `ES` - Spain\n* `LK` - Sri Lanka\n* `SD` - Sudan\n* `SR` - Suriname\n* `SJ` - Svalbard and Jan Mayen\n* `SE` - Sweden\n* `CH` - Switzerland\n* `SY` - Syrian Arab Republic\n* `TW` - Taiwan, Province of China\n* `TJ` - Tajikistan\n* `TZ` - Tanzania, United Republic of\n* `TH` - Thailand\n* `TL` - Timor-Leste\n* `TG` - Togo\n* `TK` - Tokelau\n* `TO` - Tonga\n* `TT` - Trinidad and Tobago\n* `TN` - Tunisia\n* `TM` - Turkmenistan\n* `TC` - Turks and Caicos Islands\n* `TV` - Tuvalu\n* `TR` - Türkiye\n* `UG` - Uganda\n* `UA` - Ukraine\n* `AE` - United Arab Emirates\n* `GB` - United Kingdom\n* `US` - United States\n* `UM` - United States Minor Outlying Islands\n* `UY` - Uruguay\n* `UZ` - Uzbekistan\n* `VU` - Vanuatu\n* `VE` - Venezuela, Bolivarian Republic of\n* `VN` - Viet Nam\n* `VG` - Virgin Islands, British\n* `VI` - Virgin Islands, U.S.\n* `WF` - Wallis and Futuna\n* `EH` - Western Sahara\n* `YE` - Yemen\n* `ZM` - Zambia\n* `ZW` - Zimbabwe\n* `AX` - Åland Islands"},"postal_code":{"type":"string","maxLength":12}},"required":["city","country","line1"]},"shipping_address":{"type":"object","description":"Nested serializer to save Address data into PaymentTransaction","properties":{"line1":{"type":"string","maxLength":128},"line2":{"type":"string","maxLength":128},"city":{"type":"string","maxLength":40},"state":{"type":"string","maxLength":40},"country":{"enum":["AF","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","HR","CU","CW","CY","CZ","CI","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RO","RU","RW","RE","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TM","TC","TV","TR","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","AX"],"type":"string","description":"* `AF` - Afghanistan\n* `AL` - Albania\n* `DZ` - Algeria\n* `AS` - American Samoa\n* `AD` - Andorra\n* `AO` - Angola\n* `AI` - Anguilla\n* `AQ` - Antarctica\n* `AG` - Antigua and Barbuda\n* `AR` - Argentina\n* `AM` - Armenia\n* `AW` - Aruba\n* `AU` - Australia\n* `AT` - Austria\n* `AZ` - Azerbaijan\n* `BS` - Bahamas\n* `BH` - Bahrain\n* `BD` - Bangladesh\n* `BB` - Barbados\n* `BY` - Belarus\n* `BE` - Belgium\n* `BZ` - Belize\n* `BJ` - Benin\n* `BM` - Bermuda\n* `BT` - Bhutan\n* `BO` - Bolivia, Plurinational State of\n* `BQ` - Bonaire, Sint Eustatius and Saba\n* `BA` - Bosnia and Herzegovina\n* `BW` - Botswana\n* `BV` - Bouvet Island\n* `BR` - Brazil\n* `IO` - British Indian Ocean Territory\n* `BN` - Brunei Darussalam\n* `BG` - Bulgaria\n* `BF` - Burkina Faso\n* `BI` - Burundi\n* `CV` - Cabo Verde\n* `KH` - Cambodia\n* `CM` - Cameroon\n* `CA` - Canada\n* `KY` - Cayman Islands\n* `CF` - Central African Republic\n* `TD` - Chad\n* `CL` - Chile\n* `CN` - China\n* `CX` - Christmas Island\n* `CC` - Cocos (Keeling) Islands\n* `CO` - Colombia\n* `KM` - Comoros\n* `CG` - Congo\n* `CD` - Congo, The Democratic Republic of the\n* `CK` - Cook Islands\n* `CR` - Costa Rica\n* `HR` - Croatia\n* `CU` - Cuba\n* `CW` - Curaçao\n* `CY` - Cyprus\n* `CZ` - Czechia\n* `CI` - Côte d'Ivoire\n* `DK` - Denmark\n* `DJ` - Djibouti\n* `DM` - Dominica\n* `DO` - Dominican Republic\n* `EC` - Ecuador\n* `EG` - Egypt\n* `SV` - El Salvador\n* `GQ` - Equatorial Guinea\n* `ER` - Eritrea\n* `EE` - Estonia\n* `SZ` - Eswatini\n* `ET` - Ethiopia\n* `FK` - Falkland Islands (Malvinas)\n* `FO` - Faroe Islands\n* `FJ` - Fiji\n* `FI` - Finland\n* `FR` - France\n* `GF` - French Guiana\n* `PF` - French Polynesia\n* `TF` - French Southern Territories\n* `GA` - Gabon\n* `GM` - Gambia\n* `GE` - Georgia\n* `DE` - Germany\n* `GH` - Ghana\n* `GI` - Gibraltar\n* `GR` - Greece\n* `GL` - Greenland\n* `GD` - Grenada\n* `GP` - Guadeloupe\n* `GU` - Guam\n* `GT` - Guatemala\n* `GG` - Guernsey\n* `GN` - Guinea\n* `GW` - Guinea-Bissau\n* `GY` - Guyana\n* `HT` - Haiti\n* `HM` - Heard Island and McDonald Islands\n* `VA` - Holy See (Vatican City State)\n* `HN` - Honduras\n* `HK` - Hong Kong\n* `HU` - Hungary\n* `IS` - Iceland\n* `IN` - India\n* `ID` - Indonesia\n* `IR` - Iran, Islamic Republic of\n* `IQ` - Iraq\n* `IE` - Ireland\n* `IM` - Isle of Man\n* `IL` - Israel\n* `IT` - Italy\n* `JM` - Jamaica\n* `JP` - Japan\n* `JE` - Jersey\n* `JO` - Jordan\n* `KZ` - Kazakhstan\n* `KE` - Kenya\n* `KI` - Kiribati\n* `KP` - Korea, Democratic People's Republic of\n* `KR` - Korea, Republic of\n* `KW` - Kuwait\n* `KG` - Kyrgyzstan\n* `LA` - Lao People's Democratic Republic\n* `LV` - Latvia\n* `LB` - Lebanon\n* `LS` - Lesotho\n* `LR` - Liberia\n* `LY` - Libya\n* `LI` - Liechtenstein\n* `LT` - Lithuania\n* `LU` - Luxembourg\n* `MO` - Macao\n* `MG` - Madagascar\n* `MW` - Malawi\n* `MY` - Malaysia\n* `MV` - Maldives\n* `ML` - Mali\n* `MT` - Malta\n* `MH` - Marshall Islands\n* `MQ` - Martinique\n* `MR` - Mauritania\n* `MU` - Mauritius\n* `YT` - Mayotte\n* `MX` - Mexico\n* `FM` - Micronesia, Federated States of\n* `MD` - Moldova, Republic of\n* `MC` - Monaco\n* `MN` - Mongolia\n* `ME` - Montenegro\n* `MS` - Montserrat\n* `MA` - Morocco\n* `MZ` - Mozambique\n* `MM` - Myanmar\n* `NA` - Namibia\n* `NR` - Nauru\n* `NP` - Nepal\n* `NL` - Netherlands\n* `NC` - New Caledonia\n* `NZ` - New Zealand\n* `NI` - Nicaragua\n* `NE` - Niger\n* `NG` - Nigeria\n* `NU` - Niue\n* `NF` - Norfolk Island\n* `MK` - North Macedonia\n* `MP` - Northern Mariana Islands\n* `NO` - Norway\n* `OM` - Oman\n* `PK` - Pakistan\n* `PW` - Palau\n* `PS` - Palestine, State of\n* `PA` - Panama\n* `PG` - Papua New Guinea\n* `PY` - Paraguay\n* `PE` - Peru\n* `PH` - Philippines\n* `PN` - Pitcairn\n* `PL` - Poland\n* `PT` - Portugal\n* `PR` - Puerto Rico\n* `QA` - Qatar\n* `RO` - Romania\n* `RU` - Russian Federation\n* `RW` - Rwanda\n* `RE` - Réunion\n* `BL` - Saint Barthélemy\n* `SH` - Saint Helena, Ascension and Tristan da Cunha\n* `KN` - Saint Kitts and Nevis\n* `LC` - Saint Lucia\n* `MF` - Saint Martin (French part)\n* `PM` - Saint Pierre and Miquelon\n* `VC` - Saint Vincent and the Grenadines\n* `WS` - Samoa\n* `SM` - San Marino\n* `ST` - Sao Tome and Principe\n* `SA` - Saudi Arabia\n* `SN` - Senegal\n* `RS` - Serbia\n* `SC` - Seychelles\n* `SL` - Sierra Leone\n* `SG` - Singapore\n* `SX` - Sint Maarten (Dutch part)\n* `SK` - Slovakia\n* `SI` - Slovenia\n* `SB` - Solomon Islands\n* `SO` - Somalia\n* `ZA` - South Africa\n* `GS` - South Georgia and the South Sandwich Islands\n* `SS` - South Sudan\n* `ES` - Spain\n* `LK` - Sri Lanka\n* `SD` - Sudan\n* `SR` - Suriname\n* `SJ` - Svalbard and Jan Mayen\n* `SE` - Sweden\n* `CH` - Switzerland\n* `SY` - Syrian Arab Republic\n* `TW` - Taiwan, Province of China\n* `TJ` - Tajikistan\n* `TZ` - Tanzania, United Republic of\n* `TH` - Thailand\n* `TL` - Timor-Leste\n* `TG` - Togo\n* `TK` - Tokelau\n* `TO` - Tonga\n* `TT` - Trinidad and Tobago\n* `TN` - Tunisia\n* `TM` - Turkmenistan\n* `TC` - Turks and Caicos Islands\n* `TV` - Tuvalu\n* `TR` - Türkiye\n* `UG` - Uganda\n* `UA` - Ukraine\n* `AE` - United Arab Emirates\n* `GB` - United Kingdom\n* `US` - United States\n* `UM` - United States Minor Outlying Islands\n* `UY` - Uruguay\n* `UZ` - Uzbekistan\n* `VU` - Vanuatu\n* `VE` - Venezuela, Bolivarian Republic of\n* `VN` - Viet Nam\n* `VG` - Virgin Islands, British\n* `VI` - Virgin Islands, U.S.\n* `WF` - Wallis and Futuna\n* `EH` - Western Sahara\n* `YE` - Yemen\n* `ZM` - Zambia\n* `ZW` - Zimbabwe\n* `AX` - Åland Islands"},"postal_code":{"type":"string","maxLength":12},"first_name":{"type":"string","maxLength":64},"last_name":{"type":"string","maxLength":64},"email":{"type":"string","format":"email","maxLength":128},"phone":{"type":"string","maxLength":16}},"required":["city","country","email","first_name","last_name","line1","phone"]},"agreement":{"allOf":[{"type":"object","description":"Serializer to hold the recurring data information.\nThis is required for being able to create recurring payments and the PGs\nrequire this information.","properties":{"id":{"type":"string","description":"A unique identifier for the agreement established with the payer. This ID links to the specific terms and conditions the payer has authorized for processing their stored card details. Use cases include: \n1. Recurring Payments: Periodic debits, e.g., gym memberships. \n2. Installment Payments: Multiple charges for a single purchase over time. \n3. Unscheduled: Future payments as required, e.g., account top-ups. \n4. Industry Practice: Standard business practices related to an original payment, e.g., hotel charges after checkout.","maxLength":128},"amount_variability":{"enum":["fixed","variable"],"type":"string","description":"Indicates if all payments within the agreement use the same amount or if the amount differs between the payments.\n\n* `fixed` - Fixed\n* `variable` - Variable"},"start_date":{"type":"string","format":"date","description":"Date on which the agreement with the payer to process payments starts."},"expiry_date":{"type":"string","format":"date","description":"Date on which your agreement with the payer to process payments expires."},"max_amount_per_cycle":{"type":"string","format":"decimal","description":"The maximum amount for a single payment in the series as agreed with the payer."},"cycle_interval_days":{"type":"integer","maximum":366,"minimum":1,"description":"The minimum number of days between payments agreed with the payer."},"total_cycles":{"type":"integer","maximum":999,"minimum":1,"description":"The number of merchant-initiated payments within the recurring payment agreement."},"frequency":{"enum":["irregular","daily","weekly","semi_monthly","monthly","quarterly","semi_annually","yearly","other"],"type":"string","description":"The frequency of the payments within the series as agreed with the payer.\n\n* `irregular` - Irregular\n* `daily` - Daily\n* `weekly` - Weekly\n* `semi_monthly` - Semi Monthly\n* `monthly` - Monthly\n* `quarterly` - Quarterly\n* `semi_annually` - Semi Annually\n* `yearly` - Yearly\n* `other` - Other"},"type":{"enum":["event_based","installment","recurring","unscheduled","other"],"type":"string","default":"recurring","description":"The type of commercial agreement that the payer has with the merchant.\n\n *Note*: For `unscheduled` agreements, the allowed values should be configured as follows: \n\n `id` - Accepts any value. \n\n `frequency`. \n\n `type`.\n\n This configuration ensures that only specific values are permitted for each field when the `type` is `Unscheduled`.\n\n *Note*: For `recurring` agreements, the following fields are mandatory as follows: \n\n `amount_variability` \n\n `cycle_interval_days` \n\n `expiry_date` \n\n ` `requency` \n\n `id` \n\n  `total_cycles` \n\n This configuration ensures that the required values are mandatory for each field when the `type` is `Recurring`.\n\n* `event_based` - Event Based\n* `installment` - Installment\n* `recurring` - Recurring\n* `unscheduled` - Unscheduled\n* `other` - Other"},"seller":{"allOf":[{"type":"object","properties":{"name":{"type":"string","description":"The retailer's trading name.","maxLength":128},"short_name":{"type":"string","description":"Abbreviation of the retailer's trading name, suitable for payer's statement display.","maxLength":64},"category_code":{"type":"string","description":"A 4-digit code classifying the retailer's business by the type of goods or services it offers.","maxLength":64}}}],"description":"Details about the retailer, if the agreement is for installment payments."},"extra_params":{"allOf":[{"type":"object","properties":{"payment_processing_day":{"type":"integer","maximum":31,"minimum":1,"description":"Day of the month on which the payment must be processed. Not required for unscheduled payment agreements."}}}],"description":"Additional parameters related to the agreement."}}}],"description":"An established contractual arrangement with the payer, which authorizes you to securely store and subsequently utilize their payment information for specific purposes. This could encompass arrangements like recurring payments for services such as mobile subscriptions, installment-based payments for purchases, arrangements for ad-hoc charges like account top-ups, or for standard industry practices like penalty charges for missed appointments. \n\nNote: If your intention is solely to store payment details for transactions initiated by the payer in the future, then this parameter group should not be used."},"amount":{"type":"string","format":"decimal","description":"Represents the total amount of the payment transaction, which includes the cost of the purchased items or services but excludes any additional fees or charges"},"attachment":{"type":"string","format":"uri","description":"A writable field that accepts an attachment file to be included in email notifications sent to the customer regarding their payment, and also be available for download on the checkout page. This field may be used to provide the customer with additional information or documentation related to their purchase. The value of this field should be a file object. Upon successful submission, the API will return the URL for downloading the attached file. "},"attachment_short_url":{"type":"string","format":"uri","readOnly":true,"description":"A short URL that links to the attachment associated with this payment. This URL may be included in email/sms notifications sent to the customer regarding their payment or displayed on the checkout page to allow the customer to easily access the attachment."},"attachment_upload_url":{"type":"string","description":"A writable field that accepts an attachment that has already been uploaded to the server.","pattern":"(?:pdf|jpeg|png|doc|docx|jpg|xls|xlsx|txt)$"},"card_acceptance_criteria":{"allOf":[{"type":"object","properties":{"min_expiry_time":{"type":"integer","maximum":365,"minimum":1,"description":"Specifies the minimum required validity period, in days, for a card to be eligible for payment. If set to 30 days, for example, cards set to expire within the next month would be declined. This ensures short-lived cards nearing their expiration date are filtered out, reducing chances of payment failures. When implementing, balance your operational needs with customer convenience. Setting it too stringent might increase payment declines, while a lenient approach could risk future payment failures.\n\nAdditionally, it defaults to 30 days when the `payment_type` is `auto_debit`. If any other payment type is selected, no default value is set."}}}],"description":"This field allows you to define specific rules and conditions that a card must meet to be eligible for payment. These stipulations apply regardless of whether a customer chooses to pay using a saved card or opts to add a new card for the transaction. By leveraging the `card_acceptance_criteria`, you gain the power to fine-tune your payment processing strategy, tailoring acceptance rules to align with your business needs, security standards, and risk management policies.\n\n**Example**: If you run an exclusive service that caters predominantly to premium customers, you might set criteria that only allow transactions from high-tier credit cards like VISA Platinum. This ensures that payments align with the exclusivity and branding of your services. Remember to configure these criteria thoughtfully. Striking the right balance between security, risk mitigation, and user experience is paramount.\n\n**Note**: The `card_acceptance_criteria` field is applicable only for direct payments and not for hosted session payments."},"checkout_short_url":{"type":"string","format":"uri","readOnly":true,"description":"A short URL link that, when opened, redirects to the checkout page for this payment. This URL may be shared with the customer to allow them to easily access and complete the payment. This field is only available if the `shortify_checkout_url` field is set to True."},"checkout_url":{"type":"string","format":"uri","readOnly":true,"description":"URL that directs the customer to the Ottu Checkout Page where they can see the payment details and available payment methods for the transaction. If you need to share the payment link over SMS or WhatsApp, use `checkout_short_url` instead."},"company_name":{"type":"string","description":"The company name is used for invoice API.","maxLength":64},"customer_birthdate":{"type":"string","format":"date","title":"Customer Date of Birth","description":"Customer's date of birth in YYYY-MM-DD format.This field can be used for age verification or compliance purposes during payment processing."},"customer_email":{"type":"string","format":"email","description":"The email address of the customer that is used to send payment notifications and receipts, and can be used for fraud prevention. This field is mandatory and is always sent to the payment gateway. It may also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":128},"customer_first_name":{"type":"string","description":"The first name of the recipient of the payment. This field is used for various communications such as the invoice, receipt, email, SMS, or displayed on the payment page. It may also be sent to the payment gateway if necessary.","maxLength":64},"customer_id":{"type":"string","description":"The customer ID is a unique identifier for the customer within the merchant's system. It is also used as a merchant identifier for the customer and plays a critical role in tokenization. All the customer's cards will be associated with this ID.","maxLength":64},"customer_last_name":{"type":"string","description":"The last name of the recipient of the payment. This field is used for various communications such as the invoice, receipt, email, SMS, or displayed on the payment page. It may also be sent to the payment gateway if necessary.","maxLength":64},"customer_phone":{"type":"string","description":"Customer phone number associated with the payment. This might be sent to the payment gateway and depending on the gateway, it may trigger a click to pay process on the payment page. The phone number will also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":16},"customer_phone_2":{"type":"string","title":"Customer additional phone","description":"The customer's additional phone number, if any. This field can be updated by the customer on the payment page or in the Checkout SDK.","maxLength":16},"discount_amount":{"type":"string","format":"decimal","description":"The fixed amount discount applied to the full invoice amount, including taxes. If set, the discount_percentage field will be set to null. Both discount_amount and discount_percentage cannot be set simultaneously. The discount cannot be higher than the `total_excl_tax` field."},"discount_percentage":{"type":"string","format":"decimal","description":"The percentage-based discount applied to the full invoice amount, including taxes. If set, the discount_amount field will be automatically calculated. Both discount_amount and discount_percentage cannot be set simultaneously. The discount cannot be higher than the `total_excl_tax` field."},"due_datetime":{"type":"string","format":"date-time","title":"Due date and time","description":"The date and time by which the payment is due. This field may be used to help remind the customer to complete the payment before the due date."},"email_recipients":{"type":"array","items":{"type":"string","format":"email"},"description":"A comma-separated list of email addresses for internal recipients who will receive customer emails. These recipients will be included in email notifications sent to the customer regarding their payment."},"expiration_time":{"type":"string","description":"If defined, any payment transactions created more than the specified period of time ago will be invalidated or expired if the customer attempts to complete them. By default, this expiration period is set to 24 hours from the time of transaction creation. This feature helps ensure that payment transactions are processed promptly."},"extra":{"allOf":[{"type":"object","description":"Serializer for extra data aka dynamic fields.\nExtra data can accept any value by default. However,\nif the merchant wants to enforce a specific type, they can\nuse the plugins.Field class to do so. All CUSTOM fields are\nvalidated inside extra field.\n\nImplementation:\n    - requires to have a config property in the parent\n    serializer which has to return a PluginConfig instance,\n    to which fields are attached.","properties":{"payment_category_name":{"type":"string"},"payment_category_amount":{"type":"string"},"month":{"enum":["january","february"],"type":"string","description":"* `january` - January\n* `february` - February"},"full_name":{"type":"string"},"booking_reference":{"type":"string"}},"required":["month"]}],"description":"The extra information for the payment details, which the merchant has sent it in key value form."},"generate_qr_code":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to true, the `qr_code_url` field will be present in the response. Upon scanning it, the customer will be redirected to the checkout_url, which is the Ottu Checkout page."},"include_sdk_setup_preload":{"type":"boolean","writeOnly":true,"default":false,"description":"Set this to true to include the 'sdk_setup_preload_payload' payload in the API response. This payload is only generated and added when this parameter is explicitly set to true. By default, it is false and the 'sdk_setup_preload_payload' payload will not be included."},"initiator_id":{"type":"integer","title":"initiator","description":"The user who initiated the creation of this payment transaction, if available. This field is optional and may be used to track who created the payment transaction. Note that if the payment transaction was using API Key auth initiator_id can be set to any value that corresponds to an existing ACTIVE user in the system"},"invoice_id":{"type":"integer","readOnly":true},"language":{"enum":["en","ar"],"type":"string","default":"en","description":"This field specifies the language to be used for communication with the customer, including the payment page, receipt, invoice, email, SMS, and any other communications related to the payment transaction.\n\n* `en` - English\n* `ar` - Arabic"},"notifications":{"allOf":[{"type":"object","properties":{"email":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized","voided","refunded","captured"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized\n* `voided` - Voided\n* `refunded` - Refunded\n* `captured` - Captured"}},"sms":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized","voided","refunded","captured"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized\n* `voided` - Voided\n* `refunded` - Refunded\n* `captured` - Captured"}},"whatsapp":{"type":"array","items":{"enum":["created","paid","canceled","failed","expired","authorized"],"type":"string","description":"* `created` - Created\n* `paid` - Paid\n* `canceled` - Canceled\n* `failed` - Failed\n* `expired` - Expired\n* `authorized` - Authorized"}}}}],"title":"Notification settings","description":"A JSON field that contains the notification settings for this payment transaction, including SMS and email notifications, as well as the events for which they will be sent (e.g., 'created', 'paid', 'refund', 'canceled', etc.). This field may be used to configure and customize the notifications sent to customers and internal recipients throughout the payment process."},"operation":{"type":"string","readOnly":true,"description":"Specifies the type of operation to be performed by the payment gateway. If set to `purchase`, the payment source will be directly charged. If set to `authorize`, the payment source will only be authorized and the actual charge will be made at a later time."},"order_no":{"type":"string","description":"The unique identifier assigned to this payment transaction. It is used for tracking purposes and is set by the merchant or the system.","maxLength":128},"payment_methods":{"allOf":[{"type":"object","properties":{"code":{"type":"string","description":"The slug code of the payment method.","pattern":"^[-a-zA-Z0-9_]+$"},"name":{"type":"string","description":"The name of the payment method."},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"amount":{"type":"string","description":"The total amount to be charged, including fees."},"currency_code":{"type":"string","description":"The currency code for the payment method represented as an ISO 4217 code.","maxLength":3},"fee":{"type":"string","description":"The fee charged by the payment gateway."},"fee_description":{"type":"string","description":"This field provides the label for any additional transaction fee. In the SDK, this label will be displayed prominently during the checkout process to inform the payer about the nature of the fee. Ensure to incorporate this field in a clear and visible manner within the checkout UI to maintain transparency with the end-users."},"icon":{"type":"string","format":"uri","description":"The svg URL of the icon for the payment method."},"icons":{"allOf":[{"type":"object","properties":{"webp":{"type":"string","format":"uri","description":"The webp URL of the icon for the payment method."},"svg":{"type":"string","format":"uri","description":"The svg URL of the icon for the payment method."}},"required":["svg","webp"]}],"description":"The URLs of the icon for the payment method."},"pg_icons":{"allOf":[{"type":"object","description":"Serializer for PG logo with custom logo URL resolution.","properties":{"svg":{"type":["string","null"],"format":"uri","readOnly":true,"description":"`Optional` field. Upload a logo in SVG format only. If provided and no WebP image is uploaded, a WebP version will be automatically generated. Only .svg files are accepted. Do not upload any other format."},"webp":{"type":"string","readOnly":true,"description":"`Mandatory` field. This must be provided either by uploading a WebP image directly, or it will be auto-generated from the SVG file (if provided). This field does not accept SVG files — only raster images like PNG or JPEG that will be converted to WebP."},"label":{"type":"string","description":"The display name of the logo (translatable in EN and AR).","maxLength":255}},"required":["label","svg","webp"]}],"description":"Represents list of mid icons configured for `pgmid` settings"},"flow":{"type":"string","default":"redirect","description":"The flow type of the payment method."},"redirect_url":{"type":["string","null"],"format":"uri","description":"The URL where the customer should be redirected to perform the payment."}},"required":["amount","code","currency_code","fee","fee_description","icon","icons","name","type"]}],"readOnly":true,"description":"An array containing all the payment methods derived from the `pg_codes` input. Each object in the array contains information about a single payment gateway, including its icon and the `redirect_url` that will redirect the customer to the payment gateway's payment page."},"payment_type":{"enum":["one_off","auto_debit","save_card"],"type":"string","default":"one_off","description":"Type of payment. Choose `one_off` for payments that occur only once without future commitments. Choose `auto_debit` for payments that are automatically deducted, such as recurring subscriptions, installments, or unscheduled auto-debits. \n\nChoose `save_card` if you want to perform a card tokenization operation.\n\nNOTE: If `auto_debit` is selected: \n1. `agreement` and `customer_id` parameters will also be mandatory. \n2. Only PG codes supporting tokenization can be selected. \nAs a side effect, the card used for the payment will be associated with the supplied `agreement.id`. This card will be locked, preventing the customer from deleting it from the system until an alternate card is chosen for auto-debit payments.\n\nNOTE: If `save_card` is selected: \n1. The amount must be zero for the save card operation. \n2. The selected MID(pg_code) must support tokenization to enable the save card operation. \n3. Please note that the save card operation is considered successful without any funds being charged.\n4. Once a card is created, Ottu will send a webhook containing the card details to the merchant's webhook URL.\n5. When the transaction type is `save_card`, all previously saved cards returned in the sdk_preload_payload should be hidden since the user is saving a new card and does not need to select from existing ones.\n\n* `one_off` - One Off\n* `auto_debit` - Auto Debit\n* `save_card` - Save Card"},"product_type":{"type":"string","description":"The type of product or service being purchased. This field may be used for tracking and reporting purposes.","maxLength":128},"qr_code_url":{"type":"string","format":"uri","readOnly":true,"description":"A QR code that, when scanned, redirects to the checkout page for this payment. This QR code may be displayed on invoices, receipts, or other documents to allow customers to easily access the checkout page and make a payment. This parameter is only present when `generate_qr_code` is set to true."},"redirect_url":{"type":"string","format":"uri","description":"The URL where the customer will be redirected after the payment stage only if the webhook URL returns a success status. `order_no`, `reference_number` and `session_id` will be appended to the redirect URL as query parameters.","maxLength":2000},"sdk_setup_preload_payload":{"allOf":[{"type":"object","description":"Serialize data for SDK init.\nThe SDK will use this data to initialize the payment process and\nto display the payment methods.","properties":{"amount":{"type":"string","format":"decimal","description":"Represents the total amount of the payment transaction, which includes the cost of the purchased items or services but excludes any additional fees or charges"},"cards":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"List of saved tokenized cards for customer payments, which can be used for transactions. Render alongside `payment_methods` for customers to choose from.","readOnly":true},"customer_id":{"type":"string","description":"The customer ID is a unique identifier for the customer within the merchant's system. It is also used as a merchant identifier for the customer and plays a critical role in tokenization. All the customer's cards will be associated with this ID.","maxLength":64},"customer_phone":{"type":"string","description":"Customer phone number associated with the payment. This might be sent to the payment gateway and depending on the gateway, it may trigger a click to pay process on the payment page. The phone number will also be included in the invoice, receipt, email, and displayed on the payment page.","maxLength":16},"currency_code":{"type":"string","description":"The specified currency represents the denomination of the transaction.Nevertheless, it doesn't necessarily mandate payment in this exact currency.Due to potential currency conversions or exchanges, the final charge may be in a different currency."},"language":{"enum":["en","ar"],"type":"string","default":"en","description":"This field specifies the language to be used for communication with the customer, including the payment page, receipt, invoice, email, SMS, and any other communications related to the payment transaction.\n\n* `en` - English\n* `ar` - Arabic"},"operation":{"type":"string","readOnly":true,"description":"Specifies the type of operation to be performed by the payment gateway. If set to `purchase`, the payment source will be directly charged. If set to `authorize`, the payment source will only be authorized and the actual charge will be made at a later time."},"payment_type":{"enum":["one_off","auto_debit","save_card"],"type":"string","default":"one_off","description":"Type of payment. Choose `one_off` for payments that occur only once without future commitments. Choose `auto_debit` for payments that are automatically deducted, such as recurring subscriptions, installments, or unscheduled auto-debits. \n\nChoose `save_card` if you want to perform a card tokenization operation.\n\nNOTE: If `auto_debit` is selected: \n1. `agreement` and `customer_id` parameters will also be mandatory. \n2. Only PG codes supporting tokenization can be selected. \nAs a side effect, the card used for the payment will be associated with the supplied `agreement.id`. This card will be locked, preventing the customer from deleting it from the system until an alternate card is chosen for auto-debit payments.\n\nNOTE: If `save_card` is selected: \n1. The amount must be zero for the save card operation. \n2. The selected MID(pg_code) must support tokenization to enable the save card operation. \n3. Please note that the save card operation is considered successful without any funds being charged.\n4. Once a card is created, Ottu will send a webhook containing the card details to the merchant's webhook URL.\n5. When the transaction type is `save_card`, all previously saved cards returned in the sdk_preload_payload should be hidden since the user is saving a new card and does not need to select from existing ones.\n\n* `one_off` - One Off\n* `auto_debit` - Auto Debit\n* `save_card` - Save Card"},"payment_methods":{"type":"array","items":{},"description":"The provided documentation describes the `payment_methods` field.\n\n Detailing the types of payment methods included and their functionality \nas well as backward compatibility considerations for removed methods. \n\nThe `payment_methods` field includes various payment options available to customers\nexcluding device-specific methods like `apple_pay`, `google_pay`and `flex_methods` represented in flex methods section\nit primarily supports methods requiring a redirect flow\nwhere users complete transactions on an external webpage.\n\n`Functionality`: users are redirected to an external \nsite mostly to gateway payment page \nusing `redirect_url` where they can complete the payment flow\n\n**The dynamic nature of the payment_methods**:`payment_methods` type is an array of objects \nand it's type allows it to accommodate an unlimited variety of payment options\nas each object represents a gateway payment option but strictly associated to redirect payment flow\n\n**Backward Compatibility Notice:**\n\n`stc_pay`: \nprevious Inclusion, `stc_pay` was formerly listed within the `payment_methods` array\nit has been removed in favor of a more streamlined integration within the SDK\nsimilar to the approach for `payment_services`.\n\n**Backward Compatibility:** \n\nThe SDK must still support STC Pay for applications relying on older API versions.\nAlthough it will not appear in current and future versions\nthe SDK will manage its inclusion internally\n\nto ensure a seamless transition and consistent user experience\nacross different API versions, without disrupting existing integrations.\n","readOnly":true},"payment_services":{"type":"array","items":{},"description":"Dedicated to singular, prominently featured payment options\n\nsuch as `apple_pay`, `google_pay`, `samsung_pay`, `stc_pay`, etc.,\nthe `payment_services` field presents these methods in a distinctive manner.\n\nUnlike `payment_methods`, payment services are intended to be displayed uniquely,\nTypically represented by dedicated buttons or interfaces within the payment page.\n\nThis ensures that each payment service,\nidentifiable by its unique flow ie: (`apple_pay`, `stc_pay`)\nis presented no more than once to the user\nmaintaining clarity and simplicity in the payment selection process.\n\n**Backward Compatibility Notice**:\nhistorically, the availability of (`apple_pay`, `google_pay`) \nwas indicated through the `apple_pay_available` and `google_pay_available` flags\nat the root level of the API response.\n\nWith the evolution of the API, these flags have been deprecated, \nand the respective payment methods have been integrated into the `payment_services` array.\n\nDespite this restructuring, backward compatibility for these payment methods\nis preserved in the SDK to accommodate previous API versions,\nensuring a seamless transition for existing implementations.\n","readOnly":true},"flex_methods":{"type":"array","items":{},"description":"The `flex_methods` field encompasses a comprehensive array\nof payment options available to customers,\nexplicitly excluding device-specific methods such as `apple_pay`\n`google_pay`, redirect flow `payment_methods` and tokenized card solutions\notherwise it represents the flexible payment methods ie:(`tamara`, `tabby`)\npayment options that necessitate dynamic flows\nwhere SDK might need to fetch some `pre-payment-check` API calls then\nusers are guided to an external webpage to finalize their payment transactions.\n\nIt's important to note that the flex_methods array is dynamic\nand can accommodate an unlimited array of payment methods.\neach method listed should be individually rendered within the user interface with a separated flow.\n","readOnly":true},"response":{"type":"object","additionalProperties":{},"description":"**What is a payment gateway response?**\n\nA payment gateway response is the feedback received\nfrom payment gateway after a user has completed a payment\nthis response provides information on whether the payment was successful or if it was canceled or failed.\n\n**When do we receive the response?**\n\nWe receive the payment gateway response immediately after the user has made a payment\nor after n of minutes defined for a gateway inquiry request initiated by ottu core\nto fetch the transaction status after the defined time for each gateway.\n\n**Which attempt do we get the response for?**\n\nthe response we provide is from the most recent payment attempt.\nthis ensures that the information reflects the latest status of the transaction.\n\n**Structure of the response**: \n\nThe response structure is managed by our SDK,\nwhich updates the payment details and triggers one of three callbacks\nbased on the status provided in the response:\n\n`successCallback`: Triggered if the response.status indicates a successful payment.\n\n`cancelCallback`: Triggered if the response.status indicates a canceled payment.\n\n`errorCallback`: Triggered if the response.status indicates a error payment.\n\n","readOnly":true},"state":{"enum":["created","pending","attempted","authorized","paid","failed","canceled","expired","invalided","refunded","cod"],"type":"string","readOnly":true,"description":"The current state of the payment transaction, it helps to understand the progress of the payment.\n\n* `created` - Created\n* `pending` - Pending\n* `attempted` - Attempted\n* `authorized` - Authorized\n* `paid` - Paid\n* `failed` - Failed\n* `canceled` - Canceled\n* `expired` - Expired\n* `invalided` - Invalided\n* `refunded` - Refunded\n* `cod` - Cash on Delivery"},"type":{"enum":["e_commerce","payment_request"],"type":"string","description":"The type of the payment transaction. This field represents the purpose of the payment and can be one of several pre-defined choices.\n\n* `e_commerce` - Ecommerce\n* `payment_request` - Payment Request"},"is_amount_editable":{"type":"boolean","readOnly":true,"title":"Editable amount","description":"This field specifies whether the customer can modify the payment amount and choose the amount he wishes to pay."},"session_id":{"type":"string","readOnly":true,"description":"A unique identifier for each payment transaction, used to maintain the session state during the payment process."},"cancel_url":{"type":"string","format":"uri","readOnly":true,"description":"This endpoint used to cancel the transaction using the merchant cancellation flow, \nto ensure the transaction cannot be paid again \nand trigger the webhook notification \n"}},"required":["amount","cancel_url","cards","currency_code","flex_methods","is_amount_editable","operation","payment_methods","payment_services","response","session_id","state","type"]}],"readOnly":true,"default":false,"description":"A JSON object containing preloaded data required to initialize the checkout interface.This includes essential details such as customer information, available payment methods.and specific transaction details, all formatted according to the Checkout SDK's initialization specifications.This field streamlines the checkout process by providing necessary information upfront.enhancing user experience and efficiency."},"session_id":{"type":"string","readOnly":true,"description":"A unique identifier for each payment transaction, used to maintain the session state during the payment process."},"settled_pg_code":{"type":"string","readOnly":true,"title":"Final Payment Gateway","description":"The code of the payment gateway used for completing the transaction. This field indicates the specific gateway that processed and settled the payment, providing clarity on which payment service was ultimately utilized for this transaction."},"shipping_excl_tax":{"type":"string","format":"decimal","title":"Shipping Excl. Tax","description":"The cost of shipping for the invoice, excluding taxes."},"shipping_incl_tax":{"type":"string","format":"decimal","title":"Shipping Incl. Tax","description":"The cost of shipping for the invoice, including all applicable taxes."},"shipping_method":{"type":"string","description":"The method or service used for shipping the items associated with the invoice."},"shipping_tax_rate":{"type":"string","format":"decimal","description":"The tax rate applied to the shipping cost, expressed as a percentage. "},"shortify_attachment_url":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to True, the URL of the uploaded attachment will be shortened using a URL shortener service. This should be used when sharing the attachment URL via SMS or WhatsApp."},"shortify_checkout_url":{"type":"boolean","writeOnly":true,"default":false,"description":"If set to True, the checkout URL will be shortened using a URL shortener service. This should be used when sharing the payment URL via SMS or WhatsApp."},"state":{"enum":["created","pending","attempted","authorized","paid","failed","canceled","expired","invalided","refunded","cod"],"type":"string","readOnly":true,"description":"The current state of the payment transaction, it helps to understand the progress of the payment.\n\n* `created` - Created\n* `pending` - Pending\n* `attempted` - Attempted\n* `authorized` - Authorized\n* `paid` - Paid\n* `failed` - Failed\n* `canceled` - Canceled\n* `expired` - Expired\n* `invalided` - Invalided\n* `refunded` - Refunded\n* `cod` - Cash on Delivery"},"status":{"enum":["sent","paid","overdue","canceled"],"type":"string","readOnly":true,"description":"Current status of the invoice. Can be one of the following: `sent`, `paid`, `overdue`, `canceled`.\n\n* `sent` - Sent\n* `paid` - Paid\n* `overdue` - Overdue\n* `canceled` - Canceled"},"subtotal":{"type":"string","format":"decimal","description":"Sum of total_incl_tax's of all invoice items."},"tax_amount":{"type":"string","format":"decimal","description":"The total amount of tax applied to the invoice."},"tax_rate":{"type":"string","format":"decimal","title":"Tax","description":"The tax rate applied to the invoice, expressed as a percentage."},"total_excl_tax":{"type":"string","format":"decimal","title":"Total Excl. Tax","description":"The total amount of the invoice, excluding taxes."},"total_incl_tax":{"type":"string","format":"decimal","title":"Total Incl. Tax","description":"The total amount of the invoice, including all applicable taxes."},"unit_code":{"type":"string","writeOnly":true,"title":"Unit","description":"The slug of the unit to be used for the transaction."},"vendor_name":{"type":"string","description":"The name of the vendor or merchant associated with this payment. This field may be used for accounting and reporting purposes.","maxLength":64},"webhook_url":{"type":"string","format":"uri","description":"URL where the payment result will be sent via a POST request after the customer has completed the payment session. The payment result will be included in the request body. ","maxLength":2000}},"required":["attachment_short_url","checkout_short_url","checkout_url","currency_code","due_date","invoice_id","invoice_items","invoice_number","operation","payment_methods","pg_codes","qr_code_url","sdk_setup_preload_payload","session_id","settled_pg_code","state","status","type"]}}},"description":""},"400":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"field_name":{"type":"array","items":{"type":"string","default":"This field is required."}}}},{"type":"object","properties":{"field_name":{"type":"object","properties":{"field_name":{"type":"array","items":{"type":"string","default":"To use sms notifications provide the `customer_phone` field."}}},"required":["field_name"]}},"required":["field_name"]},{"type":"object","properties":{"detail":{"type":"string"}},"required":["detail"]}]}}},"description":""}}}}},"components":{"securitySchemes":{"SSO_BasicAuth":{"type":"http","scheme":"basic"},"SSO_JWT_Auth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"basicAuth":{"type":"http","scheme":"basic"},"jwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}}}}
```

## [Guide: Step by Step](#guide-step-by-step)

Dive into integrating the `Invoice API` with our concise, step-by-step guide. Designed for seamless adoption into your existing systems, this guide will take you through the essentials of setup and utilization. It's tailored to enhance your invoicing process, ensuring accuracy and efficiency in your financial transactions. Get ready to transform and streamline your billing operations with ease.

The objective of the `POST` request is to facilitate the creation of payment transactions and the subsequent generation of payment links, each of which is associated with a unique [session\_id](../checkout-api#session_id-string-mandatory). These links can be effortlessly shared with customers through various communication channels, including email, WhatsApp, and SMS. Additionally, it is possible to incorporate the customer's [billing](../checkout-api#billing_address-object-optional) and [shipping](../checkout-api#shipping_address-object-optional) information into the transaction. Moreover, users of this API can include diverse forms of data and information within the body request.

#### Creating the Invoice:

#### 1. [Retrieving pg\_codes (optional)](#id-1.-retrieving-pg_codes-optional)

Prior to initiating the initial payment, you can choose to invoke the [Payment Methods API](payment-methods) to obtain the required [pg\_codes](../checkout-api#pg_codes-array-required).

#### 2. [Initiating the Payment via Invoice API](#id-2.-initiating-the-payment-via-invoice-api)

Using a payload as minimal as the one below, you can obtain an invoice.

#### Request

```json
{
   "type":"e_commerce",
   "due_date":"2025-12-29",
   "currency_code":"KWD",
   "pg_codes":[
      "credit-card"
   ],
   "invoice_number":"A00001",
   "invoice_items":[
      {
         "sku":"ABC111",
         "description":"Test",
         "quantity":1.111,
         "unit_price":5.234
      }
   ]
}
```

#### Response

```json
{
   "amount":5.815,
   "checkout_url":"https://sandbox.ottu.net/b/checkout/redirect/start/?session_id=9ba4c834f55f1e5476b9d9ea47ec7b12f61f9511",
   "currency_code":"KWD",
   "due_datetime":"29/12/2025 00:00:00",
   "invoice_id":3,
   "language":"en",
   "operation":"purchase",
   "payment_methods":[
      {
         "code":"credit-card",
         "name":"Credit Card",
         "pg":"Ottu PG",
         "type":"sandbox",
         "amount":"5.815",
         "currency_code":"KWD",
         "fee":"0.000",
         "fee_description":"",
         "icon":"https://sandbox.ottu.net/media/gateway/settings/logos/MASTER_q6sxwtA_md4lBKv.jpeg",
         "flow":"redirect",
         "redirect_url":"https://pg.ottu.dev/checkout/c2FuZGJveC5vdHR1Lm5ldA==/Z0F"
      }
   ],
   "payment_type":"one_off",
   "pg_codes":[
      "credit-card"
   ],
   "session_id":"9ba4c834f55f1e5476b9d9ea47ec7b12f61f9511",
   "state":"created",
   "type":"e_commerce",
   "invoice_number":"A00001",
   "due_date":"2025-12-29",
   "invoice_items":[
      {
         "sku":"ABC111",
         "description":"Test",
         "quantity":1.111,
         "unit_price":5.234,
         "total_excl_tax":5.815,
         "tax_amount":0.0,
         "total_incl_tax":5.815
      }
   ],
   "shortify_checkout_url":false,
   "expiration_time":null,
   "shortify_attachment_url":false,
   "generate_qr_code":false,
   "include_sdk_setup_preload":false,
   "data":{
      "fields":[
         
      ],
      "api_version":"invoice_v1"
   },
   "subtotal":5.815,
   "total_excl_tax":5.815,
   "tax_amount":0.0,
   "shipping_incl_tax":0.0,
   "total_incl_tax":5.815,
   "invoice_pdf_url":"https://e.pay.kn/HWiDBBAQ8WBn"
}
```

The URL for the invoice PDF in the above [response](#response) is:

```json
"invoice_pdf_url":"https://e.pay.kn/HWiDBBAQ8WBn"
```

<figure><img src="https://2847651520-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiUKrMb9zLt5ZzGPUYDsK%2Fuploads%2FRD13ezBTOQ6uwiXUKDg1%2FInvoice%20API%202.png?alt=media&#x26;token=95a250ea-7b65-46aa-813d-f65032f3223f" alt=""><figcaption></figcaption></figure>

Applying a discount percentage of 12 to the `invoice_items` object within the `Invoice API` request payload:

```json
{
   "type":"e_commerce",
   "due_date":"2025-12-29",
   "currency_code":"KWD",
   "pg_codes":[
      "credit-card"
   ],
   "invoice_number":"A00002",
   "invoice_items":[
      {
         "sku":"ABC111",
         "description":"Test",
         "quantity":1.111,
         "unit_price":5.234,
         "discount_percentage":12
      }
   ]
}
```

&#x20;  **Invoice:**

<figure><img src="https://2847651520-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiUKrMb9zLt5ZzGPUYDsK%2Fuploads%2FT0lskcvb4h1a6A1lYGNo%2FInvoice%20API%203.png?alt=media&#x26;token=52e29a78-92a9-48f8-bb89-adaf91e43ca8" alt=""><figcaption></figcaption></figure>

## [Best Practices](#best-practices)

**Understanding Ottu's Invoice API:** Ottu's `Invoice API` automates invoice generation, saving time and reducing errors for both online and walk-in customers. Please check [Invoice Generation Logic](#invoice-generation-logic).

**Prerequisites for Integration:** Ensure a **Purchase** [Payment Gateway](../user-guide/payment-gateway) and understand Ottu's[ rounding function](#how-round-funtion-works). Optionally explore the [Payment Methods API](payment-methods) for dynamic updates.

**Authentication Best Practices:** Use [Private API Key](../authentication#private-key-api-key) or [Basic Authentication](../authentication#basic-authentication). Regularly rotate `API keys` for security.

**Updating Invoice:** Invoice is immutable; create a new one for updates.

**VAL CALC Fields:** [VAL CALC](#what-do-the-calculated-values-encompass) fields ensure accurate figures, like Tax Amount and Shipping Including Tax.

**Documentation References:** Refer to Ottu's OpenAPI[ schema](#b-invoice-v1-invoice) for technical details.

**Technical Implementation Guide:** Follow Ottu's [step-by-step guide](#guide-step-by-step) for a seamless integration.

## [Invoice Generation Logic](#invoice-generation-logic)

The Invoice Generation Logic is a critical component of Ottu's invoicing system, designed to ensure precision, accuracy, and consistency in financial transactions. At the core of this logic is the utilization of the `round` function. For more information about round function, please check [here](#how-round-funtion-works).&#x20;

### [**Key Steps in Invoice Generation**](#key-steps-in-invoice-generation)

The invoice generation process involves two levels: the invoice items level and the invoice level. The logic begins at the invoice items level and progresses through a series of calculations, incorporating discounts, taxes, and total values. The results are then aggregated at the invoice level to derive a comprehensive view of the entire transaction

#### **Invoice Items Level:**

1. Calculate `quantity_price`: round(`quantity` \* `unit_price`)
2. Calculate the discount on the item:
   * If both `discount_percentage` and `discount_amount` are present, throw an error message.
   * If only `discount_percentage` is present, calculate the total discount for this item: `total_discount` = (`quantity_price` \* `discount_percentage`/100).
   * If only `discount_amount` is present, ensure it is not more than `quantity_price` and store it in `total_discount`.
   * `total_discount` = round(`total_discount`) for proper number handling.
3. Calculate total values:
   * `total_excl_tax` = round(`quantity_price` - `total_discount`)
   * `total_excl_tax`: `VAL CALC`: If provided in the payload, check for discrepancies.
   * `tax_amount` = round(`total_excl_tax` \* `tax_rate` / 100)
   * `tax_amount`: `VAL CALC`
   * `total_incl_tax` = round(`total_excl_tax` + `tax_amount`)
   * `total_incl_tax`: `VAL CALC`
4. Store results for use on the Invoice level.

#### **Invoice Level:**

1. Calculate subtotal by:
   * `subtotal = 0`
   * Loop over items: `subtotal` = round(`subtotal` + `item.total_incl_tax`)
   * `subtotal`: `VAL CALC`
2. Calculate the discount on the invoice:
   * If both `discount_percentage` and `discount_amount` are present, throw an error message.
   * If only `discount_percentage` is present, calculate the total discount for the invoice: `total_discount` = (`subtotal` \* `discount_percentage`/100).
   * If only `discount_amount` is present, ensure it is not more than the `subtotal` and store it in `total_discount`.
   * `total_discount` = round(`total_discount`) for proper number handling.
3. Calculate total values:
   * `total_excl_tax` = round(`subtotal` - `total_discount`)
   * `total_excl_tax`: `VAL CALC`: If provided in the payload, check for discrepancies.
   * `tax_amount` = round(`total_excl_tax` \* `tax_rate` / 100)
   * `tax_amount`: `VAL CALC`
   * `shipping_tax` = round(`shipping_excl_tax` \* `shipping_tax_rate` / 100)
   * `shipping_incl_tax` = round(`shipping_excl_tax` + `shipping_tax`)
   * `shipping_incl_tax`: `VAL CALC`
   * `total_incl_tax` = round(`total_excl_tax` + `tax_amount` + `shipping_incl_tax`)
   * `total_incl_tax`: `VAL CALC`
   * `amount` = `total_incl_tax`
   * `amount`: `VAL CALC`: The `amount` field is not mandatory, but if included, it serves as a verification measure. It acts as a final check to ensure that the total amount calculated on the frontend aligns with the amount the endpoint will use for the invoice creation. Any mismatch halts the process to prevent inconsistencies.

## [FAQ](#faq)

#### :digit\_one: [**What is Ottu's Invoice API?**](#what-is-ottus-invoice-api)

Ottu's `Invoice API` is a tool provided by Ottu for businesses and developers to integrate invoice functionality into their systems. It automates the process of invoice generation, making it efficient for both online and walk-in customers.&#x20;

#### :digit\_two: [**Why should I use Ottu's Invoice API?**](#why-should-i-use-ottus-invoice-api)

Ottu's `Invoice API` automates the invoicing process, saving time and reducing errors associated with manual creation. It provides a seamless experience for customers and merchants, ensuring timely communication and streamlined payment collection.

#### :digit\_three: [**What are the prerequisites for integrating with Ottu's Invoice API?**](#what-are-the-prerequisites-for-integrating-with-ottus-invoice-api)

Before integration, ensure you have a **Purchase** [Payment Gateway](../user-guide/payment-gateway), understand the [round](#how-round-funtion-works) function, and optionally explore the [Payment Methods API](payment-methods). For more information, please refer to [Setup](#setup).

#### :digit\_four: [**Can I skip using the Payment Methods API?**](#can-i-skip-using-the-payment-methods-api)

Yes, if you are familiar with a specific `pg_code`, you can skip using the[ Payment Methods API](payment-methods). However, using it ensures you stay informed about recent payment gateways and configurations, enhancing adaptability.

#### :digit\_five: [**How do I handle authentication and permissions for Ottu's Invoice API?**](#how-do-i-handle-authentication-and-permissions-for-ottus-invoice-api)

[Authentication](#authentication) can be done using [Private API Key](../authentication#private-key-api-key) or [Basic Authentication](../authentication#basic-authentication). For more information please refer to [Permissions](#permissions) section.

#### :digit\_six: [**What are VAL CALC fields in the Invoice API?**](#what-are-val-calc-fields-in-the-invoice-api)

They are optional and fields associated with the calculation of prices in an invoice. They play a crucial role in displaying accurate figures during the invoice creation process, such as `Tax Amount` and `Shipping Including Tax`. For more information, please check [here](#how-round-funtion-works).

#### :digit\_seven: [**Can I modify an invoice after creation?**](#can-i-modify-an-invoice-after-creation)

No, Ottu's `Invoice API` does not support the PATCH method. Once an invoice is created, it is immutable and cannot be modified. Any updates require creating a new invoice.

#### :digit\_eight: [**How does Ottu calculate totals and taxes in the invoice?**](#how-does-ottu-calculate-totals-and-taxes-in-the-invoice)

Ottu uses a specific logic for calculating totals and taxes at both the item and invoice levels. Details are provided in the [Invoice Generation Logic](#invoice-generation-logic) section of the documentation.

#### :digit\_nine: [**Where can I find more technical details and implementation specifics?**](#where-can-i-find-more-technical-details-and-implementation-specifics)

For detailed technical understanding and implementation specifics, refer to Ottu's OpenAPI schema in the API Schema Reference section of the documentation.

**To conclude,** Ottu's `Invoice API` presents a powerful tool for businesses and developers, offering a seamless and automated solution for invoice generation. With a focus on user-friendly integration, the API streamlines the invoicing process, providing flexibility and customization for merchants. The comprehensive features, including detailed invoice information and generation logic, ensure accuracy and efficiency. Ottu's `Invoice API` stands as a valuable asset for those seeking to enhance their invoicing workflows, providing a reliable and advanced solution for a diverse range of businesses.
