Test

Check Status-Inquiry

post

The Check Status-Inquiry endpoint is part of our Payment Gateway API. It's designed for checking the status of a specific payment transaction. This endpoint is particularly useful when notifications about a transaction status change haven't been received. It acts as a manual check for confirming the payment status, mirroring the structure of a payment webhook notification.

The Inquiry operation can only be triggered for payment transactions in the pending, attempted, failed, or expired states. If the transaction state is already paid or authorized, the response is returned immediately without re-confirming it with third-party Payment Gateways (PGs). However, if the system isn't up to date and the transaction state is still in one of the mentioned states, Ottu will trigger an API call to the PG to update the transaction state. If multiple payment options were attempted using different PGs, all PGs supporting payment status checks will be called, ensuring the merchant receives the most updated status of the payment.

This endpoint uses a throttling mechanism to prevent potential system abuse. Throttling rules are as follows:

  1. Initial Grace Period (10 minutes): If the Inquiry endpoint is called within 10 minutes from when the payment transaction is created, the request will be throttled.

  2. First Request: Once the initial grace period has passed, the first request is allowed. Subsequent requests for the same transaction within the next 30 minutes will be throttled.

  3. Second Request: After the end of the first throttle period, a second request is permitted. Further requests for the same transaction within another 30 minutes from the second request are throttled.

  4. Subsequent Requests: If the number of requests for the same transaction exceeds three within the overall time frame, any further requests are denied.

Note: The above rules are applied per transaction. Additionally, the endpoint allows a maximum of 30 requests per minute across all transactions.

It's mandatory to provide at least one of the identifiers (session_id or order_no).

Authorizations
Header parameters
AuthorizationstringRequired

Private API key to be provided in the format Api-Key <key>.

Default: Api-Key vSUmxsXx.V81oYvOWFMcIywaOu57Utx6VSCmG11lo
Body

This serializer is used to validate the lookup fields for the inquiry operation.

order_nostring · max: 128Optional

This is an optional identifier used to specify the payment transaction upon which the operation should be performed. You can use either the order_no or session_id field; at least one of these two identifiers must be provided to select the payment transaction that should be actioned.

session_idstring · max: 128Optional

Similar to order_no, session_id is an optional identifier used to specify the payment transaction for the operation. You must provide either order_no or session_id in order to select the appropriate payment transaction.

