Mark expense as paid
curl --request POST \
--url https://api.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-finops-version: <x-finops-version>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"paid_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid"
payload = { "paid_at": "2023-11-07T05:31:56Z" }
headers = {
"x-finops-version": "<x-finops-version>",
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-finops-version': '<x-finops-version>',
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({paid_at: '2023-11-07T05:31:56Z'})
};
fetch('https://api.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid', 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.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid",
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([
'paid_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-finops-version: <x-finops-version>",
"x-organization-id: <x-organization-id>"
],
]);
$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.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid"
payload := strings.NewReader("{\n \"paid_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-finops-version", "<x-finops-version>")
req.Header.Add("x-organization-id", "<x-organization-id>")
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.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid")
.header("x-finops-version", "<x-finops-version>")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"paid_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-finops-version"] = '<x-finops-version>'
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paid_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "USD",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expense_status": "new",
"has_validation_errors": true,
"merchant_amount": 123,
"merchant_currency": "AED",
"merchant_name": "Acme Inc.",
"started_at": "<string>",
"subtype": "capture",
"type": "card",
"applied_policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"department_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"entity_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"ledger_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_location": "New York, US",
"no_receipt_reason": "<string>",
"paid_at": "<string>",
"paid_by_entity_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"partner_metadata": {},
"payment_method": {
"details": {
"brand": "visa",
"card_type": "credit",
"expiry_month": 6,
"expiry_year": 123,
"last4": 1234
},
"type": "card"
},
"payment_processing_status": "created",
"payout_method": "outside_platform",
"payout_status": "unpaid",
"receipt_file_url": "<string>",
"receipt_id": "<string>",
"reject_reason": "<string>",
"source_of_data": {
"department_id": "user",
"description": "user",
"ledger_account_id": "user",
"location_id": "user",
"receipt_id": "user"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"error": {
"message": "<string>"
}
}Expenses
Mark expense as paid
Records that an approved reimbursement was paid outside the platform. Answers 409 for a card, a reimbursement that is not approved, or one already paid.
POST
/
expenses
/
{expense_id}
/
mark-as-paid
Mark expense as paid
curl --request POST \
--url https://api.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-finops-version: <x-finops-version>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"paid_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid"
payload = { "paid_at": "2023-11-07T05:31:56Z" }
headers = {
"x-finops-version": "<x-finops-version>",
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-finops-version': '<x-finops-version>',
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({paid_at: '2023-11-07T05:31:56Z'})
};
fetch('https://api.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid', 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.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid",
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([
'paid_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-finops-version: <x-finops-version>",
"x-organization-id: <x-organization-id>"
],
]);
$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.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid"
payload := strings.NewReader("{\n \"paid_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-finops-version", "<x-finops-version>")
req.Header.Add("x-organization-id", "<x-organization-id>")
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.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid")
.header("x-finops-version", "<x-finops-version>")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"paid_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/finops/v1/expenses/{expense_id}/mark-as-paid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-finops-version"] = '<x-finops-version>'
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paid_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "USD",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expense_status": "new",
"has_validation_errors": true,
"merchant_amount": 123,
"merchant_currency": "AED",
"merchant_name": "Acme Inc.",
"started_at": "<string>",
"subtype": "capture",
"type": "card",
"applied_policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"department_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"entity_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"ledger_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_location": "New York, US",
"no_receipt_reason": "<string>",
"paid_at": "<string>",
"paid_by_entity_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"partner_metadata": {},
"payment_method": {
"details": {
"brand": "visa",
"card_type": "credit",
"expiry_month": 6,
"expiry_year": 123,
"last4": 1234
},
"type": "card"
},
"payment_processing_status": "created",
"payout_method": "outside_platform",
"payout_status": "unpaid",
"receipt_file_url": "<string>",
"receipt_id": "<string>",
"reject_reason": "<string>",
"source_of_data": {
"department_id": "user",
"description": "user",
"ledger_account_id": "user",
"location_id": "user",
"receipt_id": "user"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"error": {
"message": "<string>"
}
}Authorizations
Headers
Body
application/json
Response
Successful Response
The transaction amount in minor units. Positive values for in-flow, negative values for out-flow.
ISO currency code.
Available options:
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW Example:
"USD"
ISO currency code for the merchant_amount.
Available options:
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW ID of the entity user who owns the transaction. Must be an active or invited user of the organization. When omitted and the request is made as an entity user, the caller becomes the owner; an explicit null leaves the transaction unowned. A caller limited to their own transactions may only name themselves or one of their direct reportees, and becomes the owner when the field is null.
Was this page helpful?