Teklifler API

Teklifler modülünün tüm işlemleri (13) ve veri modelleri (5): adresler, izinler, girdiler, ön koşullar, olaylar ve örnekler.

PDF’i ve müşterinin kabul ya da reddedebileceği bir bağlantısı olan fiyat teklifleri.

Modül kodu quotes · 13 işlem · 5 veri modeli · 12 olay. Bir anahtar ya da token, arkasındaki kişinin bu modülde yapabildiğinden fazlasını asla yapamaz; satır düzeyindeki güvenlik uygulamadakiyle birebir aynıdır. Yetki kapsamları: quotes (hepsi), quotes:read (yalnız okuma) ya da quotes:<yetenek>.

Kaynaklar

KaynakTabloListeleme ve okumaPOSTPATCHDELETE
quote_eventsquote_event/api/v1/quote_events
quote_linesquote_line/api/v1/quote_lines
quote_templatesquote_template/api/v1/quote_templates
quote_versionsquote_version/api/v1/quote_versions
quotesquote/api/v1/quotesquotes.create

Listeler limit (en çok 200), cursor, order (ör. -created_at), fields ve q alır; diğer her sorgu parametresi bir sütun süzgecidir: ?status=paid, ?total[gte]=100, ?id[in]=a,b, ?x=null.

İşlemler

İşlemGereken izinNe yapar
quotes.acceptquotes:writeKabul edildi işaretle
quotes.add_notequotes:writeNot ekle
quotes.createquotes:writeTeklif başlat
quotes.create_templatequotes:manageTeklif şablonu kaydet
quotes.delete_templatequotes:manageTeklif şablonunu sil
quotes.duplicatequotes:writeÇoğalt
quotes.expire_duequotes:writeSüresi geçen teklifleri düşür
quotes.rejectquotes:writeReddedildi işaretle
quotes.revisequotes:writeYeni sürüme revize et
quotes.sendquotes:writeE-postayla gönder
quotes.update_draftquotes:writeTaslak teklifi düzenle
quotes.update_templatequotes:manageTeklif şablonunu düzenle
quotes.withdrawquotes:writeGeri çek

quotes.accept

Kabul edildi işaretle — Müşterinin mevcut sürüme evetini kaydeder; finans ondan sözleşme taslağı hazırlar.

Gereken izin quotes:write · dışarıya ulaşır (gönderir, yayımlar ya da ücret alır) · Era çalıştırırken bir kişiye onaylatır

POSThttps://app.getera.io/api/v1/quotes/{id}/actions/accept
API anahtarı ya da OAuth token · quotes:write
  • Asıl adres: POST /api/v1/actions/quotes.accept

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Teklif · kimliği: quote
namestringYanıtlayan · en çok 200
notestringNot · en çok 4000
viastring (enum)Nasıl · İzin verilen değerler: manual, link
signatureNamestringYazılı imza · en çok 200
ipstringGönderen adresi · en çok 64
userAgentstringTarayıcı · en çok 400

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
quote_not_foundTeklif bulunmalı.
quote_not_openYalnızca gönderilmiş bir teklif yanıtlanır.
quote_validity_passedGeçerlilik günü geçmiş bir teklif kabul edilmez.
quote_signature_requiredBağlantıdan kabul etmek müşterinin adını yazmasını gerektirir.

Yayımladığı olaylar: quotes.accepted

Neye yazar: quote (update) — Marks it accepted, freezes the accepted version and keeps the typed signature; quote_event (insert) — Records the answer

curl -X POST https://app.getera.io/api/v1/quotes/QUOTE_ID/actions/accept \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"name":"Answered by"}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.accepted"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quotes.accept("QUOTE_ID", {
  name: "Answered by"
})
era quotes accept QUOTE_ID \
  --name "Answered by"