Responses
200Success
application/json
post
/b/pbl/v2/inquiry/
POST /b/pbl/v2/inquiry/ HTTP/1.1
Host: localhost:9001
Authorization: Api-Key vSUmxsXx.V81oYvOWFMcIywaOu57Utx6VSCmG11lo
Content-Type: application/json
Accept: */*
Content-Length: 39

{
  "order_no": "text",
  "session_id": "text"
}
{
  "pg_params": {
    "auth_code": null,
    "card_type": null,
    "card_holder": null,
    "cardholder_email": null,
    "card_expiry_month": null,
    "card_expiry_year": null,
    "full_card_expiry": null,
    "card_number": null,
    "card_issuer": null,
    "ref": null,
    "result": null,
    "track_id": null,
    "post_date": null,
    "transaction_id": null,
    "payment_id": null,
    "pg_message": null,
    "receipt_no": null,
    "transaction_no": null,
    "decision": null,
    "card_expiry": null,
    "card_details": null,
    "dcc_payer_amount": null,
    "dcc_payer_currency": null,
    "dcc_payer_exchange_rate": null,
    "rrn": null
  },
  "agreement": {
    "id": "text",
    "amount_variability": "fixed",
    "start_date": "2025-11-05",
    "expiry_date": "2025-11-05",
    "max_amount_per_cycle": "text",
    "cycle_interval_days": 1,
    "total_cycles": 1,
    "frequency": "irregular",
    "type": "recurring",
    "seller": {
      "name": "text",
      "short_name": "text",
      "category_code": "text"
    }
  },
  "amount": "text",
  "amount_details": {
    "currency_code": "text",
    "amount": "text",
    "total": "text",
    "fee": "text",
    "exchange_rate": "text"
  },
  "capture_delivery_address": true,
  "capture_delivery_location": true,
  "card_acceptance_criteria": {
    "min_expiry_time": 1
  },
  "currency_code": "text",
  "customer_address_city": "text",
  "customer_address_country": "text",
  "customer_address_line1": "text",
  "customer_address_line2": "text",
  "customer_birthdate": null,
  "customer_address_postal_code": "text",
  "customer_address_state": "text",
  "customer_email": "text",
  "customer_first_name": "text",
  "customer_id": "text",
  "customer_last_name": "text",
  "customer_phone": "text",
  "extra": null,
  "fee": "text",
  "gateway_account": "text",
  "gateway_name": "text",
  "gateway_response": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "initiator": {
    "id": 1,
    "first_name": "text",
    "last_name": "text",
    "username": "text",
    "email": "name@gmail.com",
    "phone": "text"
  },
  "is_sandbox": true,
  "message": "text",
  "order_no": null,
  "paid_amount": 1,
  "payment_type": "one_off",
  "reference_number": "text",
  "refunded_amount": 1,
  "remaining_amount": 1,
  "result": "pending",
  "session_id": "text",
  "settled_amount": 1,
  "signature": "text",
  "state": "text",
  "token": {
    "brand": null,
    "customer_id": "text",
    "cvv_required": true,
    "expiry_month": "text",
    "expiry_year": "text",
    "is_expired": true,
    "is_preferred": true,
    "name_on_card": null,
    "number": null,
    "pg_code": "text",
    "pg_name": "knet",
    "token": "text",
    "agreements": null
  },
  "transaction_log_id": null,
  "timestamp_utc": "2025-11-05T23:46:41.328Z",
  "transactions": [
    {
      "amount": "text",
      "currency_code": "text",
      "order_no": null,
      "session_id": "text",
      "state": "paid"
    }
  ],
  "voided_amount": 1
}

Auto debit endpoint for auto debit payment flow

post

This endpoint will take a session id and check for it's related payment if it's possible to be auto charged or not. if possible it will charge the payment and return the operation response. 📝 NOTE Optional fields may not be represented in response body.

Authorizations
Header parameters
AuthorizationstringRequired

Private API key to be provided in the format Api-Key <key>.

Default: Api-Key vSUmxsXx.V81oYvOWFMcIywaOu57Utx6VSCmG11lo
Body

Auto debit serializer should take session_id and consumer payment token then validate if session id is valid if session id is valid then validate if payment gateway supports auto debit if payment gateway supports auto debit then validate if payment gateway has implemented auto debit if payment gateway has implemented auto debit then charge the token and return charge response from client auto_debit method which should be implemented in client

session_idstring · max: 128Required

A unique identifier for each payment transaction, used to maintain the session state during the payment process.

tokenstringRequired

Use this field to provide the unique identifier of a saved customer card for processing a payment in the API request.

Responses
200Success
application/json
post
/b/pbl/v2/auto-debit/
POST /b/pbl/v2/auto-debit/ HTTP/1.1
Host: localhost:9001
Authorization: Api-Key vSUmxsXx.V81oYvOWFMcIywaOu57Utx6VSCmG11lo
Content-Type: application/json
Accept: */*
Content-Length: 36

