Moyasar Payments API

Create and manage card and wallet payments.

Operations 6

GET /payments List payments #
POST /payments Create a payment #
GET /payments/{id} Fetch a payment #
POST /payments/{id}/refund Refund a payment #
POST /payments/{id}/capture Capture a payment #
POST /payments/{id}/void Void a payment #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/moyasar-payments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

moyasar-payments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Moyasar Payments API
  description: Moyasar is a Saudi Arabian payment gateway.
  version: '1.0'
  contact:
    name: Moyasar
    url: https://moyasar.com
  license:
    name: Proprietary
    url: https://moyasar.com/en/terms/
servers:
- url: https://api.moyasar.com/v1
  description: Moyasar production API
security:
- basicAuth: []
tags:
- name: Payments
  description: Create and manage card and wallet payments.
paths:
  /payments:
    get:
      operationId: listPayments
      tags:
      - Payments
      summary: List payments
      description: Lists payments on the account with filtering and pagination.
      parameters:
      - name: page
        in: query
        required: false
        schema:
          type: integer
          default: 1
      - name: id
        in: query
        required: false
        schema:
          type: string
          format: uuid
      - name: status
        in: query
        required: false
        schema:
          type: string
          enum:
          - initiated
          - paid
          - authorized
          - failed
          - refunded
          - captured
          - voided
          - verified
      - name: created[gt]
        in: query
        required: false
        schema:
          type: string
          format: date-time
      - name: created[lt]
        in: query
        required: false
        schema:
          type: string
          format: date-time
      - name: card_last_digits
        in: query
        required: false
        schema:
          type: string
      - name: receipt_no
        in: query
        required: false
        schema:
          type: string
      responses:
        '200':
          description: A paginated list of payments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  payments:
                    type: array
                    items:
                      $ref: '#/components/schemas/Payment'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createPayment
      tags:
      - Payments
      summary: Create a payment
      description: Creates a payment. Can be called with a publishable key from the client side or a secret key from the backend. The `source` object selects the payment method (creditcard, token, applepay, samsungpay, stcpay).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentInput'
      responses:
        '201':
          description: The created payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /payments/{id}:
    parameters:
    - $ref: '#/components/parameters/PaymentId'
    get:
      operationId: fetchPayment
      tags:
      - Payments
      summary: Fetch a payment
      description: Retrieves a single payment by its ID.
      responses:
        '200':
          description: The requested payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /payments/{id}/refund:
    parameters:
    - $ref: '#/components/parameters/PaymentId'
    post:
      operationId: refundPayment
      tags:
      - Payments
      summary: Refund a payment
      description: Refunds a paid payment in full or in part. Omit `amount` for a full refund.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: integer
                  description: Amount to refund in the smallest currency unit. Full refund if omitted.
      responses:
        '200':
          description: The refunded payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /payments/{id}/capture:
    parameters:
    - $ref: '#/components/parameters/PaymentId'
    post:
      operationId: capturePayment
      tags:
      - Payments
      summary: Capture a payment
      description: Captures an authorized payment, in full or in part. Omit `amount` to capture the full authorized amount.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: integer
                  description: Amount to capture in the smallest currency unit. Full capture if omitted.
      responses:
        '200':
          description: The captured payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /payments/{id}/void:
    parameters:
    - $ref: '#/components/parameters/PaymentId'
    post:
      operationId: voidPayment
      tags:
      - Payments
      summary: Void a payment
      description: Voids an authorized payment that has not yet been captured.
      responses:
        '200':
          description: The voided payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Payment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
          - initiated
          - paid
          - authorized
          - failed
          - refunded
          - captured
          - voided
          - verified
        amount:
          type: integer
        fee:
          type: integer
        currency:
          type: string
        refunded:
          type: integer
        refunded_at:
          type:
          - string
          - 'null'
          format: date-time
        captured:
          type: integer
        captured_at:
          type:
          - string
          - 'null'
          format: date-time
        voided_at:
          type:
          - string
          - 'null'
          format: date-time
        amount_format:
          type: string
        description:
          type:
          - string
          - 'null'
        invoice_id:
          type:
          - string
          - 'null'
        ip:
          type:
          - string
          - 'null'
        callback_url:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        metadata:
          type:
          - object
          - 'null'
          additionalProperties: true
        source:
          type: object
          additionalProperties: true
      additionalProperties: true
    PaymentInput:
      type: object
      required:
      - amount
      - currency
      - source
      properties:
        amount:
          type: integer
          description: Positive amount in the smallest currency unit (halalas for SAR).
        currency:
          type: string
          description: ISO-4217 three-letter code (e.g. SAR).
          default: SAR
        source:
          $ref: '#/components/schemas/PaymentSource'
        description:
          type: string
        callback_url:
          type: string
          format: uri
          description: Required for creditcard and token sources.
        given_id:
          type: string
          description: Client-supplied UUID for idempotency.
        metadata:
          type: object
          additionalProperties: true
        splits:
          type: array
          items:
            type: object
            additionalProperties: true
    PaymentSource:
      type: object
      description: Payment source. The `type` field selects the method. Additional fields depend on the source type (card fields, token id, wallet token, etc.).
      properties:
        type:
          type: string
          enum:
          - creditcard
          - token
          - applepay
          - samsungpay
          - stcpay
        name:
          type: string
        number:
          type: string
        cvc:
          type: string
        month:
          type: string
        year:
          type: string
        token:
          type: string
      additionalProperties: true
    PaginationMeta:
      type: object
      properties:
        current_page:
          type: integer
        next_page:
          type:
          - integer
          - 'null'
        prev_page:
          type:
          - integer
          - 'null'
        total_pages:
          type: integer
        total_count:
          type: integer
    Error:
      type: object
      properties:
        type:
          type: string
        message:
          type: string
        errors:
          type: object
          additionalProperties: true
  responses:
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Invalid or missing authorization credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: The request payload failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    PaymentId:
      name: id
      in: path
      required: true
      description: The payment UUID.
      schema:
        type: string
        format: uuid
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic authentication. Pass your API key as the username and leave the password empty (e.g. `-u sk_test_123:`). Publishable keys (pk_test_ / pk_live_) may only create payments and tokens; secret keys (sk_test_ / sk_live_) authorize all operations.