Update a subscription
PUT/payment/{connection_id}/subscription/{id}
Updates the PaymentSubscription identified by id. Provide the unified PaymentSubscription fields to change in the request body.
Parameters
fieldsstring array
Fields to return
rawstring
Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar
connection_idstring required
ID of the connection
idstring required
ID of the Subscription
Payload
idstring
created_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
updated_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
descriptionstring
contact_idstring
a reference to an Accounting Contact (reference to AccountingContact)
invoice_idstring
a reference to an Accounting Invoice (reference to AccountingInvoice)
current_period_end_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
current_period_start_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
canceled_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
currencystring
total_amountnumber
start_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
end_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
status enum
Valid values:
"ACTIVE"
"INACTIVE"
"CANCELED"
"PAUSED"
monthnumber
the month on which to charge a customer (1-12). Only applies when the interval_unit is YEAR.
interval_unit enum
Valid values:
"YEAR"
"MONTH"
"WEEK"
"DAY"
day_of_monthnumber
The day of the month to charge customers on. 1-28 or -1 to indicate the last day of the month. Only applies when the interval_unit is MONTH.
day_of_weeknumber
The day of the week to charge customers on. 1-7 or -1 to indicate the last day of the week. Only applies when the interval_unit is WEEK.
intervalnumber
The number of intervals between charges within the interval_unit. Defaults to 1.
Returns
| Response field | Type | Required | Description |
|---|---|---|---|
id | string | No | |
created_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
updated_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
description | string | No | |
contact_id | string | No | a reference to an Accounting Contact (reference to AccountingContact) |
invoice_id | string | No | a reference to an Accounting Invoice (reference to AccountingInvoice) |
current_period_end_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
current_period_start_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
canceled_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
currency | string | No | |
total_amount | number | No | |
start_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
end_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
status | enum | No | Values: ACTIVE, INACTIVE, CANCELED, PAUSED |
month | number | No | the month on which to charge a customer (1-12). Only applies when the interval_unit is YEAR. |
interval_unit | enum | No | Values: YEAR, MONTH, WEEK, DAY |
day_of_month | number | No | The day of the month to charge customers on. 1-28 or -1 to indicate the last day of the month. Only applies when the interval_unit is MONTH. |
day_of_week | number | No | The day of the week to charge customers on. 1-7 or -1 to indicate the last day of the week. Only applies when the interval_unit is WEEK. |
interval | number | No | The number of intervals between charges within the interval_unit. Defaults to 1. |
lineitems | PaymentLineitem[] | No | |
lineitems[].id | string | No | |
lineitems[].created_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
lineitems[].updated_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
lineitems[].refunded_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
lineitems[].total_amount | number | No | |
lineitems[].refund_amount | number | No | new field |
lineitems[].discount_amount | number | No | |
lineitems[].tax_amount | number | No | |
lineitems[].item_id | string | No | (reference to CommerceItem) |
lineitems[].unit_amount | number | No | |
lineitems[].unit_quantity | number | No | |
lineitems[].item_sku | string | No | |
lineitems[].item_name | string | No | |
lineitems[].item_description | string | No | |
lineitems[].notes | string | No | |
lineitems[].taxrate_id | string | No | |
lineitems[].account_id | string | No | (reference to AccountingAccount) |
metadata | PaymentMetadata[] | No | |
metadata[].id | string | No | |
metadata[].slug | string | No | |
metadata[].value | object | No | |
metadata[].namespace | string | No | |
metadata[].format | enum | No | Values: TEXT, NUMBER, DATE, BOOLEAN, FILE, TEXTAREA, SINGLE_SELECT, MULTIPLE_SELECT, MEASUREMENT, PRICE, YES_NO, CURRENCY, URL |
metadata[].extra_data | object | No |
Errors
Errors return the HTTP status code and a JSON body with statusCode, error (the short label) and message (a human-readable detail).
{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Too many requests to unified.to API; max requests per minute: N"
}| Status | Error | Meaning |
|---|---|---|
400 | Bad Request | The request was malformed or failed validation. |
401 | Unauthorized | The connection is likely broken; re-authorize it. |
403 | Forbidden | The connection is missing permissions or scopes. |
404 | Not Found | The requested resource does not exist. |
429 | Too Many Requests | Rate limit exceeded (see the two sources below). |
500 | Internal Server Error | An unexpected error occurred. |
501 | Not Implemented | Not supported by this integration. |
Errors from the underlying integration pass through: the integration's status comes back as ours (429, 401, 403, 404 or 5xx), usually with its message. When the integration's error body is unclear, Unified extracts what it can and returns a clearer message.
429 Too Many Requests
A 429 has two possible sources:
- The integration's own rate limit, passed through.
- Unified's workspace limit: a rolling 60 seconds, set by plan, with the message
Too many requests to unified.to API; max requests per minute: N.
const options = {
method: 'PUT',
url: 'https://api.unified.to/payment/5de520f96e439b002043d8dc/subscription/5de520f96e439b002043d8d8',
headers: {
authorization: 'bearer .....'
},
data: undefined,
params: {
fields: '',
raw: '',
}
};
const results = await axios.request(options); Are we missing anything? Let us know
Was this page helpful?