Openpay Webhooks API

Register and manage webhook endpoints for event notifications.

OpenAPI Specification

openpay-webhooks-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Openpay BankAccounts Webhooks API
  description: REST API for the Openpay online payments platform (BBVA group), available in Mexico and Colombia. Resources are scoped to a merchant under the path /v1/{merchant_id}. The API supports charges against cards, convenience stores (cash), and banks (SPEI); customers and stored cards; client-side tokens; recurring plans and subscriptions; payouts and transfers to bank accounts; commission fees; and webhook notifications. Authentication uses HTTP Basic auth with the merchant private API key as the username and an empty password.
  termsOfService: https://www.openpay.mx/terminos-y-condiciones.html
  contact:
    name: Openpay Support
    url: https://www.openpay.mx
    email: soporte@openpay.mx
  version: '1.0'
servers:
- url: https://api.openpay.mx/v1
  description: Production (Mexico)
- url: https://sandbox-api.openpay.mx/v1
  description: Sandbox (Mexico)
- url: https://api.openpay.co/v1
  description: Production (Colombia)
- url: https://sandbox-api.openpay.co/v1
  description: Sandbox (Colombia)
security:
- basicAuth: []
tags:
- name: Webhooks
  description: Register and manage webhook endpoints for event notifications.
paths:
  /{merchant_id}/webhooks:
    parameters:
    - $ref: '#/components/parameters/MerchantId'
    post:
      operationId: createWebhook
      tags:
      - Webhooks
      summary: Register a webhook endpoint.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhook'
      responses:
        '200':
          description: Webhook created (pending verification).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
    get:
      operationId: listWebhooks
      tags:
      - Webhooks
      summary: List registered webhooks.
      responses:
        '200':
          description: A list of webhooks.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Webhook'
  /{merchant_id}/webhooks/{webhook_id}:
    parameters:
    - $ref: '#/components/parameters/MerchantId'
    - name: webhook_id
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: getWebhook
      tags:
      - Webhooks
      summary: Get a webhook by id.
      responses:
        '200':
          description: The webhook.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
    delete:
      operationId: deleteWebhook
      tags:
      - Webhooks
      summary: Delete a webhook.
      responses:
        '204':
          description: Webhook deleted.
components:
  schemas:
    CreateWebhook:
      type: object
      required:
      - url
      properties:
        url:
          type: string
          description: HTTPS endpoint that will receive POST notifications.
        user:
          type: string
          description: Optional basic-auth user sent with notifications.
        password:
          type: string
          description: Optional basic-auth password sent with notifications.
        event_types:
          type: array
          items:
            type: string
            enum:
            - charge.refunded
            - charge.failed
            - charge.cancelled
            - charge.created
            - charge.succeeded
            - charge.rescored.to.decline
            - subscription.charge.failed
            - payout.created
            - payout.succeeded
            - payout.failed
            - transfer.succeeded
            - fee.succeeded
            - fee.refund.succeeded
            - spei.received
            - chargeback.created
            - chargeback.rejected
            - chargeback.accepted
            - order.created
            - order.activated
            - order.payment.received
            - order.completed
            - order.expired
            - order.cancelled
            - order.payment.cancelled
            - verification
    Webhook:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        user:
          type: string
        event_types:
          type: array
          items:
            type: string
        status:
          type: string
          enum:
          - verified
          - unverified
  parameters:
    MerchantId:
      name: merchant_id
      in: path
      required: true
      description: The merchant identifier that scopes all resources.
      schema:
        type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic authentication. Use the merchant private API key as the username and leave the password empty.