---
agentTools:
  projectIndex: https://developer.mxmerchant.com/llms.txt
---

# Create Notification

[block:callout]
{
  "type": "info",
  "title": "Link2Pay",
  "body": "For notifications from Link2Pay sources, add a dash and the name of the payment link after Link2Pay in the sources field, i.e. *Link2Pay - Example Payment Link*.",
  "sidebar": true
}
[/block]

[block:callout]
{
  "type": "info",
  "title": "Want to see some example responses?",
  "body": "Click [here](https://developer.mxmerchant.com/docs/notification-examples) to go to the notifications documentation section where we have examples for each notification type."
}
[/block]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Checkout API",
    "version": "1.00"
  },
  "servers": [
    {
      "url": "https://sandbox.api.mxmerchant.com/checkout"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v3/subscription": {
      "put": {
        "summary": "Create Notification",
        "description": "",
        "operationId": "create-notification",
        "parameters": [
          {
            "name": "echo",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "eventType",
                  "merchantId",
                  "sendEmail",
                  "sendSMS",
                  "sendWebhook",
                  "inviteUsers"
                ],
                "properties": {
                  "eventType": {
                    "type": "string",
                    "description": "Values: `Chargeback, Deposit, PaymentSuccess, PaymentFail, UpcomingSAQExpiration, RefundCreated, NewStatement, BatchClosed, ExpiredCard`"
                  },
                  "merchantId": {
                    "type": "integer",
                    "description": "Merchant Id",
                    "format": "int32"
                  },
                  "sendEmail": {
                    "type": "boolean",
                    "description": "Send email notification"
                  },
                  "emailAddress": {
                    "type": "string",
                    "description": "Email address to send email notification to"
                  },
                  "sendSMS": {
                    "type": "boolean",
                    "description": "Send text message notification"
                  },
                  "phoneNumber": {
                    "type": "string",
                    "description": "Phone number to send SMS notification to"
                  },
                  "sendWebhook": {
                    "type": "boolean",
                    "description": "Send webhook notification"
                  },
                  "callbackUrl": {
                    "type": "string",
                    "description": "URL to send webhook notification to"
                  },
                  "threshold": {
                    "type": "integer",
                    "description": "Thresholds are required for SAQ expiration and any notification related to dollar amounts.",
                    "format": "int32"
                  },
                  "sources": {
                    "type": "string",
                    "description": "Comma separated list of sources from which to be notified for payments and refunds. This can be QuickPay, Invoice, Recurring, Order, MXExpress, MXRetail, API, and/or Link2Pay."
                  },
                  "inviteUsers": {
                    "type": "string",
                    "description": "Comma separated list of roles from which to be notified by browser alerts. This can be Administrator, FullAccess, Supervisor, Clerk, ReadOnly. (Can be sent as an empty string)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"id\": 411,\n  \"eventType\": \"PaymentSuccess\",\n  \"merchantId\": 110070419,\n  \"created\": \"2018-03-20T21:10:12.54Z\",\n  \"modified\": \"2018-03-20T21:10:12.54Z\",\n  \"phoneNumber\": \"8662102157\",\n  \"threshold\": 10,\n  \"sendEmail\": false,\n  \"sendSMS\": true,\n  \"sendWebhook\": false,\n  \"Sources\": \"API\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "example": 411,
                      "default": 0
                    },
                    "eventType": {
                      "type": "string",
                      "example": "PaymentSuccess"
                    },
                    "merchantId": {
                      "type": "integer",
                      "example": 110070419,
                      "default": 0
                    },
                    "created": {
                      "type": "string",
                      "example": "2018-03-20T21:10:12.54Z"
                    },
                    "modified": {
                      "type": "string",
                      "example": "2018-03-20T21:10:12.54Z"
                    },
                    "phoneNumber": {
                      "type": "string",
                      "example": "8662102157"
                    },
                    "threshold": {
                      "type": "integer",
                      "example": 10,
                      "default": 0
                    },
                    "sendEmail": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "sendSMS": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "sendWebhook": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "Sources": {
                      "type": "string",
                      "example": "API"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": false
  },
  "x-readme-fauxas": true,
  "_id": "644bb860dd3d4600261d0de7:644bb860dd3d4600261d0e2f"
}
```