Ifthenpay API

Ifthenpay API as documented publicly: 17 operations. Contract generated from the documentation by API Evangelist (2026-11-12); not the provider's own document.

GitHub OpenAPI

Operations 17

POST /api/v1/auth/token Generate a JWT bearer token #
POST /directdebit/api/v1/auth/token POST /directdebit/api/v1/auth/token #
GET /get Request a new PAYSHOP payment reference #
GET /getPayments Retrieve List of Payments - SOAP (1.1 and 1.2) #
GET /getPaymentsJsonV2 Retrieve List of Payments - JSON​ #
GET /getPaymentsXml Retrieve List of Payments - XML #
GET /getsandbox Request a new PAYSHOP payment reference in sandbox mode #
GET /mbway/status check payment status #
POST /multibanco/reference/init POST /multibanco/reference/init #
GET /payment/status/ Check Payment Status #
POST /spg/payment/mbway POST /spg/payment/mbway #
GET /status.php GET /status.php #
POST /v2/callback/activation POST /v2/callback/activation #
POST /v2/payments/read POST /v2/payments/read #
POST /v2/payments/refund POST /v2/payments/refund #
POST /{gatewayKey} request a new payment link and a pinpay code #
POST /{gatewayKey}/{requestStatus} enable or disable pay by link and pinpay #

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/ifthenpay-com:ifthenpay-com-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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

ifthenpay-com-openapi-generated.yml Raw ↑
openapi: 3.1.0
info:
  title: Ifthenpay API
  version: '2026-11-12'
  description: 'GENERATED FROM DOCUMENTATION by API Evangelist on 2026-11-12: 17 operation(s) read from 11 public documentation page(s) (each
    operation names its page in x-source). This is not the provider''s published contract; Ifthenpay has published no machine-readable contract
    that the pipeline could find. Engine: local.'
  x-evidence-tiers:
    code-example: 8
    documentation: 9
    pages-with-code: 9
    pages-read: 11
  x-generated-from: documentation
  x-provenance: generated
  x-authored-by: API Evangelist
  x-generated: '2026-11-12'
  x-generator: generate-contract-from-docs.py
  x-engine: local
  x-sources:
  - https://www.ifthenpay.com/docs/en/api/pbl
  - https://www.ifthenpay.com/docs/en/api/pix
  - https://www.ifthenpay.com/docs/en/api/ccard
  - https://www.ifthenpay.com/docs/en/api/mbway
  - https://www.ifthenpay.com/docs/en/api/refund
  - https://www.ifthenpay.com/docs/en/api/payshop
  - https://www.ifthenpay.com/docs/en/api/callback
  - https://www.ifthenpay.com/docs/en/api/multibanco
  - https://www.ifthenpay.com/docs/en/api/directdebit
  - https://www.ifthenpay.com/docs/en/api/list-of-payments
  - https://www.ifthenpay.com/docs/en/api/list-of-payments-rest
