Squarepay API
  1. Agreement Actions
Squarepay API
  • Authentication
    • Test Authentication
      POST
  • PayTo
    • Agreements
      • Create Agreement
      • List Agreements
      • Show Agreement
      • Show Agreement History
    • Agreement Actions
      • Cancel Agreement
        POST
    • Payments
      • Create Payment
      • List Payments
      • Show Payment
      • Retry Payment
  • Webhook Subscriptions
    • Create Webhook Subscription
      POST
    • List Webhook Subscriptions
      GET
    • Update Webhook Subscription
      PUT
    • Delete Webhook Subscription
      DELETE
  • Webhooks
    • List Webhooks
      GET
    • Show Webhook
      GET
    • Resend Webhook
      POST
  1. Agreement Actions

Cancel Agreement

POST
/pay-to/agreements/{identifier}/cancel
payto

Request

Authorization
Send your HTTP requests with an
Authorization
header that contains the word Basic followed by a space and a base64-encoded string username:password
Example:
Authorization: Basic *****************
Path Params
identifier
string 
required
When id_type is uuid, search will be conducted using the agreement uuid. Alternatively reference will search by your unique reference.
Example:
1142b253-c844-4104-b42b-472ddeacf7fa
Query Params
id_type
enum<string> 
optional
The type of identifier to search by. uuid is default, this is our unique identifier. reference may also be used which is your unique identifier.
Allowed values:
uuidreference
Example:
uuid
Header Params
Accept
string 
optional
Example:
application/json
Body Params application/json
reason
enum<string> 
required
The reason for the agreement being cancelled.
>= 1 characters<= 255 characters
Allowed values:
invalid_debtor_account_numberclosed_account_numberclosed_debtor_account_numberblocked_accountinvalid_debtor_account_typetransaction_forbiddentransaction_not_supportednot_allowed_currencynot_allowed_amountamount_exceeds_agreed_limitcustomer_deceasedno_mandate_service_agentno_mandate_service_customercustomer_requestedinitiating_party_requestedmandate_expiredsuspected_fraudulentno_reason_customerno_reason_agentnarrativeregulatoryno_service_debtorcreditor_not_whitelisted_by_debtorcreditor_blacklisted_by_debtorcontract_amendeddebtor_cancellation_requestedcontract_expiredmandate_suspended_final_collectionmandate_suspended_one_collectionmandate_suspended_failed_collectionsno_answer
reason_detailed
string  | null 
optional
Free text human readable explanation for cancellation.
<= 256 characters
Example
{
  "reference": "4f3b4342-2d1f-47e7-aea4-f7fc47ad6042",
  "purpose": "loan",
  "description": "Loan 1337",
  "last_name": "Bob",
  "first_name": "Billy",
  "customer_reference": "MEM000001337",
  "response_required_by": "2024-02-25T16:45:15",
  "start_date": "2024-02-01",
  "end_date": "2025-01-31",
  "payment_term_type": "fixed",
  "frequency": "weekly",
  "amount": 10000,
  "count": 10,
  "first_payment_date": "2024-02-01",
  "last_payment_date": "2024-04-11",
  "account_type": "bban",
  "bsb": "062000",
  "account_number": "123456789"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api-sandbox.squarepay.com.au/v2/pay-to/agreements/1142b253-c844-4104-b42b-472ddeacf7fa/cancel?id_type=uuid' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data-raw '{
    "reference": "4f3b4342-2d1f-47e7-aea4-f7fc47ad6042",
    "purpose": "loan",
    "description": "Loan 1337",
    "last_name": "Bob",
    "first_name": "Billy",
    "customer_reference": "MEM000001337",
    "response_required_by": "2024-02-25T16:45:15",
    "start_date": "2024-02-01",
    "end_date": "2025-01-31",
    "payment_term_type": "fixed",
    "frequency": "weekly",
    "amount": 10000,
    "count": 10,
    "first_payment_date": "2024-02-01",
    "last_payment_date": "2024-04-11",
    "account_type": "bban",
    "bsb": "062000",
    "account_number": "123456789"
}'

Responses

🟢200OK
application/json
Body
data
array[object (AgreementHistory) {4}] 
required
uuid
string 
required
UUID 36 characters
<= 36 characters
event_date
string 
required
The date of the event
event_type
string 
required
The type of event TODO: Fill out the enums.
body
object  | null 
optional
Example
{
  "data": {
    "uuid": "a2743d92-6d29-4b4d-9ef5-eecbf3c7a208",
    "status": "cancelled",
    "error_code": null,
    "reference": "ac19cda6-1d62-41a6-a2f1-c1b33ff86dd2",
    "purpose": "loan",
    "description": "Loan 1337",
    "last_name": "Bob",
    "first_name": "Billy",
    "customer_reference": "MEM000001337",
    "response_required_by": "2024-02-25T16:45:15",
    "start_date": "2024-02-01",
    "end_date": "2025-01-31",
    "payment_term_type": "fixed",
    "frequency": "weekly",
    "amount": "100.00",
    "count": 10,
    "first_payment_date": "2024-02-01",
    "last_payment_date": "2024-04-11",
    "max_amount": null,
    "first_payment_amount": null,
    "last_payment_amount": null,
    "account_type": "bban",
    "bsb": "062000",
    "account_number": "123456789",
    "pay_id": null
  }
}
🟠401Unauthorised
🟠404Not Found
🟠422Unprocessable Entity
🔴500Server Error
Previous
Show Agreement History
Next
Create Payment
Built with