Uplaćeno Docs
sr en

API reference

Webhooks

Outbound HTTPS events to your endpoint. Field names stay Serbian ASCII; amounts are decimal strings; timestamps are RFC 3339 with offset.

GET /v1/webhookovi

Lista webhook URL-ova

Privremeno (1.4.1), ceka potvrdu. Minimalni CRUD: najvise 1 URL po organization i okruzenju, prima sve dogadjaje. Korak webhook i dalje moze da se preskoci.

Authentication and scopes

  • Session (HttpOnly cookie)
  • OAuth2: webhookovi:citanje
  • API key (Authorization: Bearer upl_live_…)

Parameters

NameInRequiredTypeDescription
X-Organizacija-Idheadernostring (uuid)Active organization. Required for user OIDC tokens with multiple orgs; for API key/client credentials the org is in the credential (header must match or be omitted).

Responses

200 Success
{
  "objekat": "lista",
  "podaci": [
    {
      "objekat": "webhook_endpoint",
      "id": "0192e4a1-7c3b-7d4e-9a10-3f5b2c8d9e01",
      "url": "https://primer.rs/uplaceno/webhook",
      "okruzenje": "live",
      "aktivan": true,
      "kreirano": "2026-11-01T08:00:00Z"
    }
  ]
}
401 Missing or invalid token/key
403 Nedovoljna prava: zabranjeno, nedovoljan_opseg, funkcija_nije_u_planu, organization
429 Too many requests
default Unexpected error

Example (curl)

curl -sS -X GET "https://api.uplaceno.rs/api/v1/webhookovi" \
  -H "Authorization: Bearer upl_live_VAS_KLJUC" \
  -H "Content-Type: application/json"
POST /v1/webhookovi

Registracija webhook URL-a

Privremeno (1.4.1), ceka potvrdu. Minimalni CRUD: najvise 1 URL po organization i okruzenju, prima sve dogadjaje. Korak webhook i dalje moze da se preskoci. Vec postoji URL: 409 konflikt (prvo DELETE). Odgovor jednom vraca tajna_za_potpis.

Authentication and scopes

  • Session (HttpOnly cookie)
  • OAuth2: webhookovi:pisanje
  • API key (Authorization: Bearer upl_live_…)

Parameters

