---
updatedAt: 2026-04-20T20:32:06.000Z
agentTools:
  projectIndex: https://docs.zeptopayments.com/llms.txt
---

# list agreement history

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Zepto PayTo API",
    "version": "20260901",
    "description": "Documentation for the Zepto PayTo API.",
    "termsOfService": "https://www.zepto.com.au/customer-terms",
    "contact": {
      "email": "support@zepto.com.au"
    }
  },
  "tags": [
    {
      "name": "Agreements",
      "description": "Create and query agreements"
    }
  ],
  "externalDocs": {
    "description": "Zepto API v1.0",
    "url": "https://docs.zeptopayments.com"
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/payto/agreements/{agreement_uid}/history": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ZeptoAPIVersion"
        },
        {
          "name": "agreement_uid",
          "in": "path",
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9\\-._~]+$",
            "description": "A supplied unique ID",
            "example": "Agreement_00012345"
          },
          "required": true
        }
      ],
      "get": {
        "summary": "list agreement history",
        "tags": [
          "Agreements"
        ],
        "parameters": [
          {
            "name": "per_page",
            "description": "Number of results per page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "starting_after",
            "description": "Opaque pagination cursor value. Set by following \"next\" links.",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful",
            "content": {
              "application/json": {
                "examples": {
                  "Successful request": {
                    "summary": "Successful request",
                    "value": {
                      "links": {
                        "next": "/payto/agreements/biz_agreement_000123/history?per_page=20&starting_after=aaaaaaaa-0000-0000-0000-00000000000e"
                      },
                      "data": [
                        {
                          "id": "aaaaaaaa-0000-0000-0000-00000000002a",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:35:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "failure": {
                              "code": "UKNWN",
                              "title": "Unknown Error",
                              "detail": "An unexpected error occured. Reach out to Zepto for more information"
                            }
                          },
                          "type": "payto_agreement.suspension_failed"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000029",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:33:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "reason": {
                              "code": "AC06",
                              "title": "Blocked Account",
                              "detail": "The Payer Customer Account is blocked"
                            },
                            "caused_by": "debtor"
                          },
                          "type": "payto_agreement.suspended"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000028",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:31:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "failure": {
                              "code": "UKNWN",
                              "title": "Unknown Error",
                              "detail": "An unexpected error occured. Reach out to Zepto for more information"
                            }
                          },
                          "type": "payto_agreement.reactivation_failed"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000027",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:29:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "caused_by": "debtor"
                          },
                          "type": "payto_agreement.reactivated"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000026",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:27:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "failure": {
                              "code": "UKNWN",
                              "title": "Unknown Error",
                              "detail": "An unexpected error occured. Reach out to Zepto for more information"
                            }
                          },
                          "type": "payto_agreement.failed"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000025",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:25:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": null,
                          "type": "payto_agreement.expired"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000024",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:23:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "reason": {
                              "code": "AC02",
                              "title": "Invalid Debtor Account",
                              "detail": "The Payer Customer Account does not exist within NPP"
                            },
                            "caused_by": "debtor"
                          },
                          "type": "payto_agreement.declined"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000023",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:21:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "reason": {
                              "code": "AC05",
                              "title": "Closed Debtor Account",
                              "detail": "The Payer Customer account is closed"
                            },
                            "caused_by": "debtor"
                          },
                          "type": "payto_agreement.cancelled"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000022",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:19:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "failure": {
                              "code": "UKNWN",
                              "title": "Unknown Error",
                              "detail": "An unexpected error occured. Reach out to Zepto for more information"
                            }
                          },
                          "type": "payto_agreement.cancellation_failed"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000021",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:17:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": null,
                          "type": "payto_agreement.amendment_recalled"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000020",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:15:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "failure": {
                              "code": "UKNWN",
                              "title": "Unknown Error",
                              "detail": "An unexpected error occured. Reach out to Zepto for more information"
                            }
                          },
                          "type": "payto_agreement.amendment_recall_failed"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-00000000001f",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:13:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "failure": {
                              "code": "UKNWN",
                              "title": "Unknown Error",
                              "detail": "An unexpected error occured. Reach out to Zepto for more information"
                            }
                          },
                          "type": "payto_agreement.amendment_failed"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-00000000001e",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:11:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": null,
                          "type": "payto_agreement.amendment_expired"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-00000000001d",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:09:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "caused_by": "debtor"
                          },
                          "type": "payto_agreement.amendment_declined"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-00000000001c",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:07:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": {
                            "changes": {
                              "description": "new description"
                            },
                            "caused_by": "initiator"
                          },
                          "type": "payto_agreement.amended"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-00000000001b",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:05:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": null,
                          "type": "payto_agreement.activated"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000010",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:03:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": null,
                          "type": "payto_agreement.activated"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-00000000000f",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:03:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": null,
                          "type": "payto_agreement.activated"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-000000000008",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:03:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": null,
                          "type": "payto_agreement.activated"
                        },
                        {
                          "id": "aaaaaaaa-0000-0000-0000-00000000000e",
                          "resource_uid": "biz_agreement_000123",
                          "published_at": "2022-01-01T02:03:00.000Z",
                          "resource_type": "payto_agreement",
                          "body": null,
                          "type": "payto_agreement.activated"
                        }
                      ]
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "links": {
                      "$ref": "#/components/schemas/payto.pagination_links"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "anyOf": [
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.activated"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.amended"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.amendment_declined"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.amendment_expired"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.amendment_failed"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.amendment_recall_failed"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.amendment_recalled"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.cancellation_failed"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.cancelled"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.declined"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.expired"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.failed"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.reactivated"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.reactivation_failed"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.suspended"
                          },
                          {
                            "$ref": "#/components/schemas/payto.event.payto_agreement.suspension_failed"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "examples": {
                  "Unauthorised access token": {
                    "summary": "Unauthorised access token",
                    "value": {
                      "errors": [
                        {
                          "title": "Unauthorised access token",
                          "detail": "Access token is expired or not valid",
                          "links": {
                            "about": "https://docs.zeptopayments.com/docs/zepto-api#authentication-and-authorisation"
                          }
                        }
                      ]
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/payto.generic_errors"
                }
              }
            }
          },
          "403": {
            "description": "forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "examples": {
                  "Non integer per_page": {
                    "summary": "Non integer per_page",
                    "value": {
                      "errors": [
                        {
                          "code": "ZPPGN00",
                          "title": "One or more paramaters are invalid",
                          "detail": "The `per_page` param is not valid."
                        }
                      ]
                    }
                  },
                  "No record with ID matching starting_after param": {
                    "summary": "No record with ID matching starting_after param",
                    "value": {
                      "errors": [
                        {
                          "code": "ZPPGN00",
                          "title": "One or more paramaters are invalid",
                          "detail": "Could not find a record for the given `starting_after` param."
                        }
                      ]
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/payto.unprocessable_pagination_errors"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    }
  },
  "servers": [
    {
      "description": "Zepto Sandbox",
      "url": "https://api.sandbox.zeptopayments.com"
    },
    {
      "description": "Zepto Production",
      "url": "https://api.zeptopayments.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "parameters": {
      "ZeptoAPIVersion": {
        "name": "Zepto-API-Version",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^\\d{8}$",
          "default": "20250101",
          "example": "20260901"
        },
        "description": "API version in YYYYMMDD format. Defaults to 20250101 (legacy) when omitted."
      }
    },
    "schemas": {
      "payto.account_identifier": {
        "type": "object",
        "description": "An identifier representing the parties account",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "bban",
              "alias_phone",
              "alias_email",
              "alias_abn",
              "alias_organisation_identifier"
            ]
          },
          "value": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/payto.account_identifiers_bban"
              },
              {
                "$ref": "#/components/schemas/payto.account_identifiers_alias_email"
              },
              {
                "$ref": "#/components/schemas/payto.account_identifiers_alias_phone"
              },
              {
                "$ref": "#/components/schemas/payto.account_identifiers_alias_abn"
              },
              {
                "$ref": "#/components/schemas/payto.account_identifiers_alias_organisation_identifier"
              }
            ]
          }
        }
      },
      "payto.account_identifiers_alias_abn": {
        "type": "string",
        "title": "ABN alias",
        "description": "A PayID ABN alias",
        "example": "123456789",
        "pattern": "^((\\d{9})|(\\d{11}))$"
      },
      "payto.account_identifiers_alias_email": {
        "type": "string",
        "title": "Email alias",
        "description": "A PayID email alias",
        "example": "default@example.com",
        "pattern": "^(?:[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)$"
      },
      "payto.account_identifiers_alias_organisation_identifier": {
        "type": "string",
        "title": "Organisation alias",
        "description": "A PayID organisation identifier alias",
        "example": "Zepto Pty Ltd, Byron Bay NSW",
        "pattern": "^[!-@\\[-~][ -@\\[-~]{0,254}[!-@\\[-~]$"
      },
      "payto.account_identifiers_alias_phone": {
        "type": "string",
        "title": "Phone alias",
        "description": "A PayID phone alias. e.g. +61-411222333",
        "example": "+61-411222333",
        "pattern": "^\\+[0-9]{1,3}-[1-9]{1,1}[0-9]{1,29}$"
      },
      "payto.account_identifiers_bban": {
        "type": "string",
        "title": "BBAN",
        "description": "A branch code (BSB) and account number separated with a hyphen",
        "example": "123456-98765432",
        "pattern": "^\\d{6}-[ -~]{1,28}$"
      },
      "payto.event.agreement_action_failed": {
        "type": "object",
        "properties": {
          "body": {
            "type": "object",
            "description": "More information about the failure",
            "properties": {
              "failure": {
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "A short description of the reason or failure",
                    "example": "Agreement Status Invalid"
                  },
                  "detail": {
                    "type": "string",
                    "description": "A longer description of the reason or failure",
                    "example": "Contact Zepto for more information - The requested operation cannot be performed for the current status of the agreement"
                  },
                  "code": {
                    "type": "string",
                    "description": "A unique identifier for this specific type of reason or failure",
                    "example": "MMS.API.9104",
                    "enum": [
                      "MMS.API.9000",
                      "MMS.API.9001",
                      "MMS.API.9002",
                      "MMS.API.9003",
                      "MMS.API.9005",
                      "MMS.API.9006",
                      "MMS.API.9007",
                      "MMS.API.9008",
                      "MMS.API.9009",
                      "MMS.API.9010",
                      "MMS.API.9011",
                      "MMS.API.9013",
                      "MMS.API.9015",
                      "MMS.API.9016",
                      "MMS.API.9017",
                      "MMS.API.9018",
                      "MMS.API.9019",
                      "MMS.API.9101",
                      "MMS.API.9102",
                      "MMS.API.9103",
                      "MMS.API.9104",
                      "MMS.API.9105",
                      "MMS.API.9106",
                      "MMS.API.9107",
                      "MMS.API.9108",
                      "MMS.API.9109",
                      "MMS.API.9110",
                      "MMS.API.9111",
                      "MMS.API.9112",
                      "MMS.API.9113",
                      "MMS.API.9114",
                      "MMS.API.9115",
                      "MMS.API.9116",
                      "MMS.API.9117",
                      "MMS.API.9118",
                      "MMS.API.9119",
                      "MMS.API.9120",
                      "MMS.API.9121",
                      "MMS.API.9301",
                      "MMS.API.9302",
                      "MMS.API.9303",
                      "MMS.API.9401",
                      "MMS.API.9402",
                      "MMS.API.9501",
                      "MMS.API.9601",
                      "MMS.API.9900",
                      "MMS.API.9901",
                      "UKNWN"
                    ]
                  }
                }
              }
            },
            "required": [
              "failure"
            ]
          }
        }
      },
      "payto.event.base": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the event that triggered the webhook delivery. Value is a UUIDv7",
            "example": "019c6f54-1117-7a38-89ae-841bb4e4ac67"
          },
          "type": {
            "type": "string",
            "description": "The type of event that triggered the webhook delivery",
            "example": "payto_payment.settled"
          },
          "published_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the event was published by Zepto",
            "example": "2023-03-07T22:50:40Z"
          },
          "resource_uid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9\\-._~]+$",
            "description": "Supplied unique identifier for resource that the event affected, maximum 64 characters containing only unreserved characters as defined in RFC3986.",
            "example": "biz_20221231_G7MQWwkQZIP8vbfH"
          },
          "resource_type": {
            "type": "string",
            "description": "The type of resource the resource_uid relates to",
            "enum": [
              "payto_agreement",
              "payto_payment",
              "payto_refund"
            ],
            "example": "payto_payment"
          },
          "body": {
            "type": "object",
            "nullable": true,
            "example": null
          }
        },
        "required": [
          "id",
          "type",
          "published_at",
          "resource_uid",
          "resource_type",
          "body"
        ]
      },
      "payto.event.payto_agreement.activated": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "$ref": "#/components/schemas/payto.event.resource_metadata"
          },
          {
            "type": "object",
            "properties": {
              "body": {
                "type": "object",
                "required": [
                  "mms_agreement_id"
                ],
                "properties": {
                  "mms_agreement_id": {
                    "type": "string",
                    "description": "The agreement ID as per the MMS. Formatted as a Universally Unique Identifier (UUID) version 1, as described in IETC RFC 4122 without the 4 hyphen separators.",
                    "example": "3de455278b21196da0c4599025cb7dfa",
                    "nullable": false,
                    "pattern": "^[a-f0-9]{12}1[a-f0-9]{3}[89ab][a-f0-9]{15}$"
                  }
                }
              }
            }
          }
        ]
      },
      "payto.event.payto_agreement.amended": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "type": "object",
            "properties": {
              "body": {
                "type": "object",
                "required": [
                  "caused_by",
                  "changes"
                ],
                "properties": {
                  "caused_by": {
                    "type": "string",
                    "description": "The party that caused the amendment",
                    "enum": [
                      "debtor",
                      "initiator"
                    ]
                  },
                  "changes": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "example": "Payment plan for loan #1234",
                        "pattern": "^[ -~]+$",
                        "minLength": 1,
                        "maxLength": 140,
                        "description": "The reason for the agreement, as narrative text. ASCII-printable characters only."
                      },
                      "validity_end_date": {
                        "type": "string",
                        "format": "date",
                        "description": "End date of the validity of the agreement. If specified, the agreement will be valid until 23:59:59.999 Australia Sydney time on this date.",
                        "nullable": true,
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                        "example": "2023-12-31"
                      },
                      "payment_terms": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "description": "The pattern that payments will follow",
                            "enum": [
                              "balloon",
                              "fixed",
                              "usage_based",
                              "variable"
                            ],
                            "example": "fixed"
                          },
                          "frequency": {
                            "type": "string",
                            "description": "The frequency at which payments will be made. Can be used in conjunction with `count` to allow more than one payment per period.",
                            "enum": [
                              "adhoc",
                              "daily",
                              "weekly",
                              "fortnightly",
                              "monthly",
                              "quarterly",
                              "semi_annual",
                              "annual"
                            ],
                            "example": "monthly"
                          },
                          "count": {
                            "type": "integer",
                            "description": "Count of payments allowed per frequency period. With non-adhoc frequency periods, if count is not given, one payment per frequency period will be allowed. If frequency is adhoc and count is not given, unlimited payments will be allowed.",
                            "example": 1,
                            "minimum": 1,
                            "nullable": true
                          },
                          "amount": {
                            "type": "integer",
                            "description": "Fixed amount to be debited from the debtor's account. Required for 'fixed' and 'balloon' types.",
                            "example": 10000,
                            "minimum": 1,
                            "maximum": 1000000000,
                            "nullable": true
                          },
                          "max_amount": {
                            "type": "integer",
                            "description": "The maximum allowed payment amount, in cents.",
                            "example": 100000,
                            "minimum": 1,
                            "maximum": 1000000000,
                            "nullable": true
                          },
                          "first_payment_amount": {
                            "type": "integer",
                            "description": "Optional specified payment amount for first payment, in cents. Applicable only to 'balloon' terms type.",
                            "example": 100000,
                            "minimum": 1,
                            "maximum": 1000000000,
                            "nullable": true
                          },
                          "last_payment_amount": {
                            "type": "integer",
                            "description": "Optional specified payment amount for last payment, in cents. Applicable only to 'balloon' terms type.",
                            "example": 100000,
                            "minimum": 1,
                            "maximum": 1000000000,
                            "nullable": true
                          },
                          "first_payment_date": {
                            "type": "string",
                            "format": "date",
                            "description": "The date first payment will be initiated for agreement. Date timezone is Australia Sydney.",
                            "nullable": true,
                            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                            "example": "2023-12-31"
                          },
                          "last_payment_date": {
                            "type": "string",
                            "format": "date",
                            "description": "The date last payment will be initiated for agreement. Date timezone is Australia Sydney.",
                            "nullable": true,
                            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                            "example": "2024-12-31"
                          }
                        }
                      },
                      "creditor": {
                        "type": "object",
                        "description": "Who and where the payment will be made to",
                        "properties": {
                          "ultimate_party_name": {
                            "type": "string",
                            "example": "Billie Jean Senior",
                            "minLength": 1,
                            "maxLength": 140,
                            "pattern": "^[ -~]+$",
                            "description": "The ultimate creditor name must accurately represent the ultimate creditor party and may be the same as the party_name. HTML name entities are not allowed."
                          },
                          "party_name": {
                            "type": "string",
                            "example": "Billie Jean Junior",
                            "minLength": 1,
                            "maxLength": 140,
                            "pattern": "^[ -~]+$",
                            "description": "The name of the creditor party must accurately represent the creditor party and may be the same as the ultimate_party_name. HTML name entities are not allowed."
                          },
                          "account_identifier": {
                            "$ref": "#/components/schemas/payto.account_identifier"
                          },
                          "payment_account_uid": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64,
                            "pattern": "^[A-Za-z0-9\\-._~]+$",
                            "description": "The uid of the payment account registered via the Counterparties API, identifying the party behind the nominated account.",
                            "example": "pa_20221231_G7MQWwkQZIP8vbfH"
                          }
                        }
                      },
                      "debtor": {
                        "type": "object",
                        "description": "Who and where the payment is taken from",
                        "properties": {
                          "ultimate_party_name": {
                            "type": "string",
                            "example": "Billie Jean Senior",
                            "minLength": 1,
                            "maxLength": 140,
                            "pattern": "^[ -~]+$",
                            "description": "The ultimate debtor name for the account. Defaults to `party_name` if not provided. HTML name entities are not allowed."
                          },
                          "party_name": {
                            "type": "string",
                            "example": "Billie Jean Junior",
                            "minLength": 1,
                            "maxLength": 140,
                            "pattern": "^[ -~]+$",
                            "description": "The name of the debtor party for this agreement. HTML name entities are not allowed."
                          },
                          "account_identifier": {
                            "$ref": "#/components/schemas/payto.account_identifier"
                          }
                        }
                      },
                      "initiator": {
                        "type": "object",
                        "description": "The details of the party that initiated this agreement",
                        "properties": {
                          "name": {
                            "type": "string",
                            "example": "Jane's Flowers",
                            "minLength": 1,
                            "maxLength": 140,
                            "pattern": "^[ -~]+$",
                            "description": "The name of the initating party for this agreement. Displayed to the end customer by their financial institution. HTML name entities are not allowed."
                          },
                          "legal_name": {
                            "type": "string",
                            "example": "Blossoming Flowers Pty Ltd",
                            "minLength": 1,
                            "maxLength": 140,
                            "pattern": "^[ -~]+$",
                            "description": "The legal name of the initating party for this agreement. HTML name entities are not allowed."
                          },
                          "abn": {
                            "type": "string",
                            "nullable": true,
                            "example": "56192755287",
                            "minLength": 11,
                            "maxLength": 11,
                            "pattern": "^\\d+$",
                            "description": "The Australian Business Number (ABN) of the initiating party for this agreement."
                          },
                          "acn": {
                            "type": "string",
                            "nullable": true,
                            "example": "192755287",
                            "minLength": 9,
                            "maxLength": 9,
                            "pattern": "^\\d+$",
                            "description": "The Australian Company Number (ACN) of the initiating party for this agreement."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "payto.event.payto_agreement.amendment_declined": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "type": "object",
            "properties": {
              "body": {
                "type": "object",
                "properties": {
                  "caused_by": {
                    "type": "string",
                    "description": "The party that caused the amendment to be declined",
                    "enum": [
                      "debtor"
                    ]
                  }
                }
              }
            }
          }
        ]
      },
      "payto.event.payto_agreement.amendment_expired": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          }
        ]
      },
      "payto.event.payto_agreement.amendment_failed": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "type": "object",
            "properties": {
              "body": {
                "type": "object",
                "description": "More information about the failure",
                "properties": {
                  "failure": {
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "A short description of the reason or failure",
                        "example": "Agreement Status Invalid"
                      },
                      "detail": {
                        "type": "string",
                        "description": "A longer description of the reason or failure",
                        "example": "Contact Zepto for more information - The requested operation cannot be performed for the current status of the agreement"
                      },
                      "code": {
                        "type": "string",
                        "description": "A unique identifier for this specific type of reason or failure",
                        "example": "MMS.API.9104",
                        "enum": [
                          "MMS.API.9000",
                          "MMS.API.9001",
                          "MMS.API.9002",
                          "MMS.API.9003",
                          "MMS.API.9005",
                          "MMS.API.9006",
                          "MMS.API.9007",
                          "MMS.API.9008",
                          "MMS.API.9009",
                          "MMS.API.9010",
                          "MMS.API.9011",
                          "MMS.API.9013",
                          "MMS.API.9015",
                          "MMS.API.9016",
                          "MMS.API.9017",
                          "MMS.API.9018",
                          "MMS.API.9019",
                          "MMS.API.9101",
                          "MMS.API.9102",
                          "MMS.API.9103",
                          "MMS.API.9104",
                          "MMS.API.9105",
                          "MMS.API.9106",
                          "MMS.API.9107",
                          "MMS.API.9108",
                          "MMS.API.9109",
                          "MMS.API.9110",
                          "MMS.API.9111",
                          "MMS.API.9112",
                          "MMS.API.9113",
                          "MMS.API.9114",
                          "MMS.API.9115",
                          "MMS.API.9116",
                          "MMS.API.9117",
                          "MMS.API.9118",
                          "MMS.API.9119",
                          "MMS.API.9120",
                          "MMS.API.9121",
                          "MMS.API.9301",
                          "MMS.API.9302",
                          "MMS.API.9303",
                          "MMS.API.9401",
                          "MMS.API.9402",
                          "MMS.API.9501",
                          "MMS.API.9601",
                          "MMS.API.9900",
                          "MMS.API.9901",
                          "ZPUNP01",
                          "ZPUNP02",
                          "ZPUNP06",
                          "ZPUNP07",
                          "ZPUNP08",
                          "UKNWN"
                        ]
                      }
                    }
                  }
                },
                "required": [
                  "failure"
                ]
              }
            }
          }
        ]
      },
      "payto.event.payto_agreement.amendment_recall_failed": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "$ref": "#/components/schemas/payto.event.agreement_action_failed"
          }
        ]
      },
      "payto.event.payto_agreement.amendment_recalled": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          }
        ]
      },
      "payto.event.payto_agreement.cancellation_failed": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "$ref": "#/components/schemas/payto.event.agreement_action_failed"
          }
        ]
      },
      "payto.event.payto_agreement.cancelled": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "type": "object",
            "properties": {
              "body": {
                "type": "object",
                "properties": {
                  "caused_by": {
                    "type": "string",
                    "description": "The party that caused the agreement to be cancelled",
                    "enum": [
                      "debtor",
                      "initiator",
                      "zepto_admin",
                      "zepto_system"
                    ]
                  },
                  "reason": {
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "A short description of the reason or failure",
                        "example": "Agreement Status Invalid"
                      },
                      "detail": {
                        "type": "string",
                        "description": "A longer description of the reason or failure",
                        "example": "Contact Zepto for more information - The requested operation cannot be performed for the current status of the agreement"
                      },
                      "code": {
                        "type": "string",
                        "description": "A unique identifier for this specific type of reason or failure",
                        "example": "MMS.API.9104",
                        "enum": [
                          "AC02",
                          "AC04",
                          "AC05",
                          "AC06",
                          "AC13",
                          "AG01",
                          "AG03",
                          "AM03",
                          "AM12",
                          "AM14",
                          "MD07",
                          "MD08",
                          "MD09",
                          "MD16",
                          "MD17",
                          "MD20",
                          "MD21",
                          "MS02",
                          "MS03",
                          "NARR",
                          "RR04",
                          "SL01",
                          "SL11",
                          "SL12",
                          "CTAM",
                          "CTCA",
                          "CTEX",
                          "MCFC",
                          "MCOC",
                          "MSUC",
                          "NOAS"
                        ]
                      },
                      "narrative": {
                        "description": "Free text description to accompany the given reason",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "nullable": true,
                        "example": "custom description"
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "payto.event.payto_agreement.declined": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "$ref": "#/components/schemas/payto.event.resource_metadata"
          },
          {
            "type": "object",
            "properties": {
              "body": {
                "type": "object",
                "required": [
                  "caused_by",
                  "reason",
                  "mms_agreement_id"
                ],
                "properties": {
                  "mms_agreement_id": {
                    "type": "string",
                    "description": "The agreement ID as per the MMS. Formatted as a Universally Unique Identifier (UUID) version 1, as described in IETC RFC 4122 without the 4 hyphen separators.",
                    "example": "3de455278b21196da0c4599025cb7dfa",
                    "nullable": false,
                    "pattern": "^[a-f0-9]{12}1[a-f0-9]{3}[89ab][a-f0-9]{15}$"
                  },
                  "caused_by": {
                    "type": "string",
                    "description": "The party that caused the agreement to be declined",
                    "enum": [
                      "debtor"
                    ]
                  },
                  "reason": {
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "A short description of the reason or failure",
                        "example": "Agreement Status Invalid"
                      },
                      "detail": {
                        "type": "string",
                        "description": "A longer description of the reason or failure",
                        "example": "Contact Zepto for more information - The requested operation cannot be performed for the current status of the agreement"
                      },
                      "code": {
                        "type": "string",
                        "description": "A unique identifier for this specific type of reason or failure",
                        "example": "MMS.API.9104",
                        "enum": [
                          "AC02",
                          "AC05",
                          "AC06",
                          "AC13",
                          "AG01",
                          "AG03",
                          "AM03",
                          "AM12",
                          "AM14",
                          "BE06",
                          "MD09",
                          "MD16",
                          "MD21",
                          "NOAS",
                          "RR04",
                          "SL11",
                          "SL12",
                          "UKNWN"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "payto.event.payto_agreement.expired": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "$ref": "#/components/schemas/payto.event.resource_metadata"
          },
          {
            "type": "object",
            "properties": {
              "body": {
                "type": "object",
                "required": [
                  "mms_agreement_id"
                ],
                "properties": {
                  "mms_agreement_id": {
                    "type": "string",
                    "description": "The agreement ID as per the MMS. Formatted as a Universally Unique Identifier (UUID) version 1, as described in IETC RFC 4122 without the 4 hyphen separators.",
                    "example": "3de455278b21196da0c4599025cb7dfa",
                    "nullable": false,
                    "pattern": "^[a-f0-9]{12}1[a-f0-9]{3}[89ab][a-f0-9]{15}$"
                  }
                }
              }
            }
          }
        ]
      },
      "payto.event.payto_agreement.failed": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "$ref": "#/components/schemas/payto.event.resource_metadata"
          },
          {
            "type": "object",
            "properties": {
              "body": {
                "type": "object",
                "description": "Agreement creation failure details",
                "properties": {
                  "reason": {
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "A short description of the reason or failure",
                        "example": "Agreement Status Invalid"
                      },
                      "detail": {
                        "type": "string",
                        "description": "A longer description of the reason or failure",
                        "example": "Contact Zepto for more information - The requested operation cannot be performed for the current status of the agreement"
                      },
                      "code": {
                        "type": "string",
                        "description": "A unique identifier for this specific type of reason or failure",
                        "example": "MMS.API.9104",
                        "enum": [
                          "MMS.API.9000",
                          "MMS.API.9001",
                          "MMS.API.9002",
                          "MMS.API.9003",
                          "MMS.API.9005",
                          "MMS.API.9006",
                          "MMS.API.9007",
                          "MMS.API.9008",
                          "MMS.API.9009",
                          "MMS.API.9010",
                          "MMS.API.9011",
                          "MMS.API.9013",
                          "MMS.API.9015",
                          "MMS.API.9016",
                          "MMS.API.9017",
                          "MMS.API.9018",
                          "MMS.API.9019",
                          "MMS.API.9101",
                          "MMS.API.9102",
                          "MMS.API.9103",
                          "MMS.API.9104",
                          "MMS.API.9105",
                          "MMS.API.9106",
                          "MMS.API.9107",
                          "MMS.API.9108",
                          "MMS.API.9109",
                          "MMS.API.9110",
                          "MMS.API.9111",
                          "MMS.API.9112",
                          "MMS.API.9113",
                          "MMS.API.9114",
                          "MMS.API.9115",
                          "MMS.API.9116",
                          "MMS.API.9117",
                          "MMS.API.9118",
                          "MMS.API.9119",
                          "MMS.API.9120",
                          "MMS.API.9121",
                          "MMS.API.9301",
                          "MMS.API.9302",
                          "MMS.API.9303",
                          "MMS.API.9401",
                          "MMS.API.9402",
                          "MMS.API.9501",
                          "MMS.API.9601",
                          "MMS.API.9900",
                          "MMS.API.9901",
                          "ZPUNP01",
                          "ZPUNP02",
                          "ZPUNP06",
                          "ZPUNP07",
                          "ZPUNP08",
                          "UKNWN"
                        ]
                      }
                    }
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        ]
      },
      "payto.event.payto_agreement.reactivated": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "type": "object",
            "properties": {
              "body": {
                "type": "object",
                "properties": {
                  "caused_by": {
                    "type": "string",
                    "description": "The party that caused the agreement to be reactivated",
                    "enum": [
                      "debtor",
                      "initiator",
                      "zepto_admin",
                      "zepto_system"
                    ]
                  }
                }
              }
            }
          }
        ]
      },
      "payto.event.payto_agreement.reactivation_failed": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "$ref": "#/components/schemas/payto.event.agreement_action_failed"
          }
        ]
      },
      "payto.event.payto_agreement.suspended": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "type": "object",
            "properties": {
              "body": {
                "type": "object",
                "properties": {
                  "caused_by": {
                    "type": "string",
                    "description": "The party that caused the agreement to be suspended",
                    "enum": [
                      "debtor",
                      "initiator",
                      "zepto_admin",
                      "zepto_system"
                    ]
                  },
                  "reason": {
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "A short description of the reason or failure",
                        "example": "Agreement Status Invalid"
                      },
                      "detail": {
                        "type": "string",
                        "description": "A longer description of the reason or failure",
                        "example": "Contact Zepto for more information - The requested operation cannot be performed for the current status of the agreement"
                      },
                      "code": {
                        "type": "string",
                        "description": "A unique identifier for this specific type of reason or failure",
                        "example": "MMS.API.9104",
                        "enum": [
                          "AC02",
                          "AC04",
                          "AC05",
                          "AC06",
                          "AC13",
                          "AG01",
                          "AG03",
                          "AM03",
                          "AM12",
                          "AM14",
                          "MD07",
                          "MD08",
                          "MD09",
                          "MD16",
                          "MD17",
                          "MD20",
                          "MD21",
                          "MS02",
                          "MS03",
                          "NARR",
                          "RR04",
                          "SL01",
                          "SL11",
                          "SL12",
                          "CTAM",
                          "CTCA",
                          "CTEX",
                          "MCFC",
                          "MCOC",
                          "MSUC",
                          "NOAS"
                        ]
                      },
                      "narrative": {
                        "description": "Free text description to accompany the given reason_code",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "nullable": true,
                        "example": "custom description"
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "payto.event.payto_agreement.suspension_failed": {
        "allOf": [
          {
            "$ref": "#/components/schemas/payto.event.base"
          },
          {
            "$ref": "#/components/schemas/payto.event.agreement_action_failed"
          }
        ]
      },
      "payto.event.resource_metadata": {
        "type": "object",
        "properties": {
          "resource_metadata": {
            "type": "object",
            "description": "Custom metadata that was supplied to the API when the affected resource was created.",
            "nullable": true,
            "example": {
              "custom_key": "custom_value"
            }
          }
        },
        "required": [
          "id",
          "type",
          "published_at",
          "resource_uid",
          "resource_type",
          "body"
        ]
      },
      "payto.generic_error": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "example": "Title of error"
          },
          "detail": {
            "type": "string",
            "description": "A short description of the error",
            "example": "Description of error"
          },
          "links": {
            "type": "object",
            "properties": {
              "about": {
                "type": "string",
                "description": "An optional link to more information on the error",
                "example": "https://docs.zeptopayments.com/docs/zepto-environments"
              }
            },
            "required": [
              "about"
            ]
          },
          "meta": {
            "type": "object",
            "description": "Optional meta information about the error",
            "properties": {
              "resource_ref": {
                "type": "string",
                "description": "Resource reference of the resource impacted by the error",
                "example": "P2PAY.1000"
              },
              "resource_uid": {
                "type": "string",
                "description": "Supplied ID of the resource impacted by the error",
                "example": "payment_34fj8djh2"
              }
            }
          }
        },
        "required": [
          "title",
          "detail"
        ]
      },
      "payto.generic_errors": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/payto.generic_error"
            }
          }
        },
        "required": [
          "errors"
        ]
      },
      "payto.pagination_links": {
        "type": "object",
        "properties": {
          "next": {
            "type": "string",
            "description": "URL for next page of results. Won't be present if there are no further pages."
          }
        }
      },
      "payto.unprocessable_pagination_error": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "detail",
          "code"
        ],
        "properties": {
          "title": {
            "type": "string",
            "example": "Title of error"
          },
          "code": {
            "type": "string",
            "description": "A code assigned to the type of error received",
            "example": "E100",
            "enum": [
              "ZPUNP00",
              "ZPPGN00"
            ]
          },
          "detail": {
            "type": "string",
            "description": "A short description of the error",
            "example": "Description of error"
          },
          "links": {
            "type": "object",
            "properties": {
              "about": {
                "type": "string",
                "description": "An optional link to more information on the error",
                "example": "https://docs.zeptopayments.com/docs/zepto-environments"
              }
            },
            "required": [
              "about"
            ]
          },
          "meta": {
            "type": "object",
            "description": "Optional meta information about the error",
            "properties": {
              "resource_ref": {
                "type": "string",
                "description": "Resource reference of the resource impacted by the error",
                "example": "P2PAY.1000"
              },
              "resource_uid": {
                "type": "string",
                "description": "Supplied ID of the resource impacted by the error",
                "example": "payment_34fj8djh2"
              }
            }
          }
        }
      },
      "payto.unprocessable_pagination_errors": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/payto.unprocessable_pagination_error"
            }
          }
        },
        "required": [
          "errors"
        ]
      }
    }
  }
}
```