cURL
curl --request PUT \
--url https://api.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId} \
--header 'Content-Type: application/json' \
--data '
{
"currency": "<string>",
"total": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"subTotal": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTaxes": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDiscounts": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTip": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalFees": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDuties": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalShipping": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"description": "<string>",
"category": "<string>",
"categoryId": 123,
"expenseReportId": 123,
"note": "<string>",
"tags": [
"<string>"
],
"reference": "<string>",
"date": "2023-11-07T05:31:56Z",
"lineItems": [
{
"productId": 123,
"groupId": 123,
"price": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"description": "<string>",
"variantId": "<string>",
"quantity": 123,
"subTotal": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDiscounts": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDuties": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"total": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTaxes": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"taxes": [
{
"taxId": 123,
"name": "<string>",
"amount": 123,
"percentage": 123,
"taxIdentificationNumber": "<string>"
}
],
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"modifiers": [
{
"productModifierId": "<string>",
"quantity": 123,
"price": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalPrice": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"taxable": true,
"sku": "<string>"
}
],
"taxable": true
}
],
"taxes": [
{
"name": "<string>",
"rate": 123,
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"taxIdentificationNumber": "<string>",
"taxIncluded": true
}
],
"discounts": [
{
"promoCodeId": 123,
"expenseId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"percentage": 123
}
],
"fees": [
{
"feeId": 123,
"name": "<string>",
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"type": "<string>"
}
],
"vendorId": 123,
"vendorAccountId": 123,
"merchantId": 123,
"merchant": {
"name": "<string>",
"website": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"stateCode": "<string>",
"countryCode": "<string>",
"postalCode": "<string>"
}
}
}
'import requests
url = "https://api.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}"
payload = {
"currency": "<string>",
"total": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"subTotal": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTaxes": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDiscounts": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTip": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalFees": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDuties": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalShipping": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"description": "<string>",
"category": "<string>",
"categoryId": 123,
"expenseReportId": 123,
"note": "<string>",
"tags": ["<string>"],
"reference": "<string>",
"date": "2023-11-07T05:31:56Z",
"lineItems": [
{
"productId": 123,
"groupId": 123,
"price": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"description": "<string>",
"variantId": "<string>",
"quantity": 123,
"subTotal": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDiscounts": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDuties": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"total": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTaxes": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"taxes": [
{
"taxId": 123,
"name": "<string>",
"amount": 123,
"percentage": 123,
"taxIdentificationNumber": "<string>"
}
],
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"modifiers": [
{
"productModifierId": "<string>",
"quantity": 123,
"price": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalPrice": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"taxable": True,
"sku": "<string>"
}
],
"taxable": True
}
],
"taxes": [
{
"name": "<string>",
"rate": 123,
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"taxIdentificationNumber": "<string>",
"taxIncluded": True
}
],
"discounts": [
{
"promoCodeId": 123,
"expenseId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"percentage": 123
}
],
"fees": [
{
"feeId": 123,
"name": "<string>",
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"type": "<string>"
}
],
"vendorId": 123,
"vendorAccountId": 123,
"merchantId": 123,
"merchant": {
"name": "<string>",
"website": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"stateCode": "<string>",
"countryCode": "<string>",
"postalCode": "<string>"
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
currency: '<string>',
total: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
subTotal: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalTaxes: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalDiscounts: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalTip: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalFees: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalDuties: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalShipping: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
description: '<string>',
category: '<string>',
categoryId: 123,
expenseReportId: 123,
note: '<string>',
tags: ['<string>'],
reference: '<string>',
date: '2023-11-07T05:31:56Z',
lineItems: [
{
productId: 123,
groupId: 123,
price: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
name: '<string>',
description: '<string>',
variantId: '<string>',
quantity: 123,
subTotal: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalDiscounts: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalDuties: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
total: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalTaxes: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
taxes: [
{
taxId: 123,
name: '<string>',
amount: 123,
percentage: 123,
taxIdentificationNumber: '<string>'
}
],
discounts: [
{
promoCodeId: 123,
amount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123,
name: '<string>'
}
],
modifiers: [
{
productModifierId: '<string>',
quantity: 123,
price: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalPrice: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
name: '<string>',
taxable: true,
sku: '<string>'
}
],
taxable: true
}
],
taxes: [
{
name: '<string>',
rate: 123,
totalAmount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
taxIdentificationNumber: '<string>',
taxIncluded: true
}
],
discounts: [
{
promoCodeId: 123,
expenseId: 123,
amount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
name: '<string>',
percentage: 123
}
],
fees: [
{
feeId: 123,
name: '<string>',
amount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123,
type: '<string>'
}
],
vendorId: 123,
vendorAccountId: 123,
merchantId: 123,
merchant: {
name: '<string>',
website: '<string>',
email: '<string>',
phoneNumber: '<string>',
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
country: '<string>',
stateCode: '<string>',
countryCode: '<string>',
postalCode: '<string>'
}
}
})
};
fetch('https://api.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}', 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.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'currency' => '<string>',
'total' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'subTotal' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalTaxes' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalDiscounts' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalTip' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalFees' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalDuties' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalShipping' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'description' => '<string>',
'category' => '<string>',
'categoryId' => 123,
'expenseReportId' => 123,
'note' => '<string>',
'tags' => [
'<string>'
],
'reference' => '<string>',
'date' => '2023-11-07T05:31:56Z',
'lineItems' => [
[
'productId' => 123,
'groupId' => 123,
'price' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'name' => '<string>',
'description' => '<string>',
'variantId' => '<string>',
'quantity' => 123,
'subTotal' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalDiscounts' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalDuties' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'total' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalTaxes' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'taxes' => [
[
'taxId' => 123,
'name' => '<string>',
'amount' => 123,
'percentage' => 123,
'taxIdentificationNumber' => '<string>'
]
],
'discounts' => [
[
'promoCodeId' => 123,
'amount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123,
'name' => '<string>'
]
],
'modifiers' => [
[
'productModifierId' => '<string>',
'quantity' => 123,
'price' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalPrice' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'name' => '<string>',
'taxable' => true,
'sku' => '<string>'
]
],
'taxable' => true
]
],
'taxes' => [
[
'name' => '<string>',
'rate' => 123,
'totalAmount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'taxIdentificationNumber' => '<string>',
'taxIncluded' => true
]
],
'discounts' => [
[
'promoCodeId' => 123,
'expenseId' => 123,
'amount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'name' => '<string>',
'percentage' => 123
]
],
'fees' => [
[
'feeId' => 123,
'name' => '<string>',
'amount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123,
'type' => '<string>'
]
],
'vendorId' => 123,
'vendorAccountId' => 123,
'merchantId' => 123,
'merchant' => [
'name' => '<string>',
'website' => '<string>',
'email' => '<string>',
'phoneNumber' => '<string>',
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'country' => '<string>',
'stateCode' => '<string>',
'countryCode' => '<string>',
'postalCode' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"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.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}"
payload := strings.NewReader("{\n \"currency\": \"<string>\",\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTip\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalFees\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalShipping\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"categoryId\": 123,\n \"expenseReportId\": 123,\n \"note\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"reference\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"variantId\": \"<string>\",\n \"quantity\": 123,\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"amount\": 123,\n \"percentage\": 123,\n \"taxIdentificationNumber\": \"<string>\"\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"modifiers\": [\n {\n \"productModifierId\": \"<string>\",\n \"quantity\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalPrice\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"taxable\": true,\n \"sku\": \"<string>\"\n }\n ],\n \"taxable\": true\n }\n ],\n \"taxes\": [\n {\n \"name\": \"<string>\",\n \"rate\": 123,\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxIdentificationNumber\": \"<string>\",\n \"taxIncluded\": true\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"expenseId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"percentage\": 123\n }\n ],\n \"fees\": [\n {\n \"feeId\": 123,\n \"name\": \"<string>\",\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"vendorId\": 123,\n \"vendorAccountId\": 123,\n \"merchantId\": 123,\n \"merchant\": {\n \"name\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"<string>\",\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTip\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalFees\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalShipping\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"categoryId\": 123,\n \"expenseReportId\": 123,\n \"note\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"reference\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"variantId\": \"<string>\",\n \"quantity\": 123,\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"amount\": 123,\n \"percentage\": 123,\n \"taxIdentificationNumber\": \"<string>\"\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"modifiers\": [\n {\n \"productModifierId\": \"<string>\",\n \"quantity\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalPrice\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"taxable\": true,\n \"sku\": \"<string>\"\n }\n ],\n \"taxable\": true\n }\n ],\n \"taxes\": [\n {\n \"name\": \"<string>\",\n \"rate\": 123,\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxIdentificationNumber\": \"<string>\",\n \"taxIncluded\": true\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"expenseId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"percentage\": 123\n }\n ],\n \"fees\": [\n {\n \"feeId\": 123,\n \"name\": \"<string>\",\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"vendorId\": 123,\n \"vendorAccountId\": 123,\n \"merchantId\": 123,\n \"merchant\": {\n \"name\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"<string>\",\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTip\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalFees\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalShipping\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"categoryId\": 123,\n \"expenseReportId\": 123,\n \"note\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"reference\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"variantId\": \"<string>\",\n \"quantity\": 123,\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"amount\": 123,\n \"percentage\": 123,\n \"taxIdentificationNumber\": \"<string>\"\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"modifiers\": [\n {\n \"productModifierId\": \"<string>\",\n \"quantity\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalPrice\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"taxable\": true,\n \"sku\": \"<string>\"\n }\n ],\n \"taxable\": true\n }\n ],\n \"taxes\": [\n {\n \"name\": \"<string>\",\n \"rate\": 123,\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxIdentificationNumber\": \"<string>\",\n \"taxIncluded\": true\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"expenseId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"percentage\": 123\n }\n ],\n \"fees\": [\n {\n \"feeId\": 123,\n \"name\": \"<string>\",\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"vendorId\": 123,\n \"vendorAccountId\": 123,\n \"merchantId\": 123,\n \"merchant\": {\n \"name\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_bodyBusinessTransactions
Put v1businesses expenses 1
PUT
/
v1
/
businesses
/
{businessId}
/
expenses
/
{expenseId}
cURL
curl --request PUT \
--url https://api.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId} \
--header 'Content-Type: application/json' \
--data '
{
"currency": "<string>",
"total": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"subTotal": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTaxes": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDiscounts": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTip": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalFees": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDuties": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalShipping": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"description": "<string>",
"category": "<string>",
"categoryId": 123,
"expenseReportId": 123,
"note": "<string>",
"tags": [
"<string>"
],
"reference": "<string>",
"date": "2023-11-07T05:31:56Z",
"lineItems": [
{
"productId": 123,
"groupId": 123,
"price": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"description": "<string>",
"variantId": "<string>",
"quantity": 123,
"subTotal": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDiscounts": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDuties": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"total": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTaxes": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"taxes": [
{
"taxId": 123,
"name": "<string>",
"amount": 123,
"percentage": 123,
"taxIdentificationNumber": "<string>"
}
],
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"modifiers": [
{
"productModifierId": "<string>",
"quantity": 123,
"price": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalPrice": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"taxable": true,
"sku": "<string>"
}
],
"taxable": true
}
],
"taxes": [
{
"name": "<string>",
"rate": 123,
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"taxIdentificationNumber": "<string>",
"taxIncluded": true
}
],
"discounts": [
{
"promoCodeId": 123,
"expenseId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"percentage": 123
}
],
"fees": [
{
"feeId": 123,
"name": "<string>",
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"type": "<string>"
}
],
"vendorId": 123,
"vendorAccountId": 123,
"merchantId": 123,
"merchant": {
"name": "<string>",
"website": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"stateCode": "<string>",
"countryCode": "<string>",
"postalCode": "<string>"
}
}
}
'import requests
url = "https://api.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}"
payload = {
"currency": "<string>",
"total": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"subTotal": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTaxes": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDiscounts": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTip": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalFees": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDuties": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalShipping": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"description": "<string>",
"category": "<string>",
"categoryId": 123,
"expenseReportId": 123,
"note": "<string>",
"tags": ["<string>"],
"reference": "<string>",
"date": "2023-11-07T05:31:56Z",
"lineItems": [
{
"productId": 123,
"groupId": 123,
"price": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"description": "<string>",
"variantId": "<string>",
"quantity": 123,
"subTotal": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDiscounts": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalDuties": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"total": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalTaxes": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"taxes": [
{
"taxId": 123,
"name": "<string>",
"amount": 123,
"percentage": 123,
"taxIdentificationNumber": "<string>"
}
],
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"modifiers": [
{
"productModifierId": "<string>",
"quantity": 123,
"price": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"totalPrice": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"taxable": True,
"sku": "<string>"
}
],
"taxable": True
}
],
"taxes": [
{
"name": "<string>",
"rate": 123,
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"taxIdentificationNumber": "<string>",
"taxIncluded": True
}
],
"discounts": [
{
"promoCodeId": 123,
"expenseId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"name": "<string>",
"percentage": 123
}
],
"fees": [
{
"feeId": 123,
"name": "<string>",
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"type": "<string>"
}
],
"vendorId": 123,
"vendorAccountId": 123,
"merchantId": 123,
"merchant": {
"name": "<string>",
"website": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"stateCode": "<string>",
"countryCode": "<string>",
"postalCode": "<string>"
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
currency: '<string>',
total: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
subTotal: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalTaxes: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalDiscounts: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalTip: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalFees: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalDuties: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalShipping: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
description: '<string>',
category: '<string>',
categoryId: 123,
expenseReportId: 123,
note: '<string>',
tags: ['<string>'],
reference: '<string>',
date: '2023-11-07T05:31:56Z',
lineItems: [
{
productId: 123,
groupId: 123,
price: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
name: '<string>',
description: '<string>',
variantId: '<string>',
quantity: 123,
subTotal: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalDiscounts: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalDuties: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
total: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalTaxes: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
taxes: [
{
taxId: 123,
name: '<string>',
amount: 123,
percentage: 123,
taxIdentificationNumber: '<string>'
}
],
discounts: [
{
promoCodeId: 123,
amount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123,
name: '<string>'
}
],
modifiers: [
{
productModifierId: '<string>',
quantity: 123,
price: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
totalPrice: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
name: '<string>',
taxable: true,
sku: '<string>'
}
],
taxable: true
}
],
taxes: [
{
name: '<string>',
rate: 123,
totalAmount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
taxIdentificationNumber: '<string>',
taxIncluded: true
}
],
discounts: [
{
promoCodeId: 123,
expenseId: 123,
amount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
name: '<string>',
percentage: 123
}
],
fees: [
{
feeId: 123,
name: '<string>',
amount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123,
type: '<string>'
}
],
vendorId: 123,
vendorAccountId: 123,
merchantId: 123,
merchant: {
name: '<string>',
website: '<string>',
email: '<string>',
phoneNumber: '<string>',
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
country: '<string>',
stateCode: '<string>',
countryCode: '<string>',
postalCode: '<string>'
}
}
})
};
fetch('https://api.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}', 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.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'currency' => '<string>',
'total' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'subTotal' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalTaxes' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalDiscounts' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalTip' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalFees' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalDuties' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalShipping' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'description' => '<string>',
'category' => '<string>',
'categoryId' => 123,
'expenseReportId' => 123,
'note' => '<string>',
'tags' => [
'<string>'
],
'reference' => '<string>',
'date' => '2023-11-07T05:31:56Z',
'lineItems' => [
[
'productId' => 123,
'groupId' => 123,
'price' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'name' => '<string>',
'description' => '<string>',
'variantId' => '<string>',
'quantity' => 123,
'subTotal' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalDiscounts' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalDuties' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'total' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalTaxes' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'taxes' => [
[
'taxId' => 123,
'name' => '<string>',
'amount' => 123,
'percentage' => 123,
'taxIdentificationNumber' => '<string>'
]
],
'discounts' => [
[
'promoCodeId' => 123,
'amount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123,
'name' => '<string>'
]
],
'modifiers' => [
[
'productModifierId' => '<string>',
'quantity' => 123,
'price' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'totalPrice' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'name' => '<string>',
'taxable' => true,
'sku' => '<string>'
]
],
'taxable' => true
]
],
'taxes' => [
[
'name' => '<string>',
'rate' => 123,
'totalAmount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'taxIdentificationNumber' => '<string>',
'taxIncluded' => true
]
],
'discounts' => [
[
'promoCodeId' => 123,
'expenseId' => 123,
'amount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'name' => '<string>',
'percentage' => 123
]
],
'fees' => [
[
'feeId' => 123,
'name' => '<string>',
'amount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123,
'type' => '<string>'
]
],
'vendorId' => 123,
'vendorAccountId' => 123,
'merchantId' => 123,
'merchant' => [
'name' => '<string>',
'website' => '<string>',
'email' => '<string>',
'phoneNumber' => '<string>',
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'country' => '<string>',
'stateCode' => '<string>',
'countryCode' => '<string>',
'postalCode' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"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.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}"
payload := strings.NewReader("{\n \"currency\": \"<string>\",\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTip\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalFees\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalShipping\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"categoryId\": 123,\n \"expenseReportId\": 123,\n \"note\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"reference\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"variantId\": \"<string>\",\n \"quantity\": 123,\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"amount\": 123,\n \"percentage\": 123,\n \"taxIdentificationNumber\": \"<string>\"\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"modifiers\": [\n {\n \"productModifierId\": \"<string>\",\n \"quantity\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalPrice\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"taxable\": true,\n \"sku\": \"<string>\"\n }\n ],\n \"taxable\": true\n }\n ],\n \"taxes\": [\n {\n \"name\": \"<string>\",\n \"rate\": 123,\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxIdentificationNumber\": \"<string>\",\n \"taxIncluded\": true\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"expenseId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"percentage\": 123\n }\n ],\n \"fees\": [\n {\n \"feeId\": 123,\n \"name\": \"<string>\",\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"vendorId\": 123,\n \"vendorAccountId\": 123,\n \"merchantId\": 123,\n \"merchant\": {\n \"name\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"<string>\",\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTip\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalFees\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalShipping\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"categoryId\": 123,\n \"expenseReportId\": 123,\n \"note\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"reference\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"variantId\": \"<string>\",\n \"quantity\": 123,\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"amount\": 123,\n \"percentage\": 123,\n \"taxIdentificationNumber\": \"<string>\"\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"modifiers\": [\n {\n \"productModifierId\": \"<string>\",\n \"quantity\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalPrice\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"taxable\": true,\n \"sku\": \"<string>\"\n }\n ],\n \"taxable\": true\n }\n ],\n \"taxes\": [\n {\n \"name\": \"<string>\",\n \"rate\": 123,\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxIdentificationNumber\": \"<string>\",\n \"taxIncluded\": true\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"expenseId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"percentage\": 123\n }\n ],\n \"fees\": [\n {\n \"feeId\": 123,\n \"name\": \"<string>\",\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"vendorId\": 123,\n \"vendorAccountId\": 123,\n \"merchantId\": 123,\n \"merchant\": {\n \"name\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartbills.io/v1/businesses/{businessId}/expenses/{expenseId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"<string>\",\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTip\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalFees\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalShipping\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"categoryId\": 123,\n \"expenseReportId\": 123,\n \"note\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"reference\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"variantId\": \"<string>\",\n \"quantity\": 123,\n \"subTotal\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDiscounts\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalDuties\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"total\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalTaxes\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"amount\": 123,\n \"percentage\": 123,\n \"taxIdentificationNumber\": \"<string>\"\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"modifiers\": [\n {\n \"productModifierId\": \"<string>\",\n \"quantity\": 123,\n \"price\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"totalPrice\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"taxable\": true,\n \"sku\": \"<string>\"\n }\n ],\n \"taxable\": true\n }\n ],\n \"taxes\": [\n {\n \"name\": \"<string>\",\n \"rate\": 123,\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"taxIdentificationNumber\": \"<string>\",\n \"taxIncluded\": true\n }\n ],\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"expenseId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"name\": \"<string>\",\n \"percentage\": 123\n }\n ],\n \"fees\": [\n {\n \"feeId\": 123,\n \"name\": \"<string>\",\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"vendorId\": 123,\n \"vendorAccountId\": 123,\n \"merchantId\": 123,\n \"merchant\": {\n \"name\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_bodyBody
application/jsontext/jsonapplication/*+json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
DRAFT, PENDING, PARTIALLY_PAID, PAID, OVERDUE, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, VOIDED, PENDING_APPROVAL, POLICY_BLOCKED, POLICY_FLAGGED Available options:
EMPLOYEE, COMPANY Show child attributes
Show child attributes
Response
200
OK
Was this page helpful?
⌘I