NameInRequiredTypeDescription
X-Organizacija-Idheadernostring (uuid)Active organization. Required for user OIDC tokens with multiple orgs; for API key/client credentials the org is in the credential (header must match or be omitted).
Idempotency-KeyheaderyesstringRequired on every POST. Response cached 24 h (KV); same key + different body → 409 ponovljen_kljuc_idempotentnosti. Response includes Idempotent-Replayed: true on replay. Exceptions (optional key): /v1/nalog/*, /v1/nalog/pristupni-kljucevi/*, /v1/ja/sesije/opozovi-ostale, public /plati/*.

Request body

FieldTypeRequiredDescription
urlstring (uri)yesSamo HTTPS (u sandboxu dozvoljen i http://localhost)

Responses

201 Success
{
  "objekat": "webhook_endpoint",
  "id": "0192e4a1-7c3b-7d4e-9a10-3f5b2c8d9e01",
  "url": "https://primer.rs/uplaceno/webhook",
  "okruzenje": "live",
  "aktivan": true,
  "kreirano": "2026-11-01T08:00:00Z"
}
400 Bad request
401 Missing or invalid token/key
403 Nedovoljna prava: zabranjeno, nedovoljan_opseg, funkcija_nije_u_planu, organization
409 Konflikt: konflikt, konflikt_verzije, nedozvoljen_prelaz_statusa, ponovljen_kljuc_idempotentnosti, opseg_brojeva_potrosen, duplikat_potvrde
422 Validation failed
429 Too many requests
default Unexpected error

Example (curl)

curl -sS -X POST "https://api.uplaceno.rs/api/v1/webhookovi" \
  -H "Authorization: Bearer upl_live_VAS_KLJUC" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{}'
DELETE /v1/webhookovi/{id}

Delete webhook URL

Privremeno (1.4.1), ceka potvrdu. Minimalni CRUD: najvise 1 URL po organization i okruzenju, prima sve dogadjaje. Korak webhook i dalje moze da se preskoci. Brisanje ne vraca korak webhook iz zavrseno.

Authentication and scopes

  • Session (HttpOnly cookie)
  • OAuth2: webhookovi:pisanje
  • API key (Authorization: Bearer upl_live_…)

Parameters

NameInRequiredTypeDescription
X-Organizacija-Idheadernostring (uuid)Active organization. Required for user OIDC tokens with multiple orgs; for API key/client credentials the org is in the credential (header must match or be omitted).
idpathyesstring (uuid)UUID v7

Responses

204 Deleted
401 Missing or invalid token/key
403 Nedovoljna prava: zabranjeno, nedovoljan_opseg, funkcija_nije_u_planu, organization
404 Not found (or not in this organization/environment)
429 Too many requests
default Unexpected error

Example (curl)

curl -sS -X DELETE "https://api.uplaceno.rs/api/v1/webhookovi/{id}" \
  -H "Authorization: Bearer upl_live_VAS_KLJUC" \
  -H "Content-Type: application/json"
PATCH /v1/webhookovi/{id}

Izmena webhook URL-a

Privremeno (1.4.2), ceka potvrdu. Menja url i/ili aktivan; tajna ostaje ista.

Authentication and scopes

  • Session (HttpOnly cookie)
  • OAuth2: webhookovi:pisanje
  • API key (Authorization: Bearer upl_live_…)

Parameters

NameInRequiredTypeDescription
X-Organizacija-Idheadernostring (uuid)Active organization. Required for user OIDC tokens with multiple orgs; for API key/client credentials the org is in the credential (header must match or be omitted).
idpathyesstring (uuid)UUID v7

Request body

FieldTypeRequiredDescription
urlstring (uri)no
aktivanbooleanno

Responses

200 Success
{
  "objekat": "webhook_endpoint",
  "id": "0192e4a1-7c3b-7d4e-9a10-3f5b2c8d9e01",
  "url": "https://primer.rs/uplaceno/webhook",
  "okruzenje": "live",
  "aktivan": true,
  "kreirano": "2026-11-01T08:00:00Z"
}
400 Bad request
401 Missing or invalid token/key
403 Nedovoljna prava: zabranjeno, nedovoljan_opseg, funkcija_nije_u_planu, organization
404 Not found (or not in this organization/environment)
422 Validation failed
429 Too many requests
default Unexpected error

Example (curl)

curl -sS -X PATCH "https://api.uplaceno.rs/api/v1/webhookovi/{id}" \
  -H "Authorization: Bearer upl_live_VAS_KLJUC" \
  -H "Content-Type: application/json" \
  -d '{"aktivan":true}'
POST /v1/webhookovi/{id}/rotiraj-tajnu

Rotacija tajne za potpis

Privremeno (1.4.2), ceka potvrdu. Generise novu tajna_za_potpis (vraca se samo u ovom odgovoru). Tokom stara_vazi_sekundi X-Uplaceno-Potpis nosi dva v1= potpisa.

Authentication and scopes

  • Session (HttpOnly cookie)
  • OAuth2: webhookovi:pisanje
  • API key (Authorization: Bearer upl_live_…)

Parameters

NameInRequiredTypeDescription
X-Organizacija-Idheadernostring (uuid)Active organization. Required for user OIDC tokens with multiple orgs; for API key/client credentials the org is in the credential (header must match or be omitted).
idpathyesstring (uuid)UUID v7
Idempotency-KeyheaderyesstringRequired on every POST. Response cached 24 h (KV); same key + different body → 409 ponovljen_kljuc_idempotentnosti. Response includes Idempotent-Replayed: true on replay. Exceptions (optional key): /v1/nalog/*, /v1/nalog/pristupni-kljucevi/*, /v1/ja/sesije/opozovi-ostale, public /plati/*.

Request body

FieldTypeRequiredDescription
stara_vazi_sekundiintegernoKoliko dugo i stara tajna vazi (potpis nosi oba v1)

Responses

200 Success
{
  "objekat": "webhook_endpoint",
  "id": "0192e4a1-7c3b-7d4e-9a10-3f5b2c8d9e01",
  "url": "https://primer.rs/uplaceno/webhook",
  "okruzenje": "live",
  "aktivan": true,
  "kreirano": "2026-11-01T08:00:00Z"
}
400 Bad request
401 Missing or invalid token/key
403 Nedovoljna prava: zabranjeno, nedovoljan_opseg, funkcija_nije_u_planu, organization
404 Not found (or not in this organization/environment)
422 Validation failed
429 Too many requests
default Unexpected error

Example (curl)

curl -sS -X POST "https://api.uplaceno.rs/api/v1/webhookovi/{id}/rotiraj-tajnu" \
  -H "Authorization: Bearer upl_live_VAS_KLJUC" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"stara_vazi_sekundi":3600}'
POST /v1/webhookovi/{id}/test

Test delivery webhooka

Sinhrono salje primer payload-a izabranog dogadjaj (podrazumevano faktura.placena) na URL endpointa, sa pravim potpisom i X-Uplaceno-Okruzenje: sandbox; timeout 10 s, bez ponovnih pokusaja. Odgovor nosi ishod delivery (i kod neuspeha je HTTP 200). Uspesan test zavrsava korak webhook. Rate limit 10/min po endpointu.

Authentication and scopes

  • Session (HttpOnly cookie)
  • OAuth2: webhookovi:pisanje
  • API key (Authorization: Bearer upl_live_…)

Parameters

NameInRequiredTypeDescription
X-Organizacija-Idheadernostring (uuid)Active organization. Required for user OIDC tokens with multiple orgs; for API key/client credentials the org is in the credential (header must match or be omitted).
idpathyesstring (uuid)UUID v7
Idempotency-KeyheaderyesstringRequired on every POST. Response cached 24 h (KV); same key + different body → 409 ponovljen_kljuc_idempotentnosti. Response includes Idempotent-Replayed: true on replay. Exceptions (optional key): /v1/nalog/*, /v1/nalog/pristupni-kljucevi/*, /v1/ja/sesije/opozovi-ostale, public /plati/*.

Request body

FieldTypeRequiredDescription
dogadjajTipDogadjajanoSvi tipovi webhook dogadjaja (ASCII srpski, tackasta notacija)

Responses

200 Success
{
  "objekat": "webhook_test",
  "isporuka_id": "0192e4a1-7c3b-7d4e-9a10-3f5b2c8d9e01",
  "dogadjaj": "profaktura.kreirana",
  "status_isporuke": "uspesna",
  "http_status": 200,
  "trajanje_ms": 184,
  "odgovor": "primer",
  "poslato": "2026-11-01T08:00:00Z"
}
400 Bad request
401 Missing or invalid token/key
403 Nedovoljna prava: zabranjeno, nedovoljan_opseg, funkcija_nije_u_planu, organization
404 Not found (or not in this organization/environment)
422 Validation failed
429 Too many requests
default Unexpected error

Example (curl)

curl -sS -X POST "https://api.uplaceno.rs/api/v1/webhookovi/{id}/test" \
  -H "Authorization: Bearer upl_live_VAS_KLJUC" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"dogadjaj":"profaktura.kreirana"}'
GET /v1/webhookovi/dogadjaji/{id}

Get webhook event

Beta. One id_dogadjaja with body and delivery state.

Authentication and scopes

  • Session (HttpOnly cookie)
  • OAuth2: webhookovi:citanje
  • API key (Authorization: Bearer upl_live_…)

Parameters

NameInRequiredTypeDescription
X-Organizacija-Idheadernostring (uuid)Active organization. Required for user OIDC tokens with multiple orgs; for API key/client credentials the org is in the credential (header must match or be omitted).
idpathyesstring (uuid)UUID v7

Responses

200 Success
401 Missing or invalid token/key
403 Nedovoljna prava: zabranjeno, nedovoljan_opseg, funkcija_nije_u_planu, organization
404 Not found (or not in this organization/environment)
default Unexpected error

Example (curl)

curl -sS -X GET "https://api.uplaceno.rs/api/v1/webhookovi/dogadjaji/{id}" \
  -H "Authorization: Bearer upl_live_VAS_KLJUC" \
  -H "Content-Type: application/json"
POST /v1/webhookovi/dogadjaji/{id}/ponovi

Ponovna delivery dogadjaja

Beta. Manually resends the same id_dogadjaja. Rate limit 10/min per endpoint.

Authentication and scopes

  • Session (HttpOnly cookie)
  • OAuth2: webhookovi:pisanje
  • API key (Authorization: Bearer upl_live_…)

Parameters

NameInRequiredTypeDescription
X-Organizacija-Idheadernostring (uuid)Active organization. Required for user OIDC tokens with multiple orgs; for API key/client credentials the org is in the credential (header must match or be omitted).
idpathyesstring (uuid)UUID v7
Idempotency-KeyheaderyesstringRequired on every POST. Response cached 24 h (KV); same key + different body → 409 ponovljen_kljuc_idempotentnosti. Response includes Idempotent-Replayed: true on replay. Exceptions (optional key): /v1/nalog/*, /v1/nalog/pristupni-kljucevi/*, /v1/ja/sesije/opozovi-ostale, public /plati/*.

Responses

202 Ponovna delivery zakazana
{
  "objekat": "webhook_ponovi",
  "id_dogadjaja": "0192e4a2-0000-7000-8000-000000001042",
  "status": "zakazano"
}
401 Missing or invalid token/key
403 Nedovoljna prava: zabranjeno, nedovoljan_opseg, funkcija_nije_u_planu, organization
404 Not found (or not in this organization/environment)
429 Too many requests
default Unexpected error

Example (curl)

curl -sS -X POST "https://api.uplaceno.rs/api/v1/webhookovi/dogadjaji/{id}/ponovi" \
  -H "Authorization: Bearer upl_live_VAS_KLJUC" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)"
GET /v1/webhookovi/isporuke

Istorija delivery webhooka

Beta. List delivery attempts; pagination limit/kursor. Manual event resend allowed for 30 days after the last failure.

Authentication and scopes

  • Session (HttpOnly cookie)
  • OAuth2: webhookovi:citanje
  • API key (Authorization: Bearer upl_live_…)

Parameters

NameInRequiredTypeDescription
X-Organizacija-Idheadernostring (uuid)Active organization. Required for user OIDC tokens with multiple orgs; for API key/client credentials the org is in the credential (header must match or be omitted).
limitquerynointeger
kursorquerynostringOpaque cursor from sledeci_kursor
statusquerynoenum: uspesna | neuspesna | ceka

Responses

200 Success
{
  "objekat": "lista",
  "podaci": [
    {
      "objekat": "webhook_isporuka",
      "id_dogadjaja": "0192e4a2-0000-7000-8000-000000001042",
      "pokusaj": 1,
      "status": "uspesna",
      "http_status": 200,
      "kreirano": "2026-11-02T09:00:04+01:00"
    }
  ],
  "sledeci_kursor": null,
  "ima_jos": false
}
401 Missing or invalid token/key
403 Nedovoljna prava: zabranjeno, nedovoljan_opseg, funkcija_nije_u_planu, organization
429 Too many requests
default Unexpected error

Example (curl)

curl -sS -X GET "https://api.uplaceno.rs/api/v1/webhookovi/isporuke" \
  -H "Authorization: Bearer upl_live_VAS_KLJUC" \
  -H "Content-Type: application/json"