{
  "session_id": "text",
  "token": "text"
}
{
  "pg_params": {
    "auth_code": null,
    "card_type": null,
    "card_holder": null,
    "cardholder_email": null,
    "card_expiry_month": null,
    "card_expiry_year": null,
    "full_card_expiry": null,
    "card_number": null,
    "card_issuer": null,
    "ref": null,
    "result": null,
    "track_id": null,
    "post_date": null,
    "transaction_id": null,
    "payment_id": null,
    "pg_message": null,
    "receipt_no": null,
    "transaction_no": null,
    "decision": null,
    "card_expiry": null,
    "card_details": null,
    "dcc_payer_amount": null,
    "dcc_payer_currency": null,
    "dcc_payer_exchange_rate": null,
    "rrn": null
  },
  "agreement": {
    "id": "text",
    "amount_variability": "fixed",
    "start_date": "2025-11-05",
    "expiry_date": "2025-11-05",
    "max_amount_per_cycle": "text",
    "cycle_interval_days": 1,
    "total_cycles": 1,
    "frequency": "irregular",
    "type": "recurring",
    "seller": {
      "name": "text",
      "short_name": "text",
      "category_code": "text"
    }
  },
  "amount": "text",
  "amount_details": {
    "currency_code": "text",
    "amount": "text",
    "total": "text",
    "fee": "text",
    "exchange_rate": "text"
  },
  "capture_delivery_address": true,
  "capture_delivery_location": true,
  "card_acceptance_criteria": {
    "min_expiry_time": 1
  },
  "currency_code": "text",
  "customer_address_city": "text",
  "customer_address_country": "text",
  "customer_address_line1": "text",
  "customer_address_line2": "text",
  "customer_birthdate": null,
  "customer_address_postal_code": "text",
  "customer_address_state": "text",
  "customer_email": "text",
  "customer_first_name": "text",
  "customer_id": "text",
  "customer_last_name": "text",
  "customer_phone": "text",
  "extra": null,
  "fee": "text",
  "gateway_account": "text",
  "gateway_name": "text",
  "gateway_response": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "initiator": {
    "id": 1,
    "first_name": "text",
    "last_name": "text",
    "username": "text",
    "email": "name@gmail.com",
    "phone": "text"
  },
  "is_sandbox": true,
  "message": "text",
  "order_no": null,
  "paid_amount": 1,
  "payment_type": "one_off",
  "reference_number": "text",
  "refunded_amount": 1,
  "remaining_amount": 1,
  "result": "pending",
  "session_id": "text",
  "settled_amount": 1,
  "signature": "text",
  "state": "text",
  "token": {
    "brand": null,
    "customer_id": "text",
    "cvv_required": true,
    "expiry_month": "text",
    "expiry_year": "text",
    "is_expired": true,
    "is_preferred": true,
    "name_on_card": null,
    "number": null,
    "pg_code": "text",
    "pg_name": "knet",
    "token": "text",
    "agreements": null
  },
  "transaction_log_id": null,
  "timestamp_utc": "2025-11-05T23:46:41.328Z",
  "transactions": [
    {
      "amount": "text",
      "currency_code": "text",
      "order_no": null,
      "session_id": "text",
      "state": "paid"
    }
  ],
  "voided_amount": 1
}

Create a new Payment Transaction

post

Create a new Payment Transaction

Authorizations
Header parameters
AuthorizationstringRequired

Private API key to be provided in the format Api-Key <key>.

Default: Api-Key vSUmxsXx.V81oYvOWFMcIywaOu57Utx6VSCmG11lo
Body

Serializer to work with PaymentTransaction instances.

Also uses request data from other serializers to save into PaymentTransaction db table:

amountstring · decimalRequired

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

currency_codestringRequired

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.

pg_codesstring[]Required

The list of payment gateway codes from which a customer can select to perform the payment or authorization.

typestring · enumRequired

The type of the payment transaction. This field represents the purpose of the payment and can be one of several pre-defined choices.

  • e_commerce - Ecommerce
  • payment_request - Payment Request
Possible values:
agreementall ofOptional

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.

Note: 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.

attachmentstring · uriOptional

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_urlstring · uriRead-onlyRequired

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_urlstringOptional

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)$
billingstringRead-onlyRequired

Detailed billing information including formatted amounts for display and raw values for processing. Contains both the total transaction amount and any applicable fees with their respective currency codes and labels.

