Skip to content

Match a statement to expected charges

POST
/api/v1/charges/match
curl --request POST \
--url http://127.0.0.1:8484/api/v1/charges/match \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "from": "example", "to": "example", "transactions": [ { "amount": "example", "currency": "example", "date": "example", "description": "example" } ] }'

Compares the payments of a bank or card statement with the charges Exhale expects (merchant, date within a week, amount within 30%). Changes nothing. Returns the charges each payment confirms: for action mark_paid call set_charge_status with status=paid and the amount paid (dryRun first, then show the user); when priceChange is set, ask whether it is the new price. Also lists open charges due in the period that the statement does not show.

Media typeapplication/json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
from
string
to
string
transactions
required
Array<object> | null
object
amount
required
string
currency
string
date
required
string
description
required
string

OK

Media typeapplication/json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
from
required
string
matches
required
Array<object> | null
object
action
required
string
Allowed values: mark_paid already_paid
charge
required
object
amount
required
object
currency
required
string
minor
required
integer format: int64
cancelBy
string
cancelPassed
required
boolean
chargedAmount
object
currency
required
string
minor
required
integer format: int64
daysUntil
required
integer format: int64
decision
string
delayed
required
boolean
dueDate
required
string
id
required
string
kind
required
string
Allowed values: renewal trial expiry
logo
string
note
string
originalDate
required
string
paymentMethod
string
resolvedAt
string format: date-time
status
required
string
subscriptionId
required
string
subscriptionName
required
string
updatedAt
required
string format: date-time
version
required
integer format: int64
paid
required
object
currency
required
string
minor
required
integer format: int64
priceChange
object
changePercent
required
string
charged
required
object
currency
required
string
minor
required
integer format: int64
expected
required
object
currency
required
string
minor
required
integer format: int64
yearlyDelta
required
object
currency
required
string
minor
required
integer format: int64
transaction
required
object
amount
required
string
currency
string
date
required
string
description
required
string
missing
required
Array<object> | null
object
amount
required
object
currency
required
string
minor
required
integer format: int64
cancelBy
string
cancelPassed
required
boolean
chargedAmount
object
currency
required
string
minor
required
integer format: int64
daysUntil
required
integer format: int64
decision
string
delayed
required
boolean
dueDate
required
string
id
required
string
kind
required
string
Allowed values: renewal trial expiry
logo
string
note
string
originalDate
required
string
paymentMethod
string
resolvedAt
string format: date-time
status
required
string
subscriptionId
required
string
subscriptionName
required
string
updatedAt
required
string format: date-time
version
required
integer format: int64
to
required
string
unmatched
required
integer format: int64

Example

{
"$schema": "https://example.com/api/schemas/StatementMatch.json",
"matches": [
{
"action": "mark_paid",
"charge": {
"kind": "renewal"
}
}
],
"missing": [
{
"kind": "renewal"
}
]
}

Error

Media typeapplication/problem+json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object> | null
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank

Example

{
"$schema": "https://example.com/api/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}