CreateTransaction
v1.0.0

Fired when we want to ask the payment service to create a Transaction Payment Service will response back with a confirmed event called "TransactionCreated"

Properties

userId* :

ID of the user that is the transaction for

source* :

Source of the transaction. Value can be one of below.
- PAYMENT
- REFUND
- MANUAL_ADDITION
- MANUAL_DEDUCTION

action* :

The action or the reason for this transaction, for exampele:
- CREATE_SUBSCRIPTION
- PURCHASE_ADD_ONS
- COMPLEMENTARY_CARD
- CX_GIFTS

amount* :

Amount collected for the transaction.

vat* :

Vat collected for the transaction.

brand* :

Brand used in the transaction. Value can be one of below.
  - CALO
  - MEALO

currency* :

Currency used in the transaction. Value can be one of below.
- BHD
- SAR
- AED
- KWD
- QAR
- OMR

paymentMethod* :

Payment method used. Value can be one of the below.
- cash
- cc
- benefit
- mada
- applePay
- knet

notes* :

Any extra details related the transaction.

uniqueReferenceId* :

A unique string to reference the Transaction. This can be a Invoice ID, Subscription ID, Subscription type, User action or similar. This value is generated and passed from the service/user that has initiated the transaction, that can be later used to reconcile the tranasction with your internal systems.

metadata* :

Set of key-value pairs that can be set by initiator service/user. This can be useful for storing additional information about the object in a structured format.

actor* :

The person who inititaed this transaction
flowchart LR l-API_Service[API Service]:::producer-->CreateTransaction[CreateTransaction]:::event l-Dashboard_Service[Dashboard Service]:::producer-->CreateTransaction[CreateTransaction]:::event classDef event stroke:#22e483,stroke-width: 4px; classDef producer stroke:#75d7b6,stroke-width: 2px; classDef consumer stroke:#818cf8,stroke-width: 2px; CreateTransaction[CreateTransaction]:::event-->r-Payment_Service[Payment Service]:::consumer click l-API_Service href "/services/API Service" "Go to API Service" _self click l-Dashboard_Service href "/services/Dashboard Service" "Go to Dashboard Service" _self click r-Payment_Service href "/services/Payment Service" "Go to Payment Service" _self click CreateTransaction href "/events/CreateTransaction" "Go to CreateTransaction" _self
CreateTransaction Schema (yml)
openapi: 3.0.0
info:
  version: "1.0.0"
  title: CreateTransaction
paths: {}
components:
  schemas:
    CreateTransaction:
      type: object
      required:
        - metadata
        - data
      properties:
        data:
          "$ref": "#/components/schemas/Data"
        metadata:
          "$ref": "#/components/schemas/Metadata"
    Data:
      type: object
      required:
        - userId
        - source
        - action
        - amount
        - vat
        - brand
        - currency
        - uniqueReferenceId
        - actor
      properties:
        userId:
          type: string
        source:
          "$ref": "#/components/schemas/Source"
        action:
          type: string
        amount:
          type: number
        vat:
          type: number
        brand:
          "$ref": "#/components/schemas/Brand"
        currency:
          "$ref": "#/components/schemas/Currency"
        paymentMethod:
          "$ref": "#/components/schemas/PaymentMethod"
        notes:
          type: string
        uniqueReferenceId:
          type: string
        metadata:
          type: object
        actor:
          type: string
    Metadata:
      type: object
      required:
        - serviceFunction
        - version
      properties:
        serviceFunction:
          type: string
        version:
          type: string
    Brand:
      type: string
      enum:
        - CALO
        - MEALO
    Currency:
      type: string
      enum:
        - BHD
        - SAR
        - AED
        - KWD
        - QAR
        - OMR
    PaymentMethod:
      type: string
      enum:
        - cash
        - cc
        - benefit
        - mada
        - applePay
        - knet
    Source:
      type: string
      enum:
        - PAYMENT
        - REFUND
        - MANUAL_ADDITION
        - MANUAL_DEDUCTION
Edit this pageLast updated on 2024/4/2