card_acceptance_criteriaall ofOptional

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.

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.

Note: The card_acceptance_criteria field is applicable only for direct payments and not for hosted session payments.

checkout_short_urlstring · uriRead-onlyRequired

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_urlstring · uriRead-onlyRequired

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.

customer_birthdatestring · dateOptional

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_emailstring · email · max: 128Optional

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.

customer_first_namestring · max: 64Optional

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.

customer_idstring · max: 64Optional

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.

customer_last_namestring · max: 64Optional

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.

customer_phonestring · max: 16Optional

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.

customer_phone_2string · max: 16Optional

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.

due_datetimestring · date-timeOptional

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_recipientsstring · email[]Optional

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_timestringOptional

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.

extraall ofOptional

The extra information for the payment details, which the merchant has sent it in key value form.

generate_qr_codebooleanWrite-onlyOptional

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.

Default: false
include_sdk_setup_preloadbooleanWrite-onlyOptional

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.

Default: false
initiator_idintegerOptional

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

languagestring · enumOptional

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.

  • en - English
  • ar - Arabic
Default: enPossible values:
notificationsall ofOptional

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.

operationstringRead-onlyRequired

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_nostring · max: 128Optional

The unique identifier assigned to this payment transaction. It is used for tracking purposes and is set by the merchant or the system.

payment_instrumentone ofOptional
or
or
or
payment_methodsall ofRead-onlyRequired

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_typestring · enumOptional

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.

Choose save_card if you want to perform a card tokenization operation.

NOTE: If auto_debit is selected:

  1. agreement and customer_id parameters will also be mandatory.
  2. Only PG codes supporting tokenization can be selected. As 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.

NOTE: If save_card is selected:

  1. The amount must be zero for the save card operation.
  2. The selected MID(pg_code) must support tokenization to enable the save card operation.
  3. Please note that the save card operation is considered successful without any funds being charged.
  4. Once a card is created, Ottu will send a webhook containing the card details to the merchant's webhook URL.
  5. 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.
  • one_off - One Off
  • auto_debit - Auto Debit
  • save_card - Save Card
Default: one_offPossible values:
product_typestring · max: 128Optional

The type of product or service being purchased. This field may be used for tracking and reporting purposes.

qr_code_urlstring · uriRead-onlyRequired

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_urlstring · uri · max: 2000Optional

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.

sdk_setup_preload_payloadall ofRead-onlyRequired

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.

Default: false
session_idstringRead-onlyRequired

A unique identifier for each payment transaction, used to maintain the session state during the payment process.

settled_pg_codestringRead-onlyRequired

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.

shortify_attachment_urlbooleanWrite-onlyOptional

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.

Default: false
shortify_checkout_urlbooleanWrite-onlyOptional

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.

Default: false
statestring · enumRead-onlyRequired

The current state of the payment transaction, it helps to understand the progress of the payment.

  • created - Created
  • pending - Pending
  • attempted - Attempted
  • authorized - Authorized
  • paid - Paid
  • failed - Failed
  • canceled - Canceled
  • expired - Expired
  • invalided - Invalided
  • refunded - Refunded
  • cod - Cash on Delivery
Possible values:
unit_codestringWrite-onlyOptional

The slug of the unit to be used for the transaction.

vendor_namestring · max: 64Optional

The name of the vendor or merchant associated with this payment. This field may be used for accounting and reporting purposes.

webhook_urlstring · uri · max: 2000Optional

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.

