v1

latestOpenAPI 3.1.02026-07-2469193340.0 KB
Agreements

create agreement

post/payto/agreements

Request body

uidstring required

Supplied unique identifier for agreement, maximum 64 characters containing only unreserved characters as defined in RFC3986. This identifier ensures agreement uniqueness between integrator systems and Zepto.

purpose'mortgage' | 'utility' | 'loan' | 'dependant_support' | 'gambling' | 'retail' | 'salary' | 'personal' | 'government' | 'pension' | 'tax' | 'other' required

The nature of the agreement with the debtor

descriptionstring required

The reason for the agreement, as narrative text. ASCII-printable characters only.

resolution_requested_beforestring date-time nullable

Requested resolution (accept/decline) deadline for this agreement. It will be provided in any notification sent to the debtor. This time is for informational purposes only and does not affect the expiry time. If not provided, it defaults to 5 days from agreement creation. Value must be an ISO8601 date-time in UTC timezone.

cancel_if_unresolvedboolean nullable

An optional field to indicate whether or not Zepto should auto cancel this agreement if it is not authorized by the debtor by the resolution_requested_before point in time. This field must be accompanied by the resolution_requested_before attribute and if not, will result in a 422 response and error code.

validity_start_datestring date nullable

Start date for validity of agreement. If specified, the agreement will be valid from 00:00:00 Australia Sydney time on specified date. If no date specified, the current date will be populated.

validity_end_datestring date nullable

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.

metadataPaytoMetadata nullable

Use for your custom data. A place to store any miscellaneous information your system may need in regards to the record you are creating. This will be included in associated webhook payloads under the resource_metadata key. Nested values (i.e., objects and arrays) are not allowed. The maximum size of this parameter is 2kb.

Example request

{
  "uid": "biz_agreement_G7MQWwkQZIP8vbfH",
  "purpose": "loan",
  "debtor": {
    "ultimate_party_name": "Billie Jean Senior",
    "party_name": "Billie Jean Junior",
    "account_identifier": {
      "value": "123456-98765432"
    }
  },
  "creditor": {
    "ultimate_party_name": "Billie Jean Senior",
    "party_name": "Billie Jean Junior",
    "account_identifier": {
      "value": "123456-98765432"
    }
  },
  "initiator": {
    "name": "Jane's Flowers",
    "legal_name": "Blossoming Flowers Pty Ltd",
    "abn": "56192755287"
  },
  "description": "Payment plan for loan #1234",
  "resolution_requested_before": "2022-01-20T12:34:56Z",
  "cancel_if_unresolved": true,
  "validity_start_date": "2023-01-01",
  "validity_end_date": "2023-12-31",
  "metadata": {
    "custom_key": "custom_value"
  },
  "payment_terms": {
    "type": "fixed",
    "frequency": "monthly",
    "amount": 10000,
    "count": 1,
    "first_payment_date": "2023-12-31",
    "last_payment_date": "2024-12-31"
  }
}

Response

successful

Example response

{
  "data": {
    "uid": "biz_agreement_G7MQWwkQZIP8vbfH",
    "created_at": "2022-01-20T12:34:56+11:00",
    "mms_agreement_id": "3de455278b21196da0c4599025cb7dfa",
    "links": {
      "self": "https://api.zeptopayments.com/payto/agreements/biz_agreement_G7MQWwkQZIP8vbfH"
    },
    "description": "Payment plan for loan #1234",
    "purpose": "loan",
    "resolution_requested_before": "2022-01-20T12:34:56Z",
    "cancel_if_unresolved": true,
    "payment_terms": {
      "type": "fixed",
      "frequency": "monthly",
      "count": 1,
      "amount": 10000,
      "max_amount": 100000,
      "first_payment_amount": 100000,
      "last_payment_amount": 100000,
      "first_payment_date": "2023-12-31",
      "last_payment_date": "2024-12-31"
    },
    "debtor": {
      "ultimate_party_name": "Billie Jean Senior",
      "party_name": "Billie Jean Junior",
      "account_identifier": {
        "value": "123456-98765432"
      }
    },
    "creditor": {
      "ultimate_party_name": "Billie Jean Senior",
      "party_name": "Billie Jean Junior",
      "account_identifier": {
        "value": "123456-98765432"
      }
    },
    "initiator": {
      "name": "Jane's Flowers",
      "legal_name": "Blossoming Flowers Pty Ltd",
      "abn": "56192755287",
      "acn": "192755287"
    },
    "validity_start_date": "2023-01-01",
    "validity_end_date": "2023-12-31",
    "state_reason": {
      "title": "Agreement Status Invalid",
      "detail": "Contact Zepto for more information - The requested operation cannot be performed for the current status of the agreement",
      "code": "MMS.API.9104"
    },
    "metadata": {
      "custom_key": "custom_value"
    }
  }
}