Pređi na sadržaj
API dokumentacija

Send receipt via email

POST
/receipt/send-email
Code sample: curl
curl -X POST https://api.fiscomm.rs/receipt/send-email \
-H "Authorization: Bearer $FISCOMM_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "invoiceNumber": "AZM5ZCCR-Dt1Ov2o0-507308", "email": "buyer@example.com" }'

Sends a previously issued fiscal receipt to the specified customer email address. The receipt is attached as a PDF. Body: { invoiceNumber, email, cc?, bcc? } → { success, correlationId }. Requires shop-level access via Bearer token or API key.

Media typeapplication/json
object
invoiceNumber
required

Invoice number of the receipt to send

string
email
required

Primary email address to send the receipt to

string
cc

CC (Carbon Copy) email addresses

Array<string>

Example

[
"cc1@example.com",
"cc2@example.com"
]
bcc

BCC (Blind Carbon Copy) email addresses

Array<string>

Example

[
"bcc1@example.com",
"bcc2@example.com"
]
Media typeapplication/json
object
success
required

Whether the email was accepted for delivery.

boolean
messageId

Provider message id, when the email was accepted.

string
error

Error detail, present only when success is false.

string
correlationId

Correlation id of the request, for support/log lookups.

string

Example

{
"success": true,
"correlationId": "5143aa4e-470d-4517-bd0f-07b1bb4201c8"
}

Validation or business-rule error. Branch on code: ERR_00202 (input validation), ERR_00701 (items total ≠ payments total), ERR_01010 (rejected by the Tax Administration).

Media typeapplication/json
object
status
required

HTTP status code.

number
code
required

Machine-readable Fiscomm error code. Examples: ERR_00202 (validation), ERR_00701 (item total does not match payment total), ERR_00002 (internal error).

string
message
required

Technical message describing the error.

string
userMessage

Human-friendly message safe to surface to an end user.

string
details

Additional structured detail. For validation errors this includes validationErrors: [{ field, message }].

object
key
additional properties
any
path

Request path.

string
correlationId

Correlation id of the request, for support/log lookups.

string

Example

{
"status": 400,
"code": "ERR_00202",
"message": "Validation failed",
"details": {
"validationErrors": [
{
"field": "orderNumber",
"message": "should not be empty"
}
]
},
"path": "/receipt/normal/sale",
"correlationId": "5cbf3d9f-bd38-4375-89ab-34ed6be68d97"
}

Missing or invalid API key.

Media typeapplication/json
object
status
required

HTTP status code.

number
code
required

Machine-readable Fiscomm error code. Examples: ERR_00202 (validation), ERR_00701 (item total does not match payment total), ERR_00002 (internal error).

string
message
required

Technical message describing the error.

string
userMessage

Human-friendly message safe to surface to an end user.

string
details

Additional structured detail. For validation errors this includes validationErrors: [{ field, message }].

object
key
additional properties
any
path

Request path.

string
correlationId

Correlation id of the request, for support/log lookups.

string

Example

{
"status": 401,
"code": "ERR_00101",
"message": "Failed to validate API token",
"correlationId": "5cbf3d9f-bd38-4375-89ab-34ed6be68d97"
}

The API key is valid but has no access to this shop or resource.

Media typeapplication/json
object
status
required

HTTP status code.

number
code
required

Machine-readable Fiscomm error code. Examples: ERR_00202 (validation), ERR_00701 (item total does not match payment total), ERR_00002 (internal error).

string
message
required

Technical message describing the error.

string
userMessage

Human-friendly message safe to surface to an end user.

string
details

Additional structured detail. For validation errors this includes validationErrors: [{ field, message }].

object
key
additional properties
any
path

Request path.

string
correlationId

Correlation id of the request, for support/log lookups.

string

Example

{
"status": 403,
"message": "Forbidden — API key has no access to this shop",
"correlationId": "5cbf3d9f-bd38-4375-89ab-34ed6be68d97"
}

The requested resource does not exist.

Media typeapplication/json
object
status
required

HTTP status code.

number
code
required

Machine-readable Fiscomm error code. Examples: ERR_00202 (validation), ERR_00701 (item total does not match payment total), ERR_00002 (internal error).

string
message
required

Technical message describing the error.

string
userMessage

Human-friendly message safe to surface to an end user.

string
details

Additional structured detail. For validation errors this includes validationErrors: [{ field, message }].

object
key
additional properties
any
path

Request path.

string
correlationId

Correlation id of the request, for support/log lookups.

string

Example

{
"status": 404,
"code": "NOT_FOUND",
"message": "Resource not found",
"correlationId": "5cbf3d9f-bd38-4375-89ab-34ed6be68d97"
}

Internal error. Safe to retry later.

Media typeapplication/json
object
status
required

HTTP status code.

number
code
required

Machine-readable Fiscomm error code. Examples: ERR_00202 (validation), ERR_00701 (item total does not match payment total), ERR_00002 (internal error).

string
message
required

Technical message describing the error.

string
userMessage

Human-friendly message safe to surface to an end user.

string
details

Additional structured detail. For validation errors this includes validationErrors: [{ field, message }].

object
key
additional properties
any
path

Request path.

string
correlationId

Correlation id of the request, for support/log lookups.

string

Example

{
"status": 500,
"code": "ERR_00002",
"userMessage": "Server error. Please try again later.",
"correlationId": "5cbf3d9f-bd38-4375-89ab-34ed6be68d97"
}