Skip to content

Credit API

Credit given to customers: limits, balances, ageing, promises to pay.

The same operations are in the interactive API reference, and the whole contract is in the OpenAPI document.

GET/v1/credit/policy

Get the credit policy

The limit for a person with none of their own, what happens when a sale passes the limit, and how overdue a payment may be before new credit is refused. Needs credit:read.

Scope credit:read. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

PUT/v1/credit/policy

Set the credit policy

Replaces the policy. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

GET/v1/credit/balances

What each person owes

Everyone with something open, the largest overdue first. Needs credit:read.

Scope credit:read. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
limitqueryintegerNoHow many. Default 50.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

GET/v1/credit/ageing

How old what is owed is

Totals by how far past due, by currency. Needs credit:read.

Scope credit:read. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

GET/v1/credit/parties/{party}

One person's credit

Their limit, what they owe item by item and their promises to pay. Needs credit:read.

Scope credit:read. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
partypathstringYesThe person's party id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

PUT/v1/credit/parties/{party}/limit

Set a person's limit

Sets the limit for one person. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
partypathstringYesThe person's party id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/sales

Sell on credit

Checks the sale against the limit, the policy and what is overdue, and records it as owed when it passes. A sale that passes the limit may need the owner's word; a refusal says why. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/acknowledgements

Record an acknowledgement

The buyer said they owe it and when they will pay. Credit nobody acknowledged stays gentle: reminders go, but no firm collection step or write-off. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/promises

Record a promise to pay

A promise to pay an amount by a date. It is kept, partly kept or broken by what is paid. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

GET/v1/credit/parties/{party}/plans

A person's instalment plans

The plans a person has agreed to, with what each part is and what was paid. Needs credit:read.

Scope credit:read. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
partypathstringYesThe person's party id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/plans

Offer an instalment plan

Splits what is still owed on the chosen items into equal dated parts. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/plans/{id}/payments

Pay towards a plan

Puts a payment against the oldest unpaid parts. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
idpathstringYesThe resource id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/plans/{id}/cancel

Cancel a plan

Ends a running plan. What is still owed goes back to ordinary collection. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
idpathstringYesThe resource id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

GET/v1/credit/parties/{party}/cheques

A person's cheques

The cheques received from a person and where each stands. Needs credit:read.

Scope credit:read. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
partypathstringYesThe person's party id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/cheques

Record a cheque received

Enters a cheque in the register, often post-dated. It pays nothing until it clears. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/cheques/{id}/state

Move a cheque on

Deposits, clears, bounces or returns a cheque. A deposit waits for the date on it and is refused once it has gone stale. A cleared cheque pays the items it was meant for. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
idpathstringYesThe resource id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

GET/v1/credit/parties/{party}/write-offs

A person's write-off files

Each file with the recovery steps tried so far. Needs credit:read.

Scope credit:read. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
partypathstringYesThe person's party id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

GET/v1/credit/write-off-policy

Get the recovery policy

The steps, the age and the acknowledgement a debt needs before it can be proposed for write-off. Needs credit:read.

Scope credit:read. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

PUT/v1/credit/write-off-policy

Set the recovery policy

Replaces the policy. An admin only. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/write-offs

Open a write-off file

Starts a file over open items of one person. Nothing is written off until the steps are tried and the owner approves. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/write-offs/{id}/steps

Record a recovery step

Notes that a step (a reminder, a call, a notice) was done, with what shows it. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
idpathstringYesThe resource id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/write-offs/{id}/proposal

Put a file to the owner

Refused until every required step is recorded, the debt is old enough and, where the policy asks, acknowledged. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
idpathstringYesThe resource id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/write-offs/{id}/decision

Decide a write-off

The owner approves or keeps the debt open. An approval posts the write-off to the books once; asking again after a failed post finishes the post. An admin only. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
idpathstringYesThe resource id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/write-offs/{id}/recovery

Note money recovered

Money that came in after the write-off is shown as recovered, never hidden. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
idpathstringYesThe resource id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/credit/parties/{party}/balance-link

Send a person their balance

Texts the person a link to their own balance. They prove the phone with a code before anything is shown, and the page shows nobody else's figures. Needs credit:write.

Scope credit:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
partypathstringYesThe person's party id.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.