Mamo Webhooks API

The Webhooks API from Mamo — 2 operation(s) for webhooks.

OpenAPI Specification

mamo-webhooks-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Mamo Business Business Details Webhooks API
  version: '1.6'
  description: Mamo Business API follows the REST model. Its purpose is to enable Mamo Business users to automate payment link generation, charges, subscriptions, disbursements, recipients, cards, expenses and webhooks. Accepts JSON request bodies and returns JSON responses.
  contact:
    name: Mamo API Support
    email: api@mamopay.com
servers:
- url: https://business.mamopay.com/manage_api/v1
  description: Production server
- url: https://sandbox.dev.business.mamopay.com/manage_api/v1
  description: Sandbox server
security:
- bearerAuth: []
tags:
- name: Webhooks
paths:
  /webhooks/{webhookId}:
    delete:
      tags:
      - Webhooks
      summary: Delete Webhook
      description: Allows a user to delete a registered webhook.<br><br>
      parameters:
      - in: path
        name: webhookId
        schema:
          type: string
          default: MPB-WH-09B9214B61
        required: true
        description: Webhook ID
        example: MPB-WH-09B9214B61
      - name: Content-Type
        in: header
        schema:
          type: string
        example: application/json
      - name: Authorization
        in: header
        schema:
          type: string
        example: Bearer <your sandbox api key>
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                example:
                  success: true
        '403':
          description: Unauthorised
          content:
            application/json:
              schema:
                type: object
                properties:
                  messages:
                    type: array
                    items:
                      type: string
                  error_code:
                    type: string
                example:
                  messages:
                  - Unauthorized
                  error_code: UNAUTHORIZED
        '404':
          description: Invalid request
        '500':
          description: Unexpected error
      operationId: deleteWebhooksWebhookid
    patch:
      tags:
      - Webhooks
      summary: Update Webhook
      description: Allows a user to update webhook details.<br><br>
      parameters:
      - in: path
        name: webhookId
        schema:
          type: string
          default: MPB-WH-FBA601A8DA
        required: true
        description: Webhook ID
        example: MPB-WH-FBA601A8DA
      - name: Content-Type
        in: header
        schema:
          type: string
        example: application/json
      - name: Authorization
        in: header
        schema:
          type: string
        example: Bearer <your sandbox api key>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: The URL which the customer will be redirected to after a successful payment.
                  default: https://webhook.site/e9145367-01cc-45f9-bebb-69775badb883
                enabled_events:
                  type: array
                  items:
                    type: string
                  description: 'The URL of webhook which customer will be recieved the notification:<br> charge.failed: Notification for failed one-off payments<br> charge.succeeded: Notification for successful one-off payments<br> charge.refund_initiated: Notification for initializing the refund<br> charge.refunded: Notification for the successful refund<br> charge.refund_failed: Notification for the failed refund<br> charge.card_verified: Notification for card verification payment<br> subscription.failed: Notification for failed subscription payments<br> subscription.succeeded: Notification for successful subscription payments<br> payment_link.create: Notification for successfully create payment link<br> payout.processed: Notification for settled payout<br> payout.failed: Notification for rejected payout<br> '
                  default:
                  - charge.failed
                  - charge.succeeded
                  - charge.refund_initiated
                  - charge.refunded
                  - charge.refund_failed
                  - subscription.failed
                  - subscription.succeeded
                  - payment_link.create
                auth_header:
                  type: string
                  minLength: 1
                  maxLength: 50
                  description: authentication header
                  default: authentication header
              required:
              - url
              - enabled_events
              example:
                id: MB-WH-FBA601A8DA
                url: https://webhook.site/e9145367-01cc-45f9-bebb-69775badb883
                enabled_events:
                - charge.failed
                auth_header: authentication header
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    default: MB-WH-FBA601A8DA
                    description: The identifier of webhook
                  url:
                    type: string
                    format: uri
                    default: https://webhook.site/e9145367-01cc-45f9-bebb-69775badb883
                    description: The URL which the customer will be redirected to after a successful payment.
                  enabled_events:
                    type: array
                    default:
                    - charge.failed
                    description: the options for notifying
                  auth_header:
                    type: string
                    minLength: 1
                    maxLength: 50
                    description: authentication header
                    default: test
                example:
                  url: https://webhook.site/e9145367-01cc-45f9-bebb-69775badb883
                  enabled_events:
                  - charge.failed
                  auth_header: test
                  id: MB-WH-FBA601A8DA
        '403':
          description: Unauthorised
          content:
            application/json:
              schema:
                type: object
                properties:
                  messages:
                    type: array
                    items:
                      type: string
                  error_code:
                    type: string
                example:
                  messages:
                  - Unauthorized
                  error_code: UNAUTHORIZED
        '404':
          description: Invalid request
        '500':
          description: Unexpected error
      operationId: patchWebhooksWebhookid
  /webhooks:
    get:
      tags:
      - Webhooks
      summary: Fetching Webhooks
      description: Fetches all registered webhooks for a given business.<br><br>
      parameters:
      - name: Content-Type
        in: header
        schema:
          type: string
        example: application/json
      - name: Authorization
        in: header
        schema:
          type: string
        example: Bearer <your sandbox api key>
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      default: MB-WH-D8B07FB8D7
                      description: The identifier of webhook
                    url:
                      type: string
                      format: uri
                      default: https://webhook.site/e9145367-01cc-45f9-bebb-69775badb883
                      description: The URL of webhook which customer will be recieved the notification
                    enabled_events:
                      type: array
                      default:
                      - charge.failed
                      - charge.succeeded
                      - charge.refund_initiated
                      - charge.refunded
                      - charge.refund_failed
                      - subscription.failed
                      - subscription.succeeded
                      description: the options for notifying
                    auth_header:
                      type: string
                      minLength: 1
                      maxLength: 50
                      description: authentication header
                      default: header
                example: []
        '403':
          description: Unauthorised
          content:
            application/json:
              schema:
                type: object
                properties:
                  messages:
                    type: array
                    items:
                      type: string
                  error_code:
                    type: string
                example:
                  messages:
                  - Unauthorized
                  error_code: UNAUTHORIZED
        '500':
          description: Unexpected error
      operationId: getWebhooks
    post:
      tags:
      - Webhooks
      summary: Create Webhook
      description: Webhook registration for updates on one-off payment statuses and subscription payment statues.<br><br>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: The URL of webhook which customer will be recieved the notification
                  default: https://webhook.site/e9145367-01cc-45f9-bebb-69775badb883
                enabled_events:
                  type: array
                  items:
                    type: string
                  description: 'Event types details:<br> charge.failed: Notification for failed one-off payments<br> charge.succeeded: Notification for successful one-off payments<br> charge.refund_initiated: Notification for initializing the refund<br> charge.refunded: Notification for the successful refund<br> charge.refund_failed: Notification for the failed refund<br> charge.card_verified: Notification for card verification payment<br> charge.authorized: Notification for when a charge is placed on hold<br> subscription.failed: Notification for failed subscription payments<br> subscription.succeeded: Notification for successful subscription payments<br> payment_link.create: Notification for successfully create payment link<br> payout.processed: Notification for settled payout<br> payout.failed: Notification for rejected payout<br> expense.create: Notification for expense creation<br> expense.update: Notification for expense updates<br> card_transaction.create: Notification for card transaction creation<br> card_transaction.update: Notification for card transaction updates<br> '
                  default:
                  - charge.failed
                  - charge.succeeded
                  - charge.refund_initiated
                  - charge.refunded
                  - charge.refund_failed
                  - subscription.failed
                  - subscription.succeeded
                  - payment_link.create
                auth_header:
                  type: string
                  minLength: 1
                  maxLength: 50
                  description: authentication header
                  default: authentication header
              required:
              - url
              - enabled_events
              example:
                id: MB-WH-D8B07FB8D7
                url: https://webhook.site/e9145367-01cc-45f9-bebb-69775badb883
                enabled_events:
                - charge.failed
                - charge.succeeded
                - subscription.failed
                - subscription.succeeded
                auth_header: authentication header
      parameters:
      - name: Content-Type
        in: header
        schema:
          type: string
        example: application/json
      - name: Authorization
        in: header
        schema:
          type: string
        example: Bearer <your sandbox api key>
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  url:
                    type: string
                    format: uri
                  enabled_events:
                    type: array
                  auth_header:
                    type: string
                example:
                  url: https://webhook.site/e9145367-01cc-45f9-bebb-69775badb883
                  enabled_events:
                  - charge.failed
                  - charge.succeeded
                  - charge.refund_initiated
                  - charge.refunded
                  - charge.refund_failed
                  - subscription.failed
                  - subscription.succeeded
                  auth_header: authentication header
                  id: MB-WH-D8B07FB8D7
        '403':
          description: Unauthorised
          content:
            application/json:
              schema:
                type: object
                properties:
                  messages:
                    type: array
                    items:
                      type: string
                  error_code:
                    type: string
                example:
                  messages:
                  - Unauthorized
                  error_code: UNAUTHORIZED
        '404':
          description: Invalid request
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  messages:
                    type: array
                  error_code:
                    type: string
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        items:
                          type: string
                example:
                  messages:
                  - See errors
                  error_code: VALIDATION_FAILED
                  errors:
                  - Url is missing
                  - Enabled_events is missing
        '500':
          description: Unexpected error
      operationId: postWebhooks
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key from the Mamo dashboard (Developer > Keys), passed as `Authorization: Bearer <api_key>`.'