Update fees
In case you need to update the fee after you've submitted it to Rootline, you can do so by using the PATCH /payments/{id}
method. Some scenarios that can be solved:
- a fee needs to be lowered or removed because of a full or partial refund;
- a fee needs to be added because an extra service was used.
Important
There is a time limit to updating the payment. You can do so by updating the payment up to 7 hours after the payment is authorized.
PATCH the payment to update the fee(s)
Provide the split payment_id with the fees
array, and:
- add a fee object to charge a(nother) fee;
- provide the
fee_id
of a fee that you want to increase, decrease or set to € 0.00.
- Add a fee
- Lower a fee
- Increase a fee
- Remove a fee
PATCH /payments/pmt_pFJdPDzn97ASbwJQnydJQ
curl 'http://payment-api.staging.rootline.com/v1/payments' \
--request PATCH \
--header 'content-type: application/json' \
--header 'x-api-key: [paste-your-api-key]' \
--header 'rootline-version: 2024-04-23' \
--data '{
"reference": "your-reference",
"splits": [
{
"id": "pmt_pFJdPDzn97ASbwJQnydJR",
"fees": [
{
"flat_rate": {
"amount": {
"quantity": "0.50",
"currency": "EUR"
}
}
}
]
}
]
}'
PATCH /payments/pmt_pFJdPDzn97ASbwJQnydJQ | Provide the fee_id to update the fee
curl 'http://payment-api.staging.rootline.com/v1/payments' \
--request PATCH \
--header 'content-type: application/json' \
--header 'x-api-key: [paste-your-api-key]' \
--header 'rootline-version: 2024-04-23' \
--data '{
"reference": "your-reference",
"splits": [
{
"id": "pmt_pFJdPDzn97ASbwJQnydJR",
"fees": [
{
"id": "fee_3yYvC2oKK719K4cQVn70xY" // existing fee
"flat_rate": {
"amount": {
"quantity": "0.10",
"currency": "EUR"
}
}
}
]
}
]
}'
PATCH /payments/pmt_pFJdPDzn97ASbwJQnydJQ | Provide the fee_id to update the fee
curl 'http://payment-api.staging.rootline.com/v1/payments' \
--request PATCH \
--header 'content-type: application/json' \
--header 'x-api-key: [paste-your-api-key]' \
--header 'rootline-version: 2024-04-23' \
--data '{
"reference": "your-reference",
"splits": [
{
"id": "pmt_pFJdPDzn97ASbwJQnydJR",
"fees": [
{
"id": "fee_3yYvC2oKK719K4cQVn70xY" // existing fee
"flat_rate": {
"amount": {
"quantity": "1.00",
"currency": "EUR"
}
}
}
]
}
]
}'
PATCH /payments/pmt_pFJdPDzn97ASbwJQnydJQ | To remove a fee, simply set it to € 0.00.
curl 'http://payment-api.staging.rootline.com/v1/payments' \
--request PATCH \
--header 'content-type: application/json' \
--header 'x-api-key: [paste-your-api-key]' \
--header 'rootline-version: 2024-04-23' \
--data '{
"reference": "your-reference",
"splits": [
{
"id": "pmt_pFJdPDzn97ASbwJQnydJR",
"fees": [
{
"id": "fee_3yYvC2oKK719K4cQVn70xY" // existing fee
"flat_rate": {
"amount": {
"quantity": "0.00",
"currency": "EUR"
}
}
}
]
}
]
}'