The type of an expense (refund/payment) isn’t directly editable on the API, because it’s only a convenience to make the UI more straightforward. You should be using the sign of the gross_value field to set the type of an expense - negative values are Payments and positive values are Refunds.
That is, an expense with:
{
"gross_value": -100
}
is a Payment expense for 100, and
{
"gross_value": 100
}
is a Refund expense for 100.
Hope that helps - please let us know if you need more clarification.