tools/call
{
  "name": "era__quotes__accept",
  "arguments": {
    "id": "QUOTE_ID",
    "name": "Answered by"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 quote_not_found, quote_not_open, quote_validity_passed, quote_signature_required · 429 çok sık istek

quotes.add_note

Not ekle — Teklifin kendi geçmişine bir satır.

Gereken izin quotes:write · veriyi değiştirir

POSThttps://app.getera.io/api/v1/quote_events/actions/add_note
API anahtarı ya da OAuth token · quotes:write
  • Asıl adres: POST /api/v1/actions/quotes.add_note

Girdi

AlanTürZorunluAçıklama
iduuidevetTeklif · kimliği: quote
messagestringevetNot · en çok 4000

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
quote_not_foundTeklif bulunmalı.

Yayımladığı olaylar: quotes.note_added

Neye yazar: quote_event (insert) — Records the note

curl -X POST https://app.getera.io/api/v1/quote_events/actions/add_note \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"id":"QUOTE_ID","message":"Note"}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.note_added"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quoteEvents.addNote({
  id: "QUOTE_ID",
  message: "Note"
})
era quote_events add_note \
  --id "QUOTE_ID" \
  --message "Note"
tools/call
{
  "name": "era__quotes__add_note",
  "arguments": {
    "id": "QUOTE_ID",
    "message": "Note"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 quote_not_found · 429 çok sık istek

quotes.create

Teklif başlat — İlk sürümü ve satırlarıyla numaralı bir taslak teklif; her satırda dondurulmuş vergi bilgisi.

Gereken izin quotes:write · veriyi değiştirir

POSThttps://app.getera.io/api/v1/quotes/actions/create
API anahtarı ya da OAuth token · quotes:write
  • REST kısayolu: POST /api/v1/quotes
  • Asıl adres: POST /api/v1/actions/quotes.create

Girdi

AlanTürZorunluAçıklama
customerIduuidİçin · kimliği: customer
leadIduuidPotansiyel müşteri
templateIduuidŞablondan · kimliği: quote_template
titlestringBaşlık · en çok 200
currencystringPara birimi · en çok 3
taxCountrystringVergi ülkesi · en çok 2
validUntildateGeçerlilik
notesstringNotlar · en çok 4000
linesobject / arrayKalemler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
customer_not_foundKişi bulunmalı.
quote_template_not_foundBelirtilen şablon bulunmalı.
customer_archivedArşivlenmiş bir kişiye teklif verilmez.
invalid_currencyPara birimi bir ISO-4217 kodu olmalı.
quote_needs_linesTeklifin en az bir satırı olmalı.
invalid_quote_linesHer satırın bir açıklaması, pozitif miktarı ve fiyatı olmalı; katalog ürünü bulunmalı.

Yayımladığı olaylar: quotes.created

Neye yazar: quote (insert) — Opens the quote with its number; quote_version (insert) — Writes version 1; quote_line (insert) — Writes its lines with their tax snapshot; quote_event (insert) — Records that it was created

curl -X POST https://app.getera.io/api/v1/quotes/actions/create \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"customerId":"CUSTOMER_ID"}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.created"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quotes.create({
  customerId: "CUSTOMER_ID"
})
era quotes create \
  --customer-id "CUSTOMER_ID"
tools/call
{
  "name": "era__quotes__create",
  "arguments": {
    "customerId": "CUSTOMER_ID"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 customer_not_found, quote_template_not_found, customer_archived, invalid_currency, quote_needs_lines, invalid_quote_lines · 429 çok sık istek

quotes.create_template

Teklif şablonu kaydet — Yeniden kullanılabilir başlık, notlar ve satırlar — yazılarak ya da bir tekliften kaydedilerek.

Gereken izin quotes:manage · veriyi değiştirir

POSThttps://app.getera.io/api/v1/quote_templates/actions/create_template
API anahtarı ya da OAuth token · quotes:manage
  • Asıl adres: POST /api/v1/actions/quotes.create_template

Girdi

AlanTürZorunluAçıklama
namestringevetŞablon adı · en çok 120
titlestringTeklif başlığı · en çok 200
notesstringMüşteri için notlar · en çok 4000
currencystringPara birimi · en çok 3
linesobject / arrayKalemler
fromQuoteIduuidTekliften · kimliği: quote

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
quote_template_name_takenŞablon adları çalışma alanında benzersizdir.
quote_not_foundTeklif bulunmalı.
invalid_currencyPara birimi bir ISO-4217 kodu olmalı.
quote_needs_linesTeklifin en az bir satırı olmalı.
invalid_quote_linesHer satırın bir açıklaması, pozitif miktarı ve fiyatı olmalı; katalog ürünü bulunmalı.

Yayımladığı olaylar: quotes.template_changed

Neye yazar: quote_template (insert) — Saves the template; quote_event (insert) — Notes on the quote that it was saved as a template

curl -X POST https://app.getera.io/api/v1/quote_templates/actions/create_template \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"name":"Template name"}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.template_changed"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quoteTemplates.createTemplate({
  name: "Template name"
})
era quote_templates create_template \
  --name "Template name"
