openapi: 3.0.3
info:
  title: EDC Payment Gateway - Bank API
  version: 3.3.1
  description: 'Bank API is a RESTful web service which partnered banks can integrate with EDC to enable online bill payment
    service.


    **Who implements it:** EDC Payment Gateway. **Who calls it:** the partner bank (mobile banking, iBanking, counter, agent,
    ATM).'
servers:
- url: https://edc-sit-api.oone.bz/pg-bank-api
  description: EDC SIT (staging)
paths:
  /balance/inquiry/v3:
    post:
      operationId: balanceInquiry
      summary: Balance Inquiry
      description: 'This operation is to search the balance of consumer.


        Implemented by: EDC Payment Gateway. Called by: Partner bank.'
      tags:
      - Bank API
      servers:
      - url: https://edc-sit-api.oone.bz/pg-bank-api
        description: EDC SIT (staging)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                biller_code:
                  type: string
                  description: Biller prefix code
                consumer_code:
                  type: string
                  description: Consumer code
                currency:
                  type: string
                  description: Currency code (ISO 4217) KHR USD
              required:
              - biller_code
              - consumer_code
            example:
              biller_code: EDC
              consumer_code: '80581211'
              currency: ''
      responses:
        '200':
          description: Response (check `code` for the business result)
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Response code
                  message:
                    type: string
                    description: Response message in English
                  message_kh:
                    type: string
                    description: Response message in Khmer
                  data:
                    type: object
                    properties:
                      biller_code:
                        type: string
                        description: Biller prefix code
                      biller_name:
                        type: string
                        description: Biller name
                      company_code:
                        type: string
                        description: Company code
                      company_name:
                        type: string
                        description: Company name
                      consumer_code:
                        type: string
                        description: Consumer code
                      consumer_name:
                        type: string
                        description: Consumer name
                      consumer_name_latin:
                        type: string
                        description: Consumer name in Latin
                      currency:
                        type: string
                        description: Currency code (ISO 4217)
                      total_amount:
                        type: number
                        description: Total amount to pay
                      bill_amount:
                        type: number
                        description: Bill amount
                      convenience_fee_amount:
                        type: number
                        description: Transaction fee will pay by consumer
                      sponsor_fee_amount:
                        type: number
                        description: Transaction fee will pay by biller
                      min_amount:
                        type: number
                        description: Minimum amount which consumer can pay (-1 is unlimited)
                      max_amount:
                        type: number
                        description: Maximum amount which consumer can pay (-1 is unlimited)
                      payment_token:
                        type: string
                        description: Hashed token auto generated by Payment Gateway
                      last_bill_date:
                        type: string
                        description: Last bill date
                      last_due_date:
                        type: string
                        description: Last due date
                      description_kh:
                        type: string
                        description: Description in Khmer to show in bank app
                      description_en:
                        type: string
                        description: Description in English to show in bank app
                    description: Data object
              example:
                code: '000'
                message: ''
                message_kh: ''
                data:
                  biller_code: EDC
                  biller_name: Electricite Due Cambodge
                  company_code: EDC-BTB
                  company_name: អគ្គិសនីបាត់ដំបង
                  consumer_code: '80581211'
                  consumer_name: លោក ជា សំណាង
                  consumer_name_latin: Mr. Chea Samnang
                  currency: KHR
                  total_amount: 100000.0
                  bill_amount: 100000.0
                  convenience_fee_amount: 0.0
                  sponsor_fee_amount: 0.0
                  min_amount: 100000.0
                  max_amount: -1
                  payment_token: 4be8fc1f50834aacb5c46005501cda8b...
                  last_bill_date: '2021-12-01T09:25:30'
                  last_due_date: '2021-12-15T23:59:59'
                  description_kh: វិក្កយបត្រលោកអ្នកហួសសុពលភាព អាចប្រឈមនឹងការផ្អាកផ្គត់ផ្គង់អគ្គិសនី។
                  description_en: Your electricity supply can be suspended if your bill is overdue.
      security:
      - bearerAuth: []
  /balance/validate/v2:
    post:
      operationId: balanceValidation
      summary: Balance Validation
      description: 'This operation is to validate the amount when consumer want to pay with any custom amount.


        Implemented by: EDC Payment Gateway. Called by: Partner bank.'
      tags:
      - Bank API
      servers:
      - url: https://edc-sit-api.oone.bz/pg-bank-api
        description: EDC SIT (staging)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  description: Amount to validate
                payment_token:
                  type: string
                  description: Value of "payment_token" from Balance Inquiry
              required:
              - amount
              - payment_token
            example:
              amount: 250000.0
              payment_token: 4be8fc1f50834aacb5c46005501cda8b...
      responses:
        '200':
          description: Response (check `code` for the business result)
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Response code
                  message:
                    type: string
                    description: Response message in English
                  message_kh:
                    type: string
                    description: Response message in Khmer
                  data:
                    type: object
                    properties:
                      currency:
                        type: string
                        description: Currency code (ISO 4217)
                      total_amount:
                        type: number
                        description: Total amount to pay
                      bill_amount:
                        type: number
                        description: Bill amount
                      convenience_fee_amount:
                        type: number
                        description: Transaction fee will pay by consumer
                      sponsor_fee_amount:
                        type: number
                        description: Transaction fee will pay by biller
                      payment_token:
                        type: string
                        description: Hashed token auto generated by Payment Gateway
                    description: Data object
              example:
                code: '000'
                message: ''
                message_kh: ''
                data:
                  currency: KHR
                  total_amount: 250000.0
                  bill_amount: 250000.0
                  convenience_fee_amount: 0.0
                  sponsor_fee_amount: 0.0
                  payment_token: 4be8fc1f50834aacb5c46005501cda8b...
      security:
      - bearerAuth: []
  /payment/confirm/v3:
    post:
      operationId: paymentConfirmation
      summary: Payment Confirmation
      description: 'This operation is to confirm the payment.


        Implemented by: EDC Payment Gateway. Called by: Partner bank.'
      tags:
      - Bank API
      servers:
      - url: https://edc-sit-api.oone.bz/pg-bank-api
        description: EDC SIT (staging)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                biller_code:
                  type: string
                  description: Biller prefix code
                consumer_code:
                  type: string
                  description: Consumer code
                currency:
                  type: string
                  description: Currency code (ISO 4217)
                total_amount:
                  type: number
                  description: Total amount to pay
                convenience_fee_amount:
                  type: number
                  description: Bank transaction fee charge (Consumer pay the fee)
                sponsor_fee_amount:
                  type: number
                  description: Bank transaction fee charge (Biller pay the fee)
                payment_token:
                  type: string
                  description: Value of "payment_token" from Balance Inquiry or Balance Validation
                bank_ref:
                  type: string
                  description: Payment reference number from bank
                bank_channel:
                  type: string
                  description: Payment channel of the bank that consumer use to process the payment (Free text field) MobileBanking
                    IBanking BankCounter BankAgent ATM
                bank_transaction_date:
                  type: string
                  description: Transaction date from bank (yyyy-MM-dd HH:mm:ss)
                payer_account_no:
                  type: string
                  description: Account number of the payer
                payer_account_name:
                  type: string
                  description: Account name of the payer
                payer_account_phone:
                  type: string
                  description: Phone number of the payer
                description:
                  type: string
                  description: Remark that related to the transaction from bank
              required:
              - biller_code
              - consumer_code
              - currency
              - total_amount
              - payment_token
              - bank_ref
              - bank_transaction_date
            example:
              biller_code: EDC
              consumer_code: '80581211'
              currency: KHR
              total_amount: 100000.0
              convenience_fee_amount: 0.0
              sponsor_fee_amount: 0.0
              payment_token: 4be8fc1f50834aacb5c46005501cda8b...
              bank_ref: '9040326182'
              bank_channel: MobileBanking
              bank_transaction_date: '2022-09-20 16:58:48'
              payer_account_no: '*****452'
              payer_account_name: Chea Sopheap
              payer_account_phone: 010888999
              description: ''
      responses:
        '200':
          description: Response (check `code` for the business result)
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Response code
                  message:
                    type: string
                    description: Response message in English
                  message_kh:
                    type: string
                    description: Response message in Khmer
                  data:
                    type: object
                    properties:
                      biller_code:
                        type: string
                        description: Biller prefix code
                      biller_name:
                        type: string
                        description: Biller name
                      company_code:
                        type: string
                        description: Company code
                      company_name:
                        type: string
                        description: Company name
                      consumer_code:
                        type: string
                        description: Consumer code
                      consumer_name:
                        type: string
                        description: Consumer name
                      consumer_name_latin:
                        type: string
                        description: Consumer name in Latin
                      currency:
                        type: string
                        description: Currency code (ISO 4217)
                      total_amount:
                        type: number
                        description: Total amount to pay
                      bill_amount:
                        type: number
                        description: Bill amount
                      convenience_fee_amount:
                        type: number
                        description: Transaction fee will pay by consumer
                      sponsor_fee_amount:
                        type: number
                        description: Transaction fee will pay by biller
                      bank_ref:
                        type: string
                        description: Payment reference number from bank
                      transaction_ref:
                        type: string
                        description: Payment reference number from EDC
                      transaction_date:
                        type: string
                        description: Payment date
                    description: Data object
              example:
                code: '000'
                message: ''
                message_kh: ''
                data:
                  biller_code: EDC
                  biller_name: Electricite Due Cambodge
                  company_code: EDC-BTB
                  company_name: អគ្គិសនីបាត់ដំបង
                  consumer_code: '80581211'
                  consumer_name: លោក ជា សំណាង
                  consumer_name_latin: Mr. Chea Samnang
                  currency: KHR
                  total_amount: 100000.0
                  bill_amount: 100000.0
                  convenience_fee_amount: 0.0
                  sponsor_fee_amount: 0.0
                  bank_ref: '9040326182'
                  transaction_ref: '174952172035635'
                  transaction_date: '2021-12-07T09:25:30'
      security:
      - bearerAuth: []
  /payment/verify/v3:
    post:
      operationId: paymentVerification
      summary: Payment Verification
      description: 'This operation is to verify the payment.


        Implemented by: EDC Payment Gateway. Called by: Partner bank.'
      tags:
      - Bank API
      servers:
      - url: https://edc-sit-api.oone.bz/pg-bank-api
        description: EDC SIT (staging)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                bank_ref:
                  type: string
                  description: Payment reference number from bank
              required:
              - bank_ref
            example:
              bank_ref: '9040326182'
      responses:
        '200':
          description: Response (check `code` for the business result)
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Response code
                  message:
                    type: string
                    description: Response message in English
                  message_kh:
                    type: string
                    description: Response message in Khmer
                  data:
                    type: object
                    properties:
                      biller_code:
                        type: string
                        description: Biller prefix code
                      biller_name:
                        type: string
                        description: Biller name
                      currency:
                        type: string
                        description: Currency code (ISO 4217)
                      total_amount:
                        type: number
                        description: Total amount to pay
                      bill_amount:
                        type: number
                        description: Bill amount
                      convenience_fee_amount:
                        type: number
                        description: Transaction fee will pay by consumer
                      sponsor_fee_amount:
                        type: number
                        description: Transaction fee will pay by biller
                      bank_ref:
                        type: string
                        description: Payment reference number from bank
                      transaction_ref:
                        type: string
                        description: Payment reference number from EDC
                      transaction_date:
                        type: string
                        description: Payment date
                      details:
                        type: array
                        items:
                          type: object
                          properties:
                            company_code:
                              type: string
                              description: Company code
                            company_name:
                              type: string
                              description: Company name
                            consumer_code:
                              type: string
                              description: Consumer code
                            consumer_name:
                              type: string
                              description: Consumer name
                            consumer_name_latin:
                              type: string
                              description: Consumer name in Latin
                            amount:
                              type: number
                              description: Amount to pay of the consumer
                        description: List of each consumer details and amount
                    description: Data object
              example:
                code: '000'
                message: ''
                message_kh: ''
                data:
                  biller_code: EDC
                  biller_name: Electricite Due Cambodge
                  currency: KHR
                  total_amount: 100000.0
                  bill_amount: 100000.0
                  convenience_fee_amount: 0.0
                  sponsor_fee_amount: 0.0
                  bank_ref: '9040326182'
                  transaction_ref: '174952172035635'
                  transaction_date: '2021-12-07T09:25:30'
                  details:
                  - company_code: EDC-BTB
                    company_name: អគ្គិសនីបាត់ដំបង
                    consumer_code: '80581211'
                    consumer_name: លោក ជា សំណាង
                    consumer_name_latin: Mr. Chea Samnang
                    amount: 100000.0
      security:
      - bearerAuth: []
  /payment/verify/multiple/v2:
    post:
      operationId: paymentVerificationBulk
      summary: Payment Verification (bulk verify)
      description: 'This operation is to verify the payment (bulk verify).


        Implemented by: EDC Payment Gateway. Called by: Partner bank.'
      tags:
      - Bank API
      servers:
      - url: https://edc-sit-api.oone.bz/pg-bank-api
        description: EDC SIT (staging)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                bank_refs:
                  type: array
                  items:
                    type: string
                  description: Payment reference numbers from bank
              required:
              - bank_refs
            example:
              bank_refs:
              - '9040326182'
              - '8050244095'
      responses:
        '200':
          description: Response (check `code` for the business result)
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Response code
                  message:
                    type: string
                    description: Response message in English
                  message_kh:
                    type: string
                    description: Response message in Khmer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        biller_code:
                          type: string
                          description: Biller prefix code
                        biller_name:
                          type: string
                          description: Biller name
                        currency:
                          type: string
                          description: Currency code (ISO 4217)
                        total_amount:
                          type: number
                          description: Total amount to pay
                        bill_amount:
                          type: number
                          description: Bill amount
                        convenience_fee_amount:
                          type: number
                          description: Transaction fee will pay by consumer
                        sponsor_fee_amount:
                          type: number
                          description: Transaction fee will pay by biller
                        bank_ref:
                          type: string
                          description: Payment reference number from bank
                        transaction_ref:
                          type: string
                          description: Payment reference number from EDC
                        transaction_date:
                          type: string
                          description: Payment date
                        details:
                          type: array
                          items:
                            type: object
                            properties:
                              company_code:
                                type: string
                                description: Company code
                              company_name:
                                type: string
                                description: Company name
                              consumer_code:
                                type: string
                                description: Consumer code
                              consumer_name:
                                type: string
                                description: Consumer name
                              consumer_name_latin:
                                type: string
                                description: Consumer name in Latin
                              amount:
                                type: number
                                description: Amount to pay of the consumer
                          description: List of each consumer details and amount
                    description: List of data object
              example:
                code: '000'
                message: ''
                message_kh: ''
                data:
                - biller_code: EDC
                  biller_name: Electricite Due Cambodge
                  currency: KHR
                  total_amount: 100000.0
                  bill_amount: 100000.0
                  convenience_fee_amount: 0.0
                  sponsor_fee_amount: 0.0
                  bank_ref: '9040326182'
                  transaction_ref: '174952172035635'
                  transaction_date: '2021-12-07T09:25:30'
                  details:
                  - company_code: EDC-BTB
                    consumer_code: '80581211'
                    consumer_name: លោក ជា សំណាង
                    consumer_name_latin: Mr. Chea Samnang
                    amount: 100000.0
                - biller_code: EDC
                  biller_name: Electricite Due Cambodge
                  currency: KHR
                  total_amount: 200000.0
                  bill_amount: 200000.0
                  convenience_fee_amount: 0.0
                  sponsor_fee_amount: 0.0
                  bank_ref: '8050244095'
                  transaction_ref: '344452171035624'
                  transaction_date: '2021-12-07T09:25:30'
                  details:
                  - company_code: EDC-BTB
                    company_name: អគ្គិសនីបាត់ដំបង
                    consumer_code: '80583411'
                    consumer_name: លោក ហេង លី
                    consumer_name_latin: Mr. Heng Lee
                    amount: 200000.0
      security:
      - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Token provided privately / from the token endpoint
