Update Subscription
curl --request PATCH \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"subscription": {
"amount": 123,
"billing_day": 123,
"status": "<string>",
"payment_mode": "<string>",
"payment_method_id": 123,
"surcharge_percentage": 123
}
}
'const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscription: {
amount: 123,
billing_day: 123,
status: '<string>',
payment_mode: '<string>',
payment_method_id: 123,
surcharge_percentage: 123
}
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{id}"
payload = { "subscription": {
"amount": 123,
"billing_day": 123,
"status": "<string>",
"payment_mode": "<string>",
"payment_method_id": 123,
"surcharge_percentage": 123
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"amount": 123,
"billing_day": 123,
"currency": "<string>",
"status": "<string>",
"payment_mode": "<string>",
"surcharge_percentage": 123,
"surcharge_amount": 123,
"total_amount_with_surcharge": 123,
"next_billing_date": "2023-12-25",
"discarded_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"labels": [
{
"title": "<string>",
"color": "<string>"
}
],
"payment_method": {
"id": 123,
"method_type": "<string>",
"gateway": "<string>",
"status": "<string>",
"meta": {}
},
"property_tenancy": {
"id": 123,
"contract_start_date": "2023-12-25",
"contract_end_date": "2023-12-25",
"signed_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"contract_submission": {
"id": 123,
"slug": "<string>",
"status": "<string>",
"completed_at": "2023-11-07T05:31:56Z"
},
"property_manager": {
"id": 123,
"display_title": "<string>"
}
},
"property": {
"id": 123,
"registration_number": "<string>",
"address": "<string>",
"address_line_2": "<string>",
"zip_code": "<string>",
"zone": "<string>",
"locality": "<string>",
"latitude": 123,
"longitude": 123,
"property_type": "<string>",
"area": 123,
"bedrooms": 123,
"bathrooms": 123,
"parking_spaces": 123,
"admin_fee": 123,
"amenities": [
"<string>"
],
"country_code": "<string>",
"country_name": "<string>",
"state_code": "<string>",
"state_name": "<string>",
"city_name": "<string>",
"labels": [
{
"id": 123,
"title": "<string>",
"color": "<string>"
}
],
"property_managers": [
{
"id": 123,
"account_id": 123,
"description": "<string>",
"management_fee": 123,
"contract_start_date": "2023-12-25",
"contract_end_date": "2023-12-25",
"display_title": "<string>",
"commission_type": "<string>",
"internal_photos": [
"<string>"
],
"notes": "<string>",
"listing_price": 123,
"rental_price": 123,
"currency": "<string>",
"offer_type": "<string>",
"open_to_market": true,
"status": "<string>",
"additional_attributes": {}
}
],
"active_contract_submission_id": 123,
"active_tenant_name": "<string>",
"active_tenancy_status": "<string>",
"linked_contracts_count": 123,
"property_assignments": [
{
"id": 123,
"contact_id": 123,
"role": "<string>",
"ownership_percentage": 123,
"contact": {
"id": 123,
"name": "<string>",
"email": "<string>"
}
}
]
},
"contact": {
"payload": [
{
"additional_attributes": {},
"availability_status": "<string>",
"email": "<string>",
"id": 123,
"name": "<string>",
"phone_number": "<string>",
"blocked": true,
"identifier": "<string>",
"thumbnail": "<string>",
"custom_attributes": {
"attribute_key": "attribute_value",
"signed_up_at": "dd/mm/yyyy"
},
"last_activity_at": 123,
"created_at": 123,
"contact_inboxes": [
{
"source_id": "<string>",
"inbox": {
"id": 123,
"avatar_url": "<string>",
"channel_id": 123,
"name": "<string>",
"channel_type": "<string>",
"provider": "<string>"
}
}
]
}
]
},
"tenants": [
{
"id": 123,
"name": "<string>",
"email": "<string>"
}
],
"co_debtors": [
{
"id": 123,
"name": "<string>",
"email": "<string>",
"phone_number": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Treasury Subscriptions
Update Subscription
Update details of a specific subscription
PATCH
/
api
/
v1
/
accounts
/
{account_id}
/
treasury
/
subscriptions
/
{id}
Update Subscription
curl --request PATCH \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"subscription": {
"amount": 123,
"billing_day": 123,
"status": "<string>",
"payment_mode": "<string>",
"payment_method_id": 123,
"surcharge_percentage": 123
}
}
'const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscription: {
amount: 123,
billing_day: 123,
status: '<string>',
payment_mode: '<string>',
payment_method_id: 123,
surcharge_percentage: 123
}
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{id}"
payload = { "subscription": {
"amount": 123,
"billing_day": 123,
"status": "<string>",
"payment_mode": "<string>",
"payment_method_id": 123,
"surcharge_percentage": 123
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"amount": 123,
"billing_day": 123,
"currency": "<string>",
"status": "<string>",
"payment_mode": "<string>",
"surcharge_percentage": 123,
"surcharge_amount": 123,
"total_amount_with_surcharge": 123,
"next_billing_date": "2023-12-25",
"discarded_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"labels": [
{
"title": "<string>",
"color": "<string>"
}
],
"payment_method": {
"id": 123,
"method_type": "<string>",
"gateway": "<string>",
"status": "<string>",
"meta": {}
},
"property_tenancy": {
"id": 123,
"contract_start_date": "2023-12-25",
"contract_end_date": "2023-12-25",
"signed_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"contract_submission": {
"id": 123,
"slug": "<string>",
"status": "<string>",
"completed_at": "2023-11-07T05:31:56Z"
},
"property_manager": {
"id": 123,
"display_title": "<string>"
}
},
"property": {
"id": 123,
"registration_number": "<string>",
"address": "<string>",
"address_line_2": "<string>",
"zip_code": "<string>",
"zone": "<string>",
"locality": "<string>",
"latitude": 123,
"longitude": 123,
"property_type": "<string>",
"area": 123,
"bedrooms": 123,
"bathrooms": 123,
"parking_spaces": 123,
"admin_fee": 123,
"amenities": [
"<string>"
],
"country_code": "<string>",
"country_name": "<string>",
"state_code": "<string>",
"state_name": "<string>",
"city_name": "<string>",
"labels": [
{
"id": 123,
"title": "<string>",
"color": "<string>"
}
],
"property_managers": [
{
"id": 123,
"account_id": 123,
"description": "<string>",
"management_fee": 123,
"contract_start_date": "2023-12-25",
"contract_end_date": "2023-12-25",
"display_title": "<string>",
"commission_type": "<string>",
"internal_photos": [
"<string>"
],
"notes": "<string>",
"listing_price": 123,
"rental_price": 123,
"currency": "<string>",
"offer_type": "<string>",
"open_to_market": true,
"status": "<string>",
"additional_attributes": {}
}
],
"active_contract_submission_id": 123,
"active_tenant_name": "<string>",
"active_tenancy_status": "<string>",
"linked_contracts_count": 123,
"property_assignments": [
{
"id": 123,
"contact_id": 123,
"role": "<string>",
"ownership_percentage": 123,
"contact": {
"id": 123,
"name": "<string>",
"email": "<string>"
}
}
]
},
"contact": {
"payload": [
{
"additional_attributes": {},
"availability_status": "<string>",
"email": "<string>",
"id": 123,
"name": "<string>",
"phone_number": "<string>",
"blocked": true,
"identifier": "<string>",
"thumbnail": "<string>",
"custom_attributes": {
"attribute_key": "attribute_value",
"signed_up_at": "dd/mm/yyyy"
},
"last_activity_at": 123,
"created_at": 123,
"contact_inboxes": [
{
"source_id": "<string>",
"inbox": {
"id": 123,
"avatar_url": "<string>",
"channel_id": 123,
"name": "<string>",
"channel_type": "<string>",
"provider": "<string>"
}
}
]
}
]
},
"tenants": [
{
"id": 123,
"name": "<string>",
"email": "<string>"
}
],
"co_debtors": [
{
"id": 123,
"name": "<string>",
"email": "<string>",
"phone_number": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Authorizations
Path Parameters
ID of the subscription
The numeric ID of the account
Body
application/json
Show child attributes
Show child attributes
Response
Success
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes