Moyasar Tokens API

Client-side card tokenization using a publishable key.

Operations 2

POST /tokens Create a token #
GET /tokens/{id} Fetch a token #

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-tokens-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-tokens-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Moyasar Tokens 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: Tokens
  description: Client-side card tokenization using a publishable key.
paths:
  /tokens:
    post:
      operationId: createToken
      tags:
      - Tokens
      summary: Create a token
      description: Tokenizes a mada / credit card. Intended to be called from the client side with a publishable key so raw card data never reaches the merchant backend. The resulting token id can be used as a payment source.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenInput'
      responses:
        '201':
          description: The created token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /tokens/{id}:
    parameters:
    - name: id
      in: path
      required: true
      description: The token ID.
      schema:
        type: string
    get:
      operationId: fetchToken
      tags:
      - Tokens
      summary: Fetch a token
      description: Retrieves a single token by its ID.
      responses:
        '200':
          description: The requested token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    TokenInput:
      type: object
      required:
      - name
      - number
      - month
      - year
      - cvc
      properties:
        name:
          type: string
        number:
          type: string
        month:
          type: string
        year:
          type: string
        cvc:
          type: string
        callback_url:
          type: string
          format: uri
    Token:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
        brand:
          type: string
        funding:
          type: string
        company:
          type: string
        last_four:
          type: string
        month:
          type: string
        year:
          type: string
        verification_url:
          type:
          - string
          - 'null'
          format: uri
        created_at:
          type: string
          format: date-time
      additionalProperties: true
    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'
  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.