Skip to main content

APIs

Get by Id

Get an authorization resource by id.

VerbGET
URLhttps://api.s.unit.sh/authorizations/{id}
Required Scopeauthorizations
Timeout (Seconds)5

Query Parameters

NameTypeDefaultDescription
filter[includeNonAuthorized]booleanfalseOptional. Include authorizations from all statuses.

Response

Response is a JSON:API document.

200 OK

NameTypeDescription
dataAuthorizationAuthorization resource.
curl -X GET 'https://api.s.unit.sh/authorizations/1' \
-H "Authorization: Bearer ${TOKEN}"

List

List authorizations. Filtering and sorting can be applied. Paging is available only when filtering by customer id or account id.

VerbGET
URLhttps://api.s.unit.sh/authorizations
Required Scopeauthorizations
Timeout (Seconds)5

Query Parameters

NameTypeDefaultDescription
page[limit]integer100Optional. Maximum number of resources that will be returned. Maximum is 1000 resources.
page[offset]integer0Optional. Number of resources to skip.
filter[accountId]string(empty)Optional. Filters the results by the specified account id.
filter[accountType]string(empty)Optional. Filter the results by account type (deposit, credit).
filter[customerId]string(empty)Optional. Filters the results by the specified customer id.
filter[cardId]string(empty)Optional. Filters the results by the specified card id.
filter[since]RFC3339 Date string(empty)Optional. Filters the Authorizations that occurred after the specified date. e.g. 2020-01-13T16:01:19.346Z
filter[until]RFC3339 Date string(empty)Optional. Filters the Authorizations that occurred before the specified date. e.g. 2020-01-02T20:06:23.486Z
filter[includeNonAuthorized]booleanfalseOptional. Include authorizations from all statuses.
filter[status]stringAuthorizedOptional. Filter authorizations by Authorization Status.
filter[merchantCategoryCode][]Integer(empty)Optional. Filter authorizations by their 4-digit ISO 18245 merchant category code (MCC).
filter[fromAmount]Integer(empty)Optional. Filters the Authorizations that have an amount that is higher or equal to the specified amount (in cents). e.g. 5000
filter[toAmount]Integer(empty)Optional. Filters the Authorizations that have an amount that is lower or equal to the specified amount (in cents). e.g. 7000
sortstringsort=-createdAtOptional. Leave empty or provide sort=createdAt for ascending order. Provide sort=-createdAt (leading minus sign) for descending order.
curl -X GET 'https://api.s.unit.sh/authorizations?page[limit]=20&page[offset]=0' \
-H "Authorization: Bearer ${TOKEN}"

Response

Response is a JSON:API document.

200 OK

NameTypeDescription
dataArray of AuthorizationArray of authorization resources.
meta OptionalJSON object that contains pagination dataOptional. Will be defined only when filtered by customer or account id. Pagination data includes offset, limit and total (estimated total items).
Example Response:
{
"data": [
{
"type": "authorization",
"id": "90",
"attributes": {
"createdAt": "2021-02-16T07:40:44.970Z",
"amount": 2000,
"cardLast4Digits": "",
"merchant": {
"name": "Europcar Mobility Group",
"type": 3381,
"category": "EUROP CAR",
"location": "Cupertino, CA",
"id": "029859000085093"
}
},
"relationships": {
"customer": {
"data": {
"type": "customer",
"id": "10000"
}
},
"account": {
"data": {
"type": "account",
"id": "10001"
}
},
"card": {
"data": {
"type": "card",
"id": "10501"
}
}
}
}
],
"meta": {
"pagination": {
"total": 1,
"limit": 100,
"offset": 0
}
}
}

Release Authorization

Manually release an authorization that is in Authorized status. This removes the authorization hold from the account so the available balance increases by the authorization amount (subject to other pending activity).

This endpoint is not Unit-only. It is available to your organization only when your Org Bank Agreement permits org-initiated release of authorization holds (see Org-initiated release on the overview page). When that setting is not enabled, org callers cannot self-serve this action. For operational expectations and risk disclosure, read Releasing an Authorization Hold.

This is an exception path, not a replacement for the standard authorization lifecycle. In the normal flow, holds are released when the merchant settles or reverses the authorization, or when network reconciliation determines the hold is no longer active.

No request body is required.

VerbPOST
URLhttps://api.s.unit.sh/authorizations/{id}/release
Required Scopeauthorizations
Timeout (Seconds)5
Example Request:
curl -X POST 'https://api.s.unit.sh/authorizations/:id/release'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'

Response

Response is a JSON:API document.

200 OK

NameTypeDescription
dataAuthorizationUpdated authorization.