{
  "swagger": "2.0",
  "info": {
    "title": "Payli Merchants API",
    "version": "v1",
    "description": "Payli Merchants API"
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/merchant/api/v1/balances": {
      "get": {
        "operationId": "LedgerMerchants_ListBalances",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/merchantsListBalancesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        }
      }
    },
    "/merchant/api/v1/catalog": {
      "get": {
        "operationId": "LedgerMerchants_GetMarketCatalog",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/merchantsGetMarketCatalogResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        }
      }
    },
    "/merchant/api/v1/payins/authorize-otp": {
      "post": {
        "operationId": "LedgerMerchants_AuthorizeOtp",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/merchantsAuthorizeOtpResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/merchantsAuthorizeOtpRequest"
            }
          }
        ]
      }
    },
    "/merchant/api/v1/payins/banks": {
      "get": {
        "operationId": "LedgerMerchants_ListPayInBanks",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/merchantsListPayInBanksResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "paymentMethod",
            "description": " - PAYMENT_METHOD_CARD: temporary not supported for pay in and payout\n - PAYMENT_METHOD_BANK_ACCOUNT: pay with bank and payout to bank account\navailable for pay in and payout\n - PAYMENT_METHOD_BANK_TRANSFER: available for pay in\n - PAYMENT_METHOD_MOBILE_MONEY: available for pay in and payout\n - PAYMENT_METHOD_TEST: payment method for testing purposes\navailable only in test environments",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "PAYMENT_METHOD_UNSPECIFIED",
              "PAYMENT_METHOD_CARD",
              "PAYMENT_METHOD_BANK_ACCOUNT",
              "PAYMENT_METHOD_BANK_TRANSFER",
              "PAYMENT_METHOD_MOBILE_MONEY",
              "PAYMENT_METHOD_TEST"
            ],
            "default": "PAYMENT_METHOD_UNSPECIFIED"
          },
          {
            "name": "countryCode",
            "description": "ISO 3166-1 alpha-2 country code of the payment market, for example NG, KE, GM, MW.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "trafficVertical",
            "description": "Vertical of merchant traffic.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "TRAFFIC_VERTICAL_UNSPECIFIED",
              "TRAFFIC_VERTICAL_GAMBLING",
              "TRAFFIC_VERTICAL_FOREX",
              "TRAFFIC_VERTICAL_OTHER"
            ],
            "default": "TRAFFIC_VERTICAL_UNSPECIFIED"
          },
          {
            "name": "customerSegment",
            "description": "Customer segment.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "CUSTOMER_SEGMENT_UNSPECIFIED",
              "CUSTOMER_SEGMENT_FTD",
              "CUSTOMER_SEGMENT_TRUSTED",
              "CUSTOMER_SEGMENT_VIP"
            ],
            "default": "CUSTOMER_SEGMENT_UNSPECIFIED"
          }
        ]
      }
    },
    "/merchant/api/v1/payins/create": {
      "post": {
        "summary": "h2h",
        "operationId": "LedgerMerchants_CreatePayInOrder",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/merchantsCreatePayInOrderResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/merchantsCreatePayInOrderRequest"
            }
          }
        ]
      }
    },
    "/merchant/api/v1/payins/initialize": {
      "post": {
        "summary": "h2p",
        "operationId": "LedgerMerchants_InitializePayInOrder",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/merchantsInitializePayInResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/merchantsInitializePayInRequest"
            }
          }
        ]
      }
    },
    "/merchant/api/v1/payins/mmo": {
      "get": {
        "operationId": "LedgerMerchants_ListPayInMMO",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/merchantsListPayInMMOResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "paymentMethod",
            "description": " - PAYMENT_METHOD_CARD: temporary not supported for pay in and payout\n - PAYMENT_METHOD_BANK_ACCOUNT: pay with bank and payout to bank account\navailable for pay in and payout\n - PAYMENT_METHOD_BANK_TRANSFER: available for pay in\n - PAYMENT_METHOD_MOBILE_MONEY: available for pay in and payout\n - PAYMENT_METHOD_TEST: payment method for testing purposes\navailable only in test environments",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "PAYMENT_METHOD_UNSPECIFIED",
              "PAYMENT_METHOD_CARD",
              "PAYMENT_METHOD_BANK_ACCOUNT",
              "PAYMENT_METHOD_BANK_TRANSFER",
              "PAYMENT_METHOD_MOBILE_MONEY",
              "PAYMENT_METHOD_TEST"
            ],
            "default": "PAYMENT_METHOD_UNSPECIFIED"
          },
          {
            "name": "countryCode",
            "description": "ISO 3166-1 alpha-2 country code of the payment market, for example KE, TZ, GM, MW.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "trafficVertical",
            "description": "Vertical of merchant traffic.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "TRAFFIC_VERTICAL_UNSPECIFIED",
              "TRAFFIC_VERTICAL_GAMBLING",
              "TRAFFIC_VERTICAL_FOREX",
              "TRAFFIC_VERTICAL_OTHER"
            ],
            "default": "TRAFFIC_VERTICAL_UNSPECIFIED"
          },
          {
            "name": "customerSegment",
            "description": "Customer segment.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "CUSTOMER_SEGMENT_UNSPECIFIED",
              "CUSTOMER_SEGMENT_FTD",
              "CUSTOMER_SEGMENT_TRUSTED",
              "CUSTOMER_SEGMENT_VIP"
            ],
            "default": "CUSTOMER_SEGMENT_UNSPECIFIED"
          }
        ]
      }
    },
    "/merchant/api/v1/payment/{id}": {
      "get": {
        "operationId": "LedgerMerchants_GetPaymentOrder",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ledgerPaymentOrder"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ]
      }
    },
    "/merchant/api/v1/payment/{id}/simulate": {
      "post": {
        "summary": "Simulates a payment status change in non-production environments.\nIntended for development/testing only. Triggers the regular journal/event/webhook flow.",
        "operationId": "LedgerMerchants_SimulatePaymentStatus",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ledgerPaymentOrder"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "description": "Payment order ID.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LedgerMerchantsSimulatePaymentStatusBody"
            }
          }
        ]
      }
    },
    "/merchant/api/v1/payouts/banks": {
      "get": {
        "operationId": "LedgerMerchants_ListPayOutBanks",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/merchantsListPayOutBanksResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "paymentMethod",
            "description": " - PAYMENT_METHOD_CARD: temporary not supported for pay in and payout\n - PAYMENT_METHOD_BANK_ACCOUNT: pay with bank and payout to bank account\navailable for pay in and payout\n - PAYMENT_METHOD_BANK_TRANSFER: available for pay in\n - PAYMENT_METHOD_MOBILE_MONEY: available for pay in and payout\n - PAYMENT_METHOD_TEST: payment method for testing purposes\navailable only in test environments",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "PAYMENT_METHOD_UNSPECIFIED",
              "PAYMENT_METHOD_CARD",
              "PAYMENT_METHOD_BANK_ACCOUNT",
              "PAYMENT_METHOD_BANK_TRANSFER",
              "PAYMENT_METHOD_MOBILE_MONEY",
              "PAYMENT_METHOD_TEST"
            ],
            "default": "PAYMENT_METHOD_UNSPECIFIED"
          },
          {
            "name": "countryCode",
            "description": "ISO 3166-1 alpha-2 country code of the payment market, for example NG, KE, GM, MW.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "trafficVertical",
            "description": "Vertical of merchant traffic.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "TRAFFIC_VERTICAL_UNSPECIFIED",
              "TRAFFIC_VERTICAL_GAMBLING",
              "TRAFFIC_VERTICAL_FOREX",
              "TRAFFIC_VERTICAL_OTHER"
            ],
            "default": "TRAFFIC_VERTICAL_UNSPECIFIED"
          },
          {
            "name": "customerSegment",
            "description": "Customer segment.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "CUSTOMER_SEGMENT_UNSPECIFIED",
              "CUSTOMER_SEGMENT_FTD",
              "CUSTOMER_SEGMENT_TRUSTED",
              "CUSTOMER_SEGMENT_VIP"
            ],
            "default": "CUSTOMER_SEGMENT_UNSPECIFIED"
          }
        ]
      }
    },
    "/merchant/api/v1/payouts/create": {
      "post": {
        "operationId": "LedgerMerchants_CreatePayOutOrder",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/merchantsCreatePayOutOrderResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/merchantsCreatePayOutOrderRequest"
            }
          }
        ]
      }
    },
    "/merchant/api/v1/payouts/mmo": {
      "get": {
        "operationId": "LedgerMerchants_ListPayOutMMO",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/merchantsListPayOutMMOResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "paymentMethod",
            "description": " - PAYMENT_METHOD_CARD: temporary not supported for pay in and payout\n - PAYMENT_METHOD_BANK_ACCOUNT: pay with bank and payout to bank account\navailable for pay in and payout\n - PAYMENT_METHOD_BANK_TRANSFER: available for pay in\n - PAYMENT_METHOD_MOBILE_MONEY: available for pay in and payout\n - PAYMENT_METHOD_TEST: payment method for testing purposes\navailable only in test environments",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "PAYMENT_METHOD_UNSPECIFIED",
              "PAYMENT_METHOD_CARD",
              "PAYMENT_METHOD_BANK_ACCOUNT",
              "PAYMENT_METHOD_BANK_TRANSFER",
              "PAYMENT_METHOD_MOBILE_MONEY",
              "PAYMENT_METHOD_TEST"
            ],
            "default": "PAYMENT_METHOD_UNSPECIFIED"
          },
          {
            "name": "countryCode",
            "description": "ISO 3166-1 alpha-2 country code of the payment market, for example KE, TZ, GM, MW.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "trafficVertical",
            "description": "Vertical of merchant traffic.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "TRAFFIC_VERTICAL_UNSPECIFIED",
              "TRAFFIC_VERTICAL_GAMBLING",
              "TRAFFIC_VERTICAL_FOREX",
              "TRAFFIC_VERTICAL_OTHER"
            ],
            "default": "TRAFFIC_VERTICAL_UNSPECIFIED"
          },
          {
            "name": "customerSegment",
            "description": "Customer segment.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "CUSTOMER_SEGMENT_UNSPECIFIED",
              "CUSTOMER_SEGMENT_FTD",
              "CUSTOMER_SEGMENT_TRUSTED",
              "CUSTOMER_SEGMENT_VIP"
            ],
            "default": "CUSTOMER_SEGMENT_UNSPECIFIED"
          }
        ]
      }
    }
  },
  "definitions": {
    "LedgerMerchantsSimulatePaymentStatusBody": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "Dev-only target status. Supported values: completed, expired, declined."
        },
        "providerError": {
          "type": "string",
          "description": "Optional internal/provider-facing failure text for declined/expired simulations."
        }
      }
    },
    "ledgerAccountType": {
      "type": "string",
      "enum": [
        "ACCOUNT_TYPE_UNSPECIFIED",
        "ACCOUNT_TYPE_ASSET",
        "ACCOUNT_TYPE_LIABILITY",
        "ACCOUNT_TYPE_REVENUE",
        "ACCOUNT_TYPE_EXPENSE"
      ],
      "default": "ACCOUNT_TYPE_UNSPECIFIED"
    },
    "ledgerCustomerSegment": {
      "type": "string",
      "enum": [
        "CUSTOMER_SEGMENT_UNSPECIFIED",
        "CUSTOMER_SEGMENT_FTD",
        "CUSTOMER_SEGMENT_TRUSTED",
        "CUSTOMER_SEGMENT_VIP"
      ],
      "default": "CUSTOMER_SEGMENT_UNSPECIFIED"
    },
    "ledgerPaymentMethod": {
      "type": "string",
      "enum": [
        "PAYMENT_METHOD_UNSPECIFIED",
        "PAYMENT_METHOD_CARD",
        "PAYMENT_METHOD_BANK_ACCOUNT",
        "PAYMENT_METHOD_BANK_TRANSFER",
        "PAYMENT_METHOD_MOBILE_MONEY",
        "PAYMENT_METHOD_TEST"
      ],
      "default": "PAYMENT_METHOD_UNSPECIFIED",
      "title": "- PAYMENT_METHOD_CARD: temporary not supported for pay in and payout\n - PAYMENT_METHOD_BANK_ACCOUNT: pay with bank and payout to bank account\navailable for pay in and payout\n - PAYMENT_METHOD_BANK_TRANSFER: available for pay in\n - PAYMENT_METHOD_MOBILE_MONEY: available for pay in and payout\n - PAYMENT_METHOD_TEST: payment method for testing purposes\navailable only in test environments"
    },
    "ledgerPaymentOrder": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "title": "Payment order ID (UUID, uniquely generated by the system)"
        },
        "providerId": {
          "type": "string",
          "title": "Provider ID"
        },
        "merchantId": {
          "type": "string",
          "title": "Merchant ID"
        },
        "merchantReference": {
          "type": "string",
          "description": "Merchant reference.\nUnique reference of the payment order in the merchant's system. Will be passed back to the merchant in the webhooks."
        },
        "paymentMethod": {
          "$ref": "#/definitions/ledgerPaymentMethod",
          "title": "Method of the payment order"
        },
        "journalId": {
          "type": "string",
          "description": "Journal ID."
        },
        "type": {
          "$ref": "#/definitions/ledgerPaymentOrderType",
          "title": "Type of payment order"
        },
        "status": {
          "$ref": "#/definitions/ledgerPaymentOrderStatus",
          "title": "Current status of the payment order"
        },
        "amount": {
          "type": "string",
          "format": "int64",
          "title": "Amount of the payment order in minor units"
        },
        "currencyCode": {
          "type": "string",
          "title": "Currency code of the payment order"
        },
        "paymentUrl": {
          "type": "string",
          "title": "URL to redirect customer to complete payment"
        },
        "redirectUrl": {
          "type": "string",
          "title": "URL to redirect customer to complete payment"
        },
        "failureReason": {
          "type": "string",
          "title": "Reason for the failure of the payment order"
        },
        "failureReasonCode": {
          "type": "string",
          "format": "int64",
          "title": "Error code for the failure of the payment order"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "title": "Timestamp when the payment order was created"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "title": "Timestamp when the payment order was last updated"
        },
        "trafficVertical": {
          "$ref": "#/definitions/ledgerTrafficVertical",
          "title": "Vertical used for routing and compliance"
        },
        "customerSegment": {
          "$ref": "#/definitions/ledgerCustomerSegment",
          "title": "Customer segment used for routing"
        },
        "marketDetails": {
          "$ref": "#/definitions/ledgerPaymentOrderMarketDetails",
          "description": "Checkout-safe market details resolved by ledger for the stored route snapshot."
        }
      },
      "title": "Payment order of any type"
    },
    "ledgerPaymentOrderMarketDetails": {
      "type": "object",
      "properties": {
        "countryCode": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country code of the selected payment market."
        },
        "mobileMoney": {
          "$ref": "#/definitions/ledgerPaymentOrderMobileMoneyMarketDetails",
          "description": "Mobile money checkout capabilities for the selected market."
        }
      }
    },
    "ledgerPaymentOrderMobileMoneyMarketDetails": {
      "type": "object",
      "properties": {
        "supported": {
          "type": "boolean",
          "description": "Whether mobile money is supported for this stored payment route."
        },
        "operatorRequired": {
          "type": "boolean",
          "description": "Whether this route requires an operator before PSP processing."
        },
        "operatorLocked": {
          "type": "boolean",
          "description": "Whether the operator was already selected and stored on the payment."
        },
        "operator": {
          "type": "string",
          "description": "Stored operator code when the operator is locked."
        },
        "operators": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ledgerPaymentOrderMobileMoneyOperator"
          },
          "description": "Checkout-safe operator options for payer selection."
        },
        "unavailableReason": {
          "type": "string",
          "description": "Explicit reason when capability details are unavailable or unsupported."
        }
      }
    },
    "ledgerPaymentOrderMobileMoneyOperator": {
      "type": "object",
      "properties": {
        "operator": {
          "type": "string",
          "description": "Machine-readable operator code accepted by backend processing."
        },
        "name": {
          "type": "string",
          "description": "Human-readable operator name for display."
        }
      }
    },
    "ledgerPaymentOrderStatus": {
      "type": "string",
      "enum": [
        "PAYMENT_ORDER_STATUS_UNSPECIFIED",
        "PAYMENT_ORDER_STATUS_CREATED",
        "PAYMENT_ORDER_STATUS_PENDING",
        "PAYMENT_ORDER_STATUS_COMPLETED",
        "PAYMENT_ORDER_STATUS_CANCELLED",
        "PAYMENT_ORDER_STATUS_EXPIRED",
        "PAYMENT_ORDER_STATUS_FAILED"
      ],
      "default": "PAYMENT_ORDER_STATUS_UNSPECIFIED",
      "title": "- PAYMENT_ORDER_STATUS_CREATED: Payment order is created\n - PAYMENT_ORDER_STATUS_PENDING: Payment order is being processed\n - PAYMENT_ORDER_STATUS_COMPLETED: Payment order is completed\n - PAYMENT_ORDER_STATUS_CANCELLED: Payment order is cancelled\n - PAYMENT_ORDER_STATUS_EXPIRED: Payment order is expired\n - PAYMENT_ORDER_STATUS_FAILED: Payment order is failed"
    },
    "ledgerPaymentOrderType": {
      "type": "string",
      "enum": [
        "PAYMENT_ORDER_TYPE_UNSPECIFIED",
        "PAYMENT_ORDER_TYPE_PAYMENT_IN",
        "PAYMENT_ORDER_TYPE_PAYMENT_OUT"
      ],
      "default": "PAYMENT_ORDER_TYPE_UNSPECIFIED",
      "title": "- PAYMENT_ORDER_TYPE_PAYMENT_IN: Payment order is for a pay-in\n - PAYMENT_ORDER_TYPE_PAYMENT_OUT: Payment order is for a pay-out"
    },
    "ledgerTrafficVertical": {
      "type": "string",
      "enum": [
        "TRAFFIC_VERTICAL_UNSPECIFIED",
        "TRAFFIC_VERTICAL_GAMBLING",
        "TRAFFIC_VERTICAL_FOREX",
        "TRAFFIC_VERTICAL_OTHER"
      ],
      "default": "TRAFFIC_VERTICAL_UNSPECIFIED"
    },
    "merchantsAuthorizeOtpRequest": {
      "type": "object",
      "properties": {
        "paymentOrderId": {
          "type": "string"
        },
        "token": {
          "type": "string"
        }
      }
    },
    "merchantsAuthorizeOtpResponse": {
      "type": "object",
      "properties": {
        "isAuthorized": {
          "type": "boolean"
        },
        "isStkPromptRequired": {
          "type": "boolean"
        },
        "displayMessage": {
          "type": "string"
        }
      }
    },
    "merchantsBank": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "merchantsCreatePayInOrderRequest": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "string",
          "format": "int64",
          "title": "Amount of the payment order in minor units"
        },
        "currencyCode": {
          "type": "string",
          "description": "ISO 4217 currency code of the payment order, for example NGN, KES, GMD, MWK."
        },
        "countryCode": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country code of the payment market, for example NG, KE, GM, MW.\nRequired for currencies shared by multiple countries such as XAF/XOF and recommended for mobile money flows."
        },
        "paymentMethod": {
          "$ref": "#/definitions/ledgerPaymentMethod",
          "title": "Method of the payment order"
        },
        "merchantReference": {
          "type": "string",
          "description": "Merchant reference\nUnique reference of the payment order in the merchant's system. Will be passed back to the merchant in the webhooks."
        },
        "redirectUrl": {
          "type": "string",
          "title": "Redirect URL to redirect the user after successful payment"
        },
        "isGambling": {
          "type": "boolean",
          "title": "Indicates whether the transaction is related to gambling"
        },
        "trafficVertical": {
          "$ref": "#/definitions/ledgerTrafficVertical",
          "description": "Vertical of merchant traffic. For legacy clients can be omitted and derived from is_gambling."
        },
        "customerSegment": {
          "$ref": "#/definitions/ledgerCustomerSegment",
          "description": "Customer segment. If omitted/unspecified, FTD is used."
        },
        "bankAccountDetails": {
          "$ref": "#/definitions/merchantsPayInBankAccountRequestDetails"
        },
        "bankTransferDetails": {
          "$ref": "#/definitions/merchantsPayInBankTransferRequestDetails"
        },
        "mobileMoneyDetails": {
          "$ref": "#/definitions/merchantsPayInMobileMoneyRequestDetails"
        },
        "testDetails": {
          "$ref": "#/definitions/merchantsPayInTestRequestDetails"
        }
      }
    },
    "merchantsCreatePayInOrderResponse": {
      "type": "object",
      "properties": {
        "paymentOrder": {
          "$ref": "#/definitions/ledgerPaymentOrder"
        },
        "bankAccountDetails": {
          "$ref": "#/definitions/merchantsPayInBankAccountResponseDetails"
        },
        "bankTransferDetails": {
          "$ref": "#/definitions/merchantsPayInBankTransferResponseDetails"
        },
        "mobileMoneyDetails": {
          "$ref": "#/definitions/merchantsPayInMobileMoneyResponseDetails"
        }
      }
    },
    "merchantsCreatePayOutOrderRequest": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "string",
          "format": "int64",
          "title": "Amount of the payment order in minor units"
        },
        "currencyCode": {
          "type": "string",
          "description": "ISO 4217 currency code of the payment order, for example NGN, KES, GMD, MWK."
        },
        "countryCode": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country code of the payment market, for example NG, KE, GM, MW.\nRequired for currencies shared by multiple countries such as XAF/XOF and recommended for mobile money flows."
        },
        "paymentMethod": {
          "$ref": "#/definitions/ledgerPaymentMethod",
          "title": "Method of the payment order"
        },
        "merchantReference": {
          "type": "string",
          "description": "Merchant reference\nUnique reference of the payment order in the merchant's system. Will be passed back to the merchant in the webhooks."
        },
        "isGambling": {
          "type": "boolean",
          "title": "Indicates whether the transaction is related to gambling"
        },
        "trafficVertical": {
          "$ref": "#/definitions/ledgerTrafficVertical",
          "description": "Vertical of merchant traffic. For legacy clients can be omitted and derived from is_gambling."
        },
        "customerSegment": {
          "$ref": "#/definitions/ledgerCustomerSegment",
          "description": "Customer segment. If omitted/unspecified, FTD is used."
        },
        "bankAccountDetails": {
          "$ref": "#/definitions/merchantsPayOutBankAccountRequestDetails"
        },
        "mobileMoneyDetails": {
          "$ref": "#/definitions/merchantsPayOutMobileMoneyRequestDetails"
        },
        "testDetails": {
          "$ref": "#/definitions/merchantsPayOutTestRequestDetails"
        }
      }
    },
    "merchantsCreatePayOutOrderResponse": {
      "type": "object",
      "properties": {
        "paymentOrder": {
          "$ref": "#/definitions/ledgerPaymentOrder"
        }
      }
    },
    "merchantsGetMarketCatalogResponse": {
      "type": "object",
      "properties": {
        "markets": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/merchantsMarketCatalogMarket"
          }
        }
      }
    },
    "merchantsInitializePayInRequest": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "string",
          "format": "int64",
          "title": "Amount of the payment order in minor units"
        },
        "currencyCode": {
          "type": "string",
          "description": "ISO 4217 currency code of the payment order, for example NGN, KES, GMD, MWK."
        },
        "countryCode": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country code of the payment market, for example NG, KE, GM, MW.\nRequired for currencies shared by multiple countries such as XAF/XOF and recommended for mobile money flows."
        },
        "paymentMethod": {
          "$ref": "#/definitions/ledgerPaymentMethod",
          "title": "Method of the payment order"
        },
        "merchantReference": {
          "type": "string",
          "description": "Merchant reference\nUnique reference of the payment order in the merchant's system. Will be passed back to the merchant in the webhooks."
        },
        "redirectUrl": {
          "type": "string",
          "title": "Redirect URL to redirect the user after successful payment"
        },
        "isGambling": {
          "type": "boolean",
          "title": "Indicates whether the transaction is related to gambling"
        },
        "trafficVertical": {
          "$ref": "#/definitions/ledgerTrafficVertical",
          "description": "Vertical of merchant traffic. For legacy clients can be omitted and derived from is_gambling."
        },
        "customerSegment": {
          "$ref": "#/definitions/ledgerCustomerSegment",
          "description": "Customer segment. If omitted/unspecified, FTD is used."
        },
        "mobileMoneyOperator": {
          "type": "string",
          "description": "Optional mobile money operator code used for operator-aware routing during init.\nExamples: wave, qcell, africell, mtn, vodacom. Supported values depend on country/currency and active provider setup."
        }
      }
    },
    "merchantsInitializePayInResponse": {
      "type": "object",
      "properties": {
        "paymentOrder": {
          "$ref": "#/definitions/ledgerPaymentOrder"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time",
          "title": "Expiration time in UTC. The payment can be processed only before this time"
        }
      }
    },
    "merchantsListBalancesResponse": {
      "type": "object",
      "properties": {
        "balances": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/merchantsMerchantBalance"
          }
        }
      }
    },
    "merchantsListPayInBanksResponse": {
      "type": "object",
      "properties": {
        "banks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/merchantsBank"
          }
        }
      }
    },
    "merchantsListPayInMMOResponse": {
      "type": "object",
      "properties": {
        "operators": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/merchantsMobileMoneyOperator"
          }
        }
      }
    },
    "merchantsListPayOutBanksResponse": {
      "type": "object",
      "properties": {
        "banks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/merchantsBank"
          }
        }
      }
    },
    "merchantsListPayOutMMOResponse": {
      "type": "object",
      "properties": {
        "operators": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/merchantsMobileMoneyOperator"
          }
        }
      }
    },
    "merchantsMarketCatalogMarket": {
      "type": "object",
      "properties": {
        "countryCode": {
          "type": "string"
        },
        "currencyCode": {
          "type": "string"
        },
        "methodsIn": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "methodsOut": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "merchantsMerchantBalance": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string"
        },
        "accountType": {
          "$ref": "#/definitions/ledgerAccountType"
        },
        "currencyCode": {
          "type": "string"
        },
        "amount": {
          "type": "string",
          "format": "int64"
        }
      }
    },
    "merchantsMobileMoneyOperator": {
      "type": "object",
      "properties": {
        "operator": {
          "type": "string",
          "description": "Machine-readable mobile money operator code to send in operator-aware requests."
        },
        "name": {
          "type": "string",
          "description": "Human-readable mobile money operator name for display in merchant UI."
        }
      }
    },
    "merchantsPayInBankAccountRequestDetails": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "bankCode": {
          "type": "string"
        }
      }
    },
    "merchantsPayInBankAccountResponseDetails": {
      "type": "object",
      "properties": {
        "redirectUrl": {
          "type": "string",
          "title": "The redirect url to proceed with payment"
        }
      }
    },
    "merchantsPayInBankTransferRequestDetails": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        }
      }
    },
    "merchantsPayInBankTransferResponseDetails": {
      "type": "object",
      "properties": {
        "accountName": {
          "type": "string"
        },
        "accountNumber": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time",
          "description": "Expiration time in UTC."
        }
      }
    },
    "merchantsPayInMobileMoneyRequestDetails": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "mobileNumber": {
          "type": "string",
          "description": "Customer mobile wallet number / MSISDN in the format expected by the target provider."
        },
        "operator": {
          "type": "string",
          "description": "Mobile money operator code for the customer wallet.\nExamples: wave, qcell, africell, mtn, vodacom. Supported values depend on country/currency and provider setup."
        },
        "voucherPin": {
          "type": "string",
          "description": "Voucher PIN for voucher-based mobile money markets, for example Botswana BWP with operator BWVCH."
        }
      }
    },
    "merchantsPayInMobileMoneyResponseDetails": {
      "type": "object",
      "properties": {
        "isOtpAuthRequired": {
          "type": "boolean"
        },
        "displayMessage": {
          "type": "string"
        }
      }
    },
    "merchantsPayInTestRequestDetails": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "x-nullable": true
        },
        "error": {
          "type": "string",
          "x-nullable": true
        },
        "providerError": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "merchantsPayOutBankAccountRequestDetails": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "bankCode": {
          "type": "string"
        },
        "account": {
          "type": "string"
        }
      }
    },
    "merchantsPayOutMobileMoneyRequestDetails": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "operator": {
          "type": "string",
          "description": "Mobile money operator code of the beneficiary wallet.\nExamples: wave, qcell, africell, mtn, vodacom. Supported values depend on country/currency and provider setup."
        },
        "mobileNumber": {
          "type": "string",
          "description": "Beneficiary mobile wallet number / MSISDN in the format expected by the target provider."
        },
        "accountName": {
          "type": "string",
          "description": "Beneficiary account name as required by some payout providers."
        }
      }
    },
    "merchantsPayOutTestRequestDetails": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "x-nullable": true
        },
        "error": {
          "type": "string",
          "x-nullable": true
        },
        "providerError": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    }
  },
  "host": "merchants-api.payli.dev",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "securityDefinitions": {
    "Bearer": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header",
      "description": "Enter your bearer token in the format: Bearer {token}"
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ]
}