Responses
201Success
application/json
Responseone of
or
post
/b/checkout/v1/pymt-txn/
POST /b/checkout/v1/pymt-txn/ HTTP/1.1
Host: localhost:9001
Authorization: Api-Key vSUmxsXx.V81oYvOWFMcIywaOu57Utx6VSCmG11lo
Content-Type: application/json
Accept: */*
Content-Length: 2186

{
  "amount": "text",
  "currency_code": "text",
  "pg_codes": [
    "text"
  ],
  "type": "e_commerce",
  "billing_address": {
    "line1": "text",
    "line2": "text",
    "city": "text",
    "state": "text",
    "country": "AF",
    "postal_code": "text"
  },
  "shipping_address": {
    "line1": "text",
    "line2": "text",
    "city": "text",
    "state": "text",
    "country": "AF",
    "postal_code": "text",
    "first_name": "text",
    "last_name": "text",
    "email": "name@gmail.com",
    "phone": "text"
  },
  "agreement": {
    "id": "text",
    "amount_variability": "fixed",
    "start_date": "2025-11-05",
    "expiry_date": "2025-11-05",
    "max_amount_per_cycle": "text",
    "cycle_interval_days": 1,
    "total_cycles": 1,
    "frequency": "irregular",
    "type": "recurring",
    "seller": {
      "name": "text",
      "short_name": "text",
      "category_code": "text"
    }
  },
  "attachment": "https://example.com",
  "attachment_upload_url": "text",
  "card_acceptance_criteria": {
    "min_expiry_time": 1
  },
  "customer_birthdate": "2025-11-05",
  "customer_email": "name@gmail.com",
  "customer_first_name": "text",
  "customer_id": "text",
  "customer_last_name": "text",
  "customer_phone": "text",
  "customer_phone_2": "text",
  "due_datetime": "2025-11-05T23:46:41.328Z",
  "email_recipients": [
    "name@gmail.com"
  ],
  "expiration_time": "text",
  "extra": {
    "property_name_en": "text",
    "tenant_name_en": "text",
    "unit_number": "text",
    "contract_number": "text",
    "contract_amount": "text",
    "payment_month": "text",
    "payment_year": "text",
    "student_name": "text",
    "tshirt_size_345678": "text",
    "description": "text",
    "full_name": "text",
    "country": "text",
    "adm": "text",
    "user": "fawaz",
    "what_kind_of_cake": "cheese cake ",
    "gender": "text"
  },
  "generate_qr_code": false,
  "include_sdk_setup_preload": false,
  "initiator_id": 1,
  "language": "en",
  "notifications": {
    "email": [
      "created"
    ],
    "sms": [
      "created"
    ],
    "whatsapp": [
      "created"
    ]
  },
  "order_no": "text",
  "payment_instrument": {
    "instrument_type": "apple_pay",
    "payload": {
      "paymentData": {
        "version": "text",
        "data": "text",
        "signature": "text",
        "header": {
          "ephemeralPublicKey": "text",
          "publicKeyHash": "text",
          "transactionId": "text"
        }
      },
      "paymentMethod": {
        "displayName": "text",
        "network": "text",
        "type": "text"
      },
      "transactionIdentifier": "text"
    }
  },
  "payment_type": "one_off",
  "product_type": "text",
  "redirect_url": "https://example.com",
  "shortify_attachment_url": false,
  "shortify_checkout_url": false,
  "unit_code": "text",
  "vendor_name": "text",
  "webhook_url": "https://example.com"
}
{
  "amount": "text",
  "currency_code": "text",
  "pg_codes": [
    "text"
  ],
  "type": "e_commerce",
  "billing_address": {
    "line1": "text",
    "line2": "text",
    "city": "text",
    "state": "text",
    "country": "AF",
    "postal_code": "text"
  },
  "shipping_address": {
    "line1": "text",
    "line2": "text",
    "city": "text",
    "state": "text",
    "country": "AF",
    "postal_code": "text",
    "first_name": "text",
    "last_name": "text",
    "email": "name@gmail.com",
    "phone": "text"
  },
  "agreement": {
    "id": "text",
    "amount_variability": "fixed",
    "start_date": "2025-11-05",
    "expiry_date": "2025-11-05",
    "max_amount_per_cycle": "text",
    "cycle_interval_days": 1,
    "total_cycles": 1,
    "frequency": "irregular",
    "type": "recurring",
    "seller": {
      "name": "text",
      "short_name": "text",
      "category_code": "text"
    }
  },
  "attachment": "https://example.com",
  "attachment_short_url": "https://example.com",
  "attachment_upload_url": "text",
  "billing": "text",
  "card_acceptance_criteria": {
    "min_expiry_time": 1
  },
  "checkout_short_url": "https://example.com",
  "checkout_url": "https://example.com",
  "customer_birthdate": "2025-11-05",
  "customer_email": "name@gmail.com",
  "customer_first_name": "text",
  "customer_id": "text",
  "customer_last_name": "text",
  "customer_phone": "text",
  "customer_phone_2": "text",
  "due_datetime": "2025-11-05T23:46:41.328Z",
  "email_recipients": [
    "name@gmail.com"
  ],
  "expiration_time": "text",
  "extra": {
    "property_name_en": "text",
    "tenant_name_en": "text",
    "unit_number": "text",
    "contract_number": "text",
    "contract_amount": "text",
    "payment_month": "text",
    "payment_year": "text",
    "student_name": "text",
    "tshirt_size_345678": "text",
    "description": "text",
    "full_name": "text",
    "country": "text",
    "adm": "text",
    "user": "fawaz",
    "what_kind_of_cake": "cheese cake ",
    "gender": "text"
  },
  "initiator_id": 1,
  "language": "en",
  "notifications": {
    "email": [
      "created"
    ],
    "sms": [
      "created"
    ],
    "whatsapp": [
      "created"
    ]
  },
  "operation": "text",
  "order_no": "text",
  "payment_instrument": {
    "instrument_type": "apple_pay",
    "payload": {
      "paymentData": {
        "version": "text",
        "data": "text",
        "signature": "text",
        "header": {
          "ephemeralPublicKey": "text",
          "publicKeyHash": "text",
          "transactionId": "text"
        }
      },
      "paymentMethod": {
        "displayName": "text",
        "network": "text",
        "type": "text"
      },
      "transactionIdentifier": "text"
    }
  },
  "payment_methods": {
    "code": "text",
    "name": "text",
    "type": "e_commerce",
    "amount": "text",
    "currency_code": "text",
    "fee": "text",
    "fee_description": "text",
    "icon": "https://example.com",
    "icons": {
      "webp": "https://example.com",
      "svg": "https://example.com"
    },
    "pg_icons": {
      "svg": null,
      "webp": "text",
      "label": "text"
    },
    "flow": "redirect",
    "redirect_url": null
  },
  "payment_type": "one_off",
  "product_type": "text",
  "qr_code_url": "https://example.com",
  "redirect_url": "https://example.com",
  "sdk_setup_preload_payload": false,
  "session_id": "text",
  "settled_pg_code": "text",
  "state": "created",
  "vendor_name": "text",
  "webhook_url": "https://example.com"
}

Operations

post

The Payment Operations API provides an interface to manage your payment transactions beyond their initial creation. It allows for several operations including refund, capture, void, and others, directly syncing with the Payment Gateway (PG) for certain actions to ensure consistency across systems.

Two key identifiers, order_no and session_id, can be used interchangeably to specify the payment transaction that the operation should be applied to.

For operations such as refund and capture, you can optionally define the amount to be actioned. If not provided, the API will attempt to perform the operation on the full amount, or the remaining amount if previous operations were conducted. However, note that for void, the operation always applies to the full amount, ignoring the amount value if provided.

This API also allows you to perform certain operations solely at the Ottu system level, providing increased control over your payment transactions.

For every operation, the API provides a clear response containing information about the executed operation, a user-friendly message (detail), and the operation's result (success indicates a successful operation).

Authorizations
Header parameters
AuthorizationstringRequired

Private API key to be provided in the format Api-Key <key>.

Example: {"value":"Api-Key 3qlYBXmi.9LlNUa1B7JurCR49tsqcmg785V0k46cV\n","summary":"Example API Key"}
Tracking-KeystringOptional

The Tracking-Key is a unique identifier provided by the merchant for each operation request.

It is crucial for ensuring the distinctiveness of each operation.

When initiating an operation, this key is stored alongside other transaction details in the database.

It serves as a reference for future status queries.

Enabling the retrieval of the latest status information for a specific operation.

Ensure that each Tracking-Key is distinct to prevent ambiguities in operation tracking and status updates.

Default: Tracking-Key: your_operation_tracking_key
Body

Fetch the payment txn based on the order no or session id also, if the payment txn is not in the accepted state for the input operation, raise an error

order_nostring · min: 1 · max: 128Optional

This is an optional identifier used to specify the payment transaction upon which the operation should be performed. You can use either the order_no or session_id field; at least one of these two identifiers must be provided to select the payment transaction that should be actioned.

session_idstring · min: 1 · max: 128Optional

Similar to order_no, session_id is an optional identifier used to specify the payment transaction for the operation. You must provide either order_no or session_id in order to select the appropriate payment transaction.

operationstring · enumRequired
  • delete - delete
  • cancel - cancel
  • expire - expire
  • refund - refund
  • capture - capture
  • void - void
Possible values:
amountstring · decimalOptional

This field is optional and used to specify the amount you want to action for refund and capture operations. If not specified, Ottu will attempt to perform the operation on the full amount, or the remaining amount if previous operations have been performed. Keep in mind that void operations always concern the full amount; the amount field is not considered in this case. The amount field can be sent for all operations, but it will only be taken into account for refund and capture operations.

Pattern: ^-?\d{0,13}(?:\.\d{0,3})?$
Responses
200Success
application/json
Responseone of
or
post
/b/pbl/v2/operation/
POST /b/pbl/v2/operation/ HTTP/1.1
Host: ksa.ottu.dev
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 61

{
  "session_id": "<add `session_id` here>",
  "operation": "expire"
}
{
  "detail": "text",
  "operation": "refund",
  "result": "success"
}

Retrieve a list of payment methods based on filter values.

post

This endpoint allows you to retrieve the available payment methods for a specific plugin, operation and customer. You can specify the desired filter field to get a list of payment methods that are supported and accessible.

Authorizations
Body
pluginstring · min: 1 · max: 50Required

Payment methods will be curated based on their compatibility with the specified plugin.

customer_idstring · min: 1 · max: 64Optional

If provided, customer_payment_methods will be filtered to show only those payment methods that have been successfully used with a paid payment attempts by this customer in the past.

operationall ofOptional

When specified, the available payment methods will be refined based on their compatibility with the indicated operation.

  • purchase - purchase
  • authorize - authorize
string · enumOptional
  • purchase - purchase
  • authorize - authorize
Possible values:
tokenizablebooleanOptional

If defined, payment methods will be filtered based on supporting tokenization and auto-debit action.

typeall ofOptional

When specified, the available payment methods will be refined based on their type determining if type is sandbox or production.

  • sandbox - sandbox
  • production - production
string · enumOptional
  • sandbox - sandbox
  • production - production
Possible values:
Responses
200Success
application/json
post
/b/pbl/v2/payment-methods/
POST /b/pbl/v2/payment-methods/ HTTP/1.1
Host: ksa.ottu.dev
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 127

{
  "plugin": "text",
  "currencies": [],
  "customer_id": "text",
  "operation": "purchase",
  "tokenizable": true,
  "pg_names": [],
  "type": "sandbox"
}
{
  "customer_payment_methods": [],
  "payment_methods": [
    {
      "code": "text",
      "name": "text",
      "pg": "text",
      "is_sandbox": true,
      "logo": "https://example.com",
      "wallets": [],
      "default_currency": "KWD",
      "accepted_currencies": [],
      "operation": "text",
      "operations": [],
      "is_tokenizable": true
    }
  ]
}

Last updated