Proforma Detay
İlgili şirkete ait proforma bilgileri.
Endpoint
GET /kolaybi/v1/proformas/{document_id}
Parametreler
| Parametre | Tip | Açıklama |
|---|---|---|
document_id | integer | Detayı alınmak istenen proformanın ID değeri |
Örnekler
- cURL
- JavaScript
- PHP
- Python
- C#
curl -X GET "https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/proformas/18" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Channel: YOUR_CHANNEL"
async function getProformaDetail(documentId) {
const response = await fetch(
`https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/proformas/${documentId}`,
{
method: "GET",
headers: {
Authorization: `Bearer ${accessToken}`,
Channel: channel,
},
}
);
return await response.json();
}
// Kullanım
const proformaDetail = await getProformaDetail(18);
function getProformaDetail($documentId) {
$url = "https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/proformas/{$documentId}";
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $accessToken,
'Channel: ' . $channel
],
CURLOPT_RETURNTRANSFER => true
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// Kullanım
$proformaDetail = getProformaDetail(18);
import requests
def get_proforma_detail(document_id):
url = f'https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/proformas/{document_id}'
headers = {
'Authorization': f'Bearer {access_token}',
'Channel': channel
}
response = requests.get(url, headers=headers)
return response.json()
# Kullanım
proforma_detail = get_proforma_detail(18)
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
async Task<dynamic> GetProformaDetailAsync(int documentId)
{
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get,
$"https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/proformas/{documentId}");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
request.Headers.Add("Channel", channel);
var response = await client.SendAsync(request);
var content = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<dynamic>(content);
}
// Kullanım
var proformaDetail = await GetProformaDetailAsync(18);
Yanıt
{
"data": {
"document_id": 18,
"order_number": "PROF-001",
"associate_id": 1,
"currency": "usd",
"description": "Örnek proforma açıklaması",
"issue_date": "2024-01-15 00:00:00",
"expiry_date": "2024-01-30 00:00:00",
"grand_total": 236,
"gross_total": 200,
"total_vat": 36,
"subtotal": 200,
"lines": [
{
"id": 57,
"product_id": 1,
"product_name": "Test Ürün",
"product_code": "URN-001",
"unit": "UNIT.EACH",
"unit_id": "C62",
"quantity": 2,
"unit_price": 100,
"amount": 200,
"discount_type": null,
"discount_value": null,
"discount_amount": 0,
"discounts_text": "",
"discounts": [],
"subtotal": 200,
"vat_type": "percentage",
"vat_value": 18,
"vat_amount": 36,
"total": 236,
"grand_total": 236,
"description": "Açıklama"
}
]
}
}
Yanıt Alanları
| Alan | Tip | Açıklama |
|---|---|---|
data | object | Proforma kaydı |
Proforma Alanları (data)
| Alan | Tip | Açıklama |
|---|---|---|
document_id | integer | Proforma ID değeri |
order_number | string | Proforma seri numarası |
associate_id | integer | Carinin ID değeri |
currency | string | Proforma para birimi |
description | string | Proforma açıklaması |
issue_date | string | Düzenleme tarihi (YYYY-MM-DD HH:mm:ss) |
expiry_date | string | Geçerlilik tarihi (YYYY-MM-DD HH:mm:ss) |
grand_total | number | Proforma para biriminde KDV dahil toplam |
gross_total | number | Brüt toplam (indirimler sonrası, KDV hariç) |
total_vat | number | Toplam KDV |
subtotal | number | Ara toplam (indirimler uygulanmadan kalem tutarları toplamı) |
lines | array | Proforma kalemleri (lines[n]); alanlar Sipariş Detayı sayfasındaki kalem alanlarıyla aynıdır |