servers:
- url: https://api.ifthenpay.com
paths:
  /api/v1/auth/token:
    post:
      operationId: post_api_v1_auth_token
      tags:
      - Api
      summary: Generate a JWT bearer token
      x-source: https://www.ifthenpay.com/docs/en/api/directdebit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostApiV1AuthTokenRequest'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostApiV1AuthTokenResponse'
      x-evidence:
        kind: documentation
  /directdebit/api/v1/auth/token:
    post:
      operationId: post_directdebit_api_v1_auth_token
      tags:
      - Directdebit
      summary: POST /directdebit/api/v1/auth/token
      x-source: https://www.ifthenpay.com/docs/en/api/directdebit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostDirectdebitApiV1AuthTokenRequest'
      responses:
        '201':
          description: Success (shape read from the example response on the page)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostDirectdebitApiV1AuthTokenResponse'
      x-evidence:
        kind: code-example
        language: curl
        snippet: "curl https://services.ifthenpay.com/directdebit/api/v1/auth/token  --request POST  --header 'Content-Type: application/json'\
          \  --data '{\n \"backofficeKey\": \"BACKOFFICE_KEY\"\n}'\nTest Request\n(post /api/v1/auth/token)\nSTATUS:\n201\nBEARER TOKEN SUCCESSFULLY\
          \ GENERATED.\nShow Schema\n{\n \"data\": {\n \"token_type\": \"Bearer\",\n \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"\
          ,\n \"expiry_date\": \"2024-11-05 "
  /get:
    get:
      operationId: get_get
      tags:
      - Get
      summary: Request a new PAYSHOP payment reference
      x-source: https://www.ifthenpay.com/docs/en/api/payshop
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetGetResponse'
      x-evidence:
        kind: documentation
  /getPayments:
    get:
      operationId: get_getPayments
      tags:
      - Getpayments
      summary: Retrieve List of Payments - SOAP (1.1 and 1.2)
      description: retrieve a list of all payments matching the specified criteria in SOAP (1.1 and 1.2) format
      x-source: https://www.ifthenpay.com/docs/en/api/list-of-payments
      parameters:
      - name: chavebackoffice
        in: query
        required: true
        schema:
          type: string
      - name: entidade
        in: query
        required: true
        schema:
          type: string
      - name: subentidade
        in: query
        required: true
        schema:
          type: string
      - name: dtHrInicio
        in: query
        required: true
        schema:
          type: string
      - name: dtHrFim
        in: query
        required: true
        schema:
          type: string
      - name: referencia
        in: query
        required: true
        schema:
          type: string
      - name: Valor
        in: query
        required: true
        schema:
          type: string
      - name: sandbox
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /getPaymentsJsonV2:
    get:
      operationId: get_getPaymentsJsonV2
      tags:
      - Getpaymentsjsonv2
      summary: Retrieve List of Payments - JSON​
      description: Retrieve a List of All Payments Matching the Specified Criteria in JSON format
      x-source: https://www.ifthenpay.com/docs/en/api/list-of-payments
      parameters:
      - name: chavebackoffice
        in: query
        required: true
        schema:
          type: string
        description: key provided by ifthenpay when signing the contract
      - name: entidade
        in: query
        required: true
        schema:
          type: string
        description: entity (5 digits) or MB or MBWAY or PAYSHOP or CCARD or COFIDIS or GOOGLE or APPLE or PIX or TPA
      - name: subentidade
        in: query
        required: true
        schema:
          type: string
        description: subentity (3 digits) or MB KEY or MBWAY Key or PAYSHOP KEY or CCARD KEY or COFIDIS KEY or GOOGLE KEY or APPLE KEY or PIX
          KEY or TPA KEY
      - name: dtHrInicio
        in: query
        required: true
        schema:
          type: string
        description: start date/time of the desired payments in the format dd-MM-yyyy HH:mm
      - name: dtHrFim
        in: query
        required: true
        schema:
          type: string
        description: end date/time of the desired payments in the format dd-MM-yyyy HH:mm
      - name: referencia
        in: query
        required: true
        schema:
          type: string
        description: unique payment reference for Multibanco and Payshop; for other methods, it matches the orderId
      - name: Valor
        in: query
        required: true
        schema:
          type: string
        description: amount in euros decimal separator "."
      - name: sandbox
        in: query
        required: true
        schema:
          type: string
        description: should indicate 1 or 0 depending on whether or not the test platform is used
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetGetpaymentsjsonv2Response'
      x-evidence:
        kind: documentation
  /getPaymentsXml:
    get:
      operationId: get_getPaymentsXml
      tags:
      - Getpaymentsxml
      summary: Retrieve List of Payments - XML
      description: retrieve a list of all payments matching the specified criteria in XML format
      x-source: https://www.ifthenpay.com/docs/en/api/list-of-payments
      parameters:
      - name: chavebackoffice
        in: query
        required: true
        schema:
          type: string
      - name: entidade
        in: query
        required: true
        schema:
          type: string
      - name: subentidade
        in: query
        required: true
        schema:
          type: string
      - name: dtHrInicio
        in: query
        required: true
        schema:
          type: string
      - name: dtHrFim
        in: query
        required: true
        schema:
          type: string
      - name: referencia
        in: query
        required: true
        schema:
          type: string
      - name: Valor
        in: query
        required: true
        schema:
          type: string
      - name: sandbox
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /getsandbox:
    get:
      operationId: get_getsandbox
      tags:
      - Getsandbox
      summary: Request a new PAYSHOP payment reference in sandbox mode
      x-source: https://www.ifthenpay.com/docs/en/api/payshop
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetGetsandboxResponse'
      x-evidence:
        kind: documentation
  /mbway/status:
    get:
      operationId: get_mbway_status
      tags:
      - Mbway
      summary: check payment status
      x-source: https://www.ifthenpay.com/docs/en/api/mbway
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /multibanco/reference/init:
    post:
      operationId: post_multibanco_reference_init
      tags:
      - Multibanco
      summary: POST /multibanco/reference/init
      x-source: https://www.ifthenpay.com/docs/en/api/multibanco
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostMultibancoReferenceInitRequest'
      responses:
        '201':
          description: Success (shape read from the example response on the page)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostMultibancoReferenceInitResponse'
      x-evidence:
        kind: code-example
        language: curl
        snippet: "curl https://api.ifthenpay.com/multibanco/reference/init  --request POST  --header 'Content-Type: application/json'  --data\
          \ '{\n \"mbKey\": \"MB_KEY\",\n \"orderId\": \"1887\",\n \"amount\": \"10.99\",\n \"description\": \"order 1 payment\",\n \"url\": \"\
          https://www.empresa.com\",\n \"clientCode\": 123,\n \"clientName\": \"John Doe\",\n \"clientEmail\": \"empresa@empresa.com\",\n \"clientUsername\"\
          : \"johndoe\",\n \"clientPhone\": 35197654321"
  /payment/status/:
    get:
      operationId: get_payment_status
      tags:
      - Payment
      summary: Check Payment Status
      x-source: https://www.ifthenpay.com/docs/en/api/pix
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /spg/payment/mbway:
    post:
      operationId: post_spg_payment_mbway
      tags:
      - Spg
      summary: POST /spg/payment/mbway
      x-source: https://www.ifthenpay.com/docs/en/api/mbway
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostSpgPaymentMbwayRequest'
      responses:
        '201':
          description: Success (shape read from the example response on the page)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostSpgPaymentMbwayResponse'
      x-evidence:
        kind: code-example
        language: curl
        snippet: "curl https://api.ifthenpay.com/spg/payment/mbway  --request POST  --header 'Content-Type: application/json'  --data '{\n \"\
          mbWayKey\": \"MBWAY_KEY\",\n \"orderId\": \"1887\",\n \"amount\": \"10.99\",\n \"mobileNumber\": \"351#912345678\",\n \"email\": \"\
          empresa@empresa.com\",\n \"description\": \"order 1 payment\",\n \"notificationUrl\": \"https://www.yoursite.com/notification.php\"\n\
          }'\nTest Request\n(post /mbway)\nSTATUS:\n200\nSUCCESS"
  /status.php:
    get:
      operationId: get_status_php
      tags:
      - Status
      summary: GET /status.php
      x-source: https://www.ifthenpay.com/docs/en/api/ccard
      parameters:
      - name: amount
        in: query
        required: false
        schema:
          type: string
      - name: id
        in: query
        required: false
        schema:
          type: string
      - name: requestId
        in: query
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: code-example
        language: curl
        snippet: 'curl

          CREDIT CARD ​

          Copy link

          For responsible use of the service, we recommend ALWAYS using the ''CCARD TEST KEY'' for testing in sandbox mode. If you want to carry
          out tests in our Sandbox, ask us for a ''CCARD KEY''. Abuse of the production API may generate a lock on the account.

          There is 1 method available for this API.

          /init/{CCARD_KEY}

          request a new payment​

          replace the {CCARD_KEY} with the one se'
  /v2/callback/activation:
    post:
      operationId: post_v2_callback_activation
      tags:
      - Callback
      summary: POST /v2/callback/activation
      x-source: https://www.ifthenpay.com/docs/en/api/callback
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV2CallbackActivationRequest'
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: code-example
        language: curl
        snippet: "curl https://api.ifthenpay.com/v2/callback/activation  --request POST  --header 'Content-Type: application/json'  --data '{\n\
          \ \"boKey\": \"BACKOFFICE_KEY\",\n \"paymentMethod\": \"MB\",\n \"paymentKey\": \"MB_KEY\",\n \"apKey\": \"654fds46dsf4sjmc6565\",\n\
          \ \"urlCb\": \"https://www.yoursite.com/callback.php?key=[ANTI_PHISHING_KEY]&id=[ID]&amount=[AMOUNT]&payment_datetime=[PAYMENT_DATETIME]&payment_method=[PAYMENT_METHOD]\""
  /v2/payments/read:
    post:
      operationId: post_v2_payments_read
      tags:
      - Payments
      summary: POST /v2/payments/read
      x-source: https://www.ifthenpay.com/docs/en/api/list-of-payments-rest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV2PaymentsReadRequest'
      responses:
        '201':
          description: Success (shape read from the example response on the page)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV2PaymentsReadResponse'
      x-evidence:
        kind: code-example
        language: curl
        snippet: "curl https://api.ifthenpay.com/v2/payments/read  --request POST  --header 'Content-Type: application/json'  --data '{\n \"boKey\"\
          : \"BACKOFFICE_KEY\",\n \"entity\": null,\n \"subEntity\": null,\n \"reference\": null,\n \"orderId\": null,\n \"amount\": null,\n \"\
          requestId\": null,\n \"dateStart\": \"21-10-2024 00:00:00\",\n \"dateEnd\": \"21-10-2024 23:59:59\",\n \"procDateStart\": 20241021,\n\
          \ \"procDateEnd\": 20241021\n}'\nTest Request\n("
  /v2/payments/refund:
    post:
      operationId: post_v2_payments_refund
      tags:
      - Payments
      summary: POST /v2/payments/refund
      x-source: https://www.ifthenpay.com/docs/en/api/refund
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV2PaymentsRefundRequest'
      responses:
        '201':
          description: Success (shape read from the example response on the page)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV2PaymentsRefundResponse'
      x-evidence:
        kind: code-example
        language: curl
        snippet: "curl https://api.ifthenpay.com/v2/payments/refund  --request POST  --header 'Content-Type: application/json'  --data '{\n \"\
          backofficekey\": \"BACKOFFICE_KEY\",\n \"requestId\": \"36jvlEhUYeknQ8PHKprR\",\n \"amount\": \"11.55\"\n}'\nTest Request\n(post /refund)\n\
          STATUS:\n200\nSUCCESSFUL OPERATION\nShow Schema\n{\n \"Code\": 0,\n \"Message\": \"Payment could not be refunded\"\n}\nSuccessful operation\n\
          Models\nShow More\n⬅"
  /{gatewayKey}:
    post:
      operationId: post_gatewayKey
      tags:
      - Api
      summary: request a new payment link and a pinpay code
      x-source: https://www.ifthenpay.com/docs/en/api/pbl
      parameters:
      - name: gatewayKey
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /{gatewayKey}/{requestStatus}:
    post:
      operationId: post_gatewayKey_requestStatus
      tags:
      - Api
      summary: enable or disable pay by link and pinpay
      x-source: https://www.ifthenpay.com/docs/en/api/pbl
      parameters:
      - name: gatewayKey
        in: path
        required: true
        schema:
          type: string
      - name: requestStatus
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
components:
  schemas:
    PostApiV1AuthTokenRequest:
      type: object
      properties:
        backofficeKey:
          type: string
          description: ifthenpay backoffice key provided to the user for authentication.
      required:
      - backofficeKey
    PostApiV1AuthTokenResponse:
      type: object
      properties:
        token_type:
          type: string
          description: Bearer
        access_token:
          type: string
          description: JWT token
        expiry_date:
          type: string
          description: Expiration date of the token
    PostDirectdebitApiV1AuthTokenRequest:
      type: object
      properties:
        backofficeKey:
          type: string
    PostDirectdebitApiV1AuthTokenResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            token_type:
              type: string
            access_token:
              type: string
            expiry_date:
              type: string
              format: date-time
    GetGetResponse:
      type: object
      properties:
        Code:
          type: string
        Message:
          type: string
        Reference:
          type: string
        RequestId:
          type: string
    GetGetpaymentsjsonv2Response:
      type: object
      properties:
        Entidade:
          type: integer
        SubEntidade:
          type: integer
        Referencia:
          type: integer
        Valor:
          type: string
        Id:
          type: integer
        DtHrPagamento:
          type: string
        Processamento:
          type: integer
        Terminal:
          type: string
        Tarifa:
          type: string
        ValorLiquido:
          type: string
        CodigoErro:
          type: string
        MensagemErro:
          type: string
        Imagem:
          type: string
    GetGetsandboxResponse:
      type: object
      properties:
        Code:
          type: string
        Message:
          type: string
        Reference:
          type: string
        RequestId:
          type: string
    PostMultibancoReferenceInitRequest:
      type: object
      properties:
        mbKey:
          type: string
        orderId:
          type: string
        amount:
          type: string
        description:
          type: string
        url:
          type: string
        clientCode:
          type: integer
        clientName:
          type: string
        clientEmail:
          type: string
        clientUsername:
          type: string
        clientPhone:
          type: integer
        expiryDays:
          type: string
    PostMultibancoReferenceInitResponse:
      type: object
      properties:
        Amount:
          type: string
        Entity:
          type: string
        ExpiryDate:
          type: string
        Message:
          type: string
        OrderId:
          type: string
        Reference:
          type: string
        RequestId:
          type: string
        Status:
          type: string
    PostSpgPaymentMbwayRequest:
      type: object
      properties:
        mbWayKey:
          type: string
        orderId:
          type: string
        amount:
          type: string
        mobileNumber:
          type: string
        email:
          type: string
        description:
          type: string
        notificationUrl:
          type: string
    PostSpgPaymentMbwayResponse:
      type: object
      properties:
        Amount:
          type: number
        Message:
          type: string
        orderId:
          type: integer
        RequestId:
          type: string
        Status:
          type: string
    PostV2CallbackActivationRequest:
      type: object
      properties:
        boKey:
          type: string
        paymentMethod:
          type: string
        paymentKey:
          type: string
        apKey:
          type: string
        urlCb:
          type: string
    PostV2PaymentsReadRequest:
      type: object
      properties:
        boKey:
          type: string
        entity:
          type:
          - string
          - 'null'
        subEntity:
          type:
          - string
          - 'null'
        reference:
          type:
          - string
          - 'null'
        orderId:
          type:
          - string
          - 'null'
        amount:
          type:
          - string
          - 'null'
        requestId:
          type:
          - string
          - 'null'
        dateStart:
          type: string
        dateEnd:
          type: string
        procDateStart:
          type: integer
        procDateEnd:
          type: integer
    PostV2PaymentsReadResponse:
      type: object
      properties:
        message:
          type: string
        status:
          type: integer
        payments:
          type: array
          items:
            type: object
            properties:
              amount:
                type: integer
              entity:
                type: string
              fee:
                type: number
              netAmount:
                type: number
              orderId:
                type: string
              paymentDate:
                type: string
              procDate:
                type: string
              reference:
                type: string
              requestId:
                type: string
              subEntity:
                type: string
              terminal:
                type: string
    PostV2PaymentsRefundRequest:
      type: object
      properties:
        backofficekey:
          type: string
        requestId:
          type: string
        amount:
          type: string
    PostV2PaymentsRefundResponse:
      type: object
      properties:
        Code:
          type: integer
        Message:
          type: string
  securitySchemes:
    JWT_Bearer:
      type: http
      scheme: bearer
      x-source: https://www.ifthenpay.com/docs/en/api/directdebit/
tags:
- name: Api
- name: Callback
- name: Directdebit
- name: Get
- name: Getpayments
- name: Getpaymentsjsonv2
- name: Getpaymentsxml
- name: Getsandbox
- name: Mbway
- name: Multibanco
- name: Payment
- name: Payments
- name: Spg
- name: Status
security:
- JWT_Bearer: []