curl --request POST \
--url https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounting_date": "2023-12-25"
}
'import requests
url = "https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse"
payload = { "accounting_date": "2023-12-25" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accounting_date: '2023-12-25'})
};
fetch('https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accounting_date' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse"
payload := strings.NewReader("{\n \"accounting_date\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounting_date\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounting_date\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"company_id": "<string>",
"source_type": "<string>",
"source_id": "<string>",
"direction": "<string>",
"payment_method": "<string>",
"creation_mode": "<string>",
"status": "<string>",
"money_account_id": "<string>",
"payment_route_account_id": "<string>",
"register_payment_method_id": "<string>",
"original_amount": 123,
"original_currency_code": "<string>",
"original_currency_exponent": 123,
"company_functional_amount": 123,
"company_currency_code": "<string>",
"company_currency_exponent": 123,
"organization_functional_amount": 123,
"organization_currency_code": "<string>",
"organization_currency_exponent": 123,
"conversion_snapshot": {},
"external_reference": "<string>",
"initiated_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z",
"reversed_at": "2023-11-07T05:31:56Z",
"reversed_by": "<string>",
"reversed_by_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Reverse a card settlement
Reverses a card payment settlement from the organization space: a settled one is reversed with accounting entries, one that was only initiated is cancelled.
curl --request POST \
--url https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounting_date": "2023-12-25"
}
'import requests
url = "https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse"
payload = { "accounting_date": "2023-12-25" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accounting_date: '2023-12-25'})
};
fetch('https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accounting_date' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse"
payload := strings.NewReader("{\n \"accounting_date\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounting_date\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/organization/books/{settlement}/credit-card-settlements/{settlement}/reverse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounting_date\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"company_id": "<string>",
"source_type": "<string>",
"source_id": "<string>",
"direction": "<string>",
"payment_method": "<string>",
"creation_mode": "<string>",
"status": "<string>",
"money_account_id": "<string>",
"payment_route_account_id": "<string>",
"register_payment_method_id": "<string>",
"original_amount": 123,
"original_currency_code": "<string>",
"original_currency_exponent": 123,
"company_functional_amount": 123,
"company_currency_code": "<string>",
"company_currency_exponent": 123,
"organization_functional_amount": 123,
"organization_currency_code": "<string>",
"organization_currency_exponent": 123,
"conversion_snapshot": {},
"external_reference": "<string>",
"initiated_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z",
"reversed_at": "2023-11-07T05:31:56Z",
"reversed_by": "<string>",
"reversed_by_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}settlements.reverse
Conditions
- The accounting module must be active for the organization.
- A card settlement can be reversed only from the organization space.
- The caller must have been granted access to the book in the URL and to the organization’s own book, which the reversal writes into.
- The book in the URL must be a company book; the organization’s own book or a client book is refused.
- The settlement must be a credit card payment; other methods are refused, and cheques have their own workflow.
- When accounting_date is sent it must not be before the settled date (or the initiated date if it was never settled).
- Replaying on a settlement that is already cancelled or reversed returns it unchanged.
- A settlement whose entries were already reversed or refunded elsewhere is refused.
- An entry in a closed fiscal period is reversed on the first day of the next open period instead of the requested date.
- A settled settlement becomes reversed: reversing journal entries are posted in both the company book and the organization book, the originals are marked reversed, and reversed_at / reversed_by are recorded.
- The bank matches of the organization card settlement entry are kept, even on a closed statement.
- A settlement that was only initiated becomes cancelled; no journal entry is posted.
- The payment source’s accounting status follows the settlement status (reversed or cancelled).
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the credit card settlement to reverse (27-character KSUID string).
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, company_id, source_type, source_id, direction, payment_method, creation_mode, status, money_account_id, payment_route_account_id, register_payment_method_id, original_amount, original_currency_code, original_currency_exponent, company_functional_amount, company_currency_code, company_currency_exponent, organization_functional_amount, organization_currency_code, organization_currency_exponent, conversion_snapshot, external_reference, initiated_at, settled_at, reversed_at, reversed_by, reversed_by_type, created_at, updated_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: .
Body
Date the reversing entries are posted on (ISO 8601 date). Must not be before the settled date (or initiated date if never settled). Defaults to the date of the original entries; when that period is closed, the first day of the next open period is used.
Response
Resource (only with response=resource).
Identifier of the settlement (27-character KSUID string).
Identifier of the company the record belongs to.
Kind of business record whose payment is settled, for example order_payment or customer_credit_payment.
Identifier of that business record (27-character KSUID string). A payment can have only one settlement per company.
Direction of the money flow; incoming for payments received.
Payment method: credit_card (starts initiated, confirmed later by the organization), bank_transfer or mobile_money (created already settled).
manual or automatic: how the settlement was created. Settlements created for the supported methods are automatic.
initiated (waiting for the money), settled (money confirmed on the money account), cancelled (initiated one that was reversed) or reversed (settled one that was reversed).
Organization money account that receives the money (27-character KSUID string).
Accounting account of the payment route the payment went through (27-character KSUID string).
Identifier of the register payment method the payment went through (27-character KSUID string); null when the payment has none.
Amount in the currency the customer paid in, an integer in minor units (divide by 10 to the power original_currency_exponent).
Currency the customer paid in (ISO 4217 code).
Number of decimal places of the original currency.
Amount in the company currency, an integer in minor units, frozen from the payment conversion.
Company currency (ISO 4217 code).
Number of decimal places of the company currency.
Amount in the organization currency, an integer in minor units, frozen from the payment conversion.
Organization currency (ISO 4217 code).
Number of decimal places of the organization currency.
Frozen record of the conversions, the fees applied when settled, a hash of the confirmation payload, the accounting posting status and the journal entry identifiers, and the reversal details. Never recalculated with newer rates.
Reference supplied by the payment provider or the bank; null when none.
Date and time the settlement was initiated (ISO 8601).
Date and time the money was confirmed (ISO 8601); null until settled.
Date and time the settlement was reversed or cancelled (ISO 8601); null otherwise.
Identifier of the member profile or agent account who reversed it; null otherwise.
Type of the actor who reversed it; null otherwise.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).