curl --request POST \
--url https://api.noyax.com/api/v1/purchase-return-invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"InvoiceNumber": "FAT2026000125",
"Date": "2026-09-21T10:30:00",
"Lines": [
{
"UnitCode": "C62",
"CurrencyCode": "TRY",
"ProductCode": "URN-0001",
"ECommerceProductCode": null,
"Quantity": 10,
"UnitPrice": 100,
"GrossAmount": 1000,
"ExchangeRate": 1,
"DiscountRate": 10,
"DiscountAmount": 100,
"Discounts": [
{
"Rate": 10
}
],
"VatRate": 20,
"VatIncluded": true,
"VatAmount": 225,
"AmountExcludingTax": 900,
"AmountIncludingTax": 1350,
"VatBase": 1125,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "Main Warehouse",
"Description": "<string>",
"Description2": "<string>",
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123,
"AdditionalTaxes": [
{
"Code": "0071",
"Rate": 25,
"Amount": 225,
"Base": 900
}
],
"Lots": [
{
"LotNo": "<string>",
"Quantity": 123,
"UnitCode": "C62",
"SupplierLotNo": "<string>",
"ExpiryDate": "2023-11-07T05:31:56Z",
"Description": "<string>"
}
],
"SerialNumbers": [
"<string>"
],
"ExportInfo": {
"PackagingType": "<string>",
"DeliveryTerm": "<string>",
"TransportMode": 123,
"RequiredCustomsID": "<string>",
"DeliveryAddress_CityName": "<string>",
"DeliveryAddress_CitySubdivisionName": "<string>",
"DeliveryAddress_Country": "<string>",
"DeliveryAddress_StreetName": "<string>",
"DeliveryAddress_BuildingName": "<string>",
"DeliveryAddress_BuildingNumber": "<string>",
"DeliveryAddress_PostalCode": "<string>",
"TransportMeansID": "<string>",
"GrossWeightMeasure": 123,
"NetWeightMeasure": 123,
"PackageBrand": "<string>",
"PackageID": "<string>",
"PackageQuantity": 123
},
"MedicineDeviceInfo": {
"Ilaclar": [
{
"GTIN": "<string>",
"SN": "<string>",
"BN": "<string>",
"XD": "2023-11-07T05:31:56Z"
}
],
"TibbiCihazlar": [
{
"UNO": "<string>",
"LNO": "<string>",
"SNO": "<string>",
"URT": "2023-11-07T05:31:56Z"
}
]
},
"HalInfo": {
"KUNYENO": "<string>",
"MALSAHIBIVKNTCKN": "<string>",
"MALSAHIBIADSOYADUNVAN": "<string>"
},
"ProductInfo": {
"ModelName": "<string>",
"BrandName": "<string>",
"SellersItemIdentification": "<string>",
"BuyersItemIdentification": "<string>",
"ManufacturersItemIdentification": "<string>",
"OriginCountryCode": "<string>",
"OriginCountryName": "<string>",
"ProductTraceID": "<string>",
"CommodityClassification": "<string>"
}
}
]
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/purchase-return-invoices");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-UserID", "<x-userid>");
request.AddHeader("X-CompanyID", "<x-companyid>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"InvoiceNumber\": \"FAT2026000125\",\n \"Date\": \"2026-09-21T10:30:00\",\n \"Lines\": [\n {\n \"UnitCode\": \"C62\",\n \"CurrencyCode\": \"TRY\",\n \"ProductCode\": \"URN-0001\",\n \"ECommerceProductCode\": null,\n \"Quantity\": 10,\n \"UnitPrice\": 100,\n \"GrossAmount\": 1000,\n \"ExchangeRate\": 1,\n \"DiscountRate\": 10,\n \"DiscountAmount\": 100,\n \"Discounts\": [\n {\n \"Rate\": 10\n }\n ],\n \"VatRate\": 20,\n \"VatIncluded\": true,\n \"VatAmount\": 225,\n \"AmountExcludingTax\": 900,\n \"AmountIncludingTax\": 1350,\n \"VatBase\": 1125,\n \"VatExemptionCode\": \"<string>\",\n \"LineGroupName\": \"<string>\",\n \"WarehouseName\": \"Main Warehouse\",\n \"Description\": \"<string>\",\n \"Description2\": \"<string>\",\n \"WithholdingCode\": \"<string>\",\n \"WithholdingNumerator\": 123,\n \"WithholdingDenominator\": 123,\n \"WithheldVatAmount\": 123,\n \"AdditionalTaxes\": [\n {\n \"Code\": \"0071\",\n \"Rate\": 25,\n \"Amount\": 225,\n \"Base\": 900\n }\n ],\n \"Lots\": [\n {\n \"LotNo\": \"<string>\",\n \"Quantity\": 123,\n \"UnitCode\": \"C62\",\n \"SupplierLotNo\": \"<string>\",\n \"ExpiryDate\": \"2023-11-07T05:31:56Z\",\n \"Description\": \"<string>\"\n }\n ],\n \"SerialNumbers\": [\n \"<string>\"\n ],\n \"ExportInfo\": {\n \"PackagingType\": \"<string>\",\n \"DeliveryTerm\": \"<string>\",\n \"TransportMode\": 123,\n \"RequiredCustomsID\": \"<string>\",\n \"DeliveryAddress_CityName\": \"<string>\",\n \"DeliveryAddress_CitySubdivisionName\": \"<string>\",\n \"DeliveryAddress_Country\": \"<string>\",\n \"DeliveryAddress_StreetName\": \"<string>\",\n \"DeliveryAddress_BuildingName\": \"<string>\",\n \"DeliveryAddress_BuildingNumber\": \"<string>\",\n \"DeliveryAddress_PostalCode\": \"<string>\",\n \"TransportMeansID\": \"<string>\",\n \"GrossWeightMeasure\": 123,\n \"NetWeightMeasure\": 123,\n \"PackageBrand\": \"<string>\",\n \"PackageID\": \"<string>\",\n \"PackageQuantity\": 123\n },\n \"MedicineDeviceInfo\": {\n \"Ilaclar\": [\n {\n \"GTIN\": \"<string>\",\n \"SN\": \"<string>\",\n \"BN\": \"<string>\",\n \"XD\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"TibbiCihazlar\": [\n {\n \"UNO\": \"<string>\",\n \"LNO\": \"<string>\",\n \"SNO\": \"<string>\",\n \"URT\": \"2023-11-07T05:31:56Z\"\n }\n ]\n },\n \"HalInfo\": {\n \"KUNYENO\": \"<string>\",\n \"MALSAHIBIVKNTCKN\": \"<string>\",\n \"MALSAHIBIADSOYADUNVAN\": \"<string>\"\n },\n \"ProductInfo\": {\n \"ModelName\": \"<string>\",\n \"BrandName\": \"<string>\",\n \"SellersItemIdentification\": \"<string>\",\n \"BuyersItemIdentification\": \"<string>\",\n \"ManufacturersItemIdentification\": \"<string>\",\n \"OriginCountryCode\": \"<string>\",\n \"OriginCountryName\": \"<string>\",\n \"ProductTraceID\": \"<string>\",\n \"CommodityClassification\": \"<string>\"\n }\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'POST',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
InvoiceNumber: 'FAT2026000125',
Date: '2026-09-21T10:30:00',
Lines: [
{
UnitCode: 'C62',
CurrencyCode: 'TRY',
ProductCode: 'URN-0001',
ECommerceProductCode: null,
Quantity: 10,
UnitPrice: 100,
GrossAmount: 1000,
ExchangeRate: 1,
DiscountRate: 10,
DiscountAmount: 100,
Discounts: [{Rate: 10}],
VatRate: 20,
VatIncluded: true,
VatAmount: 225,
AmountExcludingTax: 900,
AmountIncludingTax: 1350,
VatBase: 1125,
VatExemptionCode: '<string>',
LineGroupName: '<string>',
WarehouseName: 'Main Warehouse',
Description: '<string>',
Description2: '<string>',
WithholdingCode: '<string>',
WithholdingNumerator: 123,
WithholdingDenominator: 123,
WithheldVatAmount: 123,
AdditionalTaxes: [{Code: '0071', Rate: 25, Amount: 225, Base: 900}],
Lots: [
{
LotNo: '<string>',
Quantity: 123,
UnitCode: 'C62',
SupplierLotNo: '<string>',
ExpiryDate: '2023-11-07T05:31:56Z',
Description: '<string>'
}
],
SerialNumbers: ['<string>'],
ExportInfo: {
PackagingType: '<string>',
DeliveryTerm: '<string>',
TransportMode: 123,
RequiredCustomsID: '<string>',
DeliveryAddress_CityName: '<string>',
DeliveryAddress_CitySubdivisionName: '<string>',
DeliveryAddress_Country: '<string>',
DeliveryAddress_StreetName: '<string>',
DeliveryAddress_BuildingName: '<string>',
DeliveryAddress_BuildingNumber: '<string>',
DeliveryAddress_PostalCode: '<string>',
TransportMeansID: '<string>',
GrossWeightMeasure: 123,
NetWeightMeasure: 123,
PackageBrand: '<string>',
PackageID: '<string>',
PackageQuantity: 123
},
MedicineDeviceInfo: {
Ilaclar: [{GTIN: '<string>', SN: '<string>', BN: '<string>', XD: '2023-11-07T05:31:56Z'}],
TibbiCihazlar: [
{UNO: '<string>', LNO: '<string>', SNO: '<string>', URT: '2023-11-07T05:31:56Z'}
]
},
HalInfo: {
KUNYENO: '<string>',
MALSAHIBIVKNTCKN: '<string>',
MALSAHIBIADSOYADUNVAN: '<string>'
},
ProductInfo: {
ModelName: '<string>',
BrandName: '<string>',
SellersItemIdentification: '<string>',
BuyersItemIdentification: '<string>',
ManufacturersItemIdentification: '<string>',
OriginCountryCode: '<string>',
OriginCountryName: '<string>',
ProductTraceID: '<string>',
CommodityClassification: '<string>'
}
}
]
})
};
fetch('https://api.noyax.com/api/v1/purchase-return-invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/purchase-return-invoices"
payload = {
"InvoiceNumber": "FAT2026000125",
"Date": "2026-09-21T10:30:00",
"Lines": [
{
"UnitCode": "C62",
"CurrencyCode": "TRY",
"ProductCode": "URN-0001",
"ECommerceProductCode": None,
"Quantity": 10,
"UnitPrice": 100,
"GrossAmount": 1000,
"ExchangeRate": 1,
"DiscountRate": 10,
"DiscountAmount": 100,
"Discounts": [{ "Rate": 10 }],
"VatRate": 20,
"VatIncluded": True,
"VatAmount": 225,
"AmountExcludingTax": 900,
"AmountIncludingTax": 1350,
"VatBase": 1125,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "Main Warehouse",
"Description": "<string>",
"Description2": "<string>",
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123,
"AdditionalTaxes": [
{
"Code": "0071",
"Rate": 25,
"Amount": 225,
"Base": 900
}
],
"Lots": [
{
"LotNo": "<string>",
"Quantity": 123,
"UnitCode": "C62",
"SupplierLotNo": "<string>",
"ExpiryDate": "2023-11-07T05:31:56Z",
"Description": "<string>"
}
],
"SerialNumbers": ["<string>"],
"ExportInfo": {
"PackagingType": "<string>",
"DeliveryTerm": "<string>",
"TransportMode": 123,
"RequiredCustomsID": "<string>",
"DeliveryAddress_CityName": "<string>",
"DeliveryAddress_CitySubdivisionName": "<string>",
"DeliveryAddress_Country": "<string>",
"DeliveryAddress_StreetName": "<string>",
"DeliveryAddress_BuildingName": "<string>",
"DeliveryAddress_BuildingNumber": "<string>",
"DeliveryAddress_PostalCode": "<string>",
"TransportMeansID": "<string>",
"GrossWeightMeasure": 123,
"NetWeightMeasure": 123,
"PackageBrand": "<string>",
"PackageID": "<string>",
"PackageQuantity": 123
},
"MedicineDeviceInfo": {
"Ilaclar": [
{
"GTIN": "<string>",
"SN": "<string>",
"BN": "<string>",
"XD": "2023-11-07T05:31:56Z"
}
],
"TibbiCihazlar": [
{
"UNO": "<string>",
"LNO": "<string>",
"SNO": "<string>",
"URT": "2023-11-07T05:31:56Z"
}
]
},
"HalInfo": {
"KUNYENO": "<string>",
"MALSAHIBIVKNTCKN": "<string>",
"MALSAHIBIADSOYADUNVAN": "<string>"
},
"ProductInfo": {
"ModelName": "<string>",
"BrandName": "<string>",
"SellersItemIdentification": "<string>",
"BuyersItemIdentification": "<string>",
"ManufacturersItemIdentification": "<string>",
"OriginCountryCode": "<string>",
"OriginCountryName": "<string>",
"ProductTraceID": "<string>",
"CommodityClassification": "<string>"
}
}
]
}
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"Success": true,
"ResultCode": "0000",
"Data": {
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerName": "<string>",
"Cancelled": true,
"CurrencyCode": "TRY",
"ShipmentDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Address": "<string>",
"CustomerTitle": "<string>",
"TaxNumber": "<string>",
"TaxOffice": "<string>",
"EInvoiceType": 2,
"InvoiceNumber": "FAT2026000125",
"DocumentNumber": "<string>",
"Date": "2026-09-21T10:30:00",
"Description": "<string>",
"CustomerCode": "C-0001",
"DueDays": 123,
"SharingCode": "<string>",
"ShipmentDefinitionCode": "<string>",
"DiscountTotal": 100,
"SubTotal": 900,
"VatTotal": 225,
"GrandTotal": 1350,
"Consolidated": true,
"PrintDescription": true,
"ApplyWithholding": true,
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithholdingTotal": 0,
"AdditionalTaxTotal": 225,
"ProfileId": "<string>",
"InvoiceTypeCode": "<string>",
"WithholdingTaxRate": 123,
"SocialSecurityRate": 123,
"MarketRate": 123,
"ReturnedInvoiceNumber": "<string>",
"ReturnedInvoiceDate": "2026-10-15",
"OrderReferenceNumber": "<string>",
"OrderReferenceDate": "2026-10-15",
"BranchNumber": "<string>",
"BranchTitle": "<string>",
"BranchAddress": "<string>",
"InvestmentIncentiveDocumentNumber": "<string>",
"InvestmentIncentiveDocumentDate": "2026-10-15",
"EnergyPeriodStart": "2023-11-07T05:31:56Z",
"EnergyPeriodEnd": "2023-11-07T05:31:56Z",
"DeliveryInfo": {
"DeliveryTerm": "<string>",
"TransportModeCode": 123,
"Country": "<string>",
"CityName": "<string>",
"CitySubdivisionName": "<string>",
"StreetName": "<string>",
"BuildingName": "<string>",
"BuildingNumber": "<string>",
"PostalZone": "<string>",
"TransportMeans": "<string>",
"DeclaredForCarriageValueAmount": 123,
"DeliveryInsuranceValue": 123
},
"PaymentMeans": [
{
"PaymentMeansCode": "<string>",
"PayeeFinancialAccountID": "<string>",
"CurrencyCode": "<string>"
}
],
"ReferencedDespatches": [
{
"ID": "<string>",
"IssueDate": "2023-11-07T05:31:56Z"
}
],
"CustomerIdentitySchemes": [
{
"SchemeID": "<string>",
"Value": "<string>"
}
],
"PublicSectorSpendingUnit": {
"BCP_Name": "<string>",
"BCP_VKN": "<string>",
"BCP_Country": "<string>",
"BCP_CityName": "<string>",
"BCP_CitySubdivisionName": "<string>"
},
"SgkInfo": {
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z",
"MukellefKodu": "<string>",
"MukellefAdi": "<string>",
"DosyaNo": "<string>",
"FaturaAltTipi": "<string>"
},
"AverageExchangeRate": 1,
"CreateDate": "2023-11-07T05:31:56Z",
"ModifyDate": "2023-11-07T05:31:56Z",
"Lines": [
{
"ProductId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"LineGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"WarehouseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ProductName": "<string>",
"UnitName": "ADET",
"MainUnitQuantity": 10,
"ProductCode": "URN-0001",
"ECommerceProductCode": null,
"UnitCode": "C62",
"Quantity": 10,
"UnitPrice": 100,
"GrossAmount": 1000,
"CurrencyCode": "TRY",
"ExchangeRate": 1,
"DiscountRate": 10,
"DiscountAmount": 100,
"Discounts": [
{
"Rate": 10
}
],
"VatRate": 20,
"VatIncluded": true,
"VatAmount": 225,
"AmountExcludingTax": 900,
"AmountIncludingTax": 1350,
"VatBase": 1125,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "Main Warehouse",
"Description": "<string>",
"Description2": "<string>",
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123,
"AdditionalTaxes": [
{
"Code": "0071",
"Rate": 25,
"Amount": 225,
"Base": 900
}
],
"Lots": [
{
"LotNo": "<string>",
"Quantity": 123,
"UnitCode": "C62",
"SupplierLotNo": "<string>",
"ExpiryDate": "2023-11-07T05:31:56Z",
"Description": "<string>"
}
],
"SerialNumbers": [
"<string>"
],
"ExportInfo": {
"PackagingType": "<string>",
"DeliveryTerm": "<string>",
"TransportMode": 123,
"RequiredCustomsID": "<string>",
"DeliveryAddress_CityName": "<string>",
"DeliveryAddress_CitySubdivisionName": "<string>",
"DeliveryAddress_Country": "<string>",
"DeliveryAddress_StreetName": "<string>",
"DeliveryAddress_BuildingName": "<string>",
"DeliveryAddress_BuildingNumber": "<string>",
"DeliveryAddress_PostalCode": "<string>",
"TransportMeansID": "<string>",
"GrossWeightMeasure": 123,
"NetWeightMeasure": 123,
"PackageBrand": "<string>",
"PackageID": "<string>",
"PackageQuantity": 123
},
"MedicineDeviceInfo": {
"Ilaclar": [
{
"GTIN": "<string>",
"SN": "<string>",
"BN": "<string>",
"XD": "2023-11-07T05:31:56Z"
}
],
"TibbiCihazlar": [
{
"UNO": "<string>",
"LNO": "<string>",
"SNO": "<string>",
"URT": "2023-11-07T05:31:56Z"
}
]
},
"HalInfo": {
"KUNYENO": "<string>",
"MALSAHIBIVKNTCKN": "<string>",
"MALSAHIBIADSOYADUNVAN": "<string>"
},
"ProductInfo": {
"ModelName": "<string>",
"BrandName": "<string>",
"SellersItemIdentification": "<string>",
"BuyersItemIdentification": "<string>",
"ManufacturersItemIdentification": "<string>",
"OriginCountryCode": "<string>",
"OriginCountryName": "<string>",
"ProductTraceID": "<string>",
"CommodityClassification": "<string>"
}
}
]
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "3010",
"Message": "At least one line is required.",
"Errors": [
{
"Code": "3010",
"Message": "At least one line is required."
}
]
}{
"Success": false,
"ResultCode": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token.",
"Errors": [
{
"Code": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token."
}
]
}{
"Success": false,
"ResultCode": "0110",
"Message": "You do not have permission for this operation.",
"Errors": [
{
"Code": "0110",
"Message": "You do not have permission for this operation."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}Create purchase return invoice
Creates the purchase return invoice and its lines in one transaction.
curl --request POST \
--url https://api.noyax.com/api/v1/purchase-return-invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"InvoiceNumber": "FAT2026000125",
"Date": "2026-09-21T10:30:00",
"Lines": [
{
"UnitCode": "C62",
"CurrencyCode": "TRY",
"ProductCode": "URN-0001",
"ECommerceProductCode": null,
"Quantity": 10,
"UnitPrice": 100,
"GrossAmount": 1000,
"ExchangeRate": 1,
"DiscountRate": 10,
"DiscountAmount": 100,
"Discounts": [
{
"Rate": 10
}
],
"VatRate": 20,
"VatIncluded": true,
"VatAmount": 225,
"AmountExcludingTax": 900,
"AmountIncludingTax": 1350,
"VatBase": 1125,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "Main Warehouse",
"Description": "<string>",
"Description2": "<string>",
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123,
"AdditionalTaxes": [
{
"Code": "0071",
"Rate": 25,
"Amount": 225,
"Base": 900
}
],
"Lots": [
{
"LotNo": "<string>",
"Quantity": 123,
"UnitCode": "C62",
"SupplierLotNo": "<string>",
"ExpiryDate": "2023-11-07T05:31:56Z",
"Description": "<string>"
}
],
"SerialNumbers": [
"<string>"
],
"ExportInfo": {
"PackagingType": "<string>",
"DeliveryTerm": "<string>",
"TransportMode": 123,
"RequiredCustomsID": "<string>",
"DeliveryAddress_CityName": "<string>",
"DeliveryAddress_CitySubdivisionName": "<string>",
"DeliveryAddress_Country": "<string>",
"DeliveryAddress_StreetName": "<string>",
"DeliveryAddress_BuildingName": "<string>",
"DeliveryAddress_BuildingNumber": "<string>",
"DeliveryAddress_PostalCode": "<string>",
"TransportMeansID": "<string>",
"GrossWeightMeasure": 123,
"NetWeightMeasure": 123,
"PackageBrand": "<string>",
"PackageID": "<string>",
"PackageQuantity": 123
},
"MedicineDeviceInfo": {
"Ilaclar": [
{
"GTIN": "<string>",
"SN": "<string>",
"BN": "<string>",
"XD": "2023-11-07T05:31:56Z"
}
],
"TibbiCihazlar": [
{
"UNO": "<string>",
"LNO": "<string>",
"SNO": "<string>",
"URT": "2023-11-07T05:31:56Z"
}
]
},
"HalInfo": {
"KUNYENO": "<string>",
"MALSAHIBIVKNTCKN": "<string>",
"MALSAHIBIADSOYADUNVAN": "<string>"
},
"ProductInfo": {
"ModelName": "<string>",
"BrandName": "<string>",
"SellersItemIdentification": "<string>",
"BuyersItemIdentification": "<string>",
"ManufacturersItemIdentification": "<string>",
"OriginCountryCode": "<string>",
"OriginCountryName": "<string>",
"ProductTraceID": "<string>",
"CommodityClassification": "<string>"
}
}
]
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/purchase-return-invoices");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-UserID", "<x-userid>");
request.AddHeader("X-CompanyID", "<x-companyid>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"InvoiceNumber\": \"FAT2026000125\",\n \"Date\": \"2026-09-21T10:30:00\",\n \"Lines\": [\n {\n \"UnitCode\": \"C62\",\n \"CurrencyCode\": \"TRY\",\n \"ProductCode\": \"URN-0001\",\n \"ECommerceProductCode\": null,\n \"Quantity\": 10,\n \"UnitPrice\": 100,\n \"GrossAmount\": 1000,\n \"ExchangeRate\": 1,\n \"DiscountRate\": 10,\n \"DiscountAmount\": 100,\n \"Discounts\": [\n {\n \"Rate\": 10\n }\n ],\n \"VatRate\": 20,\n \"VatIncluded\": true,\n \"VatAmount\": 225,\n \"AmountExcludingTax\": 900,\n \"AmountIncludingTax\": 1350,\n \"VatBase\": 1125,\n \"VatExemptionCode\": \"<string>\",\n \"LineGroupName\": \"<string>\",\n \"WarehouseName\": \"Main Warehouse\",\n \"Description\": \"<string>\",\n \"Description2\": \"<string>\",\n \"WithholdingCode\": \"<string>\",\n \"WithholdingNumerator\": 123,\n \"WithholdingDenominator\": 123,\n \"WithheldVatAmount\": 123,\n \"AdditionalTaxes\": [\n {\n \"Code\": \"0071\",\n \"Rate\": 25,\n \"Amount\": 225,\n \"Base\": 900\n }\n ],\n \"Lots\": [\n {\n \"LotNo\": \"<string>\",\n \"Quantity\": 123,\n \"UnitCode\": \"C62\",\n \"SupplierLotNo\": \"<string>\",\n \"ExpiryDate\": \"2023-11-07T05:31:56Z\",\n \"Description\": \"<string>\"\n }\n ],\n \"SerialNumbers\": [\n \"<string>\"\n ],\n \"ExportInfo\": {\n \"PackagingType\": \"<string>\",\n \"DeliveryTerm\": \"<string>\",\n \"TransportMode\": 123,\n \"RequiredCustomsID\": \"<string>\",\n \"DeliveryAddress_CityName\": \"<string>\",\n \"DeliveryAddress_CitySubdivisionName\": \"<string>\",\n \"DeliveryAddress_Country\": \"<string>\",\n \"DeliveryAddress_StreetName\": \"<string>\",\n \"DeliveryAddress_BuildingName\": \"<string>\",\n \"DeliveryAddress_BuildingNumber\": \"<string>\",\n \"DeliveryAddress_PostalCode\": \"<string>\",\n \"TransportMeansID\": \"<string>\",\n \"GrossWeightMeasure\": 123,\n \"NetWeightMeasure\": 123,\n \"PackageBrand\": \"<string>\",\n \"PackageID\": \"<string>\",\n \"PackageQuantity\": 123\n },\n \"MedicineDeviceInfo\": {\n \"Ilaclar\": [\n {\n \"GTIN\": \"<string>\",\n \"SN\": \"<string>\",\n \"BN\": \"<string>\",\n \"XD\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"TibbiCihazlar\": [\n {\n \"UNO\": \"<string>\",\n \"LNO\": \"<string>\",\n \"SNO\": \"<string>\",\n \"URT\": \"2023-11-07T05:31:56Z\"\n }\n ]\n },\n \"HalInfo\": {\n \"KUNYENO\": \"<string>\",\n \"MALSAHIBIVKNTCKN\": \"<string>\",\n \"MALSAHIBIADSOYADUNVAN\": \"<string>\"\n },\n \"ProductInfo\": {\n \"ModelName\": \"<string>\",\n \"BrandName\": \"<string>\",\n \"SellersItemIdentification\": \"<string>\",\n \"BuyersItemIdentification\": \"<string>\",\n \"ManufacturersItemIdentification\": \"<string>\",\n \"OriginCountryCode\": \"<string>\",\n \"OriginCountryName\": \"<string>\",\n \"ProductTraceID\": \"<string>\",\n \"CommodityClassification\": \"<string>\"\n }\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'POST',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
InvoiceNumber: 'FAT2026000125',
Date: '2026-09-21T10:30:00',
Lines: [
{
UnitCode: 'C62',
CurrencyCode: 'TRY',
ProductCode: 'URN-0001',
ECommerceProductCode: null,
Quantity: 10,
UnitPrice: 100,
GrossAmount: 1000,
ExchangeRate: 1,
DiscountRate: 10,
DiscountAmount: 100,
Discounts: [{Rate: 10}],
VatRate: 20,
VatIncluded: true,
VatAmount: 225,
AmountExcludingTax: 900,
AmountIncludingTax: 1350,
VatBase: 1125,
VatExemptionCode: '<string>',
LineGroupName: '<string>',
WarehouseName: 'Main Warehouse',
Description: '<string>',
Description2: '<string>',
WithholdingCode: '<string>',
WithholdingNumerator: 123,
WithholdingDenominator: 123,
WithheldVatAmount: 123,
AdditionalTaxes: [{Code: '0071', Rate: 25, Amount: 225, Base: 900}],
Lots: [
{
LotNo: '<string>',
Quantity: 123,
UnitCode: 'C62',
SupplierLotNo: '<string>',
ExpiryDate: '2023-11-07T05:31:56Z',
Description: '<string>'
}
],
SerialNumbers: ['<string>'],
ExportInfo: {
PackagingType: '<string>',
DeliveryTerm: '<string>',
TransportMode: 123,
RequiredCustomsID: '<string>',
DeliveryAddress_CityName: '<string>',
DeliveryAddress_CitySubdivisionName: '<string>',
DeliveryAddress_Country: '<string>',
DeliveryAddress_StreetName: '<string>',
DeliveryAddress_BuildingName: '<string>',
DeliveryAddress_BuildingNumber: '<string>',
DeliveryAddress_PostalCode: '<string>',
TransportMeansID: '<string>',
GrossWeightMeasure: 123,
NetWeightMeasure: 123,
PackageBrand: '<string>',
PackageID: '<string>',
PackageQuantity: 123
},
MedicineDeviceInfo: {
Ilaclar: [{GTIN: '<string>', SN: '<string>', BN: '<string>', XD: '2023-11-07T05:31:56Z'}],
TibbiCihazlar: [
{UNO: '<string>', LNO: '<string>', SNO: '<string>', URT: '2023-11-07T05:31:56Z'}
]
},
HalInfo: {
KUNYENO: '<string>',
MALSAHIBIVKNTCKN: '<string>',
MALSAHIBIADSOYADUNVAN: '<string>'
},
ProductInfo: {
ModelName: '<string>',
BrandName: '<string>',
SellersItemIdentification: '<string>',
BuyersItemIdentification: '<string>',
ManufacturersItemIdentification: '<string>',
OriginCountryCode: '<string>',
OriginCountryName: '<string>',
ProductTraceID: '<string>',
CommodityClassification: '<string>'
}
}
]
})
};
fetch('https://api.noyax.com/api/v1/purchase-return-invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/purchase-return-invoices"
payload = {
"InvoiceNumber": "FAT2026000125",
"Date": "2026-09-21T10:30:00",
"Lines": [
{
"UnitCode": "C62",
"CurrencyCode": "TRY",
"ProductCode": "URN-0001",
"ECommerceProductCode": None,
"Quantity": 10,
"UnitPrice": 100,
"GrossAmount": 1000,
"ExchangeRate": 1,
"DiscountRate": 10,
"DiscountAmount": 100,
"Discounts": [{ "Rate": 10 }],
"VatRate": 20,
"VatIncluded": True,
"VatAmount": 225,
"AmountExcludingTax": 900,
"AmountIncludingTax": 1350,
"VatBase": 1125,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "Main Warehouse",
"Description": "<string>",
"Description2": "<string>",
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123,
"AdditionalTaxes": [
{
"Code": "0071",
"Rate": 25,
"Amount": 225,
"Base": 900
}
],
"Lots": [
{
"LotNo": "<string>",
"Quantity": 123,
"UnitCode": "C62",
"SupplierLotNo": "<string>",
"ExpiryDate": "2023-11-07T05:31:56Z",
"Description": "<string>"
}
],
"SerialNumbers": ["<string>"],
"ExportInfo": {
"PackagingType": "<string>",
"DeliveryTerm": "<string>",
"TransportMode": 123,
"RequiredCustomsID": "<string>",
"DeliveryAddress_CityName": "<string>",
"DeliveryAddress_CitySubdivisionName": "<string>",
"DeliveryAddress_Country": "<string>",
"DeliveryAddress_StreetName": "<string>",
"DeliveryAddress_BuildingName": "<string>",
"DeliveryAddress_BuildingNumber": "<string>",
"DeliveryAddress_PostalCode": "<string>",
"TransportMeansID": "<string>",
"GrossWeightMeasure": 123,
"NetWeightMeasure": 123,
"PackageBrand": "<string>",
"PackageID": "<string>",
"PackageQuantity": 123
},
"MedicineDeviceInfo": {
"Ilaclar": [
{
"GTIN": "<string>",
"SN": "<string>",
"BN": "<string>",
"XD": "2023-11-07T05:31:56Z"
}
],
"TibbiCihazlar": [
{
"UNO": "<string>",
"LNO": "<string>",
"SNO": "<string>",
"URT": "2023-11-07T05:31:56Z"
}
]
},
"HalInfo": {
"KUNYENO": "<string>",
"MALSAHIBIVKNTCKN": "<string>",
"MALSAHIBIADSOYADUNVAN": "<string>"
},
"ProductInfo": {
"ModelName": "<string>",
"BrandName": "<string>",
"SellersItemIdentification": "<string>",
"BuyersItemIdentification": "<string>",
"ManufacturersItemIdentification": "<string>",
"OriginCountryCode": "<string>",
"OriginCountryName": "<string>",
"ProductTraceID": "<string>",
"CommodityClassification": "<string>"
}
}
]
}
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"Success": true,
"ResultCode": "0000",
"Data": {
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerName": "<string>",
"Cancelled": true,
"CurrencyCode": "TRY",
"ShipmentDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Address": "<string>",
"CustomerTitle": "<string>",
"TaxNumber": "<string>",
"TaxOffice": "<string>",
"EInvoiceType": 2,
"InvoiceNumber": "FAT2026000125",
"DocumentNumber": "<string>",
"Date": "2026-09-21T10:30:00",
"Description": "<string>",
"CustomerCode": "C-0001",
"DueDays": 123,
"SharingCode": "<string>",
"ShipmentDefinitionCode": "<string>",
"DiscountTotal": 100,
"SubTotal": 900,
"VatTotal": 225,
"GrandTotal": 1350,
"Consolidated": true,
"PrintDescription": true,
"ApplyWithholding": true,
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithholdingTotal": 0,
"AdditionalTaxTotal": 225,
"ProfileId": "<string>",
"InvoiceTypeCode": "<string>",
"WithholdingTaxRate": 123,
"SocialSecurityRate": 123,
"MarketRate": 123,
"ReturnedInvoiceNumber": "<string>",
"ReturnedInvoiceDate": "2026-10-15",
"OrderReferenceNumber": "<string>",
"OrderReferenceDate": "2026-10-15",
"BranchNumber": "<string>",
"BranchTitle": "<string>",
"BranchAddress": "<string>",
"InvestmentIncentiveDocumentNumber": "<string>",
"InvestmentIncentiveDocumentDate": "2026-10-15",
"EnergyPeriodStart": "2023-11-07T05:31:56Z",
"EnergyPeriodEnd": "2023-11-07T05:31:56Z",
"DeliveryInfo": {
"DeliveryTerm": "<string>",
"TransportModeCode": 123,
"Country": "<string>",
"CityName": "<string>",
"CitySubdivisionName": "<string>",
"StreetName": "<string>",
"BuildingName": "<string>",
"BuildingNumber": "<string>",
"PostalZone": "<string>",
"TransportMeans": "<string>",
"DeclaredForCarriageValueAmount": 123,
"DeliveryInsuranceValue": 123
},
"PaymentMeans": [
{
"PaymentMeansCode": "<string>",
"PayeeFinancialAccountID": "<string>",
"CurrencyCode": "<string>"
}
],
"ReferencedDespatches": [
{
"ID": "<string>",
"IssueDate": "2023-11-07T05:31:56Z"
}
],
"CustomerIdentitySchemes": [
{
"SchemeID": "<string>",
"Value": "<string>"
}
],
"PublicSectorSpendingUnit": {
"BCP_Name": "<string>",
"BCP_VKN": "<string>",
"BCP_Country": "<string>",
"BCP_CityName": "<string>",
"BCP_CitySubdivisionName": "<string>"
},
"SgkInfo": {
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z",
"MukellefKodu": "<string>",
"MukellefAdi": "<string>",
"DosyaNo": "<string>",
"FaturaAltTipi": "<string>"
},
"AverageExchangeRate": 1,
"CreateDate": "2023-11-07T05:31:56Z",
"ModifyDate": "2023-11-07T05:31:56Z",
"Lines": [
{
"ProductId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"LineGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"WarehouseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ProductName": "<string>",
"UnitName": "ADET",
"MainUnitQuantity": 10,
"ProductCode": "URN-0001",
"ECommerceProductCode": null,
"UnitCode": "C62",
"Quantity": 10,
"UnitPrice": 100,
"GrossAmount": 1000,
"CurrencyCode": "TRY",
"ExchangeRate": 1,
"DiscountRate": 10,
"DiscountAmount": 100,
"Discounts": [
{
"Rate": 10
}
],
"VatRate": 20,
"VatIncluded": true,
"VatAmount": 225,
"AmountExcludingTax": 900,
"AmountIncludingTax": 1350,
"VatBase": 1125,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "Main Warehouse",
"Description": "<string>",
"Description2": "<string>",
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123,
"AdditionalTaxes": [
{
"Code": "0071",
"Rate": 25,
"Amount": 225,
"Base": 900
}
],
"Lots": [
{
"LotNo": "<string>",
"Quantity": 123,
"UnitCode": "C62",
"SupplierLotNo": "<string>",
"ExpiryDate": "2023-11-07T05:31:56Z",
"Description": "<string>"
}
],
"SerialNumbers": [
"<string>"
],
"ExportInfo": {
"PackagingType": "<string>",
"DeliveryTerm": "<string>",
"TransportMode": 123,
"RequiredCustomsID": "<string>",
"DeliveryAddress_CityName": "<string>",
"DeliveryAddress_CitySubdivisionName": "<string>",
"DeliveryAddress_Country": "<string>",
"DeliveryAddress_StreetName": "<string>",
"DeliveryAddress_BuildingName": "<string>",
"DeliveryAddress_BuildingNumber": "<string>",
"DeliveryAddress_PostalCode": "<string>",
"TransportMeansID": "<string>",
"GrossWeightMeasure": 123,
"NetWeightMeasure": 123,
"PackageBrand": "<string>",
"PackageID": "<string>",
"PackageQuantity": 123
},
"MedicineDeviceInfo": {
"Ilaclar": [
{
"GTIN": "<string>",
"SN": "<string>",
"BN": "<string>",
"XD": "2023-11-07T05:31:56Z"
}
],
"TibbiCihazlar": [
{
"UNO": "<string>",
"LNO": "<string>",
"SNO": "<string>",
"URT": "2023-11-07T05:31:56Z"
}
]
},
"HalInfo": {
"KUNYENO": "<string>",
"MALSAHIBIVKNTCKN": "<string>",
"MALSAHIBIADSOYADUNVAN": "<string>"
},
"ProductInfo": {
"ModelName": "<string>",
"BrandName": "<string>",
"SellersItemIdentification": "<string>",
"BuyersItemIdentification": "<string>",
"ManufacturersItemIdentification": "<string>",
"OriginCountryCode": "<string>",
"OriginCountryName": "<string>",
"ProductTraceID": "<string>",
"CommodityClassification": "<string>"
}
}
]
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "3010",
"Message": "At least one line is required.",
"Errors": [
{
"Code": "3010",
"Message": "At least one line is required."
}
]
}{
"Success": false,
"ResultCode": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token.",
"Errors": [
{
"Code": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token."
}
]
}{
"Success": false,
"ResultCode": "0110",
"Message": "You do not have permission for this operation.",
"Errors": [
{
"Code": "0110",
"Message": "You do not have permission for this operation."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}Message. Line errors start with the line number, for example Line 2: Quantity must be greater than 0.
Field rules
Calculations
3126); see calculations. The invoice totals, AverageExchangeRate and the header’s withholding fields are filled from the lines. Send UnitPrice excluding VAT."Next"generates the number from the series shared with sales invoices — see numbering.- The customer is given with
CustomerCodeor, when you only have it, the customer’s tax number (CustomerTaxNumber); one of them is required andCustomerCodewins when both are sent. If more than one customer has the tax number, the request is rejected as ambiguous (0580); sendCustomerCodeinstead. - The customer’s address, title, tax number and tax office are copied from the customer and are not accepted in the request.
- The invoice always records a customer ledger entry (a debit).
- A successful response is 201 Created; the
Locationheader points to the new invoice.
Minimal request
A request with only the required fields; the line amounts add up (the API checks them) and the header totals are filled from the lines. Replace the codes and names with those of your own company.WarehouseName is required for products that track stock; for a Lot- or serial-tracked product the line must also carry Lots or SerialNumbers. If your company uses e-Invoice, ProfileId (e.g. TEMELFATURA) and InvoiceTypeCode (IADE or TEVKIFATIADE) are also required.
{
"InvoiceNumber": "Next",
"Date": "2026-09-29T10:30:00",
"CustomerCode": "C-0001",
"Lines": [
{
"ProductCode": "URN-0001",
"UnitCode": "C62",
"Quantity": 2,
"UnitPrice": 100,
"CurrencyCode": "TRY",
"ExchangeRate": 1,
"VatRate": 20,
"AmountExcludingTax": 200,
"VatBase": 200,
"VatAmount": 40,
"AmountIncludingTax": 240,
"WarehouseName": "Merkez Depo"
}
]
}
Error codes
Codes this endpoint can return. The general errors that apply to every endpoint (authentication, permissions, request headers, request limits) are not repeated here.| Code | HTTP | Meaning |
|---|---|---|
0002 | 400 | Request body could not be read (malformed JSON, wrong field type), or it contains a field the endpoint does not have |
0003 | 400 | A field exceeds its maximum length (the message names the field and the limit) |
0580 | 400 | A value given as text (a code or a name) matches more than one record; add the detail that tells them apart (for example City for a district, Country for a city) |
3001 | 400 | InvoiceNumber is required |
3002 | 400 | The invoice number is already used in the company for this invoice type; the response carries the existing record’s ID as ExistingId |
3004 | 400 | Date is required |
3005 | 400 | CustomerCode or CustomerTaxNumber is required |
3006 | 400 | Customer not found or not visible to the user |
3009 | 400 | SharingCode is not one of the user’s sharing codes |
3010 | 400 | At least one line is required |
3011 | 400 | DueDays cannot be less than 0 |
3013 | 400 | ShipmentDefinitionCode was not found in the company |
3018 | 400 | InvoiceTypeCode is not one of the values allowed for this ProfileId |
3019 | 400 | A return invoice’s InvoiceTypeCode can only be IADE or TEVKIFATIADE |
3020 | 400 | InvoiceTypeCode must be ISTISNA, IHRACKAYITLI or SGK when a line has a VatExemptionCode |
3021 | 400 | ProfileId is required when the company uses e-Invoice |
3022 | 400 | InvoiceTypeCode is required when the company uses e-Invoice |
3023 | 400 | When the company uses e-Invoice, the customer’s tax number, invoice title and tax office must be filled in (sales and purchase-return invoices) |
3026 | 400 | The currency given in currencyCode was not found in the company |
3028 | 400 | The customer’s risk limit (set to stop the operation) would be exceeded by the sales or purchase-return invoice |
3029 | 400 | InvoiceTypeCode cannot be IADE or TEVKIFATIADE on a sales invoice |
3080 | 400 | The company has no number series or default e-Invoice / e-Archive numbering definition for this invoice |
3081 | 400 | The series has no parts |
3082 | 400 | The series has a part type the API cannot generate |
3083 | 400 | The generated number exceeds the series maximum length |
3084 | 400 | The generated number is already used in the company |
3085 | 400 | No unused number could be generated after several attempts |
3101 | 400 | ProductCode or ECommerceProductCode is required |
3102 | 400 | Product not found in the company |
3103 | 400 | UnitCode is required |
3104 | 400 | UnitCode is not one of the product’s own units (Unit1/Unit2/Unit3) |
3105 | 400 | Quantity must be greater than 0 |
3106 | 400 | UnitPrice cannot be negative |
3107 | 400 | DiscountRate must be between 0 and 100 |
3108 | 400 | VatRate must be between 0 and 100 |
3109 | 400 | Line group not found in the company |
3110 | 400 | WarehouseName was not found in the company |
3111 | 400 | The product defines no conversion quantity for the line’s unit, so the main unit quantity cannot be calculated |
3112 | 400 | WarehouseName is required |
3115 | 400 | The sum of the Lot/serial number entries does not match the line’s Quantity |
3116 | 400 | Lots/SerialNumbers were not sent as required for the product’s stock type |
3117 | 400 | VatRate is 0 but VatExemptionCode is empty (sales and purchase-return invoices only) |
3118 | 400 | CurrencyCode is required |
3119 | 400 | The line’s currency was not found in the company |
3120 | 400 | ExchangeRate is invalid: must be 1 for the default currency, otherwise required and greater than 0 |
3121 | 400 | A line’s AdditionalTaxes can contain at most 3 additional taxes |
3122 | 400 | Code is required for every additional tax of a line |
3123 | 400 | DiscountRate does not match the cumulative rate of the line’s Discounts list |
3124 | 400 | An AdditionalTaxes Code of the line is not one of the valid additional tax codes |
3125 | 400 | The same additional tax code is used more than once on the line |
3126 | 400 | The line amounts do not add up (for example VatAmount is not VatBase × VatRate / 100); the message names the field and the expected value |
3201 | 400 | The Rate of a discount must be between 0 and 100 |
3301 | 400 | LotNo is required |
3302 | 400 | LotNo is already used in the company |
3303 | 400 | Lot not found |
3305 | 400 | Not enough Lot stock for this product and warehouse |
3401 | 400 | SerialNumbers contains an empty value |
3402 | 400 | The serial number has already been registered and has not been dispatched yet |
3403 | 400 | Serial number not found |
4401 | 400 | The operation would drop the stock below the product’s minimum stock in that warehouse (critical stock set to stop the operation) |
4402 | 400 | The operation would make the product’s stock negative in that warehouse (critical stock set to stop the operation) |
4403 | 400 | The operation would raise the stock above the product’s maximum stock in that warehouse (critical stock set to stop the operation) |
Authorizations
Headers
Body
Required. Invoice number, unique within the company for this invoice type (sales and purchase return invoices share one numbering). Send "Next" on create to generate it automatically from the relevant number series or, when applicable, from the e-Invoice or e-Archive numbering. At most 20 characters.
"FAT2026000125"
Customer code (the customer's CustomerCode from GET /api/v1/customers). When creating, send CustomerCode or CustomerTaxNumber; one of them is required, and if both are sent CustomerCode is used. The invoice's address, title and tax fields are copied from the customer at the moment it is saved and are not accepted in the request.
"C-0001"
UBL profile ID of the e-document (e.g. "TEMELFATURA", "TICARIFATURA"). Used on sales and purchase return invoices, where it is required when the company uses e-Invoice; ignored on purchase and sales return invoices. When both ProfileId and InvoiceTypeCode are sent, InvoiceTypeCode must be one of the values allowed for this ProfileId.
UBL invoice type code of the e-document (e.g. "SATIS", "IADE"). Used on sales and purchase return invoices, where it is required when the company uses e-Invoice; ignored on purchase and sales return invoices. 'IADE' and 'TEVKIFATIADE' are required on a purchase return invoice and not allowed on a sales invoice. On a sales invoice with 'IHRACKAYITLI', a line with VAT and no VatExemptionCode gets 701.
Weighted average exchange rate: when every line has the same currency, Σ(AmountExcludingTax × ExchangeRate) / Σ AmountExcludingTax; when the lines have different currencies, 1, and the totals are converted to the default currency with each line's ExchangeRate. Filled from the lines; a value sent in the request is ignored.
1
Response
Created