Accounting API
GET
Get BalanceSheet
{{baseUrl}}/accounting/balance-sheet
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/balance-sheet");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/balance-sheet" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/balance-sheet"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/balance-sheet"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/balance-sheet");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/balance-sheet"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/balance-sheet HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/balance-sheet")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/balance-sheet"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/balance-sheet")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/balance-sheet")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/balance-sheet');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/balance-sheet',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/balance-sheet';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/balance-sheet',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/balance-sheet")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/balance-sheet',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/balance-sheet',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/balance-sheet');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/balance-sheet',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/balance-sheet';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/balance-sheet"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/balance-sheet" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/balance-sheet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/balance-sheet', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/balance-sheet');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/balance-sheet');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/balance-sheet' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/balance-sheet' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/balance-sheet", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/balance-sheet"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/balance-sheet"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/balance-sheet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/balance-sheet') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/balance-sheet";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/balance-sheet \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/balance-sheet \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/balance-sheet
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/balance-sheet")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"assets": {
"current_assets": {
"accounts": [
{
"id": "1",
"name": "Accounts Receivable (A/R)",
"value": 10000
},
{
"id": "2",
"name": "Accounts Payable (A/P)",
"value": 10000
}
],
"total": 100000
},
"fixed_assets": {
"accounts": [
{
"id": "1",
"name": "Accounts Receivable (A/R)",
"value": 10000
},
{
"id": "2",
"name": "Accounts Payable (A/P)",
"value": 10000
}
],
"total": 100000
},
"total": 200000
},
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"end_date": "2017-01-01",
"equity": {
"items": [
{
"id": "1",
"name": "Retained Earnings",
"value": 10000
}
],
"total": 200000
},
"id": "12345",
"liabilities": {
"accounts": [
{
"id": "1",
"name": "Accounts Payable (A/P)",
"value": 10000
}
],
"total": 200000
},
"report_name": "BalanceSheet",
"start_date": "2017-01-01",
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "BalanceSheets",
"service": "quickbooks",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
POST
Create Bill
{{baseUrl}}/accounting/bills
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
BODY json
{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/bills");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounting/bills" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:balance ""
:bill_date ""
:bill_number ""
:created_at ""
:created_by ""
:currency ""
:currency_rate ""
:deposit ""
:downstream_id ""
:due_date ""
:id ""
:ledger_account {:code ""
:id ""
:name ""
:nominal_code ""}
:line_items [{:code ""
:created_at ""
:created_by ""
:department_id ""
:description ""
:discount_percentage ""
:id ""
:item {:code ""
:id ""
:name ""}
:ledger_account {}
:line_number 0
:location_id ""
:quantity ""
:row_id ""
:row_version ""
:tax_amount ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:total_amount ""
:type ""
:unit_of_measure ""
:unit_price ""
:updated_at ""
:updated_by ""}]
:notes ""
:paid_date ""
:po_number ""
:reference ""
:row_version ""
:status ""
:sub_total ""
:supplier {:address {:city ""
:contact_name ""
:country ""
:county ""
:email ""
:fax ""
:id ""
:latitude ""
:line1 ""
:line2 ""
:line3 ""
:line4 ""
:longitude ""
:name ""
:phone_number ""
:postal_code ""
:row_version ""
:salutation ""
:state ""
:street_number ""
:string ""
:type ""
:website ""}
:company_name ""
:display_name ""
:id ""}
:tax_code ""
:tax_inclusive false
:terms ""
:total ""
:total_tax ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/bills"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/accounting/bills"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/bills");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/bills"
payload := strings.NewReader("{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/accounting/bills HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1855
{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounting/bills")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/bills"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/bills")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounting/bills")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounting/bills');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/bills',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/bills';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"balance":"","bill_date":"","bill_number":"","created_at":"","created_by":"","currency":"","currency_rate":"","deposit":"","downstream_id":"","due_date":"","id":"","ledger_account":{"code":"","id":"","name":"","nominal_code":""},"line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"notes":"","paid_date":"","po_number":"","reference":"","row_version":"","status":"","sub_total":"","supplier":{"address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"company_name":"","display_name":"","id":""},"tax_code":"","tax_inclusive":false,"terms":"","total":"","total_tax":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/bills',
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "balance": "",\n "bill_date": "",\n "bill_number": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "deposit": "",\n "downstream_id": "",\n "due_date": "",\n "id": "",\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {},\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "notes": "",\n "paid_date": "",\n "po_number": "",\n "reference": "",\n "row_version": "",\n "status": "",\n "sub_total": "",\n "supplier": {\n "address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "company_name": "",\n "display_name": "",\n "id": ""\n },\n "tax_code": "",\n "tax_inclusive": false,\n "terms": "",\n "total": "",\n "total_tax": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/bills")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/bills',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/bills',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/accounting/bills');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/bills',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/bills';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"balance":"","bill_date":"","bill_number":"","created_at":"","created_by":"","currency":"","currency_rate":"","deposit":"","downstream_id":"","due_date":"","id":"","ledger_account":{"code":"","id":"","name":"","nominal_code":""},"line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"notes":"","paid_date":"","po_number":"","reference":"","row_version":"","status":"","sub_total":"","supplier":{"address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"company_name":"","display_name":"","id":""},"tax_code":"","tax_inclusive":false,"terms":"","total":"","total_tax":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"balance": @"",
@"bill_date": @"",
@"bill_number": @"",
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"currency_rate": @"",
@"deposit": @"",
@"downstream_id": @"",
@"due_date": @"",
@"id": @"",
@"ledger_account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"line_items": @[ @{ @"code": @"", @"created_at": @"", @"created_by": @"", @"department_id": @"", @"description": @"", @"discount_percentage": @"", @"id": @"", @"item": @{ @"code": @"", @"id": @"", @"name": @"" }, @"ledger_account": @{ }, @"line_number": @0, @"location_id": @"", @"quantity": @"", @"row_id": @"", @"row_version": @"", @"tax_amount": @"", @"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" }, @"total_amount": @"", @"type": @"", @"unit_of_measure": @"", @"unit_price": @"", @"updated_at": @"", @"updated_by": @"" } ],
@"notes": @"",
@"paid_date": @"",
@"po_number": @"",
@"reference": @"",
@"row_version": @"",
@"status": @"",
@"sub_total": @"",
@"supplier": @{ @"address": @{ @"city": @"", @"contact_name": @"", @"country": @"", @"county": @"", @"email": @"", @"fax": @"", @"id": @"", @"latitude": @"", @"line1": @"", @"line2": @"", @"line3": @"", @"line4": @"", @"longitude": @"", @"name": @"", @"phone_number": @"", @"postal_code": @"", @"row_version": @"", @"salutation": @"", @"state": @"", @"street_number": @"", @"string": @"", @"type": @"", @"website": @"" }, @"company_name": @"", @"display_name": @"", @"id": @"" },
@"tax_code": @"",
@"tax_inclusive": @NO,
@"terms": @"",
@"total": @"",
@"total_tax": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/bills"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/bills" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/bills",
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([
'balance' => '',
'bill_date' => '',
'bill_number' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'deposit' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'notes' => '',
'paid_date' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total' => '',
'total_tax' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/accounting/bills', [
'body' => '{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/bills');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'balance' => '',
'bill_date' => '',
'bill_number' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'deposit' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'notes' => '',
'paid_date' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total' => '',
'total_tax' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'balance' => '',
'bill_date' => '',
'bill_number' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'deposit' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'notes' => '',
'paid_date' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total' => '',
'total_tax' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/bills');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/bills' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/bills' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/accounting/bills", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/bills"
payload = {
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": False,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/bills"
payload <- "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/bills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/accounting/bills') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/bills";
let payload = json!({
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"line_items": (
json!({
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": json!({
"code": "",
"id": "",
"name": ""
}),
"ledger_account": json!({}),
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
})
),
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": json!({
"address": json!({
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}),
"company_name": "",
"display_name": "",
"id": ""
}),
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounting/bills \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}' | \
http POST {{baseUrl}}/accounting/bills \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method POST \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "balance": "",\n "bill_date": "",\n "bill_number": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "deposit": "",\n "downstream_id": "",\n "due_date": "",\n "id": "",\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {},\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "notes": "",\n "paid_date": "",\n "po_number": "",\n "reference": "",\n "row_version": "",\n "status": "",\n "sub_total": "",\n "supplier": {\n "address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "company_name": "",\n "display_name": "",\n "id": ""\n },\n "tax_code": "",\n "tax_inclusive": false,\n "terms": "",\n "total": "",\n "total_tax": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/bills
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"line_items": [
[
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": [
"code": "",
"id": "",
"name": ""
],
"ledger_account": [],
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
]
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": [
"address": [
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
],
"company_name": "",
"display_name": "",
"id": ""
],
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/bills")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "add",
"resource": "bills",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
DELETE
Delete Bill
{{baseUrl}}/accounting/bills/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/bills/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounting/bills/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/bills/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounting/bills/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/bills/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/bills/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounting/bills/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounting/bills/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/bills/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/bills/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounting/bills/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounting/bills/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/bills/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/bills/:id',
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/bills/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounting/bills/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/bills/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/bills/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/bills/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/bills/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounting/bills/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/bills/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/bills/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/bills/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/bills/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/accounting/bills/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/bills/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/bills/:id"
response <- VERB("DELETE", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/bills/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounting/bills/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/bills/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounting/bills/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http DELETE {{baseUrl}}/accounting/bills/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method DELETE \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/bills/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/bills/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "delete",
"resource": "bills",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get Bill
{{baseUrl}}/accounting/bills/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/bills/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/bills/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/bills/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/bills/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/bills/:id");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/bills/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/bills/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/bills/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/bills/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/bills/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/bills/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/bills/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/bills/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/bills/:id',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/bills/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/bills/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/bills/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/bills/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/bills/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/bills/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/bills/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/bills/:id');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/bills/:id');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/bills/:id' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/bills/:id' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/bills/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/bills/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/bills/:id"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/bills/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/bills/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/bills/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/bills/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/bills/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/bills/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/bills/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"balance": 27500,
"bill_date": "2020-09-30",
"bill_number": "10001",
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"currency": "USD",
"currency_rate": 0.69,
"deposit": 0,
"downstream_id": "12345",
"due_date": "2020-10-30",
"id": "12345",
"notes": "Some notes about this bill.",
"paid_date": "2020-10-30",
"po_number": "90000117",
"reference": "123456",
"row_version": "1-12345",
"status": "draft",
"sub_total": 27500,
"tax_code": "1234",
"tax_inclusive": true,
"terms": "Net 30 days",
"total": 27500,
"total_tax": 2500,
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "bills",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
List Bills
{{baseUrl}}/accounting/bills
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/bills");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/bills" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/bills"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/bills"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/bills");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/bills"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/bills HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/bills")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/bills"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/bills")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/bills")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/bills');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/bills',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/bills';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/bills',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/bills")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/bills',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/bills',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/bills');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/bills',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/bills';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/bills"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/bills" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/bills",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/bills', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/bills');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/bills');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/bills' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/bills' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/bills", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/bills"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/bills"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/bills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/bills') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/bills";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/bills \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/bills \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/bills
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/bills")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"links": {
"current": "https://unify.apideck.com/crm/companies",
"next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
},
"meta": {
"items_on_page": 50
},
"operation": "all",
"resource": "bills",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
PATCH
Update Bill
{{baseUrl}}/accounting/bills/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
BODY json
{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/bills/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounting/bills/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:balance ""
:bill_date ""
:bill_number ""
:created_at ""
:created_by ""
:currency ""
:currency_rate ""
:deposit ""
:downstream_id ""
:due_date ""
:id ""
:ledger_account {:code ""
:id ""
:name ""
:nominal_code ""}
:line_items [{:code ""
:created_at ""
:created_by ""
:department_id ""
:description ""
:discount_percentage ""
:id ""
:item {:code ""
:id ""
:name ""}
:ledger_account {}
:line_number 0
:location_id ""
:quantity ""
:row_id ""
:row_version ""
:tax_amount ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:total_amount ""
:type ""
:unit_of_measure ""
:unit_price ""
:updated_at ""
:updated_by ""}]
:notes ""
:paid_date ""
:po_number ""
:reference ""
:row_version ""
:status ""
:sub_total ""
:supplier {:address {:city ""
:contact_name ""
:country ""
:county ""
:email ""
:fax ""
:id ""
:latitude ""
:line1 ""
:line2 ""
:line3 ""
:line4 ""
:longitude ""
:name ""
:phone_number ""
:postal_code ""
:row_version ""
:salutation ""
:state ""
:street_number ""
:string ""
:type ""
:website ""}
:company_name ""
:display_name ""
:id ""}
:tax_code ""
:tax_inclusive false
:terms ""
:total ""
:total_tax ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/bills/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounting/bills/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/bills/:id");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/bills/:id"
payload := strings.NewReader("{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounting/bills/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1855
{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounting/bills/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/bills/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/bills/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounting/bills/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounting/bills/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/bills/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"balance":"","bill_date":"","bill_number":"","created_at":"","created_by":"","currency":"","currency_rate":"","deposit":"","downstream_id":"","due_date":"","id":"","ledger_account":{"code":"","id":"","name":"","nominal_code":""},"line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"notes":"","paid_date":"","po_number":"","reference":"","row_version":"","status":"","sub_total":"","supplier":{"address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"company_name":"","display_name":"","id":""},"tax_code":"","tax_inclusive":false,"terms":"","total":"","total_tax":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/bills/:id',
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "balance": "",\n "bill_date": "",\n "bill_number": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "deposit": "",\n "downstream_id": "",\n "due_date": "",\n "id": "",\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {},\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "notes": "",\n "paid_date": "",\n "po_number": "",\n "reference": "",\n "row_version": "",\n "status": "",\n "sub_total": "",\n "supplier": {\n "address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "company_name": "",\n "display_name": "",\n "id": ""\n },\n "tax_code": "",\n "tax_inclusive": false,\n "terms": "",\n "total": "",\n "total_tax": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/bills/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/accounting/bills/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/bills/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
balance: '',
bill_date: '',
bill_number: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
deposit: '',
downstream_id: '',
due_date: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
notes: '',
paid_date: '',
po_number: '',
reference: '',
row_version: '',
status: '',
sub_total: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
tax_code: '',
tax_inclusive: false,
terms: '',
total: '',
total_tax: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/bills/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"balance":"","bill_date":"","bill_number":"","created_at":"","created_by":"","currency":"","currency_rate":"","deposit":"","downstream_id":"","due_date":"","id":"","ledger_account":{"code":"","id":"","name":"","nominal_code":""},"line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"notes":"","paid_date":"","po_number":"","reference":"","row_version":"","status":"","sub_total":"","supplier":{"address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"company_name":"","display_name":"","id":""},"tax_code":"","tax_inclusive":false,"terms":"","total":"","total_tax":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"balance": @"",
@"bill_date": @"",
@"bill_number": @"",
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"currency_rate": @"",
@"deposit": @"",
@"downstream_id": @"",
@"due_date": @"",
@"id": @"",
@"ledger_account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"line_items": @[ @{ @"code": @"", @"created_at": @"", @"created_by": @"", @"department_id": @"", @"description": @"", @"discount_percentage": @"", @"id": @"", @"item": @{ @"code": @"", @"id": @"", @"name": @"" }, @"ledger_account": @{ }, @"line_number": @0, @"location_id": @"", @"quantity": @"", @"row_id": @"", @"row_version": @"", @"tax_amount": @"", @"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" }, @"total_amount": @"", @"type": @"", @"unit_of_measure": @"", @"unit_price": @"", @"updated_at": @"", @"updated_by": @"" } ],
@"notes": @"",
@"paid_date": @"",
@"po_number": @"",
@"reference": @"",
@"row_version": @"",
@"status": @"",
@"sub_total": @"",
@"supplier": @{ @"address": @{ @"city": @"", @"contact_name": @"", @"country": @"", @"county": @"", @"email": @"", @"fax": @"", @"id": @"", @"latitude": @"", @"line1": @"", @"line2": @"", @"line3": @"", @"line4": @"", @"longitude": @"", @"name": @"", @"phone_number": @"", @"postal_code": @"", @"row_version": @"", @"salutation": @"", @"state": @"", @"street_number": @"", @"string": @"", @"type": @"", @"website": @"" }, @"company_name": @"", @"display_name": @"", @"id": @"" },
@"tax_code": @"",
@"tax_inclusive": @NO,
@"terms": @"",
@"total": @"",
@"total_tax": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/bills/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/bills/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/bills/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'balance' => '',
'bill_date' => '',
'bill_number' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'deposit' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'notes' => '',
'paid_date' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total' => '',
'total_tax' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/accounting/bills/:id', [
'body' => '{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/bills/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'balance' => '',
'bill_date' => '',
'bill_number' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'deposit' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'notes' => '',
'paid_date' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total' => '',
'total_tax' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'balance' => '',
'bill_date' => '',
'bill_number' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'deposit' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'notes' => '',
'paid_date' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total' => '',
'total_tax' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/bills/:id');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/bills/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/bills/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/accounting/bills/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/bills/:id"
payload = {
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": False,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/bills/:id"
payload <- "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/bills/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/accounting/bills/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"balance\": \"\",\n \"bill_date\": \"\",\n \"bill_number\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"deposit\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"notes\": \"\",\n \"paid_date\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/bills/:id";
let payload = json!({
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"line_items": (
json!({
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": json!({
"code": "",
"id": "",
"name": ""
}),
"ledger_account": json!({}),
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
})
),
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": json!({
"address": json!({
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}),
"company_name": "",
"display_name": "",
"id": ""
}),
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounting/bills/:id \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
}' | \
http PATCH {{baseUrl}}/accounting/bills/:id \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method PATCH \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "balance": "",\n "bill_date": "",\n "bill_number": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "deposit": "",\n "downstream_id": "",\n "due_date": "",\n "id": "",\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {},\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "notes": "",\n "paid_date": "",\n "po_number": "",\n "reference": "",\n "row_version": "",\n "status": "",\n "sub_total": "",\n "supplier": {\n "address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "company_name": "",\n "display_name": "",\n "id": ""\n },\n "tax_code": "",\n "tax_inclusive": false,\n "terms": "",\n "total": "",\n "total_tax": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/bills/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"balance": "",
"bill_date": "",
"bill_number": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"deposit": "",
"downstream_id": "",
"due_date": "",
"id": "",
"ledger_account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"line_items": [
[
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_percentage": "",
"id": "",
"item": [
"code": "",
"id": "",
"name": ""
],
"ledger_account": [],
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
]
],
"notes": "",
"paid_date": "",
"po_number": "",
"reference": "",
"row_version": "",
"status": "",
"sub_total": "",
"supplier": [
"address": [
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
],
"company_name": "",
"display_name": "",
"id": ""
],
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total": "",
"total_tax": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/bills/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "update",
"resource": "bills",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get company info
{{baseUrl}}/accounting/company-info
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/company-info");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/company-info" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/company-info"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/company-info"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/company-info");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/company-info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/company-info HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/company-info")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/company-info"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/company-info")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/company-info")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/company-info');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/company-info',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/company-info';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/company-info',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/company-info")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/company-info',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/company-info',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/company-info');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/company-info',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/company-info';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/company-info"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/company-info" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/company-info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/company-info', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/company-info');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/company-info');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/company-info' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/company-info' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/company-info", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/company-info"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/company-info"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/company-info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/company-info') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/company-info";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/company-info \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/company-info \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/company-info
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/company-info")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"company_name": "SpaceX",
"company_start_date": "2015-06-05",
"country": "US",
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"currency": "USD",
"fiscal_year_start_month": "January",
"id": "12345",
"language": "EN",
"legal_name": "SpaceX Inc.",
"row_version": "1-12345",
"sales_tax_number": "111.222.333",
"status": "active",
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "company-info",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
POST
Create Credit Note
{{baseUrl}}/accounting/credit-notes
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
BODY json
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/credit-notes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounting/credit-notes" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:account {:code ""
:id ""
:name ""
:nominal_code ""}
:allocations []
:balance ""
:created_at ""
:created_by ""
:currency ""
:currency_rate ""
:customer {:company_name ""
:display_id ""
:display_name ""
:id ""
:name ""}
:date_issued ""
:date_paid ""
:id ""
:line_items [{:code ""
:created_at ""
:created_by ""
:department_id ""
:description ""
:discount_amount ""
:discount_percentage ""
:id ""
:item {:code ""
:id ""
:name ""}
:ledger_account {}
:line_number 0
:location_id ""
:quantity ""
:row_id ""
:row_version ""
:tax_amount ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:total_amount ""
:type ""
:unit_of_measure ""
:unit_price ""
:updated_at ""
:updated_by ""}]
:note ""
:number ""
:reference ""
:remaining_credit ""
:row_version ""
:status ""
:sub_total ""
:tax_code ""
:tax_inclusive false
:terms ""
:total_amount ""
:total_tax ""
:type ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/credit-notes"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/accounting/credit-notes"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/credit-notes");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/credit-notes"
payload := strings.NewReader("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/accounting/credit-notes HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1398
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounting/credit-notes")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/credit-notes"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/credit-notes")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounting/credit-notes")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounting/credit-notes');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/credit-notes',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/credit-notes';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"allocations":[],"balance":"","created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"date_issued":"","date_paid":"","id":"","line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_amount":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"note":"","number":"","reference":"","remaining_credit":"","row_version":"","status":"","sub_total":"","tax_code":"","tax_inclusive":false,"terms":"","total_amount":"","total_tax":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/credit-notes',
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "allocations": [],\n "balance": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "date_issued": "",\n "date_paid": "",\n "id": "",\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_amount": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {},\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "note": "",\n "number": "",\n "reference": "",\n "remaining_credit": "",\n "row_version": "",\n "status": "",\n "sub_total": "",\n "tax_code": "",\n "tax_inclusive": false,\n "terms": "",\n "total_amount": "",\n "total_tax": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/credit-notes")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/credit-notes',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
account: {code: '', id: '', name: '', nominal_code: ''},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/credit-notes',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
account: {code: '', id: '', name: '', nominal_code: ''},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/accounting/credit-notes');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/credit-notes',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/credit-notes';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"allocations":[],"balance":"","created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"date_issued":"","date_paid":"","id":"","line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_amount":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"note":"","number":"","reference":"","remaining_credit":"","row_version":"","status":"","sub_total":"","tax_code":"","tax_inclusive":false,"terms":"","total_amount":"","total_tax":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"allocations": @[ ],
@"balance": @"",
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"currency_rate": @"",
@"customer": @{ @"company_name": @"", @"display_id": @"", @"display_name": @"", @"id": @"", @"name": @"" },
@"date_issued": @"",
@"date_paid": @"",
@"id": @"",
@"line_items": @[ @{ @"code": @"", @"created_at": @"", @"created_by": @"", @"department_id": @"", @"description": @"", @"discount_amount": @"", @"discount_percentage": @"", @"id": @"", @"item": @{ @"code": @"", @"id": @"", @"name": @"" }, @"ledger_account": @{ }, @"line_number": @0, @"location_id": @"", @"quantity": @"", @"row_id": @"", @"row_version": @"", @"tax_amount": @"", @"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" }, @"total_amount": @"", @"type": @"", @"unit_of_measure": @"", @"unit_price": @"", @"updated_at": @"", @"updated_by": @"" } ],
@"note": @"",
@"number": @"",
@"reference": @"",
@"remaining_credit": @"",
@"row_version": @"",
@"status": @"",
@"sub_total": @"",
@"tax_code": @"",
@"tax_inclusive": @NO,
@"terms": @"",
@"total_amount": @"",
@"total_tax": @"",
@"type": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/credit-notes"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/credit-notes" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/credit-notes",
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([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'allocations' => [
],
'balance' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'date_issued' => '',
'date_paid' => '',
'id' => '',
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'note' => '',
'number' => '',
'reference' => '',
'remaining_credit' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total_amount' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/accounting/credit-notes', [
'body' => '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/credit-notes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'allocations' => [
],
'balance' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'date_issued' => '',
'date_paid' => '',
'id' => '',
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'note' => '',
'number' => '',
'reference' => '',
'remaining_credit' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total_amount' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'allocations' => [
],
'balance' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'date_issued' => '',
'date_paid' => '',
'id' => '',
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'note' => '',
'number' => '',
'reference' => '',
'remaining_credit' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total_amount' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/credit-notes');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/credit-notes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/credit-notes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/accounting/credit-notes", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/credit-notes"
payload = {
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": False,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/credit-notes"
payload <- "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/credit-notes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/accounting/credit-notes') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/credit-notes";
let payload = json!({
"account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"allocations": (),
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": json!({
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
}),
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": (
json!({
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": json!({
"code": "",
"id": "",
"name": ""
}),
"ledger_account": json!({}),
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
})
),
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounting/credit-notes \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}' | \
http POST {{baseUrl}}/accounting/credit-notes \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method POST \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "allocations": [],\n "balance": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "date_issued": "",\n "date_paid": "",\n "id": "",\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_amount": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {},\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "note": "",\n "number": "",\n "reference": "",\n "remaining_credit": "",\n "row_version": "",\n "status": "",\n "sub_total": "",\n "tax_code": "",\n "tax_inclusive": false,\n "terms": "",\n "total_amount": "",\n "total_tax": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/credit-notes
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": [
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
],
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
[
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": [
"code": "",
"id": "",
"name": ""
],
"ledger_account": [],
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
]
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/credit-notes")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "add",
"resource": "credit-notes",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
DELETE
Delete Credit Note
{{baseUrl}}/accounting/credit-notes/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/credit-notes/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounting/credit-notes/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/credit-notes/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounting/credit-notes/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/credit-notes/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/credit-notes/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounting/credit-notes/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounting/credit-notes/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/credit-notes/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/credit-notes/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounting/credit-notes/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounting/credit-notes/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/credit-notes/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/credit-notes/:id',
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/credit-notes/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounting/credit-notes/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/credit-notes/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/credit-notes/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/credit-notes/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/credit-notes/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounting/credit-notes/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/credit-notes/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/credit-notes/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/credit-notes/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/credit-notes/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/accounting/credit-notes/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/credit-notes/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/credit-notes/:id"
response <- VERB("DELETE", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/credit-notes/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounting/credit-notes/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/credit-notes/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounting/credit-notes/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http DELETE {{baseUrl}}/accounting/credit-notes/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method DELETE \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/credit-notes/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/credit-notes/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "delete",
"resource": "credit-notes",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get Credit Note
{{baseUrl}}/accounting/credit-notes/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/credit-notes/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/credit-notes/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/credit-notes/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/credit-notes/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/credit-notes/:id");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/credit-notes/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/credit-notes/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/credit-notes/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/credit-notes/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/credit-notes/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/credit-notes/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/credit-notes/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/credit-notes/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/credit-notes/:id',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/credit-notes/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/credit-notes/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/credit-notes/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/credit-notes/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/credit-notes/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/credit-notes/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/credit-notes/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/credit-notes/:id');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/credit-notes/:id');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/credit-notes/:id' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/credit-notes/:id' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/credit-notes/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/credit-notes/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/credit-notes/:id"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/credit-notes/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/credit-notes/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/credit-notes/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/credit-notes/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/credit-notes/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/credit-notes/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/credit-notes/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"balance": 27500,
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"currency": "USD",
"currency_rate": 0.69,
"date_issued": "2021-05-01T12:00:00.000Z",
"date_paid": "2021-05-01T12:00:00.000Z",
"id": "123456",
"note": "Some notes about this credit note",
"number": "OIT00546",
"reference": "123456",
"remaining_credit": 27500,
"row_version": "1-12345",
"status": "authorised",
"sub_total": 27500,
"tax_code": "1234",
"tax_inclusive": true,
"terms": "Some terms about this credit note",
"total_amount": 49.99,
"total_tax": 2500,
"type": "accounts_receivable_credit",
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "credit-notes",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
List Credit Notes
{{baseUrl}}/accounting/credit-notes
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/credit-notes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/credit-notes" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/credit-notes"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/credit-notes"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/credit-notes");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/credit-notes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/credit-notes HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/credit-notes")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/credit-notes"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/credit-notes")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/credit-notes")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/credit-notes');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/credit-notes',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/credit-notes';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/credit-notes',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/credit-notes")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/credit-notes',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/credit-notes',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/credit-notes');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/credit-notes',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/credit-notes';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/credit-notes"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/credit-notes" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/credit-notes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/credit-notes', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/credit-notes');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/credit-notes');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/credit-notes' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/credit-notes' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/credit-notes", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/credit-notes"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/credit-notes"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/credit-notes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/credit-notes') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/credit-notes";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/credit-notes \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/credit-notes \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/credit-notes
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/credit-notes")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"links": {
"current": "https://unify.apideck.com/crm/companies",
"next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
},
"meta": {
"items_on_page": 50
},
"operation": "all",
"resource": "credit-notes",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
PATCH
Update Credit Note
{{baseUrl}}/accounting/credit-notes/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
BODY json
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/credit-notes/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounting/credit-notes/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:account {:code ""
:id ""
:name ""
:nominal_code ""}
:allocations []
:balance ""
:created_at ""
:created_by ""
:currency ""
:currency_rate ""
:customer {:company_name ""
:display_id ""
:display_name ""
:id ""
:name ""}
:date_issued ""
:date_paid ""
:id ""
:line_items [{:code ""
:created_at ""
:created_by ""
:department_id ""
:description ""
:discount_amount ""
:discount_percentage ""
:id ""
:item {:code ""
:id ""
:name ""}
:ledger_account {}
:line_number 0
:location_id ""
:quantity ""
:row_id ""
:row_version ""
:tax_amount ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:total_amount ""
:type ""
:unit_of_measure ""
:unit_price ""
:updated_at ""
:updated_by ""}]
:note ""
:number ""
:reference ""
:remaining_credit ""
:row_version ""
:status ""
:sub_total ""
:tax_code ""
:tax_inclusive false
:terms ""
:total_amount ""
:total_tax ""
:type ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/credit-notes/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounting/credit-notes/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/credit-notes/:id");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/credit-notes/:id"
payload := strings.NewReader("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounting/credit-notes/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1398
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounting/credit-notes/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/credit-notes/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/credit-notes/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounting/credit-notes/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounting/credit-notes/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/credit-notes/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"allocations":[],"balance":"","created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"date_issued":"","date_paid":"","id":"","line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_amount":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"note":"","number":"","reference":"","remaining_credit":"","row_version":"","status":"","sub_total":"","tax_code":"","tax_inclusive":false,"terms":"","total_amount":"","total_tax":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/credit-notes/:id',
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "allocations": [],\n "balance": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "date_issued": "",\n "date_paid": "",\n "id": "",\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_amount": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {},\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "note": "",\n "number": "",\n "reference": "",\n "remaining_credit": "",\n "row_version": "",\n "status": "",\n "sub_total": "",\n "tax_code": "",\n "tax_inclusive": false,\n "terms": "",\n "total_amount": "",\n "total_tax": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/credit-notes/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
account: {code: '', id: '', name: '', nominal_code: ''},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
account: {code: '', id: '', name: '', nominal_code: ''},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/accounting/credit-notes/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/credit-notes/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
allocations: [],
balance: '',
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
date_issued: '',
date_paid: '',
id: '',
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
note: '',
number: '',
reference: '',
remaining_credit: '',
row_version: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
terms: '',
total_amount: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/credit-notes/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"allocations":[],"balance":"","created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"date_issued":"","date_paid":"","id":"","line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_amount":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"note":"","number":"","reference":"","remaining_credit":"","row_version":"","status":"","sub_total":"","tax_code":"","tax_inclusive":false,"terms":"","total_amount":"","total_tax":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"allocations": @[ ],
@"balance": @"",
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"currency_rate": @"",
@"customer": @{ @"company_name": @"", @"display_id": @"", @"display_name": @"", @"id": @"", @"name": @"" },
@"date_issued": @"",
@"date_paid": @"",
@"id": @"",
@"line_items": @[ @{ @"code": @"", @"created_at": @"", @"created_by": @"", @"department_id": @"", @"description": @"", @"discount_amount": @"", @"discount_percentage": @"", @"id": @"", @"item": @{ @"code": @"", @"id": @"", @"name": @"" }, @"ledger_account": @{ }, @"line_number": @0, @"location_id": @"", @"quantity": @"", @"row_id": @"", @"row_version": @"", @"tax_amount": @"", @"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" }, @"total_amount": @"", @"type": @"", @"unit_of_measure": @"", @"unit_price": @"", @"updated_at": @"", @"updated_by": @"" } ],
@"note": @"",
@"number": @"",
@"reference": @"",
@"remaining_credit": @"",
@"row_version": @"",
@"status": @"",
@"sub_total": @"",
@"tax_code": @"",
@"tax_inclusive": @NO,
@"terms": @"",
@"total_amount": @"",
@"total_tax": @"",
@"type": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/credit-notes/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/credit-notes/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/credit-notes/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'allocations' => [
],
'balance' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'date_issued' => '',
'date_paid' => '',
'id' => '',
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'note' => '',
'number' => '',
'reference' => '',
'remaining_credit' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total_amount' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/accounting/credit-notes/:id', [
'body' => '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/credit-notes/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'allocations' => [
],
'balance' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'date_issued' => '',
'date_paid' => '',
'id' => '',
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'note' => '',
'number' => '',
'reference' => '',
'remaining_credit' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total_amount' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'allocations' => [
],
'balance' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'date_issued' => '',
'date_paid' => '',
'id' => '',
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'note' => '',
'number' => '',
'reference' => '',
'remaining_credit' => '',
'row_version' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'terms' => '',
'total_amount' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/credit-notes/:id');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/credit-notes/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/credit-notes/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/accounting/credit-notes/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/credit-notes/:id"
payload = {
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": False,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/credit-notes/:id"
payload <- "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/credit-notes/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/accounting/credit-notes/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"allocations\": [],\n \"balance\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"date_issued\": \"\",\n \"date_paid\": \"\",\n \"id\": \"\",\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {},\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"note\": \"\",\n \"number\": \"\",\n \"reference\": \"\",\n \"remaining_credit\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"terms\": \"\",\n \"total_amount\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/credit-notes/:id";
let payload = json!({
"account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"allocations": (),
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": json!({
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
}),
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": (
json!({
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": json!({
"code": "",
"id": "",
"name": ""
}),
"ledger_account": json!({}),
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
})
),
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounting/credit-notes/:id \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}' | \
http PATCH {{baseUrl}}/accounting/credit-notes/:id \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method PATCH \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "allocations": [],\n "balance": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "date_issued": "",\n "date_paid": "",\n "id": "",\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_amount": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {},\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "note": "",\n "number": "",\n "reference": "",\n "remaining_credit": "",\n "row_version": "",\n "status": "",\n "sub_total": "",\n "tax_code": "",\n "tax_inclusive": false,\n "terms": "",\n "total_amount": "",\n "total_tax": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/credit-notes/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"allocations": [],
"balance": "",
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": [
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
],
"date_issued": "",
"date_paid": "",
"id": "",
"line_items": [
[
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": [
"code": "",
"id": "",
"name": ""
],
"ledger_account": [],
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
]
],
"note": "",
"number": "",
"reference": "",
"remaining_credit": "",
"row_version": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"terms": "",
"total_amount": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/credit-notes/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "update",
"resource": "credit-notes",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
POST
Create Customer
{{baseUrl}}/accounting/customers
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
BODY json
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/customers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounting/customers" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:account {:code ""
:id ""
:name ""
:nominal_code ""}
:addresses [{:city ""
:contact_name ""
:country ""
:county ""
:email ""
:fax ""
:id ""
:latitude ""
:line1 ""
:line2 ""
:line3 ""
:line4 ""
:longitude ""
:name ""
:phone_number ""
:postal_code ""
:row_version ""
:salutation ""
:state ""
:street_number ""
:string ""
:type ""
:website ""}]
:bank_accounts [{:account_name ""
:account_number ""
:account_type ""
:bank_code ""
:bic ""
:branch_identifier ""
:bsb_number ""
:currency ""
:iban ""}]
:company_name ""
:created_at ""
:created_by ""
:currency ""
:display_id ""
:display_name ""
:downstream_id ""
:emails [{:email ""
:id ""
:type ""}]
:first_name ""
:id ""
:individual false
:last_name ""
:middle_name ""
:notes ""
:parent {:id ""
:name ""}
:phone_numbers [{:area_code ""
:country_code ""
:extension ""
:id ""
:number ""
:type ""}]
:project false
:row_version ""
:status ""
:suffix ""
:tax_number ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:title ""
:updated_at ""
:updated_by ""
:websites [{:id ""
:type ""
:url ""}]}})
require "http/client"
url = "{{baseUrl}}/accounting/customers"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/accounting/customers"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/customers");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/customers"
payload := strings.NewReader("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/accounting/customers HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1719
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounting/customers")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/customers"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/customers")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounting/customers")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [
{
email: '',
id: '',
type: ''
}
],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {
id: '',
name: ''
},
phone_numbers: [
{
area_code: '',
country_code: '',
extension: '',
id: '',
number: '',
type: ''
}
],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
title: '',
updated_at: '',
updated_by: '',
websites: [
{
id: '',
type: '',
url: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounting/customers');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/customers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {id: '', name: ''},
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/customers';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"addresses":[{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""}],"bank_accounts":[{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""}],"company_name":"","created_at":"","created_by":"","currency":"","display_id":"","display_name":"","downstream_id":"","emails":[{"email":"","id":"","type":""}],"first_name":"","id":"","individual":false,"last_name":"","middle_name":"","notes":"","parent":{"id":"","name":""},"phone_numbers":[{"area_code":"","country_code":"","extension":"","id":"","number":"","type":""}],"project":false,"row_version":"","status":"","suffix":"","tax_number":"","tax_rate":{"code":"","id":"","name":"","rate":""},"title":"","updated_at":"","updated_by":"","websites":[{"id":"","type":"","url":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/customers',
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "addresses": [\n {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n }\n ],\n "bank_accounts": [\n {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n }\n ],\n "company_name": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "display_id": "",\n "display_name": "",\n "downstream_id": "",\n "emails": [\n {\n "email": "",\n "id": "",\n "type": ""\n }\n ],\n "first_name": "",\n "id": "",\n "individual": false,\n "last_name": "",\n "middle_name": "",\n "notes": "",\n "parent": {\n "id": "",\n "name": ""\n },\n "phone_numbers": [\n {\n "area_code": "",\n "country_code": "",\n "extension": "",\n "id": "",\n "number": "",\n "type": ""\n }\n ],\n "project": false,\n "row_version": "",\n "status": "",\n "suffix": "",\n "tax_number": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "title": "",\n "updated_at": "",\n "updated_by": "",\n "websites": [\n {\n "id": "",\n "type": "",\n "url": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/customers")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/customers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {id: '', name: ''},
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/customers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {id: '', name: ''},
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/accounting/customers');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [
{
email: '',
id: '',
type: ''
}
],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {
id: '',
name: ''
},
phone_numbers: [
{
area_code: '',
country_code: '',
extension: '',
id: '',
number: '',
type: ''
}
],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
title: '',
updated_at: '',
updated_by: '',
websites: [
{
id: '',
type: '',
url: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/customers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {id: '', name: ''},
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/customers';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"addresses":[{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""}],"bank_accounts":[{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""}],"company_name":"","created_at":"","created_by":"","currency":"","display_id":"","display_name":"","downstream_id":"","emails":[{"email":"","id":"","type":""}],"first_name":"","id":"","individual":false,"last_name":"","middle_name":"","notes":"","parent":{"id":"","name":""},"phone_numbers":[{"area_code":"","country_code":"","extension":"","id":"","number":"","type":""}],"project":false,"row_version":"","status":"","suffix":"","tax_number":"","tax_rate":{"code":"","id":"","name":"","rate":""},"title":"","updated_at":"","updated_by":"","websites":[{"id":"","type":"","url":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"addresses": @[ @{ @"city": @"", @"contact_name": @"", @"country": @"", @"county": @"", @"email": @"", @"fax": @"", @"id": @"", @"latitude": @"", @"line1": @"", @"line2": @"", @"line3": @"", @"line4": @"", @"longitude": @"", @"name": @"", @"phone_number": @"", @"postal_code": @"", @"row_version": @"", @"salutation": @"", @"state": @"", @"street_number": @"", @"string": @"", @"type": @"", @"website": @"" } ],
@"bank_accounts": @[ @{ @"account_name": @"", @"account_number": @"", @"account_type": @"", @"bank_code": @"", @"bic": @"", @"branch_identifier": @"", @"bsb_number": @"", @"currency": @"", @"iban": @"" } ],
@"company_name": @"",
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"display_id": @"",
@"display_name": @"",
@"downstream_id": @"",
@"emails": @[ @{ @"email": @"", @"id": @"", @"type": @"" } ],
@"first_name": @"",
@"id": @"",
@"individual": @NO,
@"last_name": @"",
@"middle_name": @"",
@"notes": @"",
@"parent": @{ @"id": @"", @"name": @"" },
@"phone_numbers": @[ @{ @"area_code": @"", @"country_code": @"", @"extension": @"", @"id": @"", @"number": @"", @"type": @"" } ],
@"project": @NO,
@"row_version": @"",
@"status": @"",
@"suffix": @"",
@"tax_number": @"",
@"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" },
@"title": @"",
@"updated_at": @"",
@"updated_by": @"",
@"websites": @[ @{ @"id": @"", @"type": @"", @"url": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/customers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/customers" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/customers",
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([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'parent' => [
'id' => '',
'name' => ''
],
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'project' => null,
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/accounting/customers', [
'body' => '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/customers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'parent' => [
'id' => '',
'name' => ''
],
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'project' => null,
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'parent' => [
'id' => '',
'name' => ''
],
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'project' => null,
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/accounting/customers');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/customers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/customers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/accounting/customers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/customers"
payload = {
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": False,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": False,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/customers"
payload <- "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/accounting/customers') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/customers";
let payload = json!({
"account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"addresses": (
json!({
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
})
),
"bank_accounts": (
json!({
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
})
),
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": (
json!({
"email": "",
"id": "",
"type": ""
})
),
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": json!({
"id": "",
"name": ""
}),
"phone_numbers": (
json!({
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
})
),
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"title": "",
"updated_at": "",
"updated_by": "",
"websites": (
json!({
"id": "",
"type": "",
"url": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounting/customers \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
echo '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}' | \
http POST {{baseUrl}}/accounting/customers \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method POST \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "addresses": [\n {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n }\n ],\n "bank_accounts": [\n {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n }\n ],\n "company_name": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "display_id": "",\n "display_name": "",\n "downstream_id": "",\n "emails": [\n {\n "email": "",\n "id": "",\n "type": ""\n }\n ],\n "first_name": "",\n "id": "",\n "individual": false,\n "last_name": "",\n "middle_name": "",\n "notes": "",\n "parent": {\n "id": "",\n "name": ""\n },\n "phone_numbers": [\n {\n "area_code": "",\n "country_code": "",\n "extension": "",\n "id": "",\n "number": "",\n "type": ""\n }\n ],\n "project": false,\n "row_version": "",\n "status": "",\n "suffix": "",\n "tax_number": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "title": "",\n "updated_at": "",\n "updated_by": "",\n "websites": [\n {\n "id": "",\n "type": "",\n "url": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/accounting/customers
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"addresses": [
[
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
]
],
"bank_accounts": [
[
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
]
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
[
"email": "",
"id": "",
"type": ""
]
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": [
"id": "",
"name": ""
],
"phone_numbers": [
[
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
]
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
[
"id": "",
"type": "",
"url": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/customers")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "add",
"resource": "customers",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
DELETE
Delete Customer
{{baseUrl}}/accounting/customers/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/customers/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounting/customers/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/customers/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounting/customers/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/customers/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/customers/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounting/customers/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounting/customers/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/customers/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/customers/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounting/customers/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounting/customers/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/customers/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/customers/:id',
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/customers/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounting/customers/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/customers/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/customers/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/customers/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/customers/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounting/customers/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/customers/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/customers/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/customers/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/customers/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/accounting/customers/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/customers/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/customers/:id"
response <- VERB("DELETE", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/customers/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounting/customers/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/customers/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounting/customers/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http DELETE {{baseUrl}}/accounting/customers/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method DELETE \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/customers/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/customers/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "delete",
"resource": "customers",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get Customer
{{baseUrl}}/accounting/customers/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/customers/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/customers/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/customers/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/customers/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/customers/:id");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/customers/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/customers/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/customers/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/customers/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/customers/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/customers/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/customers/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/customers/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/customers/:id',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/customers/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/customers/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/customers/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/customers/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/customers/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/customers/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/customers/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/customers/:id');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/customers/:id');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/customers/:id' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/customers/:id' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/customers/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/customers/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/customers/:id"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/customers/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/customers/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/customers/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/customers/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/customers/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/customers/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/customers/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"company_name": "SpaceX",
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"currency": "USD",
"display_id": "EMP00101",
"display_name": "Windsurf Shop",
"downstream_id": "12345",
"first_name": "Elon",
"id": "12345",
"individual": true,
"last_name": "Musk",
"middle_name": "D.",
"notes": "Some notes about this customer",
"project": false,
"row_version": "1-12345",
"status": "active",
"suffix": "Jr.",
"tax_number": "US123945459",
"title": "CEO",
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "customers",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
List Customers
{{baseUrl}}/accounting/customers
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/customers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/customers" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/customers"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/customers"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/customers");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/customers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/customers HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/customers")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/customers"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/customers")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/customers")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/customers');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/customers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/customers';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/customers',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/customers")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/customers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/customers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/customers');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/customers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/customers';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/customers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/customers" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/customers', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/customers');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/customers');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/customers' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/customers' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/customers", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/customers"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/customers"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/customers') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/customers";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/customers \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/customers \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/customers
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/customers")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"links": {
"current": "https://unify.apideck.com/crm/companies",
"next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
},
"meta": {
"items_on_page": 50
},
"operation": "all",
"resource": "customers",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
PATCH
Update Customer
{{baseUrl}}/accounting/customers/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
BODY json
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/customers/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounting/customers/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:account {:code ""
:id ""
:name ""
:nominal_code ""}
:addresses [{:city ""
:contact_name ""
:country ""
:county ""
:email ""
:fax ""
:id ""
:latitude ""
:line1 ""
:line2 ""
:line3 ""
:line4 ""
:longitude ""
:name ""
:phone_number ""
:postal_code ""
:row_version ""
:salutation ""
:state ""
:street_number ""
:string ""
:type ""
:website ""}]
:bank_accounts [{:account_name ""
:account_number ""
:account_type ""
:bank_code ""
:bic ""
:branch_identifier ""
:bsb_number ""
:currency ""
:iban ""}]
:company_name ""
:created_at ""
:created_by ""
:currency ""
:display_id ""
:display_name ""
:downstream_id ""
:emails [{:email ""
:id ""
:type ""}]
:first_name ""
:id ""
:individual false
:last_name ""
:middle_name ""
:notes ""
:parent {:id ""
:name ""}
:phone_numbers [{:area_code ""
:country_code ""
:extension ""
:id ""
:number ""
:type ""}]
:project false
:row_version ""
:status ""
:suffix ""
:tax_number ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:title ""
:updated_at ""
:updated_by ""
:websites [{:id ""
:type ""
:url ""}]}})
require "http/client"
url = "{{baseUrl}}/accounting/customers/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounting/customers/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/customers/:id");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/customers/:id"
payload := strings.NewReader("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounting/customers/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1719
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounting/customers/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/customers/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/customers/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounting/customers/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [
{
email: '',
id: '',
type: ''
}
],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {
id: '',
name: ''
},
phone_numbers: [
{
area_code: '',
country_code: '',
extension: '',
id: '',
number: '',
type: ''
}
],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
title: '',
updated_at: '',
updated_by: '',
websites: [
{
id: '',
type: '',
url: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounting/customers/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {id: '', name: ''},
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/customers/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"addresses":[{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""}],"bank_accounts":[{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""}],"company_name":"","created_at":"","created_by":"","currency":"","display_id":"","display_name":"","downstream_id":"","emails":[{"email":"","id":"","type":""}],"first_name":"","id":"","individual":false,"last_name":"","middle_name":"","notes":"","parent":{"id":"","name":""},"phone_numbers":[{"area_code":"","country_code":"","extension":"","id":"","number":"","type":""}],"project":false,"row_version":"","status":"","suffix":"","tax_number":"","tax_rate":{"code":"","id":"","name":"","rate":""},"title":"","updated_at":"","updated_by":"","websites":[{"id":"","type":"","url":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/customers/:id',
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "addresses": [\n {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n }\n ],\n "bank_accounts": [\n {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n }\n ],\n "company_name": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "display_id": "",\n "display_name": "",\n "downstream_id": "",\n "emails": [\n {\n "email": "",\n "id": "",\n "type": ""\n }\n ],\n "first_name": "",\n "id": "",\n "individual": false,\n "last_name": "",\n "middle_name": "",\n "notes": "",\n "parent": {\n "id": "",\n "name": ""\n },\n "phone_numbers": [\n {\n "area_code": "",\n "country_code": "",\n "extension": "",\n "id": "",\n "number": "",\n "type": ""\n }\n ],\n "project": false,\n "row_version": "",\n "status": "",\n "suffix": "",\n "tax_number": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "title": "",\n "updated_at": "",\n "updated_by": "",\n "websites": [\n {\n "id": "",\n "type": "",\n "url": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/customers/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {id: '', name: ''},
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {id: '', name: ''},
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/accounting/customers/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [
{
email: '',
id: '',
type: ''
}
],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {
id: '',
name: ''
},
phone_numbers: [
{
area_code: '',
country_code: '',
extension: '',
id: '',
number: '',
type: ''
}
],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
title: '',
updated_at: '',
updated_by: '',
websites: [
{
id: '',
type: '',
url: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/customers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
parent: {id: '', name: ''},
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
project: false,
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/customers/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"addresses":[{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""}],"bank_accounts":[{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""}],"company_name":"","created_at":"","created_by":"","currency":"","display_id":"","display_name":"","downstream_id":"","emails":[{"email":"","id":"","type":""}],"first_name":"","id":"","individual":false,"last_name":"","middle_name":"","notes":"","parent":{"id":"","name":""},"phone_numbers":[{"area_code":"","country_code":"","extension":"","id":"","number":"","type":""}],"project":false,"row_version":"","status":"","suffix":"","tax_number":"","tax_rate":{"code":"","id":"","name":"","rate":""},"title":"","updated_at":"","updated_by":"","websites":[{"id":"","type":"","url":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"addresses": @[ @{ @"city": @"", @"contact_name": @"", @"country": @"", @"county": @"", @"email": @"", @"fax": @"", @"id": @"", @"latitude": @"", @"line1": @"", @"line2": @"", @"line3": @"", @"line4": @"", @"longitude": @"", @"name": @"", @"phone_number": @"", @"postal_code": @"", @"row_version": @"", @"salutation": @"", @"state": @"", @"street_number": @"", @"string": @"", @"type": @"", @"website": @"" } ],
@"bank_accounts": @[ @{ @"account_name": @"", @"account_number": @"", @"account_type": @"", @"bank_code": @"", @"bic": @"", @"branch_identifier": @"", @"bsb_number": @"", @"currency": @"", @"iban": @"" } ],
@"company_name": @"",
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"display_id": @"",
@"display_name": @"",
@"downstream_id": @"",
@"emails": @[ @{ @"email": @"", @"id": @"", @"type": @"" } ],
@"first_name": @"",
@"id": @"",
@"individual": @NO,
@"last_name": @"",
@"middle_name": @"",
@"notes": @"",
@"parent": @{ @"id": @"", @"name": @"" },
@"phone_numbers": @[ @{ @"area_code": @"", @"country_code": @"", @"extension": @"", @"id": @"", @"number": @"", @"type": @"" } ],
@"project": @NO,
@"row_version": @"",
@"status": @"",
@"suffix": @"",
@"tax_number": @"",
@"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" },
@"title": @"",
@"updated_at": @"",
@"updated_by": @"",
@"websites": @[ @{ @"id": @"", @"type": @"", @"url": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/customers/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/customers/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/customers/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'parent' => [
'id' => '',
'name' => ''
],
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'project' => null,
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/accounting/customers/:id', [
'body' => '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/customers/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'parent' => [
'id' => '',
'name' => ''
],
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'project' => null,
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'parent' => [
'id' => '',
'name' => ''
],
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'project' => null,
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/accounting/customers/:id');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/customers/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/customers/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/accounting/customers/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/customers/:id"
payload = {
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": False,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": False,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/customers/:id"
payload <- "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/customers/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/accounting/customers/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"parent\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"project\": false,\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/customers/:id";
let payload = json!({
"account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"addresses": (
json!({
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
})
),
"bank_accounts": (
json!({
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
})
),
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": (
json!({
"email": "",
"id": "",
"type": ""
})
),
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": json!({
"id": "",
"name": ""
}),
"phone_numbers": (
json!({
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
})
),
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"title": "",
"updated_at": "",
"updated_by": "",
"websites": (
json!({
"id": "",
"type": "",
"url": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounting/customers/:id \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
echo '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": {
"id": "",
"name": ""
},
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}' | \
http PATCH {{baseUrl}}/accounting/customers/:id \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method PATCH \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "addresses": [\n {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n }\n ],\n "bank_accounts": [\n {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n }\n ],\n "company_name": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "display_id": "",\n "display_name": "",\n "downstream_id": "",\n "emails": [\n {\n "email": "",\n "id": "",\n "type": ""\n }\n ],\n "first_name": "",\n "id": "",\n "individual": false,\n "last_name": "",\n "middle_name": "",\n "notes": "",\n "parent": {\n "id": "",\n "name": ""\n },\n "phone_numbers": [\n {\n "area_code": "",\n "country_code": "",\n "extension": "",\n "id": "",\n "number": "",\n "type": ""\n }\n ],\n "project": false,\n "row_version": "",\n "status": "",\n "suffix": "",\n "tax_number": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "title": "",\n "updated_at": "",\n "updated_by": "",\n "websites": [\n {\n "id": "",\n "type": "",\n "url": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/accounting/customers/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"addresses": [
[
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
]
],
"bank_accounts": [
[
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
]
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
[
"email": "",
"id": "",
"type": ""
]
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"parent": [
"id": "",
"name": ""
],
"phone_numbers": [
[
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
]
],
"project": false,
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
[
"id": "",
"type": "",
"url": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/customers/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "update",
"resource": "customers",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
POST
Create Invoice Item
{{baseUrl}}/accounting/invoice-items
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
BODY json
{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/invoice-items");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounting/invoice-items" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:active false
:asset_account {:code ""
:id ""
:name ""
:nominal_code ""}
:code ""
:created_at ""
:created_by ""
:description ""
:expense_account {}
:id ""
:income_account {}
:inventory_date ""
:name ""
:purchase_details {:tax_inclusive false
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:unit_of_measure ""
:unit_price ""}
:purchased false
:quantity ""
:row_version ""
:sales_details {:tax_inclusive false
:tax_rate {}
:unit_of_measure ""
:unit_price ""}
:sold false
:taxable false
:tracked false
:type ""
:unit_price ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/invoice-items"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/accounting/invoice-items"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/invoice-items");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/invoice-items"
payload := strings.NewReader("{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/accounting/invoice-items HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 803
{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounting/invoice-items")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/invoice-items"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/invoice-items")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounting/invoice-items")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
active: false,
asset_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {
tax_inclusive: false,
tax_rate: {},
unit_of_measure: '',
unit_price: ''
},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounting/invoice-items');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/invoice-items',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
active: false,
asset_account: {code: '', id: '', name: '', nominal_code: ''},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {code: '', id: '', name: '', rate: ''},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {tax_inclusive: false, tax_rate: {}, unit_of_measure: '', unit_price: ''},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/invoice-items';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"active":false,"asset_account":{"code":"","id":"","name":"","nominal_code":""},"code":"","created_at":"","created_by":"","description":"","expense_account":{},"id":"","income_account":{},"inventory_date":"","name":"","purchase_details":{"tax_inclusive":false,"tax_rate":{"code":"","id":"","name":"","rate":""},"unit_of_measure":"","unit_price":""},"purchased":false,"quantity":"","row_version":"","sales_details":{"tax_inclusive":false,"tax_rate":{},"unit_of_measure":"","unit_price":""},"sold":false,"taxable":false,"tracked":false,"type":"","unit_price":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/invoice-items',
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "active": false,\n "asset_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "code": "",\n "created_at": "",\n "created_by": "",\n "description": "",\n "expense_account": {},\n "id": "",\n "income_account": {},\n "inventory_date": "",\n "name": "",\n "purchase_details": {\n "tax_inclusive": false,\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "unit_of_measure": "",\n "unit_price": ""\n },\n "purchased": false,\n "quantity": "",\n "row_version": "",\n "sales_details": {\n "tax_inclusive": false,\n "tax_rate": {},\n "unit_of_measure": "",\n "unit_price": ""\n },\n "sold": false,\n "taxable": false,\n "tracked": false,\n "type": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/invoice-items")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/invoice-items',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
active: false,
asset_account: {code: '', id: '', name: '', nominal_code: ''},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {code: '', id: '', name: '', rate: ''},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {tax_inclusive: false, tax_rate: {}, unit_of_measure: '', unit_price: ''},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/invoice-items',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
active: false,
asset_account: {code: '', id: '', name: '', nominal_code: ''},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {code: '', id: '', name: '', rate: ''},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {tax_inclusive: false, tax_rate: {}, unit_of_measure: '', unit_price: ''},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/accounting/invoice-items');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
active: false,
asset_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {
tax_inclusive: false,
tax_rate: {},
unit_of_measure: '',
unit_price: ''
},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/invoice-items',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
active: false,
asset_account: {code: '', id: '', name: '', nominal_code: ''},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {code: '', id: '', name: '', rate: ''},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {tax_inclusive: false, tax_rate: {}, unit_of_measure: '', unit_price: ''},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/invoice-items';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"active":false,"asset_account":{"code":"","id":"","name":"","nominal_code":""},"code":"","created_at":"","created_by":"","description":"","expense_account":{},"id":"","income_account":{},"inventory_date":"","name":"","purchase_details":{"tax_inclusive":false,"tax_rate":{"code":"","id":"","name":"","rate":""},"unit_of_measure":"","unit_price":""},"purchased":false,"quantity":"","row_version":"","sales_details":{"tax_inclusive":false,"tax_rate":{},"unit_of_measure":"","unit_price":""},"sold":false,"taxable":false,"tracked":false,"type":"","unit_price":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"active": @NO,
@"asset_account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"code": @"",
@"created_at": @"",
@"created_by": @"",
@"description": @"",
@"expense_account": @{ },
@"id": @"",
@"income_account": @{ },
@"inventory_date": @"",
@"name": @"",
@"purchase_details": @{ @"tax_inclusive": @NO, @"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" }, @"unit_of_measure": @"", @"unit_price": @"" },
@"purchased": @NO,
@"quantity": @"",
@"row_version": @"",
@"sales_details": @{ @"tax_inclusive": @NO, @"tax_rate": @{ }, @"unit_of_measure": @"", @"unit_price": @"" },
@"sold": @NO,
@"taxable": @NO,
@"tracked": @NO,
@"type": @"",
@"unit_price": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/invoice-items"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/invoice-items" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/invoice-items",
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([
'active' => null,
'asset_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'code' => '',
'created_at' => '',
'created_by' => '',
'description' => '',
'expense_account' => [
],
'id' => '',
'income_account' => [
],
'inventory_date' => '',
'name' => '',
'purchase_details' => [
'tax_inclusive' => null,
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'unit_of_measure' => '',
'unit_price' => ''
],
'purchased' => null,
'quantity' => '',
'row_version' => '',
'sales_details' => [
'tax_inclusive' => null,
'tax_rate' => [
],
'unit_of_measure' => '',
'unit_price' => ''
],
'sold' => null,
'taxable' => null,
'tracked' => null,
'type' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/accounting/invoice-items', [
'body' => '{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/invoice-items');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'active' => null,
'asset_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'code' => '',
'created_at' => '',
'created_by' => '',
'description' => '',
'expense_account' => [
],
'id' => '',
'income_account' => [
],
'inventory_date' => '',
'name' => '',
'purchase_details' => [
'tax_inclusive' => null,
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'unit_of_measure' => '',
'unit_price' => ''
],
'purchased' => null,
'quantity' => '',
'row_version' => '',
'sales_details' => [
'tax_inclusive' => null,
'tax_rate' => [
],
'unit_of_measure' => '',
'unit_price' => ''
],
'sold' => null,
'taxable' => null,
'tracked' => null,
'type' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'active' => null,
'asset_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'code' => '',
'created_at' => '',
'created_by' => '',
'description' => '',
'expense_account' => [
],
'id' => '',
'income_account' => [
],
'inventory_date' => '',
'name' => '',
'purchase_details' => [
'tax_inclusive' => null,
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'unit_of_measure' => '',
'unit_price' => ''
],
'purchased' => null,
'quantity' => '',
'row_version' => '',
'sales_details' => [
'tax_inclusive' => null,
'tax_rate' => [
],
'unit_of_measure' => '',
'unit_price' => ''
],
'sold' => null,
'taxable' => null,
'tracked' => null,
'type' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/invoice-items');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/invoice-items' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/invoice-items' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/accounting/invoice-items", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/invoice-items"
payload = {
"active": False,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": False,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": False,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": False,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": False,
"taxable": False,
"tracked": False,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/invoice-items"
payload <- "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/invoice-items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/accounting/invoice-items') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/invoice-items";
let payload = json!({
"active": false,
"asset_account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": json!({}),
"id": "",
"income_account": json!({}),
"inventory_date": "",
"name": "",
"purchase_details": json!({
"tax_inclusive": false,
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"unit_of_measure": "",
"unit_price": ""
}),
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": json!({
"tax_inclusive": false,
"tax_rate": json!({}),
"unit_of_measure": "",
"unit_price": ""
}),
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounting/invoice-items \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}' | \
http POST {{baseUrl}}/accounting/invoice-items \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method POST \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "active": false,\n "asset_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "code": "",\n "created_at": "",\n "created_by": "",\n "description": "",\n "expense_account": {},\n "id": "",\n "income_account": {},\n "inventory_date": "",\n "name": "",\n "purchase_details": {\n "tax_inclusive": false,\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "unit_of_measure": "",\n "unit_price": ""\n },\n "purchased": false,\n "quantity": "",\n "row_version": "",\n "sales_details": {\n "tax_inclusive": false,\n "tax_rate": {},\n "unit_of_measure": "",\n "unit_price": ""\n },\n "sold": false,\n "taxable": false,\n "tracked": false,\n "type": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/invoice-items
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"active": false,
"asset_account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": [],
"id": "",
"income_account": [],
"inventory_date": "",
"name": "",
"purchase_details": [
"tax_inclusive": false,
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"unit_of_measure": "",
"unit_price": ""
],
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": [
"tax_inclusive": false,
"tax_rate": [],
"unit_of_measure": "",
"unit_price": ""
],
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/invoice-items")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "add",
"resource": "invoice-items",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
DELETE
Delete Invoice Item
{{baseUrl}}/accounting/invoice-items/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/invoice-items/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounting/invoice-items/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/invoice-items/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounting/invoice-items/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/invoice-items/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/invoice-items/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounting/invoice-items/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounting/invoice-items/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/invoice-items/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/invoice-items/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounting/invoice-items/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounting/invoice-items/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/invoice-items/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/invoice-items/:id',
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/invoice-items/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounting/invoice-items/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/invoice-items/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/invoice-items/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/invoice-items/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/invoice-items/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounting/invoice-items/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/invoice-items/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/invoice-items/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/invoice-items/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/invoice-items/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/accounting/invoice-items/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/invoice-items/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/invoice-items/:id"
response <- VERB("DELETE", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/invoice-items/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounting/invoice-items/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/invoice-items/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounting/invoice-items/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http DELETE {{baseUrl}}/accounting/invoice-items/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method DELETE \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/invoice-items/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/invoice-items/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "delete",
"resource": "tax-rates",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get Invoice Item
{{baseUrl}}/accounting/invoice-items/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/invoice-items/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/invoice-items/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/invoice-items/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/invoice-items/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/invoice-items/:id");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/invoice-items/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/invoice-items/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/invoice-items/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/invoice-items/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/invoice-items/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/invoice-items/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/invoice-items/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/invoice-items/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/invoice-items/:id',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/invoice-items/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/invoice-items/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/invoice-items/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/invoice-items/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/invoice-items/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/invoice-items/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/invoice-items/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/invoice-items/:id');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/invoice-items/:id');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/invoice-items/:id' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/invoice-items/:id' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/invoice-items/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/invoice-items/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/invoice-items/:id"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/invoice-items/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/invoice-items/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/invoice-items/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/invoice-items/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/invoice-items/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/invoice-items/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/invoice-items/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"active": true,
"code": "120-C",
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
"id": "123456",
"inventory_date": "2020-10-30",
"name": "Model Y",
"purchased": true,
"quantity": 1,
"row_version": "1-12345",
"sold": true,
"taxable": true,
"tracked": true,
"type": "inventory",
"unit_price": 27500.5,
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "invoice-items",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
List Invoice Items
{{baseUrl}}/accounting/invoice-items
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/invoice-items");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/invoice-items" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/invoice-items"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/invoice-items"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/invoice-items");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/invoice-items"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/invoice-items HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/invoice-items")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/invoice-items"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/invoice-items")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/invoice-items")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/invoice-items');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoice-items',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/invoice-items';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/invoice-items',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/invoice-items")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/invoice-items',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoice-items',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/invoice-items');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoice-items',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/invoice-items';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/invoice-items"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/invoice-items" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/invoice-items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/invoice-items', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/invoice-items');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/invoice-items');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/invoice-items' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/invoice-items' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/invoice-items", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/invoice-items"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/invoice-items"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/invoice-items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/invoice-items') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/invoice-items";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/invoice-items \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/invoice-items \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/invoice-items
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/invoice-items")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"links": {
"current": "https://unify.apideck.com/crm/companies",
"next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
},
"meta": {
"items_on_page": 50
},
"operation": "all",
"resource": "invoice-items",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
PATCH
Update Invoice Item
{{baseUrl}}/accounting/invoice-items/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
BODY json
{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/invoice-items/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounting/invoice-items/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:active false
:asset_account {:code ""
:id ""
:name ""
:nominal_code ""}
:code ""
:created_at ""
:created_by ""
:description ""
:expense_account {}
:id ""
:income_account {}
:inventory_date ""
:name ""
:purchase_details {:tax_inclusive false
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:unit_of_measure ""
:unit_price ""}
:purchased false
:quantity ""
:row_version ""
:sales_details {:tax_inclusive false
:tax_rate {}
:unit_of_measure ""
:unit_price ""}
:sold false
:taxable false
:tracked false
:type ""
:unit_price ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/invoice-items/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounting/invoice-items/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/invoice-items/:id");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/invoice-items/:id"
payload := strings.NewReader("{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounting/invoice-items/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 803
{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounting/invoice-items/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/invoice-items/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/invoice-items/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounting/invoice-items/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
active: false,
asset_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {
tax_inclusive: false,
tax_rate: {},
unit_of_measure: '',
unit_price: ''
},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounting/invoice-items/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
active: false,
asset_account: {code: '', id: '', name: '', nominal_code: ''},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {code: '', id: '', name: '', rate: ''},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {tax_inclusive: false, tax_rate: {}, unit_of_measure: '', unit_price: ''},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/invoice-items/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"active":false,"asset_account":{"code":"","id":"","name":"","nominal_code":""},"code":"","created_at":"","created_by":"","description":"","expense_account":{},"id":"","income_account":{},"inventory_date":"","name":"","purchase_details":{"tax_inclusive":false,"tax_rate":{"code":"","id":"","name":"","rate":""},"unit_of_measure":"","unit_price":""},"purchased":false,"quantity":"","row_version":"","sales_details":{"tax_inclusive":false,"tax_rate":{},"unit_of_measure":"","unit_price":""},"sold":false,"taxable":false,"tracked":false,"type":"","unit_price":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/invoice-items/:id',
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "active": false,\n "asset_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "code": "",\n "created_at": "",\n "created_by": "",\n "description": "",\n "expense_account": {},\n "id": "",\n "income_account": {},\n "inventory_date": "",\n "name": "",\n "purchase_details": {\n "tax_inclusive": false,\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "unit_of_measure": "",\n "unit_price": ""\n },\n "purchased": false,\n "quantity": "",\n "row_version": "",\n "sales_details": {\n "tax_inclusive": false,\n "tax_rate": {},\n "unit_of_measure": "",\n "unit_price": ""\n },\n "sold": false,\n "taxable": false,\n "tracked": false,\n "type": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/invoice-items/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
active: false,
asset_account: {code: '', id: '', name: '', nominal_code: ''},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {code: '', id: '', name: '', rate: ''},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {tax_inclusive: false, tax_rate: {}, unit_of_measure: '', unit_price: ''},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
active: false,
asset_account: {code: '', id: '', name: '', nominal_code: ''},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {code: '', id: '', name: '', rate: ''},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {tax_inclusive: false, tax_rate: {}, unit_of_measure: '', unit_price: ''},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/accounting/invoice-items/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
active: false,
asset_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {
tax_inclusive: false,
tax_rate: {},
unit_of_measure: '',
unit_price: ''
},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/invoice-items/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
active: false,
asset_account: {code: '', id: '', name: '', nominal_code: ''},
code: '',
created_at: '',
created_by: '',
description: '',
expense_account: {},
id: '',
income_account: {},
inventory_date: '',
name: '',
purchase_details: {
tax_inclusive: false,
tax_rate: {code: '', id: '', name: '', rate: ''},
unit_of_measure: '',
unit_price: ''
},
purchased: false,
quantity: '',
row_version: '',
sales_details: {tax_inclusive: false, tax_rate: {}, unit_of_measure: '', unit_price: ''},
sold: false,
taxable: false,
tracked: false,
type: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/invoice-items/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"active":false,"asset_account":{"code":"","id":"","name":"","nominal_code":""},"code":"","created_at":"","created_by":"","description":"","expense_account":{},"id":"","income_account":{},"inventory_date":"","name":"","purchase_details":{"tax_inclusive":false,"tax_rate":{"code":"","id":"","name":"","rate":""},"unit_of_measure":"","unit_price":""},"purchased":false,"quantity":"","row_version":"","sales_details":{"tax_inclusive":false,"tax_rate":{},"unit_of_measure":"","unit_price":""},"sold":false,"taxable":false,"tracked":false,"type":"","unit_price":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"active": @NO,
@"asset_account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"code": @"",
@"created_at": @"",
@"created_by": @"",
@"description": @"",
@"expense_account": @{ },
@"id": @"",
@"income_account": @{ },
@"inventory_date": @"",
@"name": @"",
@"purchase_details": @{ @"tax_inclusive": @NO, @"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" }, @"unit_of_measure": @"", @"unit_price": @"" },
@"purchased": @NO,
@"quantity": @"",
@"row_version": @"",
@"sales_details": @{ @"tax_inclusive": @NO, @"tax_rate": @{ }, @"unit_of_measure": @"", @"unit_price": @"" },
@"sold": @NO,
@"taxable": @NO,
@"tracked": @NO,
@"type": @"",
@"unit_price": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/invoice-items/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/invoice-items/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/invoice-items/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'active' => null,
'asset_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'code' => '',
'created_at' => '',
'created_by' => '',
'description' => '',
'expense_account' => [
],
'id' => '',
'income_account' => [
],
'inventory_date' => '',
'name' => '',
'purchase_details' => [
'tax_inclusive' => null,
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'unit_of_measure' => '',
'unit_price' => ''
],
'purchased' => null,
'quantity' => '',
'row_version' => '',
'sales_details' => [
'tax_inclusive' => null,
'tax_rate' => [
],
'unit_of_measure' => '',
'unit_price' => ''
],
'sold' => null,
'taxable' => null,
'tracked' => null,
'type' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/accounting/invoice-items/:id', [
'body' => '{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/invoice-items/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'active' => null,
'asset_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'code' => '',
'created_at' => '',
'created_by' => '',
'description' => '',
'expense_account' => [
],
'id' => '',
'income_account' => [
],
'inventory_date' => '',
'name' => '',
'purchase_details' => [
'tax_inclusive' => null,
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'unit_of_measure' => '',
'unit_price' => ''
],
'purchased' => null,
'quantity' => '',
'row_version' => '',
'sales_details' => [
'tax_inclusive' => null,
'tax_rate' => [
],
'unit_of_measure' => '',
'unit_price' => ''
],
'sold' => null,
'taxable' => null,
'tracked' => null,
'type' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'active' => null,
'asset_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'code' => '',
'created_at' => '',
'created_by' => '',
'description' => '',
'expense_account' => [
],
'id' => '',
'income_account' => [
],
'inventory_date' => '',
'name' => '',
'purchase_details' => [
'tax_inclusive' => null,
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'unit_of_measure' => '',
'unit_price' => ''
],
'purchased' => null,
'quantity' => '',
'row_version' => '',
'sales_details' => [
'tax_inclusive' => null,
'tax_rate' => [
],
'unit_of_measure' => '',
'unit_price' => ''
],
'sold' => null,
'taxable' => null,
'tracked' => null,
'type' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/invoice-items/:id');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/invoice-items/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/invoice-items/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/accounting/invoice-items/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/invoice-items/:id"
payload = {
"active": False,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": False,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": False,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": False,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": False,
"taxable": False,
"tracked": False,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/invoice-items/:id"
payload <- "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/invoice-items/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/accounting/invoice-items/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"active\": false,\n \"asset_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"expense_account\": {},\n \"id\": \"\",\n \"income_account\": {},\n \"inventory_date\": \"\",\n \"name\": \"\",\n \"purchase_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"purchased\": false,\n \"quantity\": \"\",\n \"row_version\": \"\",\n \"sales_details\": {\n \"tax_inclusive\": false,\n \"tax_rate\": {},\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\"\n },\n \"sold\": false,\n \"taxable\": false,\n \"tracked\": false,\n \"type\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/invoice-items/:id";
let payload = json!({
"active": false,
"asset_account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": json!({}),
"id": "",
"income_account": json!({}),
"inventory_date": "",
"name": "",
"purchase_details": json!({
"tax_inclusive": false,
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"unit_of_measure": "",
"unit_price": ""
}),
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": json!({
"tax_inclusive": false,
"tax_rate": json!({}),
"unit_of_measure": "",
"unit_price": ""
}),
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounting/invoice-items/:id \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"active": false,
"asset_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": {},
"id": "",
"income_account": {},
"inventory_date": "",
"name": "",
"purchase_details": {
"tax_inclusive": false,
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"unit_of_measure": "",
"unit_price": ""
},
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": {
"tax_inclusive": false,
"tax_rate": {},
"unit_of_measure": "",
"unit_price": ""
},
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}' | \
http PATCH {{baseUrl}}/accounting/invoice-items/:id \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method PATCH \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "active": false,\n "asset_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "code": "",\n "created_at": "",\n "created_by": "",\n "description": "",\n "expense_account": {},\n "id": "",\n "income_account": {},\n "inventory_date": "",\n "name": "",\n "purchase_details": {\n "tax_inclusive": false,\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "unit_of_measure": "",\n "unit_price": ""\n },\n "purchased": false,\n "quantity": "",\n "row_version": "",\n "sales_details": {\n "tax_inclusive": false,\n "tax_rate": {},\n "unit_of_measure": "",\n "unit_price": ""\n },\n "sold": false,\n "taxable": false,\n "tracked": false,\n "type": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/invoice-items/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"active": false,
"asset_account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"code": "",
"created_at": "",
"created_by": "",
"description": "",
"expense_account": [],
"id": "",
"income_account": [],
"inventory_date": "",
"name": "",
"purchase_details": [
"tax_inclusive": false,
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"unit_of_measure": "",
"unit_price": ""
],
"purchased": false,
"quantity": "",
"row_version": "",
"sales_details": [
"tax_inclusive": false,
"tax_rate": [],
"unit_of_measure": "",
"unit_price": ""
],
"sold": false,
"taxable": false,
"tracked": false,
"type": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/invoice-items/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "update",
"resource": "invoice-items",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
POST
Create Invoice
{{baseUrl}}/accounting/invoices
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
BODY json
{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/invoices");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounting/invoices" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:balance ""
:billing_address {:city ""
:contact_name ""
:country ""
:county ""
:email ""
:fax ""
:id ""
:latitude ""
:line1 ""
:line2 ""
:line3 ""
:line4 ""
:longitude ""
:name ""
:phone_number ""
:postal_code ""
:row_version ""
:salutation ""
:state ""
:street_number ""
:string ""
:type ""
:website ""}
:created_at ""
:created_by ""
:currency ""
:currency_rate ""
:customer {:company_name ""
:display_id ""
:display_name ""
:id ""
:name ""}
:customer_memo ""
:deposit ""
:discount_amount ""
:discount_percentage ""
:downstream_id ""
:due_date ""
:id ""
:invoice_date ""
:invoice_sent false
:line_items [{:code ""
:created_at ""
:created_by ""
:department_id ""
:description ""
:discount_amount ""
:discount_percentage ""
:id ""
:item {:code ""
:id ""
:name ""}
:ledger_account {:code ""
:id ""
:name ""
:nominal_code ""}
:line_number 0
:location_id ""
:quantity ""
:row_id ""
:row_version ""
:tax_amount ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:total_amount ""
:type ""
:unit_of_measure ""
:unit_price ""
:updated_at ""
:updated_by ""}]
:number ""
:po_number ""
:reference ""
:row_version ""
:shipping_address {}
:source_document_url ""
:status ""
:sub_total ""
:tax_code ""
:tax_inclusive false
:template_id ""
:terms ""
:total ""
:total_tax ""
:type ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/invoices"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/accounting/invoices"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/invoices");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/invoices"
payload := strings.NewReader("{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/accounting/invoices HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 2032
{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounting/invoices")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/invoices"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/invoices")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounting/invoices")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounting/invoices');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/invoices',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/invoices';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"balance":"","billing_address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"customer_memo":"","deposit":"","discount_amount":"","discount_percentage":"","downstream_id":"","due_date":"","id":"","invoice_date":"","invoice_sent":false,"line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_amount":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{"code":"","id":"","name":"","nominal_code":""},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"number":"","po_number":"","reference":"","row_version":"","shipping_address":{},"source_document_url":"","status":"","sub_total":"","tax_code":"","tax_inclusive":false,"template_id":"","terms":"","total":"","total_tax":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/invoices',
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "balance": "",\n "billing_address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "customer_memo": "",\n "deposit": "",\n "discount_amount": "",\n "discount_percentage": "",\n "downstream_id": "",\n "due_date": "",\n "id": "",\n "invoice_date": "",\n "invoice_sent": false,\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_amount": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "number": "",\n "po_number": "",\n "reference": "",\n "row_version": "",\n "shipping_address": {},\n "source_document_url": "",\n "status": "",\n "sub_total": "",\n "tax_code": "",\n "tax_inclusive": false,\n "template_id": "",\n "terms": "",\n "total": "",\n "total_tax": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/invoices")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/invoices',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/invoices',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/accounting/invoices');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/invoices',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/invoices';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"balance":"","billing_address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"customer_memo":"","deposit":"","discount_amount":"","discount_percentage":"","downstream_id":"","due_date":"","id":"","invoice_date":"","invoice_sent":false,"line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_amount":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{"code":"","id":"","name":"","nominal_code":""},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"number":"","po_number":"","reference":"","row_version":"","shipping_address":{},"source_document_url":"","status":"","sub_total":"","tax_code":"","tax_inclusive":false,"template_id":"","terms":"","total":"","total_tax":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"balance": @"",
@"billing_address": @{ @"city": @"", @"contact_name": @"", @"country": @"", @"county": @"", @"email": @"", @"fax": @"", @"id": @"", @"latitude": @"", @"line1": @"", @"line2": @"", @"line3": @"", @"line4": @"", @"longitude": @"", @"name": @"", @"phone_number": @"", @"postal_code": @"", @"row_version": @"", @"salutation": @"", @"state": @"", @"street_number": @"", @"string": @"", @"type": @"", @"website": @"" },
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"currency_rate": @"",
@"customer": @{ @"company_name": @"", @"display_id": @"", @"display_name": @"", @"id": @"", @"name": @"" },
@"customer_memo": @"",
@"deposit": @"",
@"discount_amount": @"",
@"discount_percentage": @"",
@"downstream_id": @"",
@"due_date": @"",
@"id": @"",
@"invoice_date": @"",
@"invoice_sent": @NO,
@"line_items": @[ @{ @"code": @"", @"created_at": @"", @"created_by": @"", @"department_id": @"", @"description": @"", @"discount_amount": @"", @"discount_percentage": @"", @"id": @"", @"item": @{ @"code": @"", @"id": @"", @"name": @"" }, @"ledger_account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" }, @"line_number": @0, @"location_id": @"", @"quantity": @"", @"row_id": @"", @"row_version": @"", @"tax_amount": @"", @"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" }, @"total_amount": @"", @"type": @"", @"unit_of_measure": @"", @"unit_price": @"", @"updated_at": @"", @"updated_by": @"" } ],
@"number": @"",
@"po_number": @"",
@"reference": @"",
@"row_version": @"",
@"shipping_address": @{ },
@"source_document_url": @"",
@"status": @"",
@"sub_total": @"",
@"tax_code": @"",
@"tax_inclusive": @NO,
@"template_id": @"",
@"terms": @"",
@"total": @"",
@"total_tax": @"",
@"type": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/invoices"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/invoices" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/invoices",
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([
'balance' => '',
'billing_address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'customer_memo' => '',
'deposit' => '',
'discount_amount' => '',
'discount_percentage' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'invoice_date' => '',
'invoice_sent' => null,
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'number' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'shipping_address' => [
],
'source_document_url' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'template_id' => '',
'terms' => '',
'total' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/accounting/invoices', [
'body' => '{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/invoices');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'balance' => '',
'billing_address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'customer_memo' => '',
'deposit' => '',
'discount_amount' => '',
'discount_percentage' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'invoice_date' => '',
'invoice_sent' => null,
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'number' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'shipping_address' => [
],
'source_document_url' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'template_id' => '',
'terms' => '',
'total' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'balance' => '',
'billing_address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'customer_memo' => '',
'deposit' => '',
'discount_amount' => '',
'discount_percentage' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'invoice_date' => '',
'invoice_sent' => null,
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'number' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'shipping_address' => [
],
'source_document_url' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'template_id' => '',
'terms' => '',
'total' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/invoices');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/invoices' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/invoices' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/accounting/invoices", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/invoices"
payload = {
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": False,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": False,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/invoices"
payload <- "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/accounting/invoices') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/invoices";
let payload = json!({
"balance": "",
"billing_address": json!({
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}),
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": json!({
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
}),
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": (
json!({
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": json!({
"code": "",
"id": "",
"name": ""
}),
"ledger_account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
})
),
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": json!({}),
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounting/invoices \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}' | \
http POST {{baseUrl}}/accounting/invoices \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method POST \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "balance": "",\n "billing_address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "customer_memo": "",\n "deposit": "",\n "discount_amount": "",\n "discount_percentage": "",\n "downstream_id": "",\n "due_date": "",\n "id": "",\n "invoice_date": "",\n "invoice_sent": false,\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_amount": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "number": "",\n "po_number": "",\n "reference": "",\n "row_version": "",\n "shipping_address": {},\n "source_document_url": "",\n "status": "",\n "sub_total": "",\n "tax_code": "",\n "tax_inclusive": false,\n "template_id": "",\n "terms": "",\n "total": "",\n "total_tax": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/invoices
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"balance": "",
"billing_address": [
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": [
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
],
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
[
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": [
"code": "",
"id": "",
"name": ""
],
"ledger_account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
]
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": [],
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/invoices")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"downstream_id": "12345",
"id": "12345"
},
"operation": "add",
"resource": "invoices",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
DELETE
Delete Invoice
{{baseUrl}}/accounting/invoices/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/invoices/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounting/invoices/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/invoices/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounting/invoices/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/invoices/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/invoices/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounting/invoices/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounting/invoices/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/invoices/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/invoices/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounting/invoices/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounting/invoices/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/invoices/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/invoices/:id',
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/invoices/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounting/invoices/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/invoices/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/invoices/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/invoices/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/invoices/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounting/invoices/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/invoices/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/invoices/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/invoices/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/invoices/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/accounting/invoices/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/invoices/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/invoices/:id"
response <- VERB("DELETE", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/invoices/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounting/invoices/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/invoices/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounting/invoices/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http DELETE {{baseUrl}}/accounting/invoices/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method DELETE \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/invoices/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/invoices/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"downstream_id": "12345",
"id": "12345"
},
"operation": "delete",
"resource": "invoices",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get Invoice
{{baseUrl}}/accounting/invoices/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/invoices/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/invoices/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/invoices/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/invoices/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/invoices/:id");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/invoices/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/invoices/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/invoices/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/invoices/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/invoices/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/invoices/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/invoices/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/invoices/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/invoices/:id',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/invoices/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/invoices/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/invoices/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/invoices/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/invoices/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/invoices/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/invoices/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/invoices/:id');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/invoices/:id');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/invoices/:id' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/invoices/:id' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/invoices/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/invoices/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/invoices/:id"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/invoices/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/invoices/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/invoices/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/invoices/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/invoices/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/invoices/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/invoices/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"balance": 27500,
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"currency": "USD",
"currency_rate": 0.69,
"customer_memo": "Thank you for your business and have a great day!",
"deposit": 0,
"discount_amount": 25,
"discount_percentage": 5.5,
"downstream_id": "12345",
"due_date": "2020-09-30",
"id": "12345",
"invoice_date": "2020-09-30",
"invoice_sent": true,
"number": "OIT00546",
"po_number": "90000117",
"reference": "123456",
"row_version": "1-12345",
"source_document_url": "https://www.invoicesolution.com/invoice/123456",
"status": "draft",
"sub_total": 27500,
"tax_code": "1234",
"tax_inclusive": true,
"template_id": "123456",
"terms": "Net 30 days",
"total": 27500,
"total_tax": 2500,
"type": "service",
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "invoices",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
List Invoices
{{baseUrl}}/accounting/invoices
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/invoices");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/invoices" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/invoices"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/invoices"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/invoices");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/invoices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/invoices HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/invoices")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/invoices"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/invoices")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/invoices")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/invoices');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoices',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/invoices';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/invoices',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/invoices")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/invoices',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoices',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/invoices');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/invoices',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/invoices';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/invoices"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/invoices" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/invoices', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/invoices');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/invoices');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/invoices' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/invoices' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/invoices", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/invoices"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/invoices"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/invoices') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/invoices";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/invoices \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/invoices \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/invoices
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/invoices")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"links": {
"current": "https://unify.apideck.com/crm/companies",
"next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
},
"meta": {
"items_on_page": 50
},
"operation": "all",
"resource": "invoices",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
PATCH
Update Invoice
{{baseUrl}}/accounting/invoices/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
BODY json
{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/invoices/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounting/invoices/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:balance ""
:billing_address {:city ""
:contact_name ""
:country ""
:county ""
:email ""
:fax ""
:id ""
:latitude ""
:line1 ""
:line2 ""
:line3 ""
:line4 ""
:longitude ""
:name ""
:phone_number ""
:postal_code ""
:row_version ""
:salutation ""
:state ""
:street_number ""
:string ""
:type ""
:website ""}
:created_at ""
:created_by ""
:currency ""
:currency_rate ""
:customer {:company_name ""
:display_id ""
:display_name ""
:id ""
:name ""}
:customer_memo ""
:deposit ""
:discount_amount ""
:discount_percentage ""
:downstream_id ""
:due_date ""
:id ""
:invoice_date ""
:invoice_sent false
:line_items [{:code ""
:created_at ""
:created_by ""
:department_id ""
:description ""
:discount_amount ""
:discount_percentage ""
:id ""
:item {:code ""
:id ""
:name ""}
:ledger_account {:code ""
:id ""
:name ""
:nominal_code ""}
:line_number 0
:location_id ""
:quantity ""
:row_id ""
:row_version ""
:tax_amount ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:total_amount ""
:type ""
:unit_of_measure ""
:unit_price ""
:updated_at ""
:updated_by ""}]
:number ""
:po_number ""
:reference ""
:row_version ""
:shipping_address {}
:source_document_url ""
:status ""
:sub_total ""
:tax_code ""
:tax_inclusive false
:template_id ""
:terms ""
:total ""
:total_tax ""
:type ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/invoices/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounting/invoices/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/invoices/:id");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/invoices/:id"
payload := strings.NewReader("{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounting/invoices/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 2032
{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounting/invoices/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/invoices/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/invoices/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounting/invoices/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounting/invoices/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/invoices/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"balance":"","billing_address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"customer_memo":"","deposit":"","discount_amount":"","discount_percentage":"","downstream_id":"","due_date":"","id":"","invoice_date":"","invoice_sent":false,"line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_amount":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{"code":"","id":"","name":"","nominal_code":""},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"number":"","po_number":"","reference":"","row_version":"","shipping_address":{},"source_document_url":"","status":"","sub_total":"","tax_code":"","tax_inclusive":false,"template_id":"","terms":"","total":"","total_tax":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/invoices/:id',
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "balance": "",\n "billing_address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "customer_memo": "",\n "deposit": "",\n "discount_amount": "",\n "discount_percentage": "",\n "downstream_id": "",\n "due_date": "",\n "id": "",\n "invoice_date": "",\n "invoice_sent": false,\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_amount": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "number": "",\n "po_number": "",\n "reference": "",\n "row_version": "",\n "shipping_address": {},\n "source_document_url": "",\n "status": "",\n "sub_total": "",\n "tax_code": "",\n "tax_inclusive": false,\n "template_id": "",\n "terms": "",\n "total": "",\n "total_tax": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/invoices/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/accounting/invoices/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {
code: '',
id: '',
name: ''
},
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/invoices/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
balance: '',
billing_address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
customer_memo: '',
deposit: '',
discount_amount: '',
discount_percentage: '',
downstream_id: '',
due_date: '',
id: '',
invoice_date: '',
invoice_sent: false,
line_items: [
{
code: '',
created_at: '',
created_by: '',
department_id: '',
description: '',
discount_amount: '',
discount_percentage: '',
id: '',
item: {code: '', id: '', name: ''},
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
line_number: 0,
location_id: '',
quantity: '',
row_id: '',
row_version: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
type: '',
unit_of_measure: '',
unit_price: '',
updated_at: '',
updated_by: ''
}
],
number: '',
po_number: '',
reference: '',
row_version: '',
shipping_address: {},
source_document_url: '',
status: '',
sub_total: '',
tax_code: '',
tax_inclusive: false,
template_id: '',
terms: '',
total: '',
total_tax: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/invoices/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"balance":"","billing_address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"customer_memo":"","deposit":"","discount_amount":"","discount_percentage":"","downstream_id":"","due_date":"","id":"","invoice_date":"","invoice_sent":false,"line_items":[{"code":"","created_at":"","created_by":"","department_id":"","description":"","discount_amount":"","discount_percentage":"","id":"","item":{"code":"","id":"","name":""},"ledger_account":{"code":"","id":"","name":"","nominal_code":""},"line_number":0,"location_id":"","quantity":"","row_id":"","row_version":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","type":"","unit_of_measure":"","unit_price":"","updated_at":"","updated_by":""}],"number":"","po_number":"","reference":"","row_version":"","shipping_address":{},"source_document_url":"","status":"","sub_total":"","tax_code":"","tax_inclusive":false,"template_id":"","terms":"","total":"","total_tax":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"balance": @"",
@"billing_address": @{ @"city": @"", @"contact_name": @"", @"country": @"", @"county": @"", @"email": @"", @"fax": @"", @"id": @"", @"latitude": @"", @"line1": @"", @"line2": @"", @"line3": @"", @"line4": @"", @"longitude": @"", @"name": @"", @"phone_number": @"", @"postal_code": @"", @"row_version": @"", @"salutation": @"", @"state": @"", @"street_number": @"", @"string": @"", @"type": @"", @"website": @"" },
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"currency_rate": @"",
@"customer": @{ @"company_name": @"", @"display_id": @"", @"display_name": @"", @"id": @"", @"name": @"" },
@"customer_memo": @"",
@"deposit": @"",
@"discount_amount": @"",
@"discount_percentage": @"",
@"downstream_id": @"",
@"due_date": @"",
@"id": @"",
@"invoice_date": @"",
@"invoice_sent": @NO,
@"line_items": @[ @{ @"code": @"", @"created_at": @"", @"created_by": @"", @"department_id": @"", @"description": @"", @"discount_amount": @"", @"discount_percentage": @"", @"id": @"", @"item": @{ @"code": @"", @"id": @"", @"name": @"" }, @"ledger_account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" }, @"line_number": @0, @"location_id": @"", @"quantity": @"", @"row_id": @"", @"row_version": @"", @"tax_amount": @"", @"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" }, @"total_amount": @"", @"type": @"", @"unit_of_measure": @"", @"unit_price": @"", @"updated_at": @"", @"updated_by": @"" } ],
@"number": @"",
@"po_number": @"",
@"reference": @"",
@"row_version": @"",
@"shipping_address": @{ },
@"source_document_url": @"",
@"status": @"",
@"sub_total": @"",
@"tax_code": @"",
@"tax_inclusive": @NO,
@"template_id": @"",
@"terms": @"",
@"total": @"",
@"total_tax": @"",
@"type": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/invoices/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/invoices/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/invoices/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'balance' => '',
'billing_address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'customer_memo' => '',
'deposit' => '',
'discount_amount' => '',
'discount_percentage' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'invoice_date' => '',
'invoice_sent' => null,
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'number' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'shipping_address' => [
],
'source_document_url' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'template_id' => '',
'terms' => '',
'total' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/accounting/invoices/:id', [
'body' => '{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/invoices/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'balance' => '',
'billing_address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'customer_memo' => '',
'deposit' => '',
'discount_amount' => '',
'discount_percentage' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'invoice_date' => '',
'invoice_sent' => null,
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'number' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'shipping_address' => [
],
'source_document_url' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'template_id' => '',
'terms' => '',
'total' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'balance' => '',
'billing_address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'customer_memo' => '',
'deposit' => '',
'discount_amount' => '',
'discount_percentage' => '',
'downstream_id' => '',
'due_date' => '',
'id' => '',
'invoice_date' => '',
'invoice_sent' => null,
'line_items' => [
[
'code' => '',
'created_at' => '',
'created_by' => '',
'department_id' => '',
'description' => '',
'discount_amount' => '',
'discount_percentage' => '',
'id' => '',
'item' => [
'code' => '',
'id' => '',
'name' => ''
],
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'line_number' => 0,
'location_id' => '',
'quantity' => '',
'row_id' => '',
'row_version' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'type' => '',
'unit_of_measure' => '',
'unit_price' => '',
'updated_at' => '',
'updated_by' => ''
]
],
'number' => '',
'po_number' => '',
'reference' => '',
'row_version' => '',
'shipping_address' => [
],
'source_document_url' => '',
'status' => '',
'sub_total' => '',
'tax_code' => '',
'tax_inclusive' => null,
'template_id' => '',
'terms' => '',
'total' => '',
'total_tax' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/invoices/:id');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/invoices/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/invoices/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/accounting/invoices/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/invoices/:id"
payload = {
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": False,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": False,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/invoices/:id"
payload <- "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/invoices/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/accounting/invoices/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"balance\": \"\",\n \"billing_address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"customer_memo\": \"\",\n \"deposit\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"downstream_id\": \"\",\n \"due_date\": \"\",\n \"id\": \"\",\n \"invoice_date\": \"\",\n \"invoice_sent\": false,\n \"line_items\": [\n {\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"department_id\": \"\",\n \"description\": \"\",\n \"discount_amount\": \"\",\n \"discount_percentage\": \"\",\n \"id\": \"\",\n \"item\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"line_number\": 0,\n \"location_id\": \"\",\n \"quantity\": \"\",\n \"row_id\": \"\",\n \"row_version\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"type\": \"\",\n \"unit_of_measure\": \"\",\n \"unit_price\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n }\n ],\n \"number\": \"\",\n \"po_number\": \"\",\n \"reference\": \"\",\n \"row_version\": \"\",\n \"shipping_address\": {},\n \"source_document_url\": \"\",\n \"status\": \"\",\n \"sub_total\": \"\",\n \"tax_code\": \"\",\n \"tax_inclusive\": false,\n \"template_id\": \"\",\n \"terms\": \"\",\n \"total\": \"\",\n \"total_tax\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/invoices/:id";
let payload = json!({
"balance": "",
"billing_address": json!({
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}),
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": json!({
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
}),
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": (
json!({
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": json!({
"code": "",
"id": "",
"name": ""
}),
"ledger_account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
})
),
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": json!({}),
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounting/invoices/:id \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"balance": "",
"billing_address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
{
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": {
"code": "",
"id": "",
"name": ""
},
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
}
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": {},
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
}' | \
http PATCH {{baseUrl}}/accounting/invoices/:id \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method PATCH \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "balance": "",\n "billing_address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "customer_memo": "",\n "deposit": "",\n "discount_amount": "",\n "discount_percentage": "",\n "downstream_id": "",\n "due_date": "",\n "id": "",\n "invoice_date": "",\n "invoice_sent": false,\n "line_items": [\n {\n "code": "",\n "created_at": "",\n "created_by": "",\n "department_id": "",\n "description": "",\n "discount_amount": "",\n "discount_percentage": "",\n "id": "",\n "item": {\n "code": "",\n "id": "",\n "name": ""\n },\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "line_number": 0,\n "location_id": "",\n "quantity": "",\n "row_id": "",\n "row_version": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "type": "",\n "unit_of_measure": "",\n "unit_price": "",\n "updated_at": "",\n "updated_by": ""\n }\n ],\n "number": "",\n "po_number": "",\n "reference": "",\n "row_version": "",\n "shipping_address": {},\n "source_document_url": "",\n "status": "",\n "sub_total": "",\n "tax_code": "",\n "tax_inclusive": false,\n "template_id": "",\n "terms": "",\n "total": "",\n "total_tax": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/invoices/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"balance": "",
"billing_address": [
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": [
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
],
"customer_memo": "",
"deposit": "",
"discount_amount": "",
"discount_percentage": "",
"downstream_id": "",
"due_date": "",
"id": "",
"invoice_date": "",
"invoice_sent": false,
"line_items": [
[
"code": "",
"created_at": "",
"created_by": "",
"department_id": "",
"description": "",
"discount_amount": "",
"discount_percentage": "",
"id": "",
"item": [
"code": "",
"id": "",
"name": ""
],
"ledger_account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"line_number": 0,
"location_id": "",
"quantity": "",
"row_id": "",
"row_version": "",
"tax_amount": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"total_amount": "",
"type": "",
"unit_of_measure": "",
"unit_price": "",
"updated_at": "",
"updated_by": ""
]
],
"number": "",
"po_number": "",
"reference": "",
"row_version": "",
"shipping_address": [],
"source_document_url": "",
"status": "",
"sub_total": "",
"tax_code": "",
"tax_inclusive": false,
"template_id": "",
"terms": "",
"total": "",
"total_tax": "",
"type": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/invoices/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"downstream_id": "12345",
"id": "12345"
},
"operation": "update",
"resource": "invoices",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
POST
Create Journal Entry
{{baseUrl}}/accounting/journal-entries
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
BODY json
{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/journal-entries");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounting/journal-entries" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:created_at ""
:created_by ""
:currency ""
:currency_rate ""
:id ""
:journal_symbol ""
:line_items [{:department_id ""
:description ""
:id ""
:ledger_account {:code ""
:id ""
:name ""
:nominal_code ""}
:location_id ""
:tax_amount ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:total_amount ""
:tracking_category {:id ""
:name ""}
:type ""}]
:memo ""
:posted_at ""
:row_version ""
:title ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/journal-entries"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/accounting/journal-entries"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/journal-entries");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/journal-entries"
payload := strings.NewReader("{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/accounting/journal-entries HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 724
{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounting/journal-entries")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/journal-entries"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/journal-entries")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounting/journal-entries")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
location_id: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
tracking_category: {
id: '',
name: ''
},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounting/journal-entries');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/journal-entries',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
location_id: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
tracking_category: {id: '', name: ''},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/journal-entries';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"created_at":"","created_by":"","currency":"","currency_rate":"","id":"","journal_symbol":"","line_items":[{"department_id":"","description":"","id":"","ledger_account":{"code":"","id":"","name":"","nominal_code":""},"location_id":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","tracking_category":{"id":"","name":""},"type":""}],"memo":"","posted_at":"","row_version":"","title":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/journal-entries',
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "id": "",\n "journal_symbol": "",\n "line_items": [\n {\n "department_id": "",\n "description": "",\n "id": "",\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "location_id": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "tracking_category": {\n "id": "",\n "name": ""\n },\n "type": ""\n }\n ],\n "memo": "",\n "posted_at": "",\n "row_version": "",\n "title": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/journal-entries")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/journal-entries',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
location_id: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
tracking_category: {id: '', name: ''},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/journal-entries',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
location_id: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
tracking_category: {id: '', name: ''},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/accounting/journal-entries');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
location_id: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
tracking_category: {
id: '',
name: ''
},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/journal-entries',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
location_id: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
tracking_category: {id: '', name: ''},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/journal-entries';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"created_at":"","created_by":"","currency":"","currency_rate":"","id":"","journal_symbol":"","line_items":[{"department_id":"","description":"","id":"","ledger_account":{"code":"","id":"","name":"","nominal_code":""},"location_id":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","tracking_category":{"id":"","name":""},"type":""}],"memo":"","posted_at":"","row_version":"","title":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"currency_rate": @"",
@"id": @"",
@"journal_symbol": @"",
@"line_items": @[ @{ @"department_id": @"", @"description": @"", @"id": @"", @"ledger_account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" }, @"location_id": @"", @"tax_amount": @"", @"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" }, @"total_amount": @"", @"tracking_category": @{ @"id": @"", @"name": @"" }, @"type": @"" } ],
@"memo": @"",
@"posted_at": @"",
@"row_version": @"",
@"title": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/journal-entries"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/journal-entries" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/journal-entries",
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([
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'id' => '',
'journal_symbol' => '',
'line_items' => [
[
'department_id' => '',
'description' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'location_id' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'tracking_category' => [
'id' => '',
'name' => ''
],
'type' => ''
]
],
'memo' => '',
'posted_at' => '',
'row_version' => '',
'title' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/accounting/journal-entries', [
'body' => '{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/journal-entries');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'id' => '',
'journal_symbol' => '',
'line_items' => [
[
'department_id' => '',
'description' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'location_id' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'tracking_category' => [
'id' => '',
'name' => ''
],
'type' => ''
]
],
'memo' => '',
'posted_at' => '',
'row_version' => '',
'title' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'id' => '',
'journal_symbol' => '',
'line_items' => [
[
'department_id' => '',
'description' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'location_id' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'tracking_category' => [
'id' => '',
'name' => ''
],
'type' => ''
]
],
'memo' => '',
'posted_at' => '',
'row_version' => '',
'title' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/journal-entries');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/journal-entries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/journal-entries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/accounting/journal-entries", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/journal-entries"
payload = {
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/journal-entries"
payload <- "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/journal-entries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/accounting/journal-entries') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/journal-entries";
let payload = json!({
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": (
json!({
"department_id": "",
"description": "",
"id": "",
"ledger_account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"location_id": "",
"tax_amount": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"total_amount": "",
"tracking_category": json!({
"id": "",
"name": ""
}),
"type": ""
})
),
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounting/journal-entries \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}' | \
http POST {{baseUrl}}/accounting/journal-entries \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method POST \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "id": "",\n "journal_symbol": "",\n "line_items": [\n {\n "department_id": "",\n "description": "",\n "id": "",\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "location_id": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "tracking_category": {\n "id": "",\n "name": ""\n },\n "type": ""\n }\n ],\n "memo": "",\n "posted_at": "",\n "row_version": "",\n "title": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/journal-entries
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
[
"department_id": "",
"description": "",
"id": "",
"ledger_account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"location_id": "",
"tax_amount": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"total_amount": "",
"tracking_category": [
"id": "",
"name": ""
],
"type": ""
]
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/journal-entries")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "add",
"resource": "journal-entries",
"service": "quickbooks",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
DELETE
Delete Journal Entry
{{baseUrl}}/accounting/journal-entries/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/journal-entries/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounting/journal-entries/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/journal-entries/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounting/journal-entries/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/journal-entries/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/journal-entries/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounting/journal-entries/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounting/journal-entries/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/journal-entries/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/journal-entries/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounting/journal-entries/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounting/journal-entries/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/journal-entries/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/journal-entries/:id',
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/journal-entries/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounting/journal-entries/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/journal-entries/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/journal-entries/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/journal-entries/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/journal-entries/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounting/journal-entries/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/journal-entries/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/journal-entries/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/journal-entries/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/journal-entries/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/accounting/journal-entries/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/journal-entries/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/journal-entries/:id"
response <- VERB("DELETE", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/journal-entries/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounting/journal-entries/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/journal-entries/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounting/journal-entries/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http DELETE {{baseUrl}}/accounting/journal-entries/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method DELETE \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/journal-entries/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/journal-entries/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "delete",
"resource": "journal-entries",
"service": "quickbooks",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get Journal Entry
{{baseUrl}}/accounting/journal-entries/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/journal-entries/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/journal-entries/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/journal-entries/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/journal-entries/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/journal-entries/:id");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/journal-entries/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/journal-entries/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/journal-entries/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/journal-entries/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/journal-entries/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/journal-entries/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/journal-entries/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/journal-entries/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/journal-entries/:id',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/journal-entries/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/journal-entries/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/journal-entries/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/journal-entries/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/journal-entries/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/journal-entries/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/journal-entries/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/journal-entries/:id');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/journal-entries/:id');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/journal-entries/:id' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/journal-entries/:id' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/journal-entries/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/journal-entries/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/journal-entries/:id"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/journal-entries/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/journal-entries/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/journal-entries/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/journal-entries/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/journal-entries/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/journal-entries/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/journal-entries/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"currency": "USD",
"currency_rate": 0.69,
"id": "12345",
"journal_symbol": "IND",
"memo": "Thank you for your business and have a great day!",
"posted_at": "2020-09-30T07:43:32.000Z",
"row_version": "1-12345",
"title": "Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry",
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "journal-entries",
"service": "quickbooks",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
List Journal Entries
{{baseUrl}}/accounting/journal-entries
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/journal-entries");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/journal-entries" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/journal-entries"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/journal-entries"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/journal-entries");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/journal-entries"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/journal-entries HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/journal-entries")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/journal-entries"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/journal-entries")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/journal-entries")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/journal-entries');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/journal-entries',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/journal-entries';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/journal-entries',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/journal-entries")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/journal-entries',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/journal-entries',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/journal-entries');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/journal-entries',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/journal-entries';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/journal-entries"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/journal-entries" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/journal-entries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/journal-entries', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/journal-entries');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/journal-entries');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/journal-entries' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/journal-entries' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/journal-entries", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/journal-entries"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/journal-entries"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/journal-entries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/journal-entries') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/journal-entries";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/journal-entries \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/journal-entries \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/journal-entries
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/journal-entries")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"links": {
"current": "https://unify.apideck.com/crm/companies",
"next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
},
"meta": {
"items_on_page": 50
},
"operation": "all",
"resource": "journal-entries",
"service": "quickbooks",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
PATCH
Update Journal Entry
{{baseUrl}}/accounting/journal-entries/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
BODY json
{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/journal-entries/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounting/journal-entries/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:created_at ""
:created_by ""
:currency ""
:currency_rate ""
:id ""
:journal_symbol ""
:line_items [{:department_id ""
:description ""
:id ""
:ledger_account {:code ""
:id ""
:name ""
:nominal_code ""}
:location_id ""
:tax_amount ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:total_amount ""
:tracking_category {:id ""
:name ""}
:type ""}]
:memo ""
:posted_at ""
:row_version ""
:title ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/journal-entries/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounting/journal-entries/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/journal-entries/:id");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/journal-entries/:id"
payload := strings.NewReader("{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounting/journal-entries/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 724
{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounting/journal-entries/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/journal-entries/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/journal-entries/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounting/journal-entries/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
location_id: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
tracking_category: {
id: '',
name: ''
},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounting/journal-entries/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
location_id: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
tracking_category: {id: '', name: ''},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/journal-entries/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"created_at":"","created_by":"","currency":"","currency_rate":"","id":"","journal_symbol":"","line_items":[{"department_id":"","description":"","id":"","ledger_account":{"code":"","id":"","name":"","nominal_code":""},"location_id":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","tracking_category":{"id":"","name":""},"type":""}],"memo":"","posted_at":"","row_version":"","title":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/journal-entries/:id',
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "id": "",\n "journal_symbol": "",\n "line_items": [\n {\n "department_id": "",\n "description": "",\n "id": "",\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "location_id": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "tracking_category": {\n "id": "",\n "name": ""\n },\n "type": ""\n }\n ],\n "memo": "",\n "posted_at": "",\n "row_version": "",\n "title": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/journal-entries/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
location_id: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
tracking_category: {id: '', name: ''},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
location_id: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
tracking_category: {id: '', name: ''},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/accounting/journal-entries/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
location_id: '',
tax_amount: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
total_amount: '',
tracking_category: {
id: '',
name: ''
},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/journal-entries/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
id: '',
journal_symbol: '',
line_items: [
{
department_id: '',
description: '',
id: '',
ledger_account: {code: '', id: '', name: '', nominal_code: ''},
location_id: '',
tax_amount: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
total_amount: '',
tracking_category: {id: '', name: ''},
type: ''
}
],
memo: '',
posted_at: '',
row_version: '',
title: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/journal-entries/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"created_at":"","created_by":"","currency":"","currency_rate":"","id":"","journal_symbol":"","line_items":[{"department_id":"","description":"","id":"","ledger_account":{"code":"","id":"","name":"","nominal_code":""},"location_id":"","tax_amount":"","tax_rate":{"code":"","id":"","name":"","rate":""},"total_amount":"","tracking_category":{"id":"","name":""},"type":""}],"memo":"","posted_at":"","row_version":"","title":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"currency_rate": @"",
@"id": @"",
@"journal_symbol": @"",
@"line_items": @[ @{ @"department_id": @"", @"description": @"", @"id": @"", @"ledger_account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" }, @"location_id": @"", @"tax_amount": @"", @"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" }, @"total_amount": @"", @"tracking_category": @{ @"id": @"", @"name": @"" }, @"type": @"" } ],
@"memo": @"",
@"posted_at": @"",
@"row_version": @"",
@"title": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/journal-entries/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/journal-entries/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/journal-entries/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'id' => '',
'journal_symbol' => '',
'line_items' => [
[
'department_id' => '',
'description' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'location_id' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'tracking_category' => [
'id' => '',
'name' => ''
],
'type' => ''
]
],
'memo' => '',
'posted_at' => '',
'row_version' => '',
'title' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/accounting/journal-entries/:id', [
'body' => '{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/journal-entries/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'id' => '',
'journal_symbol' => '',
'line_items' => [
[
'department_id' => '',
'description' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'location_id' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'tracking_category' => [
'id' => '',
'name' => ''
],
'type' => ''
]
],
'memo' => '',
'posted_at' => '',
'row_version' => '',
'title' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'id' => '',
'journal_symbol' => '',
'line_items' => [
[
'department_id' => '',
'description' => '',
'id' => '',
'ledger_account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'location_id' => '',
'tax_amount' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'total_amount' => '',
'tracking_category' => [
'id' => '',
'name' => ''
],
'type' => ''
]
],
'memo' => '',
'posted_at' => '',
'row_version' => '',
'title' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/journal-entries/:id');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/journal-entries/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/journal-entries/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/accounting/journal-entries/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/journal-entries/:id"
payload = {
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/journal-entries/:id"
payload <- "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/journal-entries/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/accounting/journal-entries/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"id\": \"\",\n \"journal_symbol\": \"\",\n \"line_items\": [\n {\n \"department_id\": \"\",\n \"description\": \"\",\n \"id\": \"\",\n \"ledger_account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"location_id\": \"\",\n \"tax_amount\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"total_amount\": \"\",\n \"tracking_category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"type\": \"\"\n }\n ],\n \"memo\": \"\",\n \"posted_at\": \"\",\n \"row_version\": \"\",\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/journal-entries/:id";
let payload = json!({
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": (
json!({
"department_id": "",
"description": "",
"id": "",
"ledger_account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"location_id": "",
"tax_amount": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"total_amount": "",
"tracking_category": json!({
"id": "",
"name": ""
}),
"type": ""
})
),
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounting/journal-entries/:id \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
{
"department_id": "",
"description": "",
"id": "",
"ledger_account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"location_id": "",
"tax_amount": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"total_amount": "",
"tracking_category": {
"id": "",
"name": ""
},
"type": ""
}
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
}' | \
http PATCH {{baseUrl}}/accounting/journal-entries/:id \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method PATCH \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "id": "",\n "journal_symbol": "",\n "line_items": [\n {\n "department_id": "",\n "description": "",\n "id": "",\n "ledger_account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "location_id": "",\n "tax_amount": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "total_amount": "",\n "tracking_category": {\n "id": "",\n "name": ""\n },\n "type": ""\n }\n ],\n "memo": "",\n "posted_at": "",\n "row_version": "",\n "title": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/journal-entries/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"id": "",
"journal_symbol": "",
"line_items": [
[
"department_id": "",
"description": "",
"id": "",
"ledger_account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"location_id": "",
"tax_amount": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"total_amount": "",
"tracking_category": [
"id": "",
"name": ""
],
"type": ""
]
],
"memo": "",
"posted_at": "",
"row_version": "",
"title": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/journal-entries/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "update",
"resource": "journal-entries",
"service": "quickbooks",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
POST
Create Ledger Account
{{baseUrl}}/accounting/ledger-accounts
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
BODY json
{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/ledger-accounts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounting/ledger-accounts" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:active false
:bank_account {:account_name ""
:account_number ""
:account_type ""
:bank_code ""
:bic ""
:branch_identifier ""
:bsb_number ""
:currency ""
:iban ""}
:categories [{:id ""
:name ""}]
:classification ""
:code ""
:created_at ""
:created_by ""
:currency ""
:current_balance ""
:description ""
:display_id ""
:fully_qualified_name ""
:header false
:id ""
:last_reconciliation_date ""
:level ""
:name ""
:nominal_code ""
:opening_balance ""
:parent_account {:display_id ""
:id ""
:name ""}
:row_version ""
:status ""
:sub_account false
:sub_accounts []
:sub_type ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:tax_type ""
:type ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/ledger-accounts"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/accounting/ledger-accounts"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/ledger-accounts");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/ledger-accounts"
payload := strings.NewReader("{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/accounting/ledger-accounts HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 976
{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounting/ledger-accounts")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/ledger-accounts"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/ledger-accounts")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounting/ledger-accounts")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [
{
id: '',
name: ''
}
],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {
display_id: '',
id: '',
name: ''
},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounting/ledger-accounts');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/ledger-accounts',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [{id: '', name: ''}],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {display_id: '', id: '', name: ''},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/ledger-accounts';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"active":false,"bank_account":{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""},"categories":[{"id":"","name":""}],"classification":"","code":"","created_at":"","created_by":"","currency":"","current_balance":"","description":"","display_id":"","fully_qualified_name":"","header":false,"id":"","last_reconciliation_date":"","level":"","name":"","nominal_code":"","opening_balance":"","parent_account":{"display_id":"","id":"","name":""},"row_version":"","status":"","sub_account":false,"sub_accounts":[],"sub_type":"","tax_rate":{"code":"","id":"","name":"","rate":""},"tax_type":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/ledger-accounts',
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "active": false,\n "bank_account": {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n },\n "categories": [\n {\n "id": "",\n "name": ""\n }\n ],\n "classification": "",\n "code": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "current_balance": "",\n "description": "",\n "display_id": "",\n "fully_qualified_name": "",\n "header": false,\n "id": "",\n "last_reconciliation_date": "",\n "level": "",\n "name": "",\n "nominal_code": "",\n "opening_balance": "",\n "parent_account": {\n "display_id": "",\n "id": "",\n "name": ""\n },\n "row_version": "",\n "status": "",\n "sub_account": false,\n "sub_accounts": [],\n "sub_type": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "tax_type": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/ledger-accounts")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/ledger-accounts',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [{id: '', name: ''}],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {display_id: '', id: '', name: ''},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/ledger-accounts',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [{id: '', name: ''}],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {display_id: '', id: '', name: ''},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/accounting/ledger-accounts');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [
{
id: '',
name: ''
}
],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {
display_id: '',
id: '',
name: ''
},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/ledger-accounts',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [{id: '', name: ''}],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {display_id: '', id: '', name: ''},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/ledger-accounts';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"active":false,"bank_account":{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""},"categories":[{"id":"","name":""}],"classification":"","code":"","created_at":"","created_by":"","currency":"","current_balance":"","description":"","display_id":"","fully_qualified_name":"","header":false,"id":"","last_reconciliation_date":"","level":"","name":"","nominal_code":"","opening_balance":"","parent_account":{"display_id":"","id":"","name":""},"row_version":"","status":"","sub_account":false,"sub_accounts":[],"sub_type":"","tax_rate":{"code":"","id":"","name":"","rate":""},"tax_type":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"active": @NO,
@"bank_account": @{ @"account_name": @"", @"account_number": @"", @"account_type": @"", @"bank_code": @"", @"bic": @"", @"branch_identifier": @"", @"bsb_number": @"", @"currency": @"", @"iban": @"" },
@"categories": @[ @{ @"id": @"", @"name": @"" } ],
@"classification": @"",
@"code": @"",
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"current_balance": @"",
@"description": @"",
@"display_id": @"",
@"fully_qualified_name": @"",
@"header": @NO,
@"id": @"",
@"last_reconciliation_date": @"",
@"level": @"",
@"name": @"",
@"nominal_code": @"",
@"opening_balance": @"",
@"parent_account": @{ @"display_id": @"", @"id": @"", @"name": @"" },
@"row_version": @"",
@"status": @"",
@"sub_account": @NO,
@"sub_accounts": @[ ],
@"sub_type": @"",
@"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" },
@"tax_type": @"",
@"type": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/ledger-accounts"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/ledger-accounts" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/ledger-accounts",
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([
'active' => null,
'bank_account' => [
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
],
'categories' => [
[
'id' => '',
'name' => ''
]
],
'classification' => '',
'code' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'current_balance' => '',
'description' => '',
'display_id' => '',
'fully_qualified_name' => '',
'header' => null,
'id' => '',
'last_reconciliation_date' => '',
'level' => '',
'name' => '',
'nominal_code' => '',
'opening_balance' => '',
'parent_account' => [
'display_id' => '',
'id' => '',
'name' => ''
],
'row_version' => '',
'status' => '',
'sub_account' => null,
'sub_accounts' => [
],
'sub_type' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'tax_type' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/accounting/ledger-accounts', [
'body' => '{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/ledger-accounts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'active' => null,
'bank_account' => [
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
],
'categories' => [
[
'id' => '',
'name' => ''
]
],
'classification' => '',
'code' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'current_balance' => '',
'description' => '',
'display_id' => '',
'fully_qualified_name' => '',
'header' => null,
'id' => '',
'last_reconciliation_date' => '',
'level' => '',
'name' => '',
'nominal_code' => '',
'opening_balance' => '',
'parent_account' => [
'display_id' => '',
'id' => '',
'name' => ''
],
'row_version' => '',
'status' => '',
'sub_account' => null,
'sub_accounts' => [
],
'sub_type' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'tax_type' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'active' => null,
'bank_account' => [
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
],
'categories' => [
[
'id' => '',
'name' => ''
]
],
'classification' => '',
'code' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'current_balance' => '',
'description' => '',
'display_id' => '',
'fully_qualified_name' => '',
'header' => null,
'id' => '',
'last_reconciliation_date' => '',
'level' => '',
'name' => '',
'nominal_code' => '',
'opening_balance' => '',
'parent_account' => [
'display_id' => '',
'id' => '',
'name' => ''
],
'row_version' => '',
'status' => '',
'sub_account' => null,
'sub_accounts' => [
],
'sub_type' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'tax_type' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/ledger-accounts');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/ledger-accounts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/ledger-accounts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/accounting/ledger-accounts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/ledger-accounts"
payload = {
"active": False,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": False,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": False,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/ledger-accounts"
payload <- "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/ledger-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/accounting/ledger-accounts') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/ledger-accounts";
let payload = json!({
"active": false,
"bank_account": json!({
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}),
"categories": (
json!({
"id": "",
"name": ""
})
),
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": json!({
"display_id": "",
"id": "",
"name": ""
}),
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": (),
"sub_type": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounting/ledger-accounts \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}' | \
http POST {{baseUrl}}/accounting/ledger-accounts \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method POST \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "active": false,\n "bank_account": {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n },\n "categories": [\n {\n "id": "",\n "name": ""\n }\n ],\n "classification": "",\n "code": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "current_balance": "",\n "description": "",\n "display_id": "",\n "fully_qualified_name": "",\n "header": false,\n "id": "",\n "last_reconciliation_date": "",\n "level": "",\n "name": "",\n "nominal_code": "",\n "opening_balance": "",\n "parent_account": {\n "display_id": "",\n "id": "",\n "name": ""\n },\n "row_version": "",\n "status": "",\n "sub_account": false,\n "sub_accounts": [],\n "sub_type": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "tax_type": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/ledger-accounts
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"active": false,
"bank_account": [
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
],
"categories": [
[
"id": "",
"name": ""
]
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": [
"display_id": "",
"id": "",
"name": ""
],
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/ledger-accounts")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "add",
"resource": "ledger-accounts",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
DELETE
Delete Ledger Account
{{baseUrl}}/accounting/ledger-accounts/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/ledger-accounts/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounting/ledger-accounts/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/ledger-accounts/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounting/ledger-accounts/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/ledger-accounts/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/ledger-accounts/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounting/ledger-accounts/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounting/ledger-accounts/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/ledger-accounts/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/ledger-accounts/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounting/ledger-accounts/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounting/ledger-accounts/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/ledger-accounts/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/ledger-accounts/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounting/ledger-accounts/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/ledger-accounts/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/ledger-accounts/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/ledger-accounts/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/ledger-accounts/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounting/ledger-accounts/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/ledger-accounts/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/ledger-accounts/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/ledger-accounts/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/ledger-accounts/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/accounting/ledger-accounts/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/ledger-accounts/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/ledger-accounts/:id"
response <- VERB("DELETE", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/ledger-accounts/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounting/ledger-accounts/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/ledger-accounts/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounting/ledger-accounts/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http DELETE {{baseUrl}}/accounting/ledger-accounts/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method DELETE \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/ledger-accounts/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/ledger-accounts/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "delete",
"resource": "ledger-accounts",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get Ledger Account
{{baseUrl}}/accounting/ledger-accounts/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/ledger-accounts/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/ledger-accounts/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/ledger-accounts/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/ledger-accounts/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/ledger-accounts/:id");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/ledger-accounts/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/ledger-accounts/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/ledger-accounts/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/ledger-accounts/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/ledger-accounts/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/ledger-accounts/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/ledger-accounts/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/ledger-accounts/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/ledger-accounts/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/ledger-accounts/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/ledger-accounts/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/ledger-accounts/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/ledger-accounts/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/ledger-accounts/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/ledger-accounts/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/ledger-accounts/:id');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/ledger-accounts/:id');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/ledger-accounts/:id' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/ledger-accounts/:id' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/ledger-accounts/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/ledger-accounts/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/ledger-accounts/:id"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/ledger-accounts/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/ledger-accounts/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/ledger-accounts/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/ledger-accounts/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/ledger-accounts/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/ledger-accounts/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/ledger-accounts/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"active": true,
"classification": "asset",
"code": "453",
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"currency": "USD",
"current_balance": 20000,
"description": "Main checking account",
"display_id": "1-12345",
"fully_qualified_name": "Asset.Bank.Checking_Account",
"header": true,
"id": "12345",
"last_reconciliation_date": "2020-09-30",
"level": 1,
"name": "Bank account",
"nominal_code": "N091",
"opening_balance": 75000,
"row_version": "1-12345",
"status": "active",
"sub_account": false,
"sub_type": "CHECKING_ACCOUNT",
"tax_type": "NONE",
"type": "bank",
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "ledger-accounts",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
List Ledger Accounts
{{baseUrl}}/accounting/ledger-accounts
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/ledger-accounts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/ledger-accounts" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/ledger-accounts"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/ledger-accounts"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/ledger-accounts");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/ledger-accounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/ledger-accounts HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/ledger-accounts")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/ledger-accounts"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/ledger-accounts")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/ledger-accounts")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/ledger-accounts');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/ledger-accounts',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/ledger-accounts';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/ledger-accounts',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/ledger-accounts")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/ledger-accounts',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/ledger-accounts',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/ledger-accounts');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/ledger-accounts',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/ledger-accounts';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/ledger-accounts"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/ledger-accounts" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/ledger-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/ledger-accounts', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/ledger-accounts');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/ledger-accounts');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/ledger-accounts' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/ledger-accounts' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/ledger-accounts", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/ledger-accounts"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/ledger-accounts"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/ledger-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/ledger-accounts') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/ledger-accounts";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/ledger-accounts \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/ledger-accounts \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/ledger-accounts
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/ledger-accounts")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"links": {
"current": "https://unify.apideck.com/crm/companies",
"next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
},
"meta": {
"items_on_page": 50
},
"operation": "all",
"resource": "ledger-accounts",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
PATCH
Update Ledger Account
{{baseUrl}}/accounting/ledger-accounts/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
BODY json
{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/ledger-accounts/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounting/ledger-accounts/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:active false
:bank_account {:account_name ""
:account_number ""
:account_type ""
:bank_code ""
:bic ""
:branch_identifier ""
:bsb_number ""
:currency ""
:iban ""}
:categories [{:id ""
:name ""}]
:classification ""
:code ""
:created_at ""
:created_by ""
:currency ""
:current_balance ""
:description ""
:display_id ""
:fully_qualified_name ""
:header false
:id ""
:last_reconciliation_date ""
:level ""
:name ""
:nominal_code ""
:opening_balance ""
:parent_account {:display_id ""
:id ""
:name ""}
:row_version ""
:status ""
:sub_account false
:sub_accounts []
:sub_type ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:tax_type ""
:type ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/ledger-accounts/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounting/ledger-accounts/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/ledger-accounts/:id");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/ledger-accounts/:id"
payload := strings.NewReader("{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounting/ledger-accounts/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 976
{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounting/ledger-accounts/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/ledger-accounts/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/ledger-accounts/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounting/ledger-accounts/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [
{
id: '',
name: ''
}
],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {
display_id: '',
id: '',
name: ''
},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounting/ledger-accounts/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [{id: '', name: ''}],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {display_id: '', id: '', name: ''},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/ledger-accounts/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"active":false,"bank_account":{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""},"categories":[{"id":"","name":""}],"classification":"","code":"","created_at":"","created_by":"","currency":"","current_balance":"","description":"","display_id":"","fully_qualified_name":"","header":false,"id":"","last_reconciliation_date":"","level":"","name":"","nominal_code":"","opening_balance":"","parent_account":{"display_id":"","id":"","name":""},"row_version":"","status":"","sub_account":false,"sub_accounts":[],"sub_type":"","tax_rate":{"code":"","id":"","name":"","rate":""},"tax_type":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "active": false,\n "bank_account": {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n },\n "categories": [\n {\n "id": "",\n "name": ""\n }\n ],\n "classification": "",\n "code": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "current_balance": "",\n "description": "",\n "display_id": "",\n "fully_qualified_name": "",\n "header": false,\n "id": "",\n "last_reconciliation_date": "",\n "level": "",\n "name": "",\n "nominal_code": "",\n "opening_balance": "",\n "parent_account": {\n "display_id": "",\n "id": "",\n "name": ""\n },\n "row_version": "",\n "status": "",\n "sub_account": false,\n "sub_accounts": [],\n "sub_type": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "tax_type": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/ledger-accounts/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [{id: '', name: ''}],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {display_id: '', id: '', name: ''},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [{id: '', name: ''}],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {display_id: '', id: '', name: ''},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/accounting/ledger-accounts/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [
{
id: '',
name: ''
}
],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {
display_id: '',
id: '',
name: ''
},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/ledger-accounts/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
active: false,
bank_account: {
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
},
categories: [{id: '', name: ''}],
classification: '',
code: '',
created_at: '',
created_by: '',
currency: '',
current_balance: '',
description: '',
display_id: '',
fully_qualified_name: '',
header: false,
id: '',
last_reconciliation_date: '',
level: '',
name: '',
nominal_code: '',
opening_balance: '',
parent_account: {display_id: '', id: '', name: ''},
row_version: '',
status: '',
sub_account: false,
sub_accounts: [],
sub_type: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
tax_type: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/ledger-accounts/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"active":false,"bank_account":{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""},"categories":[{"id":"","name":""}],"classification":"","code":"","created_at":"","created_by":"","currency":"","current_balance":"","description":"","display_id":"","fully_qualified_name":"","header":false,"id":"","last_reconciliation_date":"","level":"","name":"","nominal_code":"","opening_balance":"","parent_account":{"display_id":"","id":"","name":""},"row_version":"","status":"","sub_account":false,"sub_accounts":[],"sub_type":"","tax_rate":{"code":"","id":"","name":"","rate":""},"tax_type":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"active": @NO,
@"bank_account": @{ @"account_name": @"", @"account_number": @"", @"account_type": @"", @"bank_code": @"", @"bic": @"", @"branch_identifier": @"", @"bsb_number": @"", @"currency": @"", @"iban": @"" },
@"categories": @[ @{ @"id": @"", @"name": @"" } ],
@"classification": @"",
@"code": @"",
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"current_balance": @"",
@"description": @"",
@"display_id": @"",
@"fully_qualified_name": @"",
@"header": @NO,
@"id": @"",
@"last_reconciliation_date": @"",
@"level": @"",
@"name": @"",
@"nominal_code": @"",
@"opening_balance": @"",
@"parent_account": @{ @"display_id": @"", @"id": @"", @"name": @"" },
@"row_version": @"",
@"status": @"",
@"sub_account": @NO,
@"sub_accounts": @[ ],
@"sub_type": @"",
@"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" },
@"tax_type": @"",
@"type": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/ledger-accounts/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/ledger-accounts/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/ledger-accounts/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'active' => null,
'bank_account' => [
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
],
'categories' => [
[
'id' => '',
'name' => ''
]
],
'classification' => '',
'code' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'current_balance' => '',
'description' => '',
'display_id' => '',
'fully_qualified_name' => '',
'header' => null,
'id' => '',
'last_reconciliation_date' => '',
'level' => '',
'name' => '',
'nominal_code' => '',
'opening_balance' => '',
'parent_account' => [
'display_id' => '',
'id' => '',
'name' => ''
],
'row_version' => '',
'status' => '',
'sub_account' => null,
'sub_accounts' => [
],
'sub_type' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'tax_type' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/accounting/ledger-accounts/:id', [
'body' => '{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/ledger-accounts/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'active' => null,
'bank_account' => [
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
],
'categories' => [
[
'id' => '',
'name' => ''
]
],
'classification' => '',
'code' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'current_balance' => '',
'description' => '',
'display_id' => '',
'fully_qualified_name' => '',
'header' => null,
'id' => '',
'last_reconciliation_date' => '',
'level' => '',
'name' => '',
'nominal_code' => '',
'opening_balance' => '',
'parent_account' => [
'display_id' => '',
'id' => '',
'name' => ''
],
'row_version' => '',
'status' => '',
'sub_account' => null,
'sub_accounts' => [
],
'sub_type' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'tax_type' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'active' => null,
'bank_account' => [
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
],
'categories' => [
[
'id' => '',
'name' => ''
]
],
'classification' => '',
'code' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'current_balance' => '',
'description' => '',
'display_id' => '',
'fully_qualified_name' => '',
'header' => null,
'id' => '',
'last_reconciliation_date' => '',
'level' => '',
'name' => '',
'nominal_code' => '',
'opening_balance' => '',
'parent_account' => [
'display_id' => '',
'id' => '',
'name' => ''
],
'row_version' => '',
'status' => '',
'sub_account' => null,
'sub_accounts' => [
],
'sub_type' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'tax_type' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/ledger-accounts/:id');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/ledger-accounts/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/ledger-accounts/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/accounting/ledger-accounts/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/ledger-accounts/:id"
payload = {
"active": False,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": False,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": False,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/ledger-accounts/:id"
payload <- "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/ledger-accounts/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/accounting/ledger-accounts/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"active\": false,\n \"bank_account\": {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n },\n \"categories\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"classification\": \"\",\n \"code\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"current_balance\": \"\",\n \"description\": \"\",\n \"display_id\": \"\",\n \"fully_qualified_name\": \"\",\n \"header\": false,\n \"id\": \"\",\n \"last_reconciliation_date\": \"\",\n \"level\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\",\n \"opening_balance\": \"\",\n \"parent_account\": {\n \"display_id\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"row_version\": \"\",\n \"status\": \"\",\n \"sub_account\": false,\n \"sub_accounts\": [],\n \"sub_type\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"tax_type\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/ledger-accounts/:id";
let payload = json!({
"active": false,
"bank_account": json!({
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}),
"categories": (
json!({
"id": "",
"name": ""
})
),
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": json!({
"display_id": "",
"id": "",
"name": ""
}),
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": (),
"sub_type": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounting/ledger-accounts/:id \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"active": false,
"bank_account": {
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
},
"categories": [
{
"id": "",
"name": ""
}
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": {
"display_id": "",
"id": "",
"name": ""
},
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
}' | \
http PATCH {{baseUrl}}/accounting/ledger-accounts/:id \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method PATCH \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "active": false,\n "bank_account": {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n },\n "categories": [\n {\n "id": "",\n "name": ""\n }\n ],\n "classification": "",\n "code": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "current_balance": "",\n "description": "",\n "display_id": "",\n "fully_qualified_name": "",\n "header": false,\n "id": "",\n "last_reconciliation_date": "",\n "level": "",\n "name": "",\n "nominal_code": "",\n "opening_balance": "",\n "parent_account": {\n "display_id": "",\n "id": "",\n "name": ""\n },\n "row_version": "",\n "status": "",\n "sub_account": false,\n "sub_accounts": [],\n "sub_type": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "tax_type": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/ledger-accounts/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"active": false,
"bank_account": [
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
],
"categories": [
[
"id": "",
"name": ""
]
],
"classification": "",
"code": "",
"created_at": "",
"created_by": "",
"currency": "",
"current_balance": "",
"description": "",
"display_id": "",
"fully_qualified_name": "",
"header": false,
"id": "",
"last_reconciliation_date": "",
"level": "",
"name": "",
"nominal_code": "",
"opening_balance": "",
"parent_account": [
"display_id": "",
"id": "",
"name": ""
],
"row_version": "",
"status": "",
"sub_account": false,
"sub_accounts": [],
"sub_type": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"tax_type": "",
"type": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/ledger-accounts/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "update",
"resource": "ledger-accounts",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
POST
Create Payment
{{baseUrl}}/accounting/payments
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
BODY json
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/payments");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounting/payments" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:account {:code ""
:id ""
:name ""
:nominal_code ""}
:accounts_receivable_account_id ""
:accounts_receivable_account_type ""
:allocations [{:amount ""
:code ""
:id ""
:type ""}]
:created_at ""
:created_by ""
:currency ""
:currency_rate ""
:customer {:company_name ""
:display_id ""
:display_name ""
:id ""
:name ""}
:display_id ""
:downstream_id ""
:id ""
:note ""
:payment_method ""
:payment_method_id ""
:payment_method_reference ""
:reconciled false
:reference ""
:row_version ""
:status ""
:supplier {:address {:city ""
:contact_name ""
:country ""
:county ""
:email ""
:fax ""
:id ""
:latitude ""
:line1 ""
:line2 ""
:line3 ""
:line4 ""
:longitude ""
:name ""
:phone_number ""
:postal_code ""
:row_version ""
:salutation ""
:state ""
:street_number ""
:string ""
:type ""
:website ""}
:company_name ""
:display_name ""
:id ""}
:total_amount ""
:transaction_date ""
:type ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/payments"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/accounting/payments"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/payments");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/payments"
payload := strings.NewReader("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/accounting/payments HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1402
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounting/payments")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/payments"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/payments")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounting/payments")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [
{
amount: '',
code: '',
id: '',
type: ''
}
],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounting/payments');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/payments',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [{amount: '', code: '', id: '', type: ''}],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/payments';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"accounts_receivable_account_id":"","accounts_receivable_account_type":"","allocations":[{"amount":"","code":"","id":"","type":""}],"created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"display_id":"","downstream_id":"","id":"","note":"","payment_method":"","payment_method_id":"","payment_method_reference":"","reconciled":false,"reference":"","row_version":"","status":"","supplier":{"address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"company_name":"","display_name":"","id":""},"total_amount":"","transaction_date":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/payments',
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "accounts_receivable_account_id": "",\n "accounts_receivable_account_type": "",\n "allocations": [\n {\n "amount": "",\n "code": "",\n "id": "",\n "type": ""\n }\n ],\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "display_id": "",\n "downstream_id": "",\n "id": "",\n "note": "",\n "payment_method": "",\n "payment_method_id": "",\n "payment_method_reference": "",\n "reconciled": false,\n "reference": "",\n "row_version": "",\n "status": "",\n "supplier": {\n "address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "company_name": "",\n "display_name": "",\n "id": ""\n },\n "total_amount": "",\n "transaction_date": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/payments")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/payments',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
account: {code: '', id: '', name: '', nominal_code: ''},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [{amount: '', code: '', id: '', type: ''}],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/payments',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
account: {code: '', id: '', name: '', nominal_code: ''},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [{amount: '', code: '', id: '', type: ''}],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/accounting/payments');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [
{
amount: '',
code: '',
id: '',
type: ''
}
],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/payments',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [{amount: '', code: '', id: '', type: ''}],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/payments';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"accounts_receivable_account_id":"","accounts_receivable_account_type":"","allocations":[{"amount":"","code":"","id":"","type":""}],"created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"display_id":"","downstream_id":"","id":"","note":"","payment_method":"","payment_method_id":"","payment_method_reference":"","reconciled":false,"reference":"","row_version":"","status":"","supplier":{"address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"company_name":"","display_name":"","id":""},"total_amount":"","transaction_date":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"accounts_receivable_account_id": @"",
@"accounts_receivable_account_type": @"",
@"allocations": @[ @{ @"amount": @"", @"code": @"", @"id": @"", @"type": @"" } ],
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"currency_rate": @"",
@"customer": @{ @"company_name": @"", @"display_id": @"", @"display_name": @"", @"id": @"", @"name": @"" },
@"display_id": @"",
@"downstream_id": @"",
@"id": @"",
@"note": @"",
@"payment_method": @"",
@"payment_method_id": @"",
@"payment_method_reference": @"",
@"reconciled": @NO,
@"reference": @"",
@"row_version": @"",
@"status": @"",
@"supplier": @{ @"address": @{ @"city": @"", @"contact_name": @"", @"country": @"", @"county": @"", @"email": @"", @"fax": @"", @"id": @"", @"latitude": @"", @"line1": @"", @"line2": @"", @"line3": @"", @"line4": @"", @"longitude": @"", @"name": @"", @"phone_number": @"", @"postal_code": @"", @"row_version": @"", @"salutation": @"", @"state": @"", @"street_number": @"", @"string": @"", @"type": @"", @"website": @"" }, @"company_name": @"", @"display_name": @"", @"id": @"" },
@"total_amount": @"",
@"transaction_date": @"",
@"type": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/payments"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/payments" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/payments",
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([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'accounts_receivable_account_id' => '',
'accounts_receivable_account_type' => '',
'allocations' => [
[
'amount' => '',
'code' => '',
'id' => '',
'type' => ''
]
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'display_id' => '',
'downstream_id' => '',
'id' => '',
'note' => '',
'payment_method' => '',
'payment_method_id' => '',
'payment_method_reference' => '',
'reconciled' => null,
'reference' => '',
'row_version' => '',
'status' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'total_amount' => '',
'transaction_date' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/accounting/payments', [
'body' => '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/payments');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'accounts_receivable_account_id' => '',
'accounts_receivable_account_type' => '',
'allocations' => [
[
'amount' => '',
'code' => '',
'id' => '',
'type' => ''
]
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'display_id' => '',
'downstream_id' => '',
'id' => '',
'note' => '',
'payment_method' => '',
'payment_method_id' => '',
'payment_method_reference' => '',
'reconciled' => null,
'reference' => '',
'row_version' => '',
'status' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'total_amount' => '',
'transaction_date' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'accounts_receivable_account_id' => '',
'accounts_receivable_account_type' => '',
'allocations' => [
[
'amount' => '',
'code' => '',
'id' => '',
'type' => ''
]
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'display_id' => '',
'downstream_id' => '',
'id' => '',
'note' => '',
'payment_method' => '',
'payment_method_id' => '',
'payment_method_reference' => '',
'reconciled' => null,
'reference' => '',
'row_version' => '',
'status' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'total_amount' => '',
'transaction_date' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/payments');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/payments' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/payments' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/accounting/payments", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/payments"
payload = {
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": False,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/payments"
payload <- "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/accounting/payments') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/payments";
let payload = json!({
"account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": (
json!({
"amount": "",
"code": "",
"id": "",
"type": ""
})
),
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": json!({
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
}),
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": json!({
"address": json!({
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}),
"company_name": "",
"display_name": "",
"id": ""
}),
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounting/payments \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}' | \
http POST {{baseUrl}}/accounting/payments \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method POST \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "accounts_receivable_account_id": "",\n "accounts_receivable_account_type": "",\n "allocations": [\n {\n "amount": "",\n "code": "",\n "id": "",\n "type": ""\n }\n ],\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "display_id": "",\n "downstream_id": "",\n "id": "",\n "note": "",\n "payment_method": "",\n "payment_method_id": "",\n "payment_method_reference": "",\n "reconciled": false,\n "reference": "",\n "row_version": "",\n "status": "",\n "supplier": {\n "address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "company_name": "",\n "display_name": "",\n "id": ""\n },\n "total_amount": "",\n "transaction_date": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/payments
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
[
"amount": "",
"code": "",
"id": "",
"type": ""
]
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": [
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
],
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": [
"address": [
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
],
"company_name": "",
"display_name": "",
"id": ""
],
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/payments")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "add",
"resource": "payments",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
DELETE
Delete Payment
{{baseUrl}}/accounting/payments/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/payments/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounting/payments/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/payments/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounting/payments/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/payments/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/payments/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounting/payments/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounting/payments/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/payments/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/payments/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounting/payments/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounting/payments/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/payments/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/payments/:id',
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/payments/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounting/payments/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/payments/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/payments/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/payments/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/payments/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounting/payments/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/payments/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/payments/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/payments/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/payments/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/accounting/payments/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/payments/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/payments/:id"
response <- VERB("DELETE", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/payments/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounting/payments/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/payments/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounting/payments/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http DELETE {{baseUrl}}/accounting/payments/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method DELETE \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/payments/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/payments/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "delete",
"resource": "payments",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get Payment
{{baseUrl}}/accounting/payments/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/payments/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/payments/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/payments/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/payments/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/payments/:id");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/payments/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/payments/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/payments/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/payments/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/payments/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/payments/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/payments/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/payments/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/payments/:id',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/payments/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/payments/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/payments/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/payments/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/payments/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/payments/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/payments/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/payments/:id');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/payments/:id');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/payments/:id' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/payments/:id' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/payments/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/payments/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/payments/:id"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/payments/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/payments/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/payments/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/payments/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/payments/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/payments/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/payments/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"accounts_receivable_account_id": "123456",
"accounts_receivable_account_type": "Account",
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"currency": "USD",
"currency_rate": 0.69,
"display_id": "123456",
"downstream_id": "12345",
"id": "123456",
"note": "Some notes about this payment",
"payment_method": "Credit Card",
"payment_method_id": "123456",
"payment_method_reference": "123456",
"reconciled": true,
"reference": "123456",
"row_version": "1-12345",
"status": "authorised",
"total_amount": 49.99,
"transaction_date": "2021-05-01T12:00:00.000Z",
"type": "accounts_receivable",
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "payments",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
List Payments
{{baseUrl}}/accounting/payments
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/payments");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/payments" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/payments"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/payments"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/payments");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/payments HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/payments")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/payments"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/payments")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/payments")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/payments');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/payments',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/payments';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/payments',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/payments")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/payments',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/payments',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/payments');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/payments',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/payments';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/payments"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/payments" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/payments', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/payments');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/payments');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/payments' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/payments' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/payments", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/payments"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/payments"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/payments') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/payments";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/payments \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/payments \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/payments
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/payments")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"links": {
"current": "https://unify.apideck.com/crm/companies",
"next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
},
"meta": {
"items_on_page": 50
},
"operation": "all",
"resource": "payments",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
PATCH
Update Payment
{{baseUrl}}/accounting/payments/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
BODY json
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/payments/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounting/payments/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:account {:code ""
:id ""
:name ""
:nominal_code ""}
:accounts_receivable_account_id ""
:accounts_receivable_account_type ""
:allocations [{:amount ""
:code ""
:id ""
:type ""}]
:created_at ""
:created_by ""
:currency ""
:currency_rate ""
:customer {:company_name ""
:display_id ""
:display_name ""
:id ""
:name ""}
:display_id ""
:downstream_id ""
:id ""
:note ""
:payment_method ""
:payment_method_id ""
:payment_method_reference ""
:reconciled false
:reference ""
:row_version ""
:status ""
:supplier {:address {:city ""
:contact_name ""
:country ""
:county ""
:email ""
:fax ""
:id ""
:latitude ""
:line1 ""
:line2 ""
:line3 ""
:line4 ""
:longitude ""
:name ""
:phone_number ""
:postal_code ""
:row_version ""
:salutation ""
:state ""
:street_number ""
:string ""
:type ""
:website ""}
:company_name ""
:display_name ""
:id ""}
:total_amount ""
:transaction_date ""
:type ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/payments/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounting/payments/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/payments/:id");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/payments/:id"
payload := strings.NewReader("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounting/payments/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1402
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounting/payments/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/payments/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/payments/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounting/payments/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [
{
amount: '',
code: '',
id: '',
type: ''
}
],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounting/payments/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [{amount: '', code: '', id: '', type: ''}],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/payments/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"accounts_receivable_account_id":"","accounts_receivable_account_type":"","allocations":[{"amount":"","code":"","id":"","type":""}],"created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"display_id":"","downstream_id":"","id":"","note":"","payment_method":"","payment_method_id":"","payment_method_reference":"","reconciled":false,"reference":"","row_version":"","status":"","supplier":{"address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"company_name":"","display_name":"","id":""},"total_amount":"","transaction_date":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/payments/:id',
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "accounts_receivable_account_id": "",\n "accounts_receivable_account_type": "",\n "allocations": [\n {\n "amount": "",\n "code": "",\n "id": "",\n "type": ""\n }\n ],\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "display_id": "",\n "downstream_id": "",\n "id": "",\n "note": "",\n "payment_method": "",\n "payment_method_id": "",\n "payment_method_reference": "",\n "reconciled": false,\n "reference": "",\n "row_version": "",\n "status": "",\n "supplier": {\n "address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "company_name": "",\n "display_name": "",\n "id": ""\n },\n "total_amount": "",\n "transaction_date": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/payments/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
account: {code: '', id: '', name: '', nominal_code: ''},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [{amount: '', code: '', id: '', type: ''}],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
account: {code: '', id: '', name: '', nominal_code: ''},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [{amount: '', code: '', id: '', type: ''}],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/accounting/payments/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [
{
amount: '',
code: '',
id: '',
type: ''
}
],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {
company_name: '',
display_id: '',
display_name: '',
id: '',
name: ''
},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/payments/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
accounts_receivable_account_id: '',
accounts_receivable_account_type: '',
allocations: [{amount: '', code: '', id: '', type: ''}],
created_at: '',
created_by: '',
currency: '',
currency_rate: '',
customer: {company_name: '', display_id: '', display_name: '', id: '', name: ''},
display_id: '',
downstream_id: '',
id: '',
note: '',
payment_method: '',
payment_method_id: '',
payment_method_reference: '',
reconciled: false,
reference: '',
row_version: '',
status: '',
supplier: {
address: {
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
},
company_name: '',
display_name: '',
id: ''
},
total_amount: '',
transaction_date: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/payments/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"accounts_receivable_account_id":"","accounts_receivable_account_type":"","allocations":[{"amount":"","code":"","id":"","type":""}],"created_at":"","created_by":"","currency":"","currency_rate":"","customer":{"company_name":"","display_id":"","display_name":"","id":"","name":""},"display_id":"","downstream_id":"","id":"","note":"","payment_method":"","payment_method_id":"","payment_method_reference":"","reconciled":false,"reference":"","row_version":"","status":"","supplier":{"address":{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""},"company_name":"","display_name":"","id":""},"total_amount":"","transaction_date":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"accounts_receivable_account_id": @"",
@"accounts_receivable_account_type": @"",
@"allocations": @[ @{ @"amount": @"", @"code": @"", @"id": @"", @"type": @"" } ],
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"currency_rate": @"",
@"customer": @{ @"company_name": @"", @"display_id": @"", @"display_name": @"", @"id": @"", @"name": @"" },
@"display_id": @"",
@"downstream_id": @"",
@"id": @"",
@"note": @"",
@"payment_method": @"",
@"payment_method_id": @"",
@"payment_method_reference": @"",
@"reconciled": @NO,
@"reference": @"",
@"row_version": @"",
@"status": @"",
@"supplier": @{ @"address": @{ @"city": @"", @"contact_name": @"", @"country": @"", @"county": @"", @"email": @"", @"fax": @"", @"id": @"", @"latitude": @"", @"line1": @"", @"line2": @"", @"line3": @"", @"line4": @"", @"longitude": @"", @"name": @"", @"phone_number": @"", @"postal_code": @"", @"row_version": @"", @"salutation": @"", @"state": @"", @"street_number": @"", @"string": @"", @"type": @"", @"website": @"" }, @"company_name": @"", @"display_name": @"", @"id": @"" },
@"total_amount": @"",
@"transaction_date": @"",
@"type": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/payments/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/payments/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/payments/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'accounts_receivable_account_id' => '',
'accounts_receivable_account_type' => '',
'allocations' => [
[
'amount' => '',
'code' => '',
'id' => '',
'type' => ''
]
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'display_id' => '',
'downstream_id' => '',
'id' => '',
'note' => '',
'payment_method' => '',
'payment_method_id' => '',
'payment_method_reference' => '',
'reconciled' => null,
'reference' => '',
'row_version' => '',
'status' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'total_amount' => '',
'transaction_date' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/accounting/payments/:id', [
'body' => '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/payments/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'accounts_receivable_account_id' => '',
'accounts_receivable_account_type' => '',
'allocations' => [
[
'amount' => '',
'code' => '',
'id' => '',
'type' => ''
]
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'display_id' => '',
'downstream_id' => '',
'id' => '',
'note' => '',
'payment_method' => '',
'payment_method_id' => '',
'payment_method_reference' => '',
'reconciled' => null,
'reference' => '',
'row_version' => '',
'status' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'total_amount' => '',
'transaction_date' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'accounts_receivable_account_id' => '',
'accounts_receivable_account_type' => '',
'allocations' => [
[
'amount' => '',
'code' => '',
'id' => '',
'type' => ''
]
],
'created_at' => '',
'created_by' => '',
'currency' => '',
'currency_rate' => '',
'customer' => [
'company_name' => '',
'display_id' => '',
'display_name' => '',
'id' => '',
'name' => ''
],
'display_id' => '',
'downstream_id' => '',
'id' => '',
'note' => '',
'payment_method' => '',
'payment_method_id' => '',
'payment_method_reference' => '',
'reconciled' => null,
'reference' => '',
'row_version' => '',
'status' => '',
'supplier' => [
'address' => [
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
],
'company_name' => '',
'display_name' => '',
'id' => ''
],
'total_amount' => '',
'transaction_date' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/payments/:id');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/payments/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/payments/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/accounting/payments/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/payments/:id"
payload = {
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": False,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/payments/:id"
payload <- "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/payments/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/accounting/payments/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"accounts_receivable_account_id\": \"\",\n \"accounts_receivable_account_type\": \"\",\n \"allocations\": [\n {\n \"amount\": \"\",\n \"code\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"currency_rate\": \"\",\n \"customer\": {\n \"company_name\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"display_id\": \"\",\n \"downstream_id\": \"\",\n \"id\": \"\",\n \"note\": \"\",\n \"payment_method\": \"\",\n \"payment_method_id\": \"\",\n \"payment_method_reference\": \"\",\n \"reconciled\": false,\n \"reference\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"supplier\": {\n \"address\": {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n },\n \"company_name\": \"\",\n \"display_name\": \"\",\n \"id\": \"\"\n },\n \"total_amount\": \"\",\n \"transaction_date\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/payments/:id";
let payload = json!({
"account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": (
json!({
"amount": "",
"code": "",
"id": "",
"type": ""
})
),
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": json!({
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
}),
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": json!({
"address": json!({
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}),
"company_name": "",
"display_name": "",
"id": ""
}),
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounting/payments/:id \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
{
"amount": "",
"code": "",
"id": "",
"type": ""
}
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": {
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
},
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": {
"address": {
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
},
"company_name": "",
"display_name": "",
"id": ""
},
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
}' | \
http PATCH {{baseUrl}}/accounting/payments/:id \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method PATCH \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "accounts_receivable_account_id": "",\n "accounts_receivable_account_type": "",\n "allocations": [\n {\n "amount": "",\n "code": "",\n "id": "",\n "type": ""\n }\n ],\n "created_at": "",\n "created_by": "",\n "currency": "",\n "currency_rate": "",\n "customer": {\n "company_name": "",\n "display_id": "",\n "display_name": "",\n "id": "",\n "name": ""\n },\n "display_id": "",\n "downstream_id": "",\n "id": "",\n "note": "",\n "payment_method": "",\n "payment_method_id": "",\n "payment_method_reference": "",\n "reconciled": false,\n "reference": "",\n "row_version": "",\n "status": "",\n "supplier": {\n "address": {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n },\n "company_name": "",\n "display_name": "",\n "id": ""\n },\n "total_amount": "",\n "transaction_date": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/payments/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"accounts_receivable_account_id": "",
"accounts_receivable_account_type": "",
"allocations": [
[
"amount": "",
"code": "",
"id": "",
"type": ""
]
],
"created_at": "",
"created_by": "",
"currency": "",
"currency_rate": "",
"customer": [
"company_name": "",
"display_id": "",
"display_name": "",
"id": "",
"name": ""
],
"display_id": "",
"downstream_id": "",
"id": "",
"note": "",
"payment_method": "",
"payment_method_id": "",
"payment_method_reference": "",
"reconciled": false,
"reference": "",
"row_version": "",
"status": "",
"supplier": [
"address": [
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
],
"company_name": "",
"display_name": "",
"id": ""
],
"total_amount": "",
"transaction_date": "",
"type": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/payments/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "update",
"resource": "payments",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get Profit and Loss
{{baseUrl}}/accounting/profit-and-loss
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/profit-and-loss");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/profit-and-loss" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/profit-and-loss"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/profit-and-loss"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/profit-and-loss");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/profit-and-loss"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/profit-and-loss HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/profit-and-loss")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/profit-and-loss"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/profit-and-loss")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/profit-and-loss")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/profit-and-loss');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/profit-and-loss',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/profit-and-loss';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/profit-and-loss',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/profit-and-loss")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/profit-and-loss',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/profit-and-loss',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/profit-and-loss');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/profit-and-loss',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/profit-and-loss';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/profit-and-loss"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/profit-and-loss" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/profit-and-loss",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/profit-and-loss', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/profit-and-loss');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/profit-and-loss');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/profit-and-loss' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/profit-and-loss' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/profit-and-loss", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/profit-and-loss"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/profit-and-loss"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/profit-and-loss")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/profit-and-loss') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/profit-and-loss";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/profit-and-loss \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/profit-and-loss \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/profit-and-loss
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/profit-and-loss")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"currency": "USD",
"customer_id": "123",
"end_date": "2017-01-01",
"expenses": {
"records": [
{
"amount": 10000,
"id": "123",
"name": "Expense 1"
},
{
"amount": 20000,
"id": "456",
"name": "Expense 2"
}
],
"total": 200000
},
"gross_profit": {
"total": 200000
},
"id": "12345",
"income": {
"records": [
{
"amount": 10000,
"id": "123",
"name": "Income 1"
},
{
"amount": 20000,
"id": "456",
"name": "Income 2"
}
],
"total": 200000
},
"net_income": {
"total": 200000
},
"net_operating_income": {
"total": 200000
},
"report_name": "ProfitAndLoss",
"start_date": "2017-01-01"
},
"operation": "one",
"resource": "ProfitAndLosses",
"service": "quickbooks",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
POST
Create Supplier
{{baseUrl}}/accounting/suppliers
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
BODY json
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/suppliers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounting/suppliers" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:account {:code ""
:id ""
:name ""
:nominal_code ""}
:addresses [{:city ""
:contact_name ""
:country ""
:county ""
:email ""
:fax ""
:id ""
:latitude ""
:line1 ""
:line2 ""
:line3 ""
:line4 ""
:longitude ""
:name ""
:phone_number ""
:postal_code ""
:row_version ""
:salutation ""
:state ""
:street_number ""
:string ""
:type ""
:website ""}]
:bank_accounts [{:account_name ""
:account_number ""
:account_type ""
:bank_code ""
:bic ""
:branch_identifier ""
:bsb_number ""
:currency ""
:iban ""}]
:company_name ""
:created_at ""
:created_by ""
:currency ""
:display_id ""
:display_name ""
:downstream_id ""
:emails [{:email ""
:id ""
:type ""}]
:first_name ""
:id ""
:individual false
:last_name ""
:middle_name ""
:notes ""
:phone_numbers [{:area_code ""
:country_code ""
:extension ""
:id ""
:number ""
:type ""}]
:row_version ""
:status ""
:suffix ""
:tax_number ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:title ""
:updated_at ""
:updated_by ""
:websites [{:id ""
:type ""
:url ""}]}})
require "http/client"
url = "{{baseUrl}}/accounting/suppliers"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/accounting/suppliers"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/suppliers");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/suppliers"
payload := strings.NewReader("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/accounting/suppliers HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1651
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounting/suppliers")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/suppliers"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/suppliers")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounting/suppliers")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [
{
email: '',
id: '',
type: ''
}
],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [
{
area_code: '',
country_code: '',
extension: '',
id: '',
number: '',
type: ''
}
],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
title: '',
updated_at: '',
updated_by: '',
websites: [
{
id: '',
type: '',
url: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounting/suppliers');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/suppliers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/suppliers';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"addresses":[{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""}],"bank_accounts":[{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""}],"company_name":"","created_at":"","created_by":"","currency":"","display_id":"","display_name":"","downstream_id":"","emails":[{"email":"","id":"","type":""}],"first_name":"","id":"","individual":false,"last_name":"","middle_name":"","notes":"","phone_numbers":[{"area_code":"","country_code":"","extension":"","id":"","number":"","type":""}],"row_version":"","status":"","suffix":"","tax_number":"","tax_rate":{"code":"","id":"","name":"","rate":""},"title":"","updated_at":"","updated_by":"","websites":[{"id":"","type":"","url":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/suppliers',
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "addresses": [\n {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n }\n ],\n "bank_accounts": [\n {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n }\n ],\n "company_name": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "display_id": "",\n "display_name": "",\n "downstream_id": "",\n "emails": [\n {\n "email": "",\n "id": "",\n "type": ""\n }\n ],\n "first_name": "",\n "id": "",\n "individual": false,\n "last_name": "",\n "middle_name": "",\n "notes": "",\n "phone_numbers": [\n {\n "area_code": "",\n "country_code": "",\n "extension": "",\n "id": "",\n "number": "",\n "type": ""\n }\n ],\n "row_version": "",\n "status": "",\n "suffix": "",\n "tax_number": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "title": "",\n "updated_at": "",\n "updated_by": "",\n "websites": [\n {\n "id": "",\n "type": "",\n "url": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/suppliers")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/suppliers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/suppliers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/accounting/suppliers');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [
{
email: '',
id: '',
type: ''
}
],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [
{
area_code: '',
country_code: '',
extension: '',
id: '',
number: '',
type: ''
}
],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
title: '',
updated_at: '',
updated_by: '',
websites: [
{
id: '',
type: '',
url: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/suppliers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/suppliers';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"addresses":[{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""}],"bank_accounts":[{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""}],"company_name":"","created_at":"","created_by":"","currency":"","display_id":"","display_name":"","downstream_id":"","emails":[{"email":"","id":"","type":""}],"first_name":"","id":"","individual":false,"last_name":"","middle_name":"","notes":"","phone_numbers":[{"area_code":"","country_code":"","extension":"","id":"","number":"","type":""}],"row_version":"","status":"","suffix":"","tax_number":"","tax_rate":{"code":"","id":"","name":"","rate":""},"title":"","updated_at":"","updated_by":"","websites":[{"id":"","type":"","url":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"addresses": @[ @{ @"city": @"", @"contact_name": @"", @"country": @"", @"county": @"", @"email": @"", @"fax": @"", @"id": @"", @"latitude": @"", @"line1": @"", @"line2": @"", @"line3": @"", @"line4": @"", @"longitude": @"", @"name": @"", @"phone_number": @"", @"postal_code": @"", @"row_version": @"", @"salutation": @"", @"state": @"", @"street_number": @"", @"string": @"", @"type": @"", @"website": @"" } ],
@"bank_accounts": @[ @{ @"account_name": @"", @"account_number": @"", @"account_type": @"", @"bank_code": @"", @"bic": @"", @"branch_identifier": @"", @"bsb_number": @"", @"currency": @"", @"iban": @"" } ],
@"company_name": @"",
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"display_id": @"",
@"display_name": @"",
@"downstream_id": @"",
@"emails": @[ @{ @"email": @"", @"id": @"", @"type": @"" } ],
@"first_name": @"",
@"id": @"",
@"individual": @NO,
@"last_name": @"",
@"middle_name": @"",
@"notes": @"",
@"phone_numbers": @[ @{ @"area_code": @"", @"country_code": @"", @"extension": @"", @"id": @"", @"number": @"", @"type": @"" } ],
@"row_version": @"",
@"status": @"",
@"suffix": @"",
@"tax_number": @"",
@"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" },
@"title": @"",
@"updated_at": @"",
@"updated_by": @"",
@"websites": @[ @{ @"id": @"", @"type": @"", @"url": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/suppliers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/suppliers" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/suppliers",
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([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/accounting/suppliers', [
'body' => '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/suppliers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/accounting/suppliers');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/suppliers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/suppliers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/accounting/suppliers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/suppliers"
payload = {
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": False,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/suppliers"
payload <- "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/suppliers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/accounting/suppliers') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/suppliers";
let payload = json!({
"account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"addresses": (
json!({
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
})
),
"bank_accounts": (
json!({
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
})
),
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": (
json!({
"email": "",
"id": "",
"type": ""
})
),
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": (
json!({
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
})
),
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"title": "",
"updated_at": "",
"updated_by": "",
"websites": (
json!({
"id": "",
"type": "",
"url": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounting/suppliers \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
echo '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}' | \
http POST {{baseUrl}}/accounting/suppliers \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method POST \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "addresses": [\n {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n }\n ],\n "bank_accounts": [\n {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n }\n ],\n "company_name": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "display_id": "",\n "display_name": "",\n "downstream_id": "",\n "emails": [\n {\n "email": "",\n "id": "",\n "type": ""\n }\n ],\n "first_name": "",\n "id": "",\n "individual": false,\n "last_name": "",\n "middle_name": "",\n "notes": "",\n "phone_numbers": [\n {\n "area_code": "",\n "country_code": "",\n "extension": "",\n "id": "",\n "number": "",\n "type": ""\n }\n ],\n "row_version": "",\n "status": "",\n "suffix": "",\n "tax_number": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "title": "",\n "updated_at": "",\n "updated_by": "",\n "websites": [\n {\n "id": "",\n "type": "",\n "url": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/accounting/suppliers
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"addresses": [
[
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
]
],
"bank_accounts": [
[
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
]
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
[
"email": "",
"id": "",
"type": ""
]
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
[
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
]
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
[
"id": "",
"type": "",
"url": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/suppliers")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "add",
"resource": "payments",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
DELETE
Delete Supplier
{{baseUrl}}/accounting/suppliers/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/suppliers/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounting/suppliers/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/suppliers/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounting/suppliers/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/suppliers/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/suppliers/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounting/suppliers/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounting/suppliers/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/suppliers/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/suppliers/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounting/suppliers/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounting/suppliers/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/suppliers/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/suppliers/:id',
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/suppliers/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounting/suppliers/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/suppliers/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/suppliers/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/suppliers/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/suppliers/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounting/suppliers/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/suppliers/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/suppliers/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/suppliers/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/suppliers/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/accounting/suppliers/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/suppliers/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/suppliers/:id"
response <- VERB("DELETE", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/suppliers/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounting/suppliers/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/suppliers/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounting/suppliers/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http DELETE {{baseUrl}}/accounting/suppliers/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method DELETE \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/suppliers/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/suppliers/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "delete",
"resource": "suppliers",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get Supplier
{{baseUrl}}/accounting/suppliers/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/suppliers/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/suppliers/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/suppliers/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/suppliers/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/suppliers/:id");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/suppliers/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/suppliers/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/suppliers/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/suppliers/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/suppliers/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/suppliers/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/suppliers/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/suppliers/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/suppliers/:id',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/suppliers/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/suppliers/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/suppliers/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/suppliers/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/suppliers/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/suppliers/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/suppliers/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/suppliers/:id');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/suppliers/:id');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/suppliers/:id' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/suppliers/:id' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/suppliers/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/suppliers/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/suppliers/:id"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/suppliers/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/suppliers/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/suppliers/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/suppliers/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/suppliers/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/suppliers/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/suppliers/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"company_name": "SpaceX",
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"currency": "USD",
"display_id": "EMP00101",
"display_name": "Windsurf Shop",
"downstream_id": "12345",
"first_name": "Elon",
"id": "12345",
"individual": true,
"last_name": "Musk",
"middle_name": "D.",
"notes": "Some notes about this supplier",
"row_version": "1-12345",
"status": "active",
"suffix": "Jr.",
"tax_number": "US123945459",
"title": "CEO",
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "suppliers",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
List Suppliers
{{baseUrl}}/accounting/suppliers
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/suppliers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/suppliers" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/suppliers"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/suppliers"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/suppliers");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/suppliers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/suppliers HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/suppliers")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/suppliers"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/suppliers")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/suppliers")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/suppliers');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/suppliers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/suppliers';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/suppliers',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/suppliers")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/suppliers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/suppliers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/suppliers');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/suppliers',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/suppliers';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/suppliers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/suppliers" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/suppliers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/suppliers', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/suppliers');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/suppliers');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/suppliers' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/suppliers' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/suppliers", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/suppliers"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/suppliers"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/suppliers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/suppliers') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/suppliers";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/suppliers \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/suppliers \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/suppliers
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/suppliers")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"links": {
"current": "https://unify.apideck.com/crm/companies",
"next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
},
"meta": {
"items_on_page": 50
},
"operation": "all",
"resource": "suppliers",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
PATCH
Update Supplier
{{baseUrl}}/accounting/suppliers/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
BODY json
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/suppliers/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounting/suppliers/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:account {:code ""
:id ""
:name ""
:nominal_code ""}
:addresses [{:city ""
:contact_name ""
:country ""
:county ""
:email ""
:fax ""
:id ""
:latitude ""
:line1 ""
:line2 ""
:line3 ""
:line4 ""
:longitude ""
:name ""
:phone_number ""
:postal_code ""
:row_version ""
:salutation ""
:state ""
:street_number ""
:string ""
:type ""
:website ""}]
:bank_accounts [{:account_name ""
:account_number ""
:account_type ""
:bank_code ""
:bic ""
:branch_identifier ""
:bsb_number ""
:currency ""
:iban ""}]
:company_name ""
:created_at ""
:created_by ""
:currency ""
:display_id ""
:display_name ""
:downstream_id ""
:emails [{:email ""
:id ""
:type ""}]
:first_name ""
:id ""
:individual false
:last_name ""
:middle_name ""
:notes ""
:phone_numbers [{:area_code ""
:country_code ""
:extension ""
:id ""
:number ""
:type ""}]
:row_version ""
:status ""
:suffix ""
:tax_number ""
:tax_rate {:code ""
:id ""
:name ""
:rate ""}
:title ""
:updated_at ""
:updated_by ""
:websites [{:id ""
:type ""
:url ""}]}})
require "http/client"
url = "{{baseUrl}}/accounting/suppliers/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounting/suppliers/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/suppliers/:id");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/suppliers/:id"
payload := strings.NewReader("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounting/suppliers/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1651
{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounting/suppliers/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/suppliers/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/suppliers/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounting/suppliers/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [
{
email: '',
id: '',
type: ''
}
],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [
{
area_code: '',
country_code: '',
extension: '',
id: '',
number: '',
type: ''
}
],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
title: '',
updated_at: '',
updated_by: '',
websites: [
{
id: '',
type: '',
url: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounting/suppliers/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/suppliers/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"addresses":[{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""}],"bank_accounts":[{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""}],"company_name":"","created_at":"","created_by":"","currency":"","display_id":"","display_name":"","downstream_id":"","emails":[{"email":"","id":"","type":""}],"first_name":"","id":"","individual":false,"last_name":"","middle_name":"","notes":"","phone_numbers":[{"area_code":"","country_code":"","extension":"","id":"","number":"","type":""}],"row_version":"","status":"","suffix":"","tax_number":"","tax_rate":{"code":"","id":"","name":"","rate":""},"title":"","updated_at":"","updated_by":"","websites":[{"id":"","type":"","url":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/suppliers/:id',
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "addresses": [\n {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n }\n ],\n "bank_accounts": [\n {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n }\n ],\n "company_name": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "display_id": "",\n "display_name": "",\n "downstream_id": "",\n "emails": [\n {\n "email": "",\n "id": "",\n "type": ""\n }\n ],\n "first_name": "",\n "id": "",\n "individual": false,\n "last_name": "",\n "middle_name": "",\n "notes": "",\n "phone_numbers": [\n {\n "area_code": "",\n "country_code": "",\n "extension": "",\n "id": "",\n "number": "",\n "type": ""\n }\n ],\n "row_version": "",\n "status": "",\n "suffix": "",\n "tax_number": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "title": "",\n "updated_at": "",\n "updated_by": "",\n "websites": [\n {\n "id": "",\n "type": "",\n "url": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/suppliers/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/accounting/suppliers/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
account: {
code: '',
id: '',
name: '',
nominal_code: ''
},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [
{
email: '',
id: '',
type: ''
}
],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [
{
area_code: '',
country_code: '',
extension: '',
id: '',
number: '',
type: ''
}
],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {
code: '',
id: '',
name: '',
rate: ''
},
title: '',
updated_at: '',
updated_by: '',
websites: [
{
id: '',
type: '',
url: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/suppliers/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
account: {code: '', id: '', name: '', nominal_code: ''},
addresses: [
{
city: '',
contact_name: '',
country: '',
county: '',
email: '',
fax: '',
id: '',
latitude: '',
line1: '',
line2: '',
line3: '',
line4: '',
longitude: '',
name: '',
phone_number: '',
postal_code: '',
row_version: '',
salutation: '',
state: '',
street_number: '',
string: '',
type: '',
website: ''
}
],
bank_accounts: [
{
account_name: '',
account_number: '',
account_type: '',
bank_code: '',
bic: '',
branch_identifier: '',
bsb_number: '',
currency: '',
iban: ''
}
],
company_name: '',
created_at: '',
created_by: '',
currency: '',
display_id: '',
display_name: '',
downstream_id: '',
emails: [{email: '', id: '', type: ''}],
first_name: '',
id: '',
individual: false,
last_name: '',
middle_name: '',
notes: '',
phone_numbers: [{area_code: '', country_code: '', extension: '', id: '', number: '', type: ''}],
row_version: '',
status: '',
suffix: '',
tax_number: '',
tax_rate: {code: '', id: '', name: '', rate: ''},
title: '',
updated_at: '',
updated_by: '',
websites: [{id: '', type: '', url: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/suppliers/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"account":{"code":"","id":"","name":"","nominal_code":""},"addresses":[{"city":"","contact_name":"","country":"","county":"","email":"","fax":"","id":"","latitude":"","line1":"","line2":"","line3":"","line4":"","longitude":"","name":"","phone_number":"","postal_code":"","row_version":"","salutation":"","state":"","street_number":"","string":"","type":"","website":""}],"bank_accounts":[{"account_name":"","account_number":"","account_type":"","bank_code":"","bic":"","branch_identifier":"","bsb_number":"","currency":"","iban":""}],"company_name":"","created_at":"","created_by":"","currency":"","display_id":"","display_name":"","downstream_id":"","emails":[{"email":"","id":"","type":""}],"first_name":"","id":"","individual":false,"last_name":"","middle_name":"","notes":"","phone_numbers":[{"area_code":"","country_code":"","extension":"","id":"","number":"","type":""}],"row_version":"","status":"","suffix":"","tax_number":"","tax_rate":{"code":"","id":"","name":"","rate":""},"title":"","updated_at":"","updated_by":"","websites":[{"id":"","type":"","url":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"account": @{ @"code": @"", @"id": @"", @"name": @"", @"nominal_code": @"" },
@"addresses": @[ @{ @"city": @"", @"contact_name": @"", @"country": @"", @"county": @"", @"email": @"", @"fax": @"", @"id": @"", @"latitude": @"", @"line1": @"", @"line2": @"", @"line3": @"", @"line4": @"", @"longitude": @"", @"name": @"", @"phone_number": @"", @"postal_code": @"", @"row_version": @"", @"salutation": @"", @"state": @"", @"street_number": @"", @"string": @"", @"type": @"", @"website": @"" } ],
@"bank_accounts": @[ @{ @"account_name": @"", @"account_number": @"", @"account_type": @"", @"bank_code": @"", @"bic": @"", @"branch_identifier": @"", @"bsb_number": @"", @"currency": @"", @"iban": @"" } ],
@"company_name": @"",
@"created_at": @"",
@"created_by": @"",
@"currency": @"",
@"display_id": @"",
@"display_name": @"",
@"downstream_id": @"",
@"emails": @[ @{ @"email": @"", @"id": @"", @"type": @"" } ],
@"first_name": @"",
@"id": @"",
@"individual": @NO,
@"last_name": @"",
@"middle_name": @"",
@"notes": @"",
@"phone_numbers": @[ @{ @"area_code": @"", @"country_code": @"", @"extension": @"", @"id": @"", @"number": @"", @"type": @"" } ],
@"row_version": @"",
@"status": @"",
@"suffix": @"",
@"tax_number": @"",
@"tax_rate": @{ @"code": @"", @"id": @"", @"name": @"", @"rate": @"" },
@"title": @"",
@"updated_at": @"",
@"updated_by": @"",
@"websites": @[ @{ @"id": @"", @"type": @"", @"url": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/suppliers/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/suppliers/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/suppliers/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/accounting/suppliers/:id', [
'body' => '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/suppliers/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'account' => [
'code' => '',
'id' => '',
'name' => '',
'nominal_code' => ''
],
'addresses' => [
[
'city' => '',
'contact_name' => '',
'country' => '',
'county' => '',
'email' => '',
'fax' => '',
'id' => '',
'latitude' => '',
'line1' => '',
'line2' => '',
'line3' => '',
'line4' => '',
'longitude' => '',
'name' => '',
'phone_number' => '',
'postal_code' => '',
'row_version' => '',
'salutation' => '',
'state' => '',
'street_number' => '',
'string' => '',
'type' => '',
'website' => ''
]
],
'bank_accounts' => [
[
'account_name' => '',
'account_number' => '',
'account_type' => '',
'bank_code' => '',
'bic' => '',
'branch_identifier' => '',
'bsb_number' => '',
'currency' => '',
'iban' => ''
]
],
'company_name' => '',
'created_at' => '',
'created_by' => '',
'currency' => '',
'display_id' => '',
'display_name' => '',
'downstream_id' => '',
'emails' => [
[
'email' => '',
'id' => '',
'type' => ''
]
],
'first_name' => '',
'id' => '',
'individual' => null,
'last_name' => '',
'middle_name' => '',
'notes' => '',
'phone_numbers' => [
[
'area_code' => '',
'country_code' => '',
'extension' => '',
'id' => '',
'number' => '',
'type' => ''
]
],
'row_version' => '',
'status' => '',
'suffix' => '',
'tax_number' => '',
'tax_rate' => [
'code' => '',
'id' => '',
'name' => '',
'rate' => ''
],
'title' => '',
'updated_at' => '',
'updated_by' => '',
'websites' => [
[
'id' => '',
'type' => '',
'url' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/accounting/suppliers/:id');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/suppliers/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/suppliers/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/accounting/suppliers/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/suppliers/:id"
payload = {
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": False,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/suppliers/:id"
payload <- "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/suppliers/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/accounting/suppliers/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"account\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"nominal_code\": \"\"\n },\n \"addresses\": [\n {\n \"city\": \"\",\n \"contact_name\": \"\",\n \"country\": \"\",\n \"county\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"id\": \"\",\n \"latitude\": \"\",\n \"line1\": \"\",\n \"line2\": \"\",\n \"line3\": \"\",\n \"line4\": \"\",\n \"longitude\": \"\",\n \"name\": \"\",\n \"phone_number\": \"\",\n \"postal_code\": \"\",\n \"row_version\": \"\",\n \"salutation\": \"\",\n \"state\": \"\",\n \"street_number\": \"\",\n \"string\": \"\",\n \"type\": \"\",\n \"website\": \"\"\n }\n ],\n \"bank_accounts\": [\n {\n \"account_name\": \"\",\n \"account_number\": \"\",\n \"account_type\": \"\",\n \"bank_code\": \"\",\n \"bic\": \"\",\n \"branch_identifier\": \"\",\n \"bsb_number\": \"\",\n \"currency\": \"\",\n \"iban\": \"\"\n }\n ],\n \"company_name\": \"\",\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"currency\": \"\",\n \"display_id\": \"\",\n \"display_name\": \"\",\n \"downstream_id\": \"\",\n \"emails\": [\n {\n \"email\": \"\",\n \"id\": \"\",\n \"type\": \"\"\n }\n ],\n \"first_name\": \"\",\n \"id\": \"\",\n \"individual\": false,\n \"last_name\": \"\",\n \"middle_name\": \"\",\n \"notes\": \"\",\n \"phone_numbers\": [\n {\n \"area_code\": \"\",\n \"country_code\": \"\",\n \"extension\": \"\",\n \"id\": \"\",\n \"number\": \"\",\n \"type\": \"\"\n }\n ],\n \"row_version\": \"\",\n \"status\": \"\",\n \"suffix\": \"\",\n \"tax_number\": \"\",\n \"tax_rate\": {\n \"code\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"rate\": \"\"\n },\n \"title\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\",\n \"websites\": [\n {\n \"id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/suppliers/:id";
let payload = json!({
"account": json!({
"code": "",
"id": "",
"name": "",
"nominal_code": ""
}),
"addresses": (
json!({
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
})
),
"bank_accounts": (
json!({
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
})
),
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": (
json!({
"email": "",
"id": "",
"type": ""
})
),
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": (
json!({
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
})
),
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": json!({
"code": "",
"id": "",
"name": "",
"rate": ""
}),
"title": "",
"updated_at": "",
"updated_by": "",
"websites": (
json!({
"id": "",
"type": "",
"url": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounting/suppliers/:id \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}'
echo '{
"account": {
"code": "",
"id": "",
"name": "",
"nominal_code": ""
},
"addresses": [
{
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
}
],
"bank_accounts": [
{
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
}
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
{
"email": "",
"id": "",
"type": ""
}
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
{
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
}
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": {
"code": "",
"id": "",
"name": "",
"rate": ""
},
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
{
"id": "",
"type": "",
"url": ""
}
]
}' | \
http PATCH {{baseUrl}}/accounting/suppliers/:id \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method PATCH \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "account": {\n "code": "",\n "id": "",\n "name": "",\n "nominal_code": ""\n },\n "addresses": [\n {\n "city": "",\n "contact_name": "",\n "country": "",\n "county": "",\n "email": "",\n "fax": "",\n "id": "",\n "latitude": "",\n "line1": "",\n "line2": "",\n "line3": "",\n "line4": "",\n "longitude": "",\n "name": "",\n "phone_number": "",\n "postal_code": "",\n "row_version": "",\n "salutation": "",\n "state": "",\n "street_number": "",\n "string": "",\n "type": "",\n "website": ""\n }\n ],\n "bank_accounts": [\n {\n "account_name": "",\n "account_number": "",\n "account_type": "",\n "bank_code": "",\n "bic": "",\n "branch_identifier": "",\n "bsb_number": "",\n "currency": "",\n "iban": ""\n }\n ],\n "company_name": "",\n "created_at": "",\n "created_by": "",\n "currency": "",\n "display_id": "",\n "display_name": "",\n "downstream_id": "",\n "emails": [\n {\n "email": "",\n "id": "",\n "type": ""\n }\n ],\n "first_name": "",\n "id": "",\n "individual": false,\n "last_name": "",\n "middle_name": "",\n "notes": "",\n "phone_numbers": [\n {\n "area_code": "",\n "country_code": "",\n "extension": "",\n "id": "",\n "number": "",\n "type": ""\n }\n ],\n "row_version": "",\n "status": "",\n "suffix": "",\n "tax_number": "",\n "tax_rate": {\n "code": "",\n "id": "",\n "name": "",\n "rate": ""\n },\n "title": "",\n "updated_at": "",\n "updated_by": "",\n "websites": [\n {\n "id": "",\n "type": "",\n "url": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/accounting/suppliers/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"account": [
"code": "",
"id": "",
"name": "",
"nominal_code": ""
],
"addresses": [
[
"city": "",
"contact_name": "",
"country": "",
"county": "",
"email": "",
"fax": "",
"id": "",
"latitude": "",
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"longitude": "",
"name": "",
"phone_number": "",
"postal_code": "",
"row_version": "",
"salutation": "",
"state": "",
"street_number": "",
"string": "",
"type": "",
"website": ""
]
],
"bank_accounts": [
[
"account_name": "",
"account_number": "",
"account_type": "",
"bank_code": "",
"bic": "",
"branch_identifier": "",
"bsb_number": "",
"currency": "",
"iban": ""
]
],
"company_name": "",
"created_at": "",
"created_by": "",
"currency": "",
"display_id": "",
"display_name": "",
"downstream_id": "",
"emails": [
[
"email": "",
"id": "",
"type": ""
]
],
"first_name": "",
"id": "",
"individual": false,
"last_name": "",
"middle_name": "",
"notes": "",
"phone_numbers": [
[
"area_code": "",
"country_code": "",
"extension": "",
"id": "",
"number": "",
"type": ""
]
],
"row_version": "",
"status": "",
"suffix": "",
"tax_number": "",
"tax_rate": [
"code": "",
"id": "",
"name": "",
"rate": ""
],
"title": "",
"updated_at": "",
"updated_by": "",
"websites": [
[
"id": "",
"type": "",
"url": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/suppliers/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "update",
"resource": "suppliers",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
POST
Create Tax Rate
{{baseUrl}}/accounting/tax-rates
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
BODY json
{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/tax-rates");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounting/tax-rates" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:code ""
:components []
:created_at ""
:created_by ""
:description ""
:effective_tax_rate ""
:id ""
:name ""
:original_tax_rate_id ""
:report_tax_type ""
:row_version ""
:status ""
:tax_payable_account_id ""
:tax_remitted_account_id ""
:total_tax_rate ""
:type ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/tax-rates"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/accounting/tax-rates"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/tax-rates");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/tax-rates"
payload := strings.NewReader("{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/accounting/tax-rates HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 386
{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounting/tax-rates")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/tax-rates"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/tax-rates")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounting/tax-rates")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounting/tax-rates');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/tax-rates',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/tax-rates';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"code":"","components":[],"created_at":"","created_by":"","description":"","effective_tax_rate":"","id":"","name":"","original_tax_rate_id":"","report_tax_type":"","row_version":"","status":"","tax_payable_account_id":"","tax_remitted_account_id":"","total_tax_rate":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/tax-rates',
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "code": "",\n "components": [],\n "created_at": "",\n "created_by": "",\n "description": "",\n "effective_tax_rate": "",\n "id": "",\n "name": "",\n "original_tax_rate_id": "",\n "report_tax_type": "",\n "row_version": "",\n "status": "",\n "tax_payable_account_id": "",\n "tax_remitted_account_id": "",\n "total_tax_rate": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/tax-rates")
.post(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/tax-rates',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/tax-rates',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/accounting/tax-rates');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/accounting/tax-rates',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/tax-rates';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"code":"","components":[],"created_at":"","created_by":"","description":"","effective_tax_rate":"","id":"","name":"","original_tax_rate_id":"","report_tax_type":"","row_version":"","status":"","tax_payable_account_id":"","tax_remitted_account_id":"","total_tax_rate":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"code": @"",
@"components": @[ ],
@"created_at": @"",
@"created_by": @"",
@"description": @"",
@"effective_tax_rate": @"",
@"id": @"",
@"name": @"",
@"original_tax_rate_id": @"",
@"report_tax_type": @"",
@"row_version": @"",
@"status": @"",
@"tax_payable_account_id": @"",
@"tax_remitted_account_id": @"",
@"total_tax_rate": @"",
@"type": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/tax-rates"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/tax-rates" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/tax-rates",
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([
'code' => '',
'components' => [
],
'created_at' => '',
'created_by' => '',
'description' => '',
'effective_tax_rate' => '',
'id' => '',
'name' => '',
'original_tax_rate_id' => '',
'report_tax_type' => '',
'row_version' => '',
'status' => '',
'tax_payable_account_id' => '',
'tax_remitted_account_id' => '',
'total_tax_rate' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/accounting/tax-rates', [
'body' => '{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/tax-rates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'code' => '',
'components' => [
],
'created_at' => '',
'created_by' => '',
'description' => '',
'effective_tax_rate' => '',
'id' => '',
'name' => '',
'original_tax_rate_id' => '',
'report_tax_type' => '',
'row_version' => '',
'status' => '',
'tax_payable_account_id' => '',
'tax_remitted_account_id' => '',
'total_tax_rate' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'code' => '',
'components' => [
],
'created_at' => '',
'created_by' => '',
'description' => '',
'effective_tax_rate' => '',
'id' => '',
'name' => '',
'original_tax_rate_id' => '',
'report_tax_type' => '',
'row_version' => '',
'status' => '',
'tax_payable_account_id' => '',
'tax_remitted_account_id' => '',
'total_tax_rate' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/tax-rates');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/tax-rates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/tax-rates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/accounting/tax-rates", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/tax-rates"
payload = {
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/tax-rates"
payload <- "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/tax-rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/accounting/tax-rates') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/tax-rates";
let payload = json!({
"code": "",
"components": (),
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounting/tax-rates \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}' | \
http POST {{baseUrl}}/accounting/tax-rates \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method POST \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "code": "",\n "components": [],\n "created_at": "",\n "created_by": "",\n "description": "",\n "effective_tax_rate": "",\n "id": "",\n "name": "",\n "original_tax_rate_id": "",\n "report_tax_type": "",\n "row_version": "",\n "status": "",\n "tax_payable_account_id": "",\n "tax_remitted_account_id": "",\n "total_tax_rate": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/tax-rates
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/tax-rates")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "add",
"resource": "tax-rates",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
DELETE
Delete Tax Rate
{{baseUrl}}/accounting/tax-rates/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/tax-rates/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounting/tax-rates/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/tax-rates/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounting/tax-rates/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/tax-rates/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/tax-rates/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounting/tax-rates/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounting/tax-rates/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/tax-rates/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/tax-rates/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounting/tax-rates/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounting/tax-rates/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/tax-rates/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/tax-rates/:id',
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/tax-rates/:id")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounting/tax-rates/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/tax-rates/:id';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/tax-rates/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/tax-rates/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/tax-rates/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounting/tax-rates/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/tax-rates/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/tax-rates/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/tax-rates/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/tax-rates/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/accounting/tax-rates/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/tax-rates/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/tax-rates/:id"
response <- VERB("DELETE", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/tax-rates/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounting/tax-rates/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/tax-rates/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounting/tax-rates/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http DELETE {{baseUrl}}/accounting/tax-rates/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method DELETE \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/tax-rates/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/tax-rates/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "delete",
"resource": "tax-rates",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
Get Tax Rate
{{baseUrl}}/accounting/tax-rates/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/tax-rates/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/tax-rates/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/tax-rates/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/tax-rates/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/tax-rates/:id");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/tax-rates/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/tax-rates/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/tax-rates/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/tax-rates/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/tax-rates/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/tax-rates/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/tax-rates/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/tax-rates/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/tax-rates/:id',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/tax-rates/:id")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/tax-rates/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/tax-rates/:id';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/tax-rates/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/tax-rates/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/tax-rates/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/tax-rates/:id', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/tax-rates/:id');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/tax-rates/:id');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/tax-rates/:id' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/tax-rates/:id' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/tax-rates/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/tax-rates/:id"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/tax-rates/:id"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/tax-rates/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/tax-rates/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/tax-rates/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/tax-rates/:id \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/tax-rates/:id \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/tax-rates/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/tax-rates/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"code": "ABN",
"created_at": "2020-09-30T07:43:32.000Z",
"created_by": "12345",
"description": "Reduced rate GST Purchases",
"effective_tax_rate": 10,
"id": "1234",
"name": "GST on Purchases",
"original_tax_rate_id": "12345",
"report_tax_type": "NONE",
"row_version": "1-12345",
"status": "active",
"tax_payable_account_id": "123456",
"tax_remitted_account_id": "123456",
"total_tax_rate": 10,
"type": "NONE",
"updated_at": "2020-09-30T07:43:32.000Z",
"updated_by": "12345"
},
"operation": "one",
"resource": "tax-rates",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
GET
List Tax Rates
{{baseUrl}}/accounting/tax-rates
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/tax-rates");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounting/tax-rates" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/accounting/tax-rates"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounting/tax-rates"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/tax-rates");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/tax-rates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounting/tax-rates HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounting/tax-rates")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/tax-rates"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/tax-rates")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounting/tax-rates")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounting/tax-rates');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/tax-rates',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/tax-rates';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/tax-rates',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounting/tax-rates")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/tax-rates',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/tax-rates',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounting/tax-rates');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounting/tax-rates',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/tax-rates';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/tax-rates"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/tax-rates" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/tax-rates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounting/tax-rates', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/tax-rates');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounting/tax-rates');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/tax-rates' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/tax-rates' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/accounting/tax-rates", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/tax-rates"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/tax-rates"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/tax-rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounting/tax-rates') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/tax-rates";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounting/tax-rates \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: '
http GET {{baseUrl}}/accounting/tax-rates \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/accounting/tax-rates
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/tax-rates")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"links": {
"current": "https://unify.apideck.com/crm/companies",
"next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
},
"meta": {
"items_on_page": 50
},
"operation": "all",
"resource": "tax-rates",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}
PATCH
Update Tax Rate
{{baseUrl}}/accounting/tax-rates/:id
HEADERS
x-apideck-consumer-id
x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS
id
BODY json
{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounting/tax-rates/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounting/tax-rates/:id" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:code ""
:components []
:created_at ""
:created_by ""
:description ""
:effective_tax_rate ""
:id ""
:name ""
:original_tax_rate_id ""
:report_tax_type ""
:row_version ""
:status ""
:tax_payable_account_id ""
:tax_remitted_account_id ""
:total_tax_rate ""
:type ""
:updated_at ""
:updated_by ""}})
require "http/client"
url = "{{baseUrl}}/accounting/tax-rates/:id"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounting/tax-rates/:id"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounting/tax-rates/:id");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounting/tax-rates/:id"
payload := strings.NewReader("{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("authorization", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounting/tax-rates/:id HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 386
{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounting/tax-rates/:id")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounting/tax-rates/:id"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounting/tax-rates/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounting/tax-rates/:id")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounting/tax-rates/:id');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounting/tax-rates/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"code":"","components":[],"created_at":"","created_by":"","description":"","effective_tax_rate":"","id":"","name":"","original_tax_rate_id":"","report_tax_type":"","row_version":"","status":"","tax_payable_account_id":"","tax_remitted_account_id":"","total_tax_rate":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accounting/tax-rates/:id',
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "code": "",\n "components": [],\n "created_at": "",\n "created_by": "",\n "description": "",\n "effective_tax_rate": "",\n "id": "",\n "name": "",\n "original_tax_rate_id": "",\n "report_tax_type": "",\n "row_version": "",\n "status": "",\n "tax_payable_account_id": "",\n "tax_remitted_account_id": "",\n "total_tax_rate": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounting/tax-rates/:id")
.patch(body)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: {
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/accounting/tax-rates/:id');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounting/tax-rates/:id',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
data: {
code: '',
components: [],
created_at: '',
created_by: '',
description: '',
effective_tax_rate: '',
id: '',
name: '',
original_tax_rate_id: '',
report_tax_type: '',
row_version: '',
status: '',
tax_payable_account_id: '',
tax_remitted_account_id: '',
total_tax_rate: '',
type: '',
updated_at: '',
updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounting/tax-rates/:id';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
body: '{"code":"","components":[],"created_at":"","created_by":"","description":"","effective_tax_rate":"","id":"","name":"","original_tax_rate_id":"","report_tax_type":"","row_version":"","status":"","tax_payable_account_id":"","tax_remitted_account_id":"","total_tax_rate":"","type":"","updated_at":"","updated_by":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"code": @"",
@"components": @[ ],
@"created_at": @"",
@"created_by": @"",
@"description": @"",
@"effective_tax_rate": @"",
@"id": @"",
@"name": @"",
@"original_tax_rate_id": @"",
@"report_tax_type": @"",
@"row_version": @"",
@"status": @"",
@"tax_payable_account_id": @"",
@"tax_remitted_account_id": @"",
@"total_tax_rate": @"",
@"type": @"",
@"updated_at": @"",
@"updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounting/tax-rates/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accounting/tax-rates/:id" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounting/tax-rates/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'code' => '',
'components' => [
],
'created_at' => '',
'created_by' => '',
'description' => '',
'effective_tax_rate' => '',
'id' => '',
'name' => '',
'original_tax_rate_id' => '',
'report_tax_type' => '',
'row_version' => '',
'status' => '',
'tax_payable_account_id' => '',
'tax_remitted_account_id' => '',
'total_tax_rate' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-apideck-app-id: ",
"x-apideck-consumer-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/accounting/tax-rates/:id', [
'body' => '{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounting/tax-rates/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'code' => '',
'components' => [
],
'created_at' => '',
'created_by' => '',
'description' => '',
'effective_tax_rate' => '',
'id' => '',
'name' => '',
'original_tax_rate_id' => '',
'report_tax_type' => '',
'row_version' => '',
'status' => '',
'tax_payable_account_id' => '',
'tax_remitted_account_id' => '',
'total_tax_rate' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'code' => '',
'components' => [
],
'created_at' => '',
'created_by' => '',
'description' => '',
'effective_tax_rate' => '',
'id' => '',
'name' => '',
'original_tax_rate_id' => '',
'report_tax_type' => '',
'row_version' => '',
'status' => '',
'tax_payable_account_id' => '',
'tax_remitted_account_id' => '',
'total_tax_rate' => '',
'type' => '',
'updated_at' => '',
'updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounting/tax-rates/:id');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounting/tax-rates/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounting/tax-rates/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/accounting/tax-rates/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounting/tax-rates/:id"
payload = {
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounting/tax-rates/:id"
payload <- "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounting/tax-rates/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/accounting/tax-rates/:id') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"code\": \"\",\n \"components\": [],\n \"created_at\": \"\",\n \"created_by\": \"\",\n \"description\": \"\",\n \"effective_tax_rate\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"original_tax_rate_id\": \"\",\n \"report_tax_type\": \"\",\n \"row_version\": \"\",\n \"status\": \"\",\n \"tax_payable_account_id\": \"\",\n \"tax_remitted_account_id\": \"\",\n \"total_tax_rate\": \"\",\n \"type\": \"\",\n \"updated_at\": \"\",\n \"updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounting/tax-rates/:id";
let payload = json!({
"code": "",
"components": (),
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounting/tax-rates/:id \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--data '{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}'
echo '{
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
}' | \
http PATCH {{baseUrl}}/accounting/tax-rates/:id \
authorization:'{{apiKey}}' \
content-type:application/json \
x-apideck-app-id:'' \
x-apideck-consumer-id:''
wget --quiet \
--method PATCH \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "code": "",\n "components": [],\n "created_at": "",\n "created_by": "",\n "description": "",\n "effective_tax_rate": "",\n "id": "",\n "name": "",\n "original_tax_rate_id": "",\n "report_tax_type": "",\n "row_version": "",\n "status": "",\n "tax_payable_account_id": "",\n "tax_remitted_account_id": "",\n "total_tax_rate": "",\n "type": "",\n "updated_at": "",\n "updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/accounting/tax-rates/:id
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"code": "",
"components": [],
"created_at": "",
"created_by": "",
"description": "",
"effective_tax_rate": "",
"id": "",
"name": "",
"original_tax_rate_id": "",
"report_tax_type": "",
"row_version": "",
"status": "",
"tax_payable_account_id": "",
"tax_remitted_account_id": "",
"total_tax_rate": "",
"type": "",
"updated_at": "",
"updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounting/tax-rates/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": {
"id": "12345"
},
"operation": "update",
"resource": "tax-rates",
"service": "xero",
"status": "OK",
"status_code": 200
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#requestvalidationerror",
"status_code": 400,
"type_name": "RequestValidationError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "You have reached your limit of 2000",
"error": "Payment Required",
"message": "Request Limit Reached",
"ref": "https://developers.apideck.com/errors#requestlimiterror",
"status_code": 402,
"type_name": "RequestLimitError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Not Found",
"message": "Unknown Widget",
"ref": "https://developers.apideck.com/errors#entitynotfounderror",
"status_code": 404,
"type_name": "EntityNotFoundError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Unprocessable request, please verify your request headers and body.",
"error": "Unprocessable Entity",
"message": "Invalid State",
"ref": "https://developers.apideck.com/errors#invalidstateerror",
"status_code": 422,
"type_name": "InvalidStateError"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Bad Request",
"message": "Invalid Params",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 400,
"type_name": "RequestHeadersValidationError"
}