Оди на содржината

Серија примени документи за проба

POST
/api/integration/v1/sandbox/seed

Fills your organisation with a series of inbound invoices, one per scenario.

The same seed always produces the same series — same amounts, same dates, same senders, same deadlines. That is the whole reason the number exists: without it a test that failed yesterday would pass today, because the data is different rather than because anything was fixed. Omit it and 1 is used, not a random one.

reset deletes what this endpoint created earlier and nothing else, so an automated run can start from the same state every time. A document placed through sandbox/inbound is left alone.

scenarios narrows the series; omit it for all of them. The response names the scenario of every document — read the list from there rather than hard-coding it, and your test stays correct when a scenario is added.

Some of these states cannot be created any other way: an expired deadline and a decision already confirmed come about with the passage of time or through an action that has already happened. They are the ones a caller usually meets first in production.

Примерот важи само за demo околината.

Request

curl -i -X POST "https://sandbox.api.earhiva.mk/api/integration/v1/sandbox/seed" \
  -H "X-Api-Key: <ВАШИОТ КЛУЧ>" \
  -H "X-Software-Id: <ИМЕ И ВЕРЗИЈА НА ВАШАТА АПЛИКАЦИЈА>" \
  -H "Content-Type: application/json" \
  -d '{ }'

Секој повик носи X-Api-Key со клуч што го има опфатот IntegrationApi, и X-Software-Id со името и верзијата на твојот софтвер. Како се бара клуч стои во Автентикација.

Parameters

Сите параметри (1)
ParameterInTypePresenceDescription
X-Software-IdheaderstringalwaysIdentifier of the calling software, e.g. SSBFocus/4.2.1. Free text, recorded in the audit trail. Required on every call; missing means EARH-1008.

Request Body

Which series to create.

Тип: application/json.

null

Error codes

EARH-1001 · EARH-1002 · EARH-1003 · EARH-1004 · EARH-1005 · EARH-1006 · EARH-1009 · EARH-1010 · EARH-1011 · EARH-2030

Целосниот список шифри, со што значат и што да се направи, е во Каталог на грешки.

The series was created; the body lists every document with its scenario.

{
  "seed": 0,
  "created": 0,
  "deleted": 0,
  "documents": [
    {
      "scenario": "",
      "docUid": "",
      "euid": "",
      "expect": ""
    }
  ]
}
Сите полиња во телото (4)
FieldTypePresenceDescription
seedinteger · int32alwaysThe series number that was used — the one you sent, or 1.
createdinteger · int32alwaysHow many documents the call created.
deletedinteger · int32alwaysHow many previously seeded documents reset removed; 0 without it.
documentsниза од објектalwaysOne entry per scenario, in the order they were created.

EARH-2030 — a scenario name is not one of the allowed values; the response lists them.

{
  "type": "https://earhiva.mk/errors/EARH-2030",
  "title": "The request body is not usable.",
  "status": 400,
  "code": "EARH-2030"
}
Сите полиња во телото (6)
FieldTypePresenceDescription
typestringalwaysAddress of this code in the error catalogue (RFC 7807).
titlestringalwaysShort, stable English summary of the error — the same string that appears in your log.
statusinteger · int32alwaysHTTP status code, repeated in the body (RFC 7807).
detailstringnullableWhat went wrong in this particular call, when there is more to say than the title. Absent when the title already says everything.
codestringalwaysThe EARH-xxxx code. This is the contract: match on it, not on the text.
eventIdstringnullableOnly on EARH-9000. Quote it when reporting the problem — it is the same reference we record in our log, so one number identifies the event on both sides.

The API key is missing, unknown, expired or revoked — EARH-1001, EARH-1002, EARH-1003. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.

The caller’s address is outside the allowed list, the key does not carry the IntegrationApi scope, the organization’s plan does not include integration access, or the key has been switched off by its owner — EARH-1004, EARH-1005, EARH-1010, EARH-1011. The last two are returned on every call and carry no Retry-After: waiting does not change the state. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.

EARH-1009 — this endpoint does not exist outside the sandbox server.

{
  "type": "https://earhiva.mk/errors/EARH-1009",
  "title": "This endpoint does not exist in this version.",
  "status": 404,
  "code": "EARH-1009"
}
Сите полиња во телото (6)
FieldTypePresenceDescription
typestringalwaysAddress of this code in the error catalogue (RFC 7807).
titlestringalwaysShort, stable English summary of the error — the same string that appears in your log.
statusinteger · int32alwaysHTTP status code, repeated in the body (RFC 7807).
detailstringnullableWhat went wrong in this particular call, when there is more to say than the title. Absent when the title already says everything.
codestringalwaysThe EARH-xxxx code. This is the contract: match on it, not on the text.
eventIdstringnullableOnly on EARH-9000. Quote it when reporting the problem — it is the same reference we record in our log, so one number identifies the event on both sides.

The traffic limit for this key has been reached — EARH-1006. The response carries Retry-After. The limit is counted per key, and its size comes from the organization’s plan. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.

Unexpected error on our side — EARH-9000. The body carries eventId; quote it when reporting the problem. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.