tools/call
{
  "name": "era__quotes__create_template",
  "arguments": {
    "name": "Template name"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 quote_template_name_taken, quote_not_found, invalid_currency, quote_needs_lines, invalid_quote_lines · 429 çok sık istek

quotes.delete_template

Teklif şablonunu sil — Şablonu kaldırır; ondan yapılmış tekliflere dokunulmaz.

Gereken izin quotes:manage · siler ya da geri alınamaz · Era çalıştırırken bir kişiye onaylatır

POSThttps://app.getera.io/api/v1/quote_templates/{id}/actions/delete_template
API anahtarı ya da OAuth token · quotes:manage
  • Asıl adres: POST /api/v1/actions/quotes.delete_template

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Şablon · kimliği: quote_template

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
quote_template_not_foundŞablon bulunmalı.

Yayımladığı olaylar: quotes.template_changed

Neye yazar: quote_template (delete) — Deletes the template

curl -X POST https://app.getera.io/api/v1/quote_templates/QUOTE_TEMPLATE_ID/actions/delete_template \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.template_changed"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quoteTemplates.deleteTemplate("QUOTE_TEMPLATE_ID")
era quote_templates delete_template QUOTE_TEMPLATE_ID
tools/call
{
  "name": "era__quotes__delete_template",
  "arguments": {
    "id": "QUOTE_TEMPLATE_ID"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 quote_template_not_found · 429 çok sık istek

quotes.duplicate

Çoğalt — Aynı satırlarla yeni bir taslak teklif — aynı kişi ya da başkası için.

Gereken izin quotes:write · veriyi değiştirir

POSThttps://app.getera.io/api/v1/quotes/{id}/actions/duplicate
API anahtarı ya da OAuth token · quotes:write
  • Asıl adres: POST /api/v1/actions/quotes.duplicate

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Teklif · kimliği: quote
customerIduuidİçin · kimliği: customer

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
quote_not_foundTeklif bulunmalı.
customer_not_foundKişi bulunmalı.
customer_archivedArşivlenmiş bir kişiye teklif verilmez.
quote_needs_linesTeklifin en az bir satırı olmalı.
invalid_quote_linesHer satırın bir açıklaması, pozitif miktarı ve fiyatı olmalı; katalog ürünü bulunmalı.

Yayımladığı olaylar: quotes.created, quotes.duplicated

Neye yazar: quote (insert) — Opens the copy with its own number; quote_version (insert) — Writes version 1; quote_line (insert) — Copies the lines, re-priced; quote_event (insert) — Records where it came from; quote (update) — Remembers the original

curl -X POST https://app.getera.io/api/v1/quotes/QUOTE_ID/actions/duplicate \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"customerId":"CUSTOMER_ID"}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.created",
    "quotes.duplicated"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quotes.duplicate("QUOTE_ID", {
  customerId: "CUSTOMER_ID"
})
era quotes duplicate QUOTE_ID \
  --customer-id "CUSTOMER_ID"
tools/call
{
  "name": "era__quotes__duplicate",
  "arguments": {
    "id": "QUOTE_ID",
    "customerId": "CUSTOMER_ID"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 quote_not_found, customer_not_found, customer_archived, quote_needs_lines, invalid_quote_lines · 429 çok sık istek

quotes.expire_due

Süresi geçen teklifleri düşür — Otomatik günlük iş: geçerlilik günü geçmiş gönderilmiş teklif süresi doldu olur.

Gereken izin quotes:write · veriyi değiştirir

Era’nın kendi çalıştırdığı bir işlem. Başvuru eksiksiz olsun diye listelenir; API anahtarı ya da token ile istek reddedilir (403 machine_only).
POSThttps://app.getera.io/api/v1/quote_events/actions/expire_due
API anahtarı ya da OAuth token · quotes:write
  • Asıl adres: POST /api/v1/actions/quotes.expire_due

Girdi

Bu işlem girdi almaz.

Yayımladığı olaylar: quotes.expired

Neye yazar: quote (update) — Marks overdue quotes expired; quote_event (insert) — Records the lapse on each

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 429 çok sık istek

quotes.reject

Reddedildi işaretle — Müşterinin hayırını, verdiyse nedeniyle kaydeder.

Gereken izin quotes:write · veriyi değiştirir

POSThttps://app.getera.io/api/v1/quotes/{id}/actions/reject
API anahtarı ya da OAuth token · quotes:write
  • Asıl adres: POST /api/v1/actions/quotes.reject

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Teklif · kimliği: quote
namestringYanıtlayan · en çok 200
notestringNot · en çok 4000
viastring (enum)Nasıl · İzin verilen değerler: manual, link
signatureNamestringYazılı imza · en çok 200
ipstringGönderen adresi · en çok 64
userAgentstringTarayıcı · en çok 400

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
quote_not_foundTeklif bulunmalı.
quote_not_openYalnızca gönderilmiş bir teklif yanıtlanır.

Yayımladığı olaylar: quotes.rejected

Neye yazar: quote (update) — Marks it declined; quote_event (insert) — Records the answer

curl -X POST https://app.getera.io/api/v1/quotes/QUOTE_ID/actions/reject \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"name":"Answered by"}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.rejected"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quotes.reject("QUOTE_ID", {
  name: "Answered by"
})
era quotes reject QUOTE_ID \
  --name "Answered by"
tools/call
{
  "name": "era__quotes__reject",
  "arguments": {
    "id": "QUOTE_ID",
    "name": "Answered by"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 quote_not_found, quote_not_open · 429 çok sık istek

quotes.revise

Yeni sürüme revize et — Gönderilen sürümü yeni bir taslak sürüme kopyalar; eski bağlantı yanıt vermez olur.

Gereken izin quotes:write · veriyi değiştirir

POSThttps://app.getera.io/api/v1/quotes/{id}/actions/revise
API anahtarı ya da OAuth token · quotes:write
  • Asıl adres: POST /api/v1/actions/quotes.revise

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Teklif · kimliği: quote

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
quote_not_foundTeklif bulunmalı.
quote_not_revisableYalnızca gönderilmiş, reddedilmiş veya süresi geçmiş bir teklif revize edilir.

Yayımladığı olaylar: quotes.revised

Neye yazar: quote_version (insert) — Writes the new version; quote_line (insert) — Copies the lines; quote (update) — Points at the new version, back to draft; quote_event (insert) — Records the revision

curl -X POST https://app.getera.io/api/v1/quotes/QUOTE_ID/actions/revise \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.revised"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quotes.revise("QUOTE_ID")
era quotes revise QUOTE_ID
tools/call
{
  "name": "era__quotes__revise",
  "arguments": {
    "id": "QUOTE_ID"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 quote_not_found, quote_not_revisable · 429 çok sık istek

quotes.send

E-postayla gönder — Mevcut sürümü kabul veya ret bağlantısıyla e-postayla gönderir; kayıt, gidip gitmediğini gösterir.

Gereken izin quotes:write · dışarıya ulaşır (gönderir, yayımlar ya da ücret alır) · Era çalıştırırken bir kişiye onaylatır

POSThttps://app.getera.io/api/v1/quotes/{id}/actions/send
API anahtarı ya da OAuth token · quotes:write
  • Asıl adres: POST /api/v1/actions/quotes.send

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Teklif · kimliği: quote
tostringE-posta · en çok 320
messagestringMesaj · en çok 4000

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
quote_not_foundTeklif bulunmalı.
quote_not_sendableYalnızca taslak veya açık bir teklif gönderilir.
quote_validity_passedGeçerlilik günü geçmiş bir teklif gönderilmez.
quote_needs_linesTeklifin en az bir satırı olmalı.
quote_recipient_missingGönderilecek bir adres olmalı.

Yayımladığı olaylar: quotes.send_requested, quotes.sent

Neye yazar: quote (update) — Marks it sent and mints its answer link; quote_version (update) — Stamps when this version was sent; quote_event (insert) — Records who it was sent to

curl -X POST https://app.getera.io/api/v1/quotes/QUOTE_ID/actions/send \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"to":"Email"}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.send_requested",
    "quotes.sent"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quotes.send("QUOTE_ID", {
  to: "Email"
})
era quotes send QUOTE_ID \
  --to "Email"
tools/call
{
  "name": "era__quotes__send",
  "arguments": {
    "id": "QUOTE_ID",
    "to": "Email"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 quote_not_found, quote_not_sendable, quote_validity_passed, quote_needs_lines, quote_recipient_missing · 429 çok sık istek

quotes.update_draft

Taslak teklifi düzenle — Başlığı, satırları, geçerliliği veya notları değiştirir — yalnızca mevcut sürüm taslakken.

Gereken izin quotes:write · veriyi değiştirir

POSThttps://app.getera.io/api/v1/quotes/{id}/actions/update_draft
API anahtarı ya da OAuth token · quotes:write
  • Asıl adres: POST /api/v1/actions/quotes.update_draft

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Teklif · kimliği: quote
titlestringBaşlık · en çok 200
validUntildateGeçerlilik
notesstringNotlar · en çok 4000
taxCountrystringVergi ülkesi · en çok 2
linesobject / arrayKalemler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
quote_not_foundTeklif bulunmalı.
quote_not_draftYalnızca taslak düzenlenir.
quote_needs_linesTeklifin en az bir satırı olmalı.
invalid_quote_linesHer satırın bir açıklaması, pozitif miktarı ve fiyatı olmalı; katalog ürünü bulunmalı.

Yayımladığı olaylar: quotes.updated

Neye yazar: quote (update) — Updates the title; quote_version (update) — Updates validity, notes and totals; quote_line (upsert) — Rewrites the lines; quote_event (insert) — Records the edit

curl -X POST https://app.getera.io/api/v1/quotes/QUOTE_ID/actions/update_draft \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"title":"Title"}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.updated"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quotes.updateDraft("QUOTE_ID", {
  title: "Title"
})
era quotes update_draft QUOTE_ID \
  --title "Title"
tools/call
{
  "name": "era__quotes__update_draft",
  "arguments": {
    "id": "QUOTE_ID",
    "title": "Title"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 quote_not_found, quote_not_draft, quote_needs_lines, invalid_quote_lines · 429 çok sık istek

quotes.update_template

Teklif şablonunu düzenle — Şablonu değiştirir; ondan yapılmış teklifler kendi kopyalarını korur.

Gereken izin quotes:manage · veriyi değiştirir

POSThttps://app.getera.io/api/v1/quote_templates/{id}/actions/update_template
API anahtarı ya da OAuth token · quotes:manage
  • Asıl adres: POST /api/v1/actions/quotes.update_template

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Şablon · kimliği: quote_template
namestringŞablon adı · en çok 120
titlestringTeklif başlığı · en çok 200
notesstringMüşteri için notlar · en çok 4000
currencystringPara birimi · en çok 3
linesobject / arrayKalemler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
quote_template_not_foundŞablon bulunmalı.
quote_template_name_takenŞablon adları çalışma alanında benzersizdir.
quote_needs_linesTeklifin en az bir satırı olmalı.
invalid_quote_linesHer satırın bir açıklaması, pozitif miktarı ve fiyatı olmalı; katalog ürünü bulunmalı.

Yayımladığı olaylar: quotes.template_changed

Neye yazar: quote_template (update) — Rewrites the template

curl -X POST https://app.getera.io/api/v1/quote_templates/QUOTE_TEMPLATE_ID/actions/update_template \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"name":"Template name"}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.template_changed"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quoteTemplates.updateTemplate("QUOTE_TEMPLATE_ID", {
  name: "Template name"
})
era quote_templates update_template QUOTE_TEMPLATE_ID \
  --name "Template name"
tools/call
{
  "name": "era__quotes__update_template",
  "arguments": {
    "id": "QUOTE_TEMPLATE_ID",
    "name": "Template name"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 quote_template_not_found, quote_template_name_taken, quote_needs_lines, invalid_quote_lines · 429 çok sık istek

quotes.withdraw

Geri çek — Taslak veya açık bir teklifi masadan kaldırır; bağlantısı yanıt vermez olur.

Gereken izin quotes:write · dışarıya ulaşır (gönderir, yayımlar ya da ücret alır) · Era çalıştırırken bir kişiye onaylatır

POSThttps://app.getera.io/api/v1/quotes/{id}/actions/withdraw
API anahtarı ya da OAuth token · quotes:write
  • Asıl adres: POST /api/v1/actions/quotes.withdraw

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Teklif · kimliği: quote
reasonstringNeden · en çok 2000

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
quote_not_foundTeklif bulunmalı.
quote_not_withdrawableYalnızca taslak veya açık bir teklif geri çekilir.

Yayımladığı olaylar: quotes.withdrawn

Neye yazar: quote (update) — Marks it withdrawn; quote_event (insert) — Records why

curl -X POST https://app.getera.io/api/v1/quotes/QUOTE_ID/actions/withdraw \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"reason":"Reason"}'
Yanıt
{
  "ok": true,
  "result": "…",
  "events": [
    "quotes.withdrawn"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.quotes.withdraw("QUOTE_ID", {
  reason: "Reason"
})
era quotes withdraw QUOTE_ID \
  --reason "Reason"
tools/call
{
  "name": "era__quotes__withdraw",
  "arguments": {
    "id": "QUOTE_ID",
    "reason": "Reason"
  }
}

Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde quotes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 quote_not_found, quote_not_withdrawable · 429 çok sık istek

Veri modelleri

QuoteEvent

Tablo quote_event · Kaynak quote_events

  • GET /api/v1/quote_events
  • GET /api/v1/quote_events/{id}
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
quote_idstring (uuid) · uuidquote
typestring · textcreated, updated, revised, send_requested, accepted, rejected, expired, withdrawn, note_added, duplicated, template_saved
messagestring · textevet
parametersobject · jsonb
actor_user_idstring (uuid) · uuidevetapp_user
occurred_atstring (date-time) · timestamptz

Birincil anahtar: id

QuoteLine

Tablo quote_line · Kaynak quote_lines

  • GET /api/v1/quote_lines
  • GET /api/v1/quote_lines/{id}
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
quote_idstring (uuid) · uuidquote
version_idstring (uuid) · uuidquote_version
descriptionstring · text
quantitystring (decimal) · numeric
item_variant_idstring (uuid) · uuidevetitem_variant
currencystring · bpcharen çok 3
unit_amountstring (int64) · int8
discount_amountstring (int64) · int8
tax_class_idstring (uuid) · uuidevettax_class
tax_class_namestring · textevet
tax_ratestring (decimal) · numeric
prices_entered_with_taxboolean · bool
net_amountstring (int64) · int8
tax_amountstring (int64) · int8
total_amountstring (int64) · int8
display_orderinteger · int4
created_atstring (date-time) · timestamptz

Birincil anahtar: id

Denetimler:

  • CHECK ((currency ~ '^[A-Z]{3}$'::text))
  • CHECK ((discount_amount >= 0))
  • CHECK ((net_amount >= 0))
  • CHECK ((quantity > (0)::numeric))
  • CHECK ((tax_amount >= 0))
  • CHECK (((tax_rate >= (0)::numeric) AND (tax_rate <= (100)::numeric)))
  • CHECK ((total_amount >= 0))
  • CHECK ((unit_amount >= 0))

QuoteTemplate

Tablo quote_template · Kaynak quote_templates

  • GET /api/v1/quote_templates
  • GET /api/v1/quote_templates/{id}
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
namestring · text
titlestring · text
notesstring · textevet
currencystring · bpchareveten çok 3
linesobject · jsonb
created_by_user_idstring (uuid) · uuidevetapp_user
created_atstring (date-time) · timestamptz
updated_atstring (date-time) · timestamptz

Birincil anahtar: id

Denetimler:

  • CHECK (((currency IS NULL) OR (currency ~ '^[A-Z]{3}$'::text)))
  • CHECK ((jsonb_typeof(lines) = 'array'::text))
  • CHECK ((length(TRIM(BOTH FROM name)) > 0))
  • CHECK ((length(TRIM(BOTH FROM title)) > 0))

QuoteVersion

Tablo quote_version · Kaynak quote_versions

  • GET /api/v1/quote_versions
  • GET /api/v1/quote_versions/{id}
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
quote_idstring (uuid) · uuidquote
version_nointeger · int4
currencystring · bpcharen çok 3
tax_countrystring · bpchareveten çok 2
valid_untilstring (date) · dateevet
notesstring · textevet
subtotal_amountstring (int64) · int8
discount_total_amountstring (int64) · int8
tax_total_amountstring (int64) · int8
total_amountstring (int64) · int8
sent_atstring (date-time) · timestamptzevet
created_by_user_idstring (uuid) · uuidevetapp_user
created_atstring (date-time) · timestamptz
updated_atstring (date-time) · timestamptz

Birincil anahtar: id

Tekil: quote_id, version_no

Denetimler:

  • CHECK ((currency ~ '^[A-Z]{3}$'::text))
  • CHECK ((discount_total_amount >= 0))
  • CHECK ((subtotal_amount >= 0))
  • CHECK (((tax_country IS NULL) OR (tax_country ~ '^[A-Z]{2}$'::text)))
  • CHECK ((tax_total_amount >= 0))
  • CHECK ((total_amount >= 0))
  • CHECK ((version_no >= 1))

Quote

Tablo quote · Kaynak quotes

  • GET /api/v1/quotes
  • GET /api/v1/quotes/{id}
  • POST /api/v1/quotes → quotes.create
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
numberstring · text
titlestring · text
statusstring · textdraft, sent, accepted, rejected, expired, withdrawn
customer_idstring (uuid) · uuidcustomer
lead_idstring (uuid) · uuidevet
owner_user_idstring (uuid) · uuidevetapp_user
current_version_idstring (uuid) · uuidevetquote_version
accepted_version_idstring (uuid) · uuidevetquote_version
link_expires_atstring (date-time) · timestamptzevet
last_viewed_atstring (date-time) · timestamptzevet
sent_atstring (date-time) · timestamptzevet
responded_atstring (date-time) · timestamptzevet
response_namestring · textevet
response_notestring · textevet
responded_viastring · textevet
withdrawn_atstring (date-time) · timestamptzevet
created_by_user_idstring (uuid) · uuidevetapp_user
created_atstring (date-time) · timestamptz
updated_atstring (date-time) · timestamptz
signature_namestring · textevet
signed_atstring (date-time) · timestamptzevet
signature_ipstring · textevet
signature_user_agentstring · textevet
duplicated_from_idstring (uuid) · uuidevetquote
template_idstring (uuid) · uuidevetquote_template

Birincil anahtar: id

Denetimler:

  • CHECK (((responded_via IS NULL) OR (responded_via = ANY (ARRAY['link'::text, 'manual'::text]))))
  • CHECK ((length(TRIM(BOTH FROM title)) > 0))

Olaylar

İş akışları ve webhook'lar bu olaylara tepki verir.

OlayNe olurTaşıdığı alanlar
quotes.acceptedMüşteri bir teklifi kabul etti.id, number, customerId, leadId, ownerUserId, versionNo, totalAmount, currency, description, lines, via
quotes.createdBir teklif başlatıldı.id, number, customerId, leadId, ownerUserId, totalAmount, currency
quotes.duplicatedBir teklif yeni bir taslağa kopyalandı.id, fromId, ownerUserId
quotes.expiredGönderilen bir teklifin süresi yanıt alınmadan doldu.id, number, ownerUserId
quotes.note_addedBir teklife not eklendi.id
quotes.rejectedMüşteri bir teklifi reddetti.id, number, customerId, ownerUserId, reason, via
quotes.revisedBir teklif yeni bir sürüm olarak revize edildi.id, versionNo
quotes.send_requestedBir teklif e-postayla gönderildi; bildirimler teslim eder.id, eventId, to
quotes.sentBir teklif müşteriye gitti.id, number, customerId, ownerUserId, versionNo
quotes.template_changedBir teklif şablonu kaydedildi, düzenlendi ya da silindi.id
quotes.updatedTaslak bir teklif düzenlendi.id
quotes.withdrawnBir teklif geri çekildi.id, ownerUserId
Bu sayfa yardımcı oldu mu?