Amend Payment Agreement
POSThttps://api.cleverhub.co/api/v1/pay_to/payment_agreement/amendment
Amend an existing payment agreement to modify its parameters, such as the limit amount or agreement details. This endpoint allows the merchant to adjust various settings of the payment agreement, including payment limits and specific agreement terms, providing flexibility to accommodate different payment scenarios or changes in the payment structure.
Use this endpoint to update agreement settings in response to new conditions or requirements. Notification settings can also be configured to receive updates on the status of the amended agreement.
Request
- application/json
Bodyrequired
The unique Hello Clever payment ID for the agreement being amended.
123456
The maximum payment amount allowed for each transaction within this amended agreement. This should reflect the updated limit you intend to set.
1000
agreement_details objectrequired
payment_agreement_notification objectrequired
Responses
- 200
- 400
- 401
- 404
- 422
Payment agreement amended successfully.
- application/json
- Schema
- Example (auto)
Schema
payment_agreement_amendment object
payment_agreement_amendment_status object
{
"payment_agreement_amendment": {
"id": 12345,
"payment_agreement_id": "agreement-12345",
"client_transaction_id": "client-trans-001",
"limit_amount": 5000,
"description": "Monthly utility bill payment agreement.",
"external_id": "custom-agreement-id-7890",
"status": "active",
"created_at": "2024-01-01T00:00:00Z",
"payment_agreement_type": "UTILITY",
"agreement_details": {
"variable_agreement_details_obj": {
"start_date": "15/07/24",
"frequency": "MONTHLY"
}
},
"payer_details": {
"name": "Jane Doe",
"bank_account_details": {
"bsb": "123456",
"account_number": "987654321"
},
"pay_id_details": {
"pay_id": "payer@payid.com",
"pay_id_type": "EMAIL"
}
},
"payment_agreement_notification": {
"endpoint_url": "https://merchant.com/payment_callback",
"authorization_header": "Bearer your_token"
}
},
"payment_agreement_amendment_status": {
"bilateral_amendment_status": "completed",
"payment_agreement_amendment_id": "30597959a853444dbadb54332bf7a98e"
}
}
Bad Request
Unauthorized
Not Found
Unprocessable Entity
Callbacks
- POST PaymentAgreementAmendmentStatus
POST{$request.body#/payment_agreement_notification/endpoint_url}
- application/json
Bodyrequired
created
: Agreement has been created but not yet activated.active
: Agreement is currently active.suspended
: Agreement has been temporarily suspended.cancelled
: Agreement has been cancelled.failed
: Agreement creation or payment has failed.
A unique identifier for the payment agreement, used for tracking and management.
12345
The unique identifier for the payment agreement, providing a reference to the specific agreement being handled.
agreement-12345
A unique ID for the transaction as provided by the merchant, used to ensure transactions can be uniquely tracked.
Possible values: non-empty
and <= 90 characters
client-trans-001
The maximum allowable amount for each payment under this agreement, helping to manage the scope of transactions.
5000
A description of the payment agreement, providing context and information for the payer and merchant.
Possible values: >= 5 characters
and <= 140 characters
Monthly utility bill payment agreement.
A custom identifier assigned to the payment agreement, typically used for tracking and reference purposes.
Possible values: <= 255 characters
custom-agreement-id-7890
The current status of the payment agreement. Possible values include:
Possible values: [created
, active
, suspended
, cancelled
, failed
]
active
The timestamp indicating when the payment agreement was created, in UTC.
2024-01-01T00:00:00Z
The type of payment agreement, indicating the nature of the payments involved.
Possible values: [MORTGAGE
, UTILITY
, LOAN
, DEPENDANT SUPPORT
, GAMBLING
, RETAIL
, SALARY
, PERSONAL
, GOVERNMENT
, PENSION
, TAX
, OTHER SERVICE
]
UTILITY
agreement_details object
payer_details object
payment_agreement_notification object
Callbacks Responses
- 200
- 400
- 401
Callback received successfully
Bad request
Unauthorized
Authorization: app-id
name: app-idtype: apiKeyin: headerdescription: A unique identifier assigned to each application.
name: secret-keytype: apiKeyin: headerdescription: A secure token associated with the `app-id`.
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.cleverhub.co/api/v1/pay_to/payment_agreement/amendment");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("app-id", "<app-id>");
request.Headers.Add("secret-key", "<app-id>");
var content = new StringContent("{\n \"id\": 123456,\n \"limit_amount\": 1000,\n \"agreement_details\": {\n \"variable_agreement_details_obj\": {\n \"start_date\": \"15/07/24\",\n \"frequency\": \"MONTHLY\"\n }\n },\n \"payment_agreement_notification\": {\n \"endpoint_url\": \"https://merchant.example.com/payment_status_callback\",\n \"authorization_header\": \"Bearer your_secret_token\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());