Sends the document as Model
Last updated
Last updated
var options = new RestClientOptions("//einsurance/Send/Model")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "Bearer {{bearerToken}}");
var body = @"{" + "\n" +
@" ""Insurance"": {" + "\n" +
@" ""CustomerInfo"": {" + "\n" +
@" ""Address"": ""<string>""," + "\n" +
@" ""City"": ""<string>""," + "\n" +
@" ""Country"": ""<string>""," + "\n" +
@" ""District"": ""<string>""," + "\n" +
@" ""Name"": ""<string>""," + "\n" +
@" ""TaxNumber"": ""99999999999""," + "\n" +
@" ""TaxOffice"": ""<string>""," + "\n" +
@" ""PartyIdentifications"": [" + "\n" +
@" {" + "\n" +
@" ""SchemeID"": ""<string>""," + "\n" +
@" ""Value"": ""<string>""" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""SchemeID"": ""<string>""," + "\n" +
@" ""Value"": ""<string>""" + "\n" +
@" }" + "\n" +
@" ]," + "\n" +
@" ""AgentPartyIdentifications"": [" + "\n" +
@" {" + "\n" +
@" ""SchemeID"": ""<string>""," + "\n" +
@" ""Value"": ""<string>""" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""SchemeID"": ""<string>""," + "\n" +
@" ""Value"": ""<string>""" + "\n" +
@" }" + "\n" +
@" ]," + "\n" +
@" ""PostalCode"": ""<string>""," + "\n" +
@" ""Phone"": ""<string>""," + "\n" +
@" ""Fax"": ""<string>""," + "\n" +
@" ""Mail"": ""<string>""," + "\n" +
@" ""WebSite"": ""<string>""" + "\n" +
@" }," + "\n" +
@" ""InsuranceInfo"": {" + "\n" +
@" ""CurrencyCode"": ""<string>""," + "\n" +
@" ""InsuranceSerieOrNumber"": ""E38_PCds""," + "\n" +
@" ""IssueDate"": ""<dateTime>""," + "\n" +
@" ""UUID"": ""<uuid>""," + "\n" +
@" ""TemplateUUID"": ""<uuid>""," + "\n" +
@" ""TemplateBase64String"": ""<string>""," + "\n" +
@" ""ExchangeRate"": ""<double>""," + "\n" +
@" ""InvoicePeriod"": {" + "\n" +
@" ""Description"": ""<string>""," + "\n" +
@" ""EndDate"": ""<dateTime>""," + "\n" +
@" ""StartDate"": ""<dateTime>""," + "\n" +
@" ""StartTime"": ""<string>""," + "\n" +
@" ""EndTime"": ""<string>""," + "\n" +
@" ""DurationMeasureValue"": ""<double>""" + "\n" +
@" }" + "\n" +
@" }," + "\n" +
@" ""InsuranceLines"": [" + "\n" +
@" {" + "\n" +
@" ""Name"": ""<string>""," + "\n" +
@" ""CancelledCommissionAmount"": ""<double>""," + "\n" +
@" ""IssuedCommissionAmount"": ""<double>""" + "\n" +
@" }" + "\n" +
@" ]," + "\n" +
@" ""CompanyInfo"": {" + "\n" +
@" ""Address"": ""<string>""," + "\n" +
@" ""City"": ""<string>""," + "\n" +
@" ""Country"": ""<string>""," + "\n" +
@" ""District"": ""<string>""," + "\n" +
@" ""Name"": ""<string>""," + "\n" +
@" ""TaxNumber"": ""46844684468""," + "\n" +
@" ""TaxOffice"": ""<string>""," + "\n" +
@" ""PartyIdentifications"": [" + "\n" +
@" {" + "\n" +
@" ""SchemeID"": ""<string>""," + "\n" +
@" ""Value"": ""<string>""" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""SchemeID"": ""<string>""," + "\n" +
@" ""Value"": ""<string>""" + "\n" +
@" }" + "\n" +
@" ]," + "\n" +
@" ""AgentPartyIdentifications"": [" + "\n" +
@" {" + "\n" +
@" ""SchemeID"": ""<string>""," + "\n" +
@" ""Value"": ""<string>""" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""SchemeID"": ""<string>""," + "\n" +
@" ""Value"": ""<string>""" + "\n" +
@" }" + "\n" +
@" ]," + "\n" +
@" ""PostalCode"": ""<string>""," + "\n" +
@" ""Phone"": ""<string>""," + "\n" +
@" ""Fax"": ""<string>""," + "\n" +
@" ""Mail"": ""<string>""," + "\n" +
@" ""WebSite"": ""<string>""" + "\n" +
@" }," + "\n" +
@" ""Notes"": [" + "\n" +
@" ""<string>""," + "\n" +
@" ""<string>""" + "\n" +
@" ]" + "\n" +
@" }" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '//einsurance/Send/Model',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"Insurance": {
"CustomerInfo": {
"Address": "<string>",
"City": "<string>",
"Country": "<string>",
"District": "<string>",
"Name": "<string>",
"TaxNumber": "99999999999",
"TaxOffice": "<string>",
"PartyIdentifications": [
{
"SchemeID": "<string>",
"Value": "<string>"
},
{
"SchemeID": "<string>",
"Value": "<string>"
}
],
"AgentPartyIdentifications": [
{
"SchemeID": "<string>",
"Value": "<string>"
},
{
"SchemeID": "<string>",
"Value": "<string>"
}
],
"PostalCode": "<string>",
"Phone": "<string>",
"Fax": "<string>",
"Mail": "<string>",
"WebSite": "<string>"
},
"InsuranceInfo": {
"CurrencyCode": "<string>",
"InsuranceSerieOrNumber": "E38_PCds",
"IssueDate": "<dateTime>",
"UUID": "<uuid>",
"TemplateUUID": "<uuid>",
"TemplateBase64String": "<string>",
"ExchangeRate": "<double>",
"InvoicePeriod": {
"Description": "<string>",
"EndDate": "<dateTime>",
"StartDate": "<dateTime>",
"StartTime": "<string>",
"EndTime": "<string>",
"DurationMeasureValue": "<double>"
}
},
"InsuranceLines": [
{
"Name": "<string>",
"CancelledCommissionAmount": "<double>",
"IssuedCommissionAmount": "<double>"
}
],
"CompanyInfo": {
"Address": "<string>",
"City": "<string>",
"Country": "<string>",
"District": "<string>",
"Name": "<string>",
"TaxNumber": "46844684468",
"TaxOffice": "<string>",
"PartyIdentifications": [
{
"SchemeID": "<string>",
"Value": "<string>"
},
{
"SchemeID": "<string>",
"Value": "<string>"
}
],
"AgentPartyIdentifications": [
{
"SchemeID": "<string>",
"Value": "<string>"
},
{
"SchemeID": "<string>",
"Value": "<string>"
}
],
"PostalCode": "<string>",
"Phone": "<string>",
"Fax": "<string>",
"Mail": "<string>",
"WebSite": "<string>"
},
"Notes": [
"<string>",
"<string>"
]
}
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: text/plain',
'Authorization: Bearer {{bearerToken}}'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
const axios = require('axios');
let data = JSON.stringify({
"Insurance": {
"CustomerInfo": {
"Address": "<string>",
"City": "<string>",
"Country": "<string>",
"District": "<string>",
"Name": "<string>",
"TaxNumber": "99999999999",
"TaxOffice": "<string>",
"PartyIdentifications": [
{
"SchemeID": "<string>",
"Value": "<string>"
},
{
"SchemeID": "<string>",
"Value": "<string>"
}
],
"AgentPartyIdentifications": [
{
"SchemeID": "<string>",
"Value": "<string>"
},
{
"SchemeID": "<string>",
"Value": "<string>"
}
],
"PostalCode": "<string>",
"Phone": "<string>",
"Fax": "<string>",
"Mail": "<string>",
"WebSite": "<string>"
},
"InsuranceInfo": {
"CurrencyCode": "<string>",
"InsuranceSerieOrNumber": "E38_PCds",
"IssueDate": "<dateTime>",
"UUID": "<uuid>",
"TemplateUUID": "<uuid>",
"TemplateBase64String": "<string>",
"ExchangeRate": "<double>",
"InvoicePeriod": {
"Description": "<string>",
"EndDate": "<dateTime>",
"StartDate": "<dateTime>",
"StartTime": "<string>",
"EndTime": "<string>",
"DurationMeasureValue": "<double>"
}
},
"InsuranceLines": [
{
"Name": "<string>",
"CancelledCommissionAmount": "<double>",
"IssuedCommissionAmount": "<double>"
}
],
"CompanyInfo": {
"Address": "<string>",
"City": "<string>",
"Country": "<string>",
"District": "<string>",
"Name": "<string>",
"TaxNumber": "46844684468",
"TaxOffice": "<string>",
"PartyIdentifications": [
{
"SchemeID": "<string>",
"Value": "<string>"
},
{
"SchemeID": "<string>",
"Value": "<string>"
}
],
"AgentPartyIdentifications": [
{
"SchemeID": "<string>",
"Value": "<string>"
},
{
"SchemeID": "<string>",
"Value": "<string>"
}
],
"PostalCode": "<string>",
"Phone": "<string>",
"Fax": "<string>",
"Mail": "<string>",
"WebSite": "<string>"
},
"Notes": [
"<string>",
"<string>"
]
}
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: '//einsurance/Send/Model',
headers: {
'Content-Type': 'application/json',
'Accept': 'text/plain',
'Authorization': 'Bearer {{bearerToken}}'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
POST /einsurance/Send/Model HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json-patch+json
Accept: */*
Content-Length: 1235
{
"Insurance": {
"InsuranceInfo": {
"UUID": "123e4567-e89b-12d3-a456-426614174000",
"TemplateUUID": "123e4567-e89b-12d3-a456-426614174000",
"TemplateBase64String": "text",
"InsuranceSerieOrNumber": "text",
"IssueDate": "2025-04-28T11:34:59.254Z",
"CurrencyCode": "text",
"ExchangeRate": 1,
"InvoicePeriod": {
"StartDate": "2025-04-28T11:34:59.254Z",
"StartTime": "text",
"EndDate": "2025-04-28T11:34:59.254Z",
"EndTime": "text",
"DurationMeasureValue": 1,
"Description": "text"
}
},
"CompanyInfo": {
"TaxNumber": "text",
"Name": "text",
"TaxOffice": "text",
"PartyIdentifications": [
{
"SchemeID": "text",
"Value": "text"
}
],
"AgentPartyIdentifications": [
{
"SchemeID": "text",
"Value": "text"
}
],
"Address": "text",
"District": "text",
"City": "text",
"Country": "text",
"PostalCode": "text",
"Phone": "text",
"Fax": "text",
"Mail": "text",
"WebSite": "text"
},
"CustomerInfo": {
"TaxNumber": "text",
"Name": "text",
"TaxOffice": "text",
"PartyIdentifications": [
{
"SchemeID": "text",
"Value": "text"
}
],
"AgentPartyIdentifications": [
{
"SchemeID": "text",
"Value": "text"
}
],
"Address": "text",
"District": "text",
"City": "text",
"Country": "text",
"PostalCode": "text",
"Phone": "text",
"Fax": "text",
"Mail": "text",
"WebSite": "text"
},
"InsuranceLines": [
{
"Name": "text",
"CancelledCommissionAmount": 1,
"IssuedCommissionAmount": 1
}
],
"Notes": [
"text"
]
}
}
SKG Belgesini model olarak gönderir.
{
"UUID": "123e4567-e89b-12d3-a456-426614174000",
"InsuranceNumber": "text"
}