{"openapi":"3.1.0","info":{"title":"Exportly E-Rechnung API","version":"1","summary":"Retrieve ZUGFeRD/XRechnung e-invoices generated in Stripe, manage Connect sellers, receive webhooks.","description":"Read access to the e-invoices that the Stripe app \"Exportly E-Rechnung\" generates, plus management of the merchant data of connected accounts (Stripe Connect) and signed webhooks.\n\nAuthentication: `Authorization: Bearer erk_test_…` or `erk_live_…`. The key determines account and mode; a test key never sees live documents. Live mode requires the Business or Enterprise plan, test mode works on every plan. Limit: 60 requests per minute per key.\n\nDocumentation: https://exportly.de/stripe-e-rechnung/api","contact":{"name":"Exportly","email":"hi@exportly.de","url":"https://exportly.de"}},"servers":[{"url":"https://api.exportly.de","description":"Production (test and live keys)"}],"tags":[{"name":"Documents","description":"E-invoices and credit notes."},{"name":"Sellers","description":"Merchant data of connected accounts (Stripe Connect). Recommended: store it in the metadata of the connected account (`einvoice_name`, `einvoice_street`, `einvoice_street2`, `einvoice_postal_code`, `einvoice_city`, `einvoice_country`, `einvoice_vat_id`, `einvoice_tax_number`, `einvoice_register`, `einvoice_managing_directors`, `einvoice_contact_name|_phone|_email`, `einvoice_account_holder`, `einvoice_iban`, `einvoice_bic`, `einvoice_bank`, `einvoice_email`, `einvoice_phone`, `einvoice_website`, `einvoice_small_business`) or set `settings.invoices.default_account_tax_ids` during onboarding; Stripe then puts name and VAT ID on every invoice. Precedence: metadata > data stored here > invoice (`account_name`, `account_tax_ids`) > account master data."},{"name":"Seller design","description":"Invoice design per seller: template, logo, colour, font or letterhead, e-mail template."},{"name":"Sender domain","description":"Send the e-invoice e-mails from your own domain (DKIM and custom MAIL FROM). Live mode requires the Enterprise plan or the sender-domain add-on; test mode works on every plan. Until the domain is verified, e-mails are sent from noreply@exportly.de."},{"name":"Webhooks","description":"Signed event notifications to your server."}],"security":[{"bearerAuth":[]}],"paths":{"/v1/documents":{"get":{"operationId":"listDocuments","summary":"List changed documents","description":"Returns documents that changed since `since` (or since the `cursor`), ascending by change time, each in its current state. Poll with `next_cursor`/`next_url` to pick up only what is new.","tags":["Documents"],"parameters":[{"name":"since","in":"query","required":false,"description":"Only documents changed at or after this time (ISO 8601, with offset). Ignored when `cursor` is given.","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","required":false,"description":"Page size (1–100, default 50).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque `next_cursor` of the previous page. Takes precedence over `since`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"seller","in":"query","required":false,"description":"Only documents of this connected account (Stripe Connect, `acct_…`). Filters after reading the page, so a page can hold fewer than `limit` items.","schema":{"type":"string","pattern":"^acct_[A-Za-z0-9]{1,64}$"}},{"name":"version","in":"query","required":false,"description":"Which version to deliver (since app 1.9.1): `original` (default) = the authoritative version the recipient got, `latest` = the latest generation (after a real payment: the version with payment note).","schema":{"type":"string","enum":["original","latest"]}}],"responses":{"200":{"description":"A page of documents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentList"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/documents/{id}":{"get":{"operationId":"getDocument","summary":"Retrieve a document","description":"Returns one invoice or credit note with fresh download links — by default the original version.","tags":["Documents"],"parameters":[{"name":"id","in":"path","required":true,"description":"Stripe ID of the invoice (`in_…`) or credit note (`cn_…`).","schema":{"type":"string","pattern":"^(in|cn)_[A-Za-z0-9]{1,250}$"},"example":"in_1QxLumen7hK2"},{"name":"version","in":"query","required":false,"description":"Which version to deliver (since app 1.9.1): `original` (default) = the authoritative version the recipient got, `latest` = the latest generation (after a real payment: the version with payment note).","schema":{"type":"string","enum":["original","latest"]}}],"responses":{"200":{"description":"The document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/ConnectKeyRejected"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/documents/{id}/versions":{"get":{"operationId":"listDocumentVersions","summary":"List the versions of a document","description":"Returns all versions of one invoice or credit note, oldest first: in live mode with the GoBD archive every archived version (original, version with payment note, regenerated versions), in test mode the versions of the test archive (kept 30 days), otherwise the 90-day working copies. Each with SHA-256 and fresh download links.","tags":["Documents"],"parameters":[{"name":"id","in":"path","required":true,"description":"Stripe ID of the invoice (`in_…`) or credit note (`cn_…`).","schema":{"type":"string","pattern":"^(in|cn)_[A-Za-z0-9]{1,250}$"},"example":"in_1QxLumen7hK2"}],"responses":{"200":{"description":"The versions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentVersionList"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/ConnectKeyRejected"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/sellers":{"get":{"operationId":"listSellers","summary":"List sellers","description":"All merchants of connected accounts maintained for your account and mode. Live mode requires the Enterprise plan (test mode works on every plan).","tags":["Sellers"],"responses":{"200":{"description":"All sellers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerList"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/sellers/{account}":{"parameters":[{"name":"account","in":"path","required":true,"description":"Stripe ID of the connected account (`acct_…`).","schema":{"type":"string","pattern":"^acct_[A-Za-z0-9]{1,64}$"},"example":"acct_1NordLicht7"}],"get":{"operationId":"getSeller","summary":"Retrieve a seller","tags":["Sellers"],"responses":{"200":{"description":"The seller.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/ConnectKeyRejected"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"operationId":"putSeller","summary":"Create or replace a seller","description":"Stores the company data of a merchant (full replacement). Required: `name`, `address` and `vat_id` or `tax_number`. Unknown fields are rejected. If your platform key is set up in the app (full-page view „Händler“), the data is written to the metadata of the connected account (`einvoice_*`), otherwise stored with Exportly. Afterwards `failed` documents of this seller from the last 90 days are regenerated automatically (`retried_documents`).","tags":["Sellers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerInput"}}}},"responses":{"200":{"description":"The stored seller.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerPutResponse"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/ConnectKeyRejected"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteSeller","summary":"Delete a seller","tags":["Sellers"],"responses":{"200":{"description":"Seller deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerDeleted"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/ConnectKeyRejected"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/sellers/{account}/design":{"parameters":[{"name":"account","in":"path","required":true,"description":"Stripe ID of the connected account (`acct_…`).","schema":{"type":"string","pattern":"^acct_[A-Za-z0-9]{1,64}$"},"example":"acct_1NordLicht7"}],"get":{"operationId":"getSellerDesign","summary":"Retrieve a seller's invoice design","description":"The design that applies to future invoices of this seller: its own design (`source: own`) or yours (`source: platform`, never your letterhead).","tags":["Seller design"],"responses":{"200":{"description":"The effective design.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerDesign"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"operationId":"putSellerDesign","summary":"Update a seller's invoice design","description":"Partial update: omitted fields stay unchanged, `null` resets a field. The first update starts from your texts and options, without your logo, letterhead and accent color. Logo and letterhead are referenced by the ID of a finished upload (`POST /v1/sellers/{account}/files`); the upload is checked and processed here (letterheads are rasterised with suggested margins). Applies to all future invoices of the seller.","tags":["Seller design"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerDesignInput"},"example":{"template":"modern","accent_color":"#1f6f5a","logo_file_id":"upl_0f3c9a1b2c3d4e5f60718293a4b5c6d7","mail":{"subject":"Ihre {{dokumentart}} {{rechnungsnummer}} von {{firma}}"}}}}},"responses":{"200":{"description":"The stored design.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerDesign"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/ConnectKeyRejected"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteSellerDesign","summary":"Reset a seller to your design","tags":["Seller design"],"responses":{"200":{"description":"The effective design (`source: platform`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerDesign"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/sellers/{account}/files":{"parameters":[{"name":"account","in":"path","required":true,"description":"Stripe ID of the connected account (`acct_…`).","schema":{"type":"string","pattern":"^acct_[A-Za-z0-9]{1,64}$"},"example":"acct_1NordLicht7"}],"post":{"operationId":"createSellerFile","summary":"Upload a logo or letterhead","description":"Returns a pre-signed `PUT` URL (valid 5 minutes). Upload the file with exactly the given headers, then reference the returned `id` in `PUT /v1/sellers/{account}/design`. Uploads are bound to this seller and expire after one day.","tags":["Seller design"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUploadInput"},"example":{"purpose":"logo","content_type":"image/png","size":48213,"filename":"nordlicht.png"}}}},"responses":{"201":{"description":"Upload prepared.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUpload"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/sellers/{account}/preview":{"parameters":[{"name":"account","in":"path","required":true,"description":"Stripe ID of the connected account (`acct_…`).","schema":{"type":"string","pattern":"^acct_[A-Za-z0-9]{1,64}$"},"example":"acct_1NordLicht7"}],"get":{"operationId":"previewSellerDesign","summary":"Preview a seller's invoice","description":"Renders a sample invoice (sample line items, this seller as seller) in the effective design and returns pre-signed links to the PDF and page 1 as PNG.","tags":["Seller design"],"responses":{"200":{"description":"Preview links.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerPreview"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/sender-domain":{"get":{"operationId":"getSenderDomain","summary":"Retrieve the sender domain","description":"Your sender domain with DNS records and status for the key's mode. A status older than 15 minutes is refreshed automatically; `refresh=true` checks immediately (at most every 20 seconds, otherwise `rate_limited`). `not_found` if no domain is set up.","tags":["Sender domain"],"parameters":[{"name":"refresh","in":"query","required":false,"description":"`true` = check the DNS records now.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"The sender domain.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderDomain"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"operationId":"putSenderDomain","summary":"Set up the sender domain","description":"Creates the domain (DKIM RSA 2048, MAIL FROM `bounce.<domain>`) and returns the DNS records to create. With the domain already set up, only `local_part` changes. One domain per account and mode; to switch domains, delete first. Live mode requires the Enterprise plan or the sender-domain add-on.","tags":["Sender domain"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderDomainInput"},"example":{"domain":"rechnungen.example.com","local_part":"rechnung"}}}},"responses":{"200":{"description":"The sender domain.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderDomain"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"409":{"$ref":"#/components/responses/SenderDomainConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteSenderDomain","summary":"Remove the sender domain","description":"E-mails are sent from noreply@exportly.de again. Idempotent.","tags":["Sender domain"],"responses":{"200":{"description":"Removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderDomainDeleted"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"webhooks":{"document.generated":{"post":{"operationId":"webhook_document_generated","summary":"E-invoice generated (also when regenerated)","description":"Sent when the event `document.generated` occurs. `data.object` is the document at the time of the event, without `files` — fetch fresh links with `GET /v1/documents/{id}`. Configure the endpoint in the Stripe app under Settings → Exportly E-Rechnung → API → Webhook.","tags":["Webhooks"],"parameters":[{"name":"Exportly-Signature","in":"header","required":true,"description":"`t=<unix time>,v1=<hex>` with `v1 = HMAC-SHA256(signing secret, \"<t>.<raw request body>\")`. Verify against the unmodified raw body with a constant-time comparison and reject if `t` is older than 5 minutes.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}},{"name":"Exportly-Delivery","in":"header","required":true,"description":"Event ID (`evt_…`), the same as `id` in the body. Stays the same on retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Acknowledge with any 2xx status within 10 seconds. Anything else (3xx, timeout, network error) counts as not delivered and is retried; 8 attempts over about 24 hours in total."}}}},"document.failed":{"post":{"operationId":"webhook_document_failed","summary":"Generation failed","description":"Sent when the event `document.failed` occurs. `data.object` is the document at the time of the event, without `files` — fetch fresh links with `GET /v1/documents/{id}`. Configure the endpoint in the Stripe app under Settings → Exportly E-Rechnung → API → Webhook.","tags":["Webhooks"],"parameters":[{"name":"Exportly-Signature","in":"header","required":true,"description":"`t=<unix time>,v1=<hex>` with `v1 = HMAC-SHA256(signing secret, \"<t>.<raw request body>\")`. Verify against the unmodified raw body with a constant-time comparison and reject if `t` is older than 5 minutes.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}},{"name":"Exportly-Delivery","in":"header","required":true,"description":"Event ID (`evt_…`), the same as `id` in the body. Stays the same on retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Acknowledge with any 2xx status within 10 seconds. Anything else (3xx, timeout, network error) counts as not delivered and is retried; 8 attempts over about 24 hours in total."}}}},"document.sent":{"post":{"operationId":"webhook_document_sent","summary":"Sent by e-mail","description":"Sent when the event `document.sent` occurs. `data.object` is the document at the time of the event, without `files` — fetch fresh links with `GET /v1/documents/{id}`. Configure the endpoint in the Stripe app under Settings → Exportly E-Rechnung → API → Webhook.","tags":["Webhooks"],"parameters":[{"name":"Exportly-Signature","in":"header","required":true,"description":"`t=<unix time>,v1=<hex>` with `v1 = HMAC-SHA256(signing secret, \"<t>.<raw request body>\")`. Verify against the unmodified raw body with a constant-time comparison and reject if `t` is older than 5 minutes.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}},{"name":"Exportly-Delivery","in":"header","required":true,"description":"Event ID (`evt_…`), the same as `id` in the body. Stays the same on retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Acknowledge with any 2xx status within 10 seconds. Anything else (3xx, timeout, network error) counts as not delivered and is retried; 8 attempts over about 24 hours in total."}}}},"document.delivery_updated":{"post":{"operationId":"webhook_document_delivery_updated","summary":"E-mail delivery status changed (delivered, bounced, complaint)","description":"Sent when the event `document.delivery_updated` occurs. `data.object` is the document at the time of the event, without `files` — fetch fresh links with `GET /v1/documents/{id}`. Configure the endpoint in the Stripe app under Settings → Exportly E-Rechnung → API → Webhook.","tags":["Webhooks"],"parameters":[{"name":"Exportly-Signature","in":"header","required":true,"description":"`t=<unix time>,v1=<hex>` with `v1 = HMAC-SHA256(signing secret, \"<t>.<raw request body>\")`. Verify against the unmodified raw body with a constant-time comparison and reject if `t` is older than 5 minutes.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}},{"name":"Exportly-Delivery","in":"header","required":true,"description":"Event ID (`evt_…`), the same as `id` in the body. Stays the same on retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Acknowledge with any 2xx status within 10 seconds. Anything else (3xx, timeout, network error) counts as not delivered and is retried; 8 attempts over about 24 hours in total."}}}},"document.voided":{"post":{"operationId":"webhook_document_voided","summary":"Invoice voided in Stripe","description":"Sent when the event `document.voided` occurs. `data.object` is the document at the time of the event, without `files` — fetch fresh links with `GET /v1/documents/{id}`. Configure the endpoint in the Stripe app under Settings → Exportly E-Rechnung → API → Webhook.","tags":["Webhooks"],"parameters":[{"name":"Exportly-Signature","in":"header","required":true,"description":"`t=<unix time>,v1=<hex>` with `v1 = HMAC-SHA256(signing secret, \"<t>.<raw request body>\")`. Verify against the unmodified raw body with a constant-time comparison and reject if `t` is older than 5 minutes.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}},{"name":"Exportly-Delivery","in":"header","required":true,"description":"Event ID (`evt_…`), the same as `id` in the body. Stays the same on retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Acknowledge with any 2xx status within 10 seconds. Anything else (3xx, timeout, network error) counts as not delivered and is retried; 8 attempts over about 24 hours in total."}}}},"document.paid":{"post":{"operationId":"webhook_document_paid","summary":"Invoice settled in Stripe (paid, credit note, customer balance or zero amount); after a real payment an additional version with payment note exists","description":"Sent when the event `document.paid` occurs. `data.object` is the document at the time of the event, without `files` — fetch fresh links with `GET /v1/documents/{id}`. Configure the endpoint in the Stripe app under Settings → Exportly E-Rechnung → API → Webhook.","tags":["Webhooks"],"parameters":[{"name":"Exportly-Signature","in":"header","required":true,"description":"`t=<unix time>,v1=<hex>` with `v1 = HMAC-SHA256(signing secret, \"<t>.<raw request body>\")`. Verify against the unmodified raw body with a constant-time comparison and reject if `t` is older than 5 minutes.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}},{"name":"Exportly-Delivery","in":"header","required":true,"description":"Event ID (`evt_…`), the same as `id` in the body. Stays the same on retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Acknowledge with any 2xx status within 10 seconds. Anything else (3xx, timeout, network error) counts as not delivered and is retried; 8 attempts over about 24 hours in total."}}}},"webhook.test":{"post":{"operationId":"webhook_test","summary":"Test event","description":"Sent by \"Send test\" in the app. `data.object` is a short test object, not a document.","tags":["Webhooks"],"parameters":[{"name":"Exportly-Signature","in":"header","required":true,"description":"`t=<unix time>,v1=<hex>` with `v1 = HMAC-SHA256(signing secret, \"<t>.<raw request body>\")`. Verify against the unmodified raw body with a constant-time comparison and reject if `t` is older than 5 minutes.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}},{"name":"Exportly-Delivery","in":"header","required":true,"description":"Event ID (`evt_…`), the same as `id` in the body. Stays the same on retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestEvent"}}}},"responses":{"2XX":{"description":"Acknowledge with any 2xx status within 10 seconds. Anything else (3xx, timeout, network error) counts as not delivered and is retried; 8 attempts over about 24 hours in total."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"erk_test_… | erk_live_…","description":"API key from the Stripe app (Settings → Exportly E-Rechnung → API): `erk_test_<32 characters>` or `erk_live_<32 characters>`."}},"schemas":{"Document":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Stripe ID of the invoice (`in_…`) or credit note (`cn_…`)."},"object":{"type":"string","enum":["invoice","credit_note"],"description":"Kind of document."},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"For credit notes: the related invoice (`in_…`)."},"number":{"type":"string","description":"Invoice or credit note number."},"status":{"type":"string","enum":["processing","generated","sent","failed","voided"],"description":"Processing state of the e-invoice."},"format":{"type":"string","enum":["zugferd","xrechnung","both"],"description":"Effective e-invoice format."},"livemode":{"type":"boolean","description":"`true` for live documents, `false` for test mode."},"amount_gross":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Gross amount in the smallest currency unit (cents), as at Stripe."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 code, lower case like at Stripe. `eur` by default; for accounts enabled by Exportly also a foreign currency with two decimals (`usd`, `gbp`, `chf`, `sek`, `nok`, `dkk`, `pln`, `czk`, `cad`, `aud`) – only for documents without VAT. All amounts of the document are in this currency; nothing is converted."},"issue_date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Invoice date, `YYYY-MM-DD`."},"created_at":{"type":"string","format":"date-time","description":"First generation."},"updated_at":{"type":"string","format":"date-time","description":"Last change. Authoritative for ordering when events arrive out of order."},"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Last successful generation."},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Time the invoice was sent by e-mail."},"delivery_status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Delivery state of the e-mail: `sent`, `delivered`, `bounced` or `complained`."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Failure reason (status `failed`) or note (status `voided`)."},"warnings":{"type":"array","items":{"type":"string"},"description":"Validation notes (German)."},"archived_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of the GoBD retention period if archived."},"seller_account":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Stripe Connect: connected account (`acct_…`) on whose behalf the invoice was issued; that merchant is the seller. `null` = your own account."},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Machine-readable failure reason for status `failed`: `seller_missing`, `connect_plan_required`, `connect_disabled`, `connect_key_invalid` (the platform key stored in the app was rejected by Stripe), `xrechnung_validation_unavailable` (the XRechnung could not be validated after several attempts; nothing was generated – generate it again) or `xrechnung_validation_error` (the validation service could not process this document; retrying does not help – contact support). `null` for every other failure."},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the invoice was settled according to Stripe (paid, settled by credit note or customer balance, or a zero-amount invoice). `null` while open, for credit notes and for documents generated before this field existed."},"settlement":{"anyOf":[{"type":"string","enum":["payment","credit_note","balance","zero","mixed"]},{"type":"null"}],"description":"How the invoice was settled: `payment` (actually paid), `credit_note` (fully offset by a credit note, nothing paid), `balance` (customer credit balance), `zero` (zero-amount invoice) or `mixed` (partly credit note, partly payment/balance). Only `payment` and `mixed` with a payment produce a new version with a payment note; for the others only `paid_at`/`settlement` change. `null` while open."},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Stripe customer (`cus_…`). `null` for documents generated before this field existed."},"buyer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Buyer name (BT-44)."},"amount_net":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Net total (BT-109) in cents. `null` for documents generated before this field existed."},"amount_tax":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"VAT total (BT-110) in cents. `null` for documents generated before this field existed."},"version":{"anyOf":[{"$ref":"#/components/schemas/DocumentVersion"},{"type":"null"}],"description":"The delivered version. Since app 1.9.1 this is the original by default (what the recipient got); `?version=latest` delivers the latest generation (after a real payment: the version with payment note). Use `id` + `version.number` to deduplicate imports. `null` if never generated or if the requested version is unavailable."},"versions_count":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Number of versions generated so far (original, version with payment note, regenerated versions). All of them: `GET /v1/documents/{id}/versions`. `null` for documents generated before this field existed."},"files":{"anyOf":[{"type":"object","properties":{"pdf":{"$ref":"#/components/schemas/DocumentFile"},"xml":{"anyOf":[{"$ref":"#/components/schemas/DocumentFile"},{"type":"null"}]}},"required":["pdf","xml"]},{"type":"null"}],"description":"Pre-signed download links, valid for 15 minutes. `null` if unavailable (see `files_unavailable_reason`)."},"files_unavailable_reason":{"type":"string","enum":["expired","not_generated","version_unavailable"],"description":"Only present when `files` is `null`: `expired` (90-day working copy gone, no archive), `not_generated` (never generated successfully) or `version_unavailable` (`?version=original` for a document whose original was replaced by the version with payment note before app 1.9.1 and is not in the GoBD archive)."},"validation":{"anyOf":[{"$ref":"#/components/schemas/DocumentValidation"},{"type":"null"}],"description":"Validation proof of the delivered version: per XML file the rule set, its version, the time of the check, the number of errors and warnings and the findings. `null` for documents generated before this field existed and while never generated. It states what was checked – not that the invoice is correct in substance."}},"required":["id","object","invoice_id","number","status","format","livemode","amount_gross","currency","issue_date","created_at","updated_at","generated_at","sent_at","delivery_status","error","warnings","archived_until","seller_account","error_code","paid_at","settlement","customer_id","buyer_name","amount_net","amount_tax","version","versions_count","files","validation"]},"DocumentFile":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Pre-signed download URL (valid 15 minutes)."},"expires_at":{"type":"string","format":"date-time","description":"When the link expires."},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256 (hex) of the file — for the 90-day working copy and for files from the GoBD archive. Missing only for working copies generated before this field existed."}},"required":["url","expires_at"]},"DocumentVersion":{"type":"object","properties":{"number":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Running number of this version (1 = first generation). `null` for documents generated before this field existed."},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Archive ID of this version (GoBD archive in live mode with Pro/Business; test archive in test mode, kept 30 days), otherwise `null`."},"trigger":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What created this version: `finalized`, `credit_note`, `manual`, `regenerate`, `paid` (payment note after a real payment), `backfill`. `null` for older documents."},"generated_at":{"type":"string","format":"date-time","description":"When this version was generated."},"variant":{"anyOf":[{"type":"string","enum":["original","paid","superseded"]},{"type":"null"}],"description":"Role of this version: `original` (the authoritative version the recipient got), `paid` (additional version with payment note after a real payment), `superseded` (replaced by „regenerate“; only in the versions list). `null` for documents generated before this field existed whose working copy may already contain a payment note."}},"required":["number","id","trigger","generated_at","variant"]},"DocumentList":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Document"},"description":"Documents changed since `since` or the cursor, ascending by change time; each is the current state."},"has_more":{"type":"boolean","description":"`true` if more changes are available right now."},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque cursor to continue after the last returned change. Stays the same if there were no new changes."},"next_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Ready-made URL for the next request (cursor and `limit`). Also set when `has_more` is `false`, so a client can later ask what is new."}},"required":["object","data","has_more","next_cursor","next_url"]},"DocumentVersionEntry":{"type":"object","properties":{"number":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"trigger":{"anyOf":[{"type":"string"},{"type":"null"}]},"generated_at":{"type":"string","format":"date-time"},"variant":{"anyOf":[{"type":"string","enum":["original","paid","superseded"]},{"type":"null"}]},"object":{"type":"string","const":"document_version","description":"Always `document_version`."},"source":{"type":"string","enum":["working_copy","archive"],"description":"`working_copy` (90-day copy) or `archive` (GoBD archive, live mode with Pro/Business; in test mode the test archive, deleted after 30 days and not GoBD-relevant)."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reason given when the version was regenerated by hand (archive only), otherwise `null`."},"archived_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of the retention period of this archived version, otherwise `null`."},"files":{"anyOf":[{"type":"object","properties":{"pdf":{"$ref":"#/components/schemas/DocumentFile"},"xml":{"anyOf":[{"$ref":"#/components/schemas/DocumentFile"},{"type":"null"}]}},"required":["pdf","xml"]},{"type":"null"}],"description":"Pre-signed download links (15 minutes); `null` if the working copy has expired."},"validation":{"anyOf":[{"$ref":"#/components/schemas/DocumentValidation"},{"type":"null"}],"description":"Validation proof of this version; `null` for versions generated before this field existed and for superseded versions."}},"required":["number","id","trigger","generated_at","variant","object","source","reason","archived_until","files","validation"]},"DocumentVersionList":{"type":"object","properties":{"object":{"type":"string","const":"list"},"document_id":{"type":"string","minLength":1,"description":"Stripe ID of the document."},"data":{"type":"array","items":{"$ref":"#/components/schemas/DocumentVersionEntry"},"description":"All versions, oldest first."},"has_more":{"type":"boolean","description":"Always `false`."}},"required":["object","document_id","data","has_more"]},"DocumentValidation":{"type":"object","properties":{"zugferd":{"anyOf":[{"$ref":"#/components/schemas/DocumentValidationCheck"},{"type":"null"}],"description":"Check of the Factur-X/ZUGFeRD XML embedded in the PDF (profile `en16931`). `null` if this version was generated before validation proofs existed."},"xrechnung":{"anyOf":[{"$ref":"#/components/schemas/DocumentValidationCheck"},{"type":"null"}],"description":"Check of the stand-alone XRechnung XML (profile `xrechnung`: EN 16931 plus the XRechnung rules). `null` if the document has no XRechnung."}},"required":["zugferd","xrechnung"]},"DocumentValidationCheck":{"type":"object","properties":{"status":{"type":"string","enum":["checked","not_checked"],"description":"`checked` = a validation result exists; `not_checked` = the file was delivered without a result (see `reason`)."},"profile":{"type":"string","enum":["en16931","xrechnung"],"description":"Rule set applied: `en16931` (XSD + EN 16931 rules for CII) or `xrechnung` (additionally the XRechnung rules)."},"mode":{"type":"string","enum":["observe","enforce"],"description":"`enforce`: a file with errors is never stored or sent (XRechnung). `observe`: the result is only recorded, so a delivered file can have `valid: false` (ZUGFeRD, since 2026-11)."},"checked_at":{"type":"string","format":"date-time","description":"Time of the check (or of the attempt, for `not_checked`)."},"rules_version":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Version of the KoSIT validation rules as reported by the validator; `null` for `not_checked`."},"valid":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"`true` = no finding of level `error`; `null` for `not_checked`."},"error_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Number of findings of level `error` (complete, even if `findings` is truncated); `null` for `not_checked`."},"warning_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Number of findings of level `warning`; `null` for `not_checked`."},"findings":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["error","warning"]},"id":{"type":"string","minLength":1,"maxLength":60},"message":{"type":"string","maxLength":300}},"required":["level","id","message"]},"description":"Findings, errors first: `level`, rule `id` (e.g. `BR-CO-15`) and `message` as delivered by the rule set. At most 20."},"findings_truncated":{"type":"boolean","description":"`true` if there were more findings than stored."},"reason":{"anyOf":[{"type":"string","enum":["unavailable","fault","no_xml"]},{"type":"null"}],"description":"Only for `not_checked`: `unavailable` (validator not reachable in time), `fault` (validator could not process the file) or `no_xml` (the XML was not available for the check)."},"summary":{"type":"string","description":"German one-liner stating exactly what was checked, e.g. „geprüft nach EN 16931 (KoSIT-Prüfregeln …) am 21.11.2026, 0 Fehler, 0 Hinweise“."}},"required":["status","profile","mode","checked_at","rules_version","valid","error_count","warning_count","findings","findings_truncated","reason","summary"]},"Seller":{"type":"object","properties":{"id":{"type":"string","description":"Connected account (`acct_…`)."},"object":{"type":"string","const":"seller"},"livemode":{"type":"boolean","description":"`true` for live data, `false` for test mode."},"name":{"type":"string"},"address":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"anyOf":[{"type":"string"},{"type":"null"}]},"postal_code":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"}},"required":["line1","line2","postal_code","city","country"]},"vat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"VAT ID with country prefix."},"tax_number":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"National tax number (alternative to `vat_id`)."},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"registry":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Commercial register entry, e.g. `HRB 1234 Amtsgericht Coburg`."},"managing_director":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Managing director(s)."},"bank":{"anyOf":[{"type":"object","properties":{"iban":{"type":"string"},"bic":{"anyOf":[{"type":"string"},{"type":"null"}]},"bank_name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["iban","bic","bank_name"]},{"type":"null"}]},"contact":{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","phone","email"]},"small_business":{"type":"boolean","description":"Small business under § 19 UStG."},"source":{"type":"string","enum":["api","app"],"description":"Where the data was maintained: `api` or `app`."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","object","livemode","name","address","vat_id","tax_number","email","phone","website","registry","managing_director","bank","contact","small_business","source","created_at","updated_at"]},"SellerInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Company name."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"postal_code":{"type":"string","minLength":1,"maxLength":20},"city":{"type":"string","minLength":1,"maxLength":100},"country":{"type":"string","pattern":"^[A-Za-z]{2}$"}},"required":["line1","postal_code","city","country"]},"vat_id":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"description":"VAT ID with country prefix, e.g. `DE123456789`. Either `vat_id` or `tax_number` is required."},"tax_number":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"National tax number. Either `vat_id` or `tax_number` is required."},"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"registry":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"managing_director":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"bank":{"anyOf":[{"type":"object","properties":{"iban":{"anyOf":[{"type":"string","maxLength":42},{"type":"null"}]},"bic":{"anyOf":[{"type":"string","maxLength":11},{"type":"null"}]},"bank_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}}},{"type":"null"}],"description":"Bank details; the IBAN is checked (checksum)."},"contact":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]}}},{"type":"null"}],"description":"Contact person for invoice queries (required for XRechnung)."},"small_business":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Small business under § 19 UStG."}},"required":["name","address"],"additionalProperties":false},"SellerList":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Seller"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"]},"SellerPutResponse":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"seller"},"livemode":{"type":"boolean"},"name":{"type":"string"},"address":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"anyOf":[{"type":"string"},{"type":"null"}]},"postal_code":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"}},"required":["line1","line2","postal_code","city","country"]},"vat_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"tax_number":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"registry":{"anyOf":[{"type":"string"},{"type":"null"}]},"managing_director":{"anyOf":[{"type":"string"},{"type":"null"}]},"bank":{"anyOf":[{"type":"object","properties":{"iban":{"type":"string"},"bic":{"anyOf":[{"type":"string"},{"type":"null"}]},"bank_name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["iban","bic","bank_name"]},{"type":"null"}]},"contact":{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","phone","email"]},"small_business":{"type":"boolean"},"source":{"type":"string","enum":["api","app"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"retried_documents":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of `failed` documents of this seller that were queued for regeneration."}},"required":["id","object","livemode","name","address","vat_id","tax_number","email","phone","website","registry","managing_director","bank","contact","small_business","source","created_at","updated_at","retried_documents"]},"SellerDeleted":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"seller"},"deleted":{"type":"boolean","const":true,"description":"Always `true`."}},"required":["id","object","deleted"]},"SellerDesign":{"type":"object","properties":{"seller":{"type":"string","description":"Connected account (`acct_…`)."},"object":{"type":"string","const":"seller_design"},"livemode":{"type":"boolean"},"source":{"type":"string","enum":["own","platform"],"description":"`own` = the seller's own design, `platform` = your design (never your letterhead, it carries your company data)."},"template":{"type":"string","enum":["classic","modern","minimal","compact","editorial","sidebar","technical"],"description":"Invoice template."},"accent_color":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Accent color (`#rrggbb`); `null` = template default."},"font":{"anyOf":[{"type":"string","enum":["inter","source_serif_4","ibm_plex_sans"]},{"type":"null"}],"description":"Font; `null` = template default."},"logo":{"anyOf":[{"type":"object","properties":{"file_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"content_type":{"type":"string"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["file_name","content_type","width","height"]},{"type":"null"}],"description":"Seller logo; `null` = company name as word mark."},"letterhead":{"anyOf":[{"type":"object","properties":{"enabled":{"type":"boolean"},"pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["enabled","pages","file_name"]},{"type":"null"}],"description":"Seller letterhead (rasterised; the invoice fills the free area)."},"mail":{"anyOf":[{"type":"object","properties":{"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"signature":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["subject","body","signature"]},{"type":"null"}],"description":"Seller e-mail template; `null` = your template or the default text."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Last change of the design."}},"required":["seller","object","livemode","source","template","accent_color","font","logo","letterhead","mail","updated_at"]},"SellerDesignInput":{"type":"object","properties":{"template":{"type":"string","enum":["classic","modern","minimal","compact","editorial","sidebar","technical"],"description":"Invoice template (one of the seven templates)."},"accent_color":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},{"type":"null"}],"description":"Accent color `#rrggbb`; `null` resets to the template default."},"font":{"anyOf":[{"type":"string","enum":["inter","source_serif_4","ibm_plex_sans"]},{"type":"null"}],"description":"Font; `null` resets to the template default."},"logo_file_id":{"anyOf":[{"type":"string","pattern":"^upl_[a-f0-9]{32}$"},{"type":"null"}],"description":"ID of a finished upload (`POST …/files`, purpose `logo`); `null` removes the logo."},"letterhead_file_id":{"anyOf":[{"type":"string","pattern":"^upl_[a-f0-9]{32}$"},{"type":"null"}],"description":"ID of a finished upload (purpose `letterhead`); rasterised with suggested margins. `null` removes it."},"mail":{"anyOf":[{"type":"object","properties":{"subject":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"signature":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}],"description":"E-mail template (subject, body, signature with `{{placeholders}}`); `null` removes it."}},"additionalProperties":false},"FileUploadInput":{"type":"object","properties":{"purpose":{"type":"string","enum":["logo","letterhead"],"description":"`logo` (PNG/JPEG, max. 2 MB) or `letterhead` (PDF/PNG/JPEG, max. 10 MB)."},"content_type":{"type":"string","enum":["image/png","image/jpeg","application/pdf"],"description":"Content type of the file; must be sent unchanged with the upload."},"size":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"File size in bytes; signed into the upload URL."},"filename":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Original file name (display only)."}},"required":["purpose","content_type","size"],"additionalProperties":false},"FileUpload":{"type":"object","properties":{"id":{"type":"string","description":"Upload ID (`upl_…`), use it as `logo_file_id` or `letterhead_file_id`."},"object":{"type":"string","const":"file_upload"},"purpose":{"type":"string","enum":["logo","letterhead"]},"seller":{"type":"string"},"livemode":{"type":"boolean"},"content_type":{"type":"string"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"upload_url":{"type":"string","format":"uri","description":"Pre-signed URL: send the file with `PUT` and the `upload_headers` (valid 5 minutes)."},"upload_method":{"type":"string","const":"PUT"},"upload_headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"type":"string","format":"date-time","description":"When the upload URL expires."}},"required":["id","object","purpose","seller","livemode","content_type","size","upload_url","upload_method","upload_headers","expires_at"]},"SellerPreview":{"type":"object","properties":{"object":{"type":"string","const":"seller_preview"},"seller":{"type":"string"},"livemode":{"type":"boolean"},"source":{"type":"string","enum":["own","platform"],"description":"Design used: `own` or `platform`."},"pdf_url":{"type":"string","format":"uri","description":"Pre-signed URL of the preview PDF with sample data (valid 15 minutes)."},"png_url":{"type":"string","format":"uri","description":"Page 1 as PNG (valid 15 minutes)."},"page_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expires_at":{"type":"string","format":"date-time"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"required":["object","seller","livemode","source","pdf_url","png_url","page_count","expires_at","warnings"]},"SenderDomain":{"type":"object","properties":{"object":{"type":"string","const":"sender_domain"},"livemode":{"type":"boolean","description":"`true` for the live-mode setting, `false` for test mode (each mode has its own setting)."},"domain":{"type":"string","description":"Your sender domain, e.g. `rechnungen.example.com`."},"local_part":{"type":"string","description":"Part before the @ of the sender address (default `rechnung`)."},"from_address":{"type":"string","description":"Sender address once the domain is verified."},"mail_from_domain":{"type":"string","description":"Custom MAIL FROM domain (`bounce.<domain>`) for bounces and SPF."},"status":{"type":"string","enum":["pending","verified","failed"],"description":"Verification of the domain (DKIM). Only `verified` domains are used for sending."},"dkim_status":{"type":"string","enum":["pending","verified","failed"],"description":"Status of the three DKIM CNAME records."},"mail_from_status":{"type":"string","enum":["pending","verified","failed"],"description":"Status of the MAIL FROM records (MX and SPF)."},"active":{"type":"boolean","description":"`true` if e-invoice e-mails are currently sent from `from_address` (verified and enabled for your plan)."},"effective_from_address":{"type":"string","description":"Address used for the next e-mail: `from_address` or `noreply@exportly.de`."},"records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CNAME","MX","TXT"]},"name":{"type":"string"},"value":{"type":"string"},"purpose":{"type":"string","enum":["dkim","mail_from_mx","mail_from_spf","dmarc"]},"status":{"anyOf":[{"type":"string","enum":["pending","verified","failed"]},{"type":"string","const":"recommended"}]}},"required":["type","name","value","purpose","status"]},"description":"DNS records to create at your DNS provider; `status` per record (`recommended` = not checked)."},"created_at":{"type":"string","format":"date-time"},"checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Last check with the e-mail provider."},"verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"First successful verification."}},"required":["object","livemode","domain","local_part","from_address","mail_from_domain","status","dkim_status","mail_from_status","active","effective_from_address","records","created_at","checked_at","verified_at"]},"SenderDomainInput":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":253,"description":"Domain you control (fully qualified, no `https://`, no e-mail address). Free-mail and Exportly domains are rejected."},"local_part":{"type":"string","maxLength":64,"description":"Part before the @ (a–z, 0–9, `.`, `-`, `_`, `+`). Default `rechnung`."}},"required":["domain"]},"SenderDomainDeleted":{"type":"object","properties":{"object":{"type":"string","const":"sender_domain"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The removed domain, `null` if none was set up."},"deleted":{"type":"boolean","const":true,"description":"Always `true`."}},"required":["object","domain","deleted"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_api_key","plan_required","not_found","seller_not_found","connect_key_rejected","sender_domain_conflict","invalid_request","rate_limited","internal_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"WebhookDocument":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Stripe ID of the invoice (`in_…`) or credit note (`cn_…`)."},"object":{"type":"string","enum":["invoice","credit_note"]},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"number":{"type":"string"},"status":{"type":"string","enum":["processing","generated","sent","failed","voided"]},"format":{"type":"string","enum":["zugferd","xrechnung","both"]},"livemode":{"type":"boolean"},"amount_gross":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"issue_date":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"delivery_status":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string"}},"archived_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"seller_account":{"anyOf":[{"type":"string"},{"type":"null"}]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settlement":{"anyOf":[{"type":"string","enum":["payment","credit_note","balance","zero","mixed"]},{"type":"null"}]},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"buyer_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount_net":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amount_tax":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/DocumentVersion"},{"type":"null"}]},"versions_count":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"validation":{"anyOf":[{"$ref":"#/components/schemas/DocumentValidation"},{"type":"null"}]}},"required":["id","object","invoice_id","number","status","format","livemode","amount_gross","currency","issue_date","created_at","updated_at","generated_at","sent_at","delivery_status","error","warnings","archived_until","seller_account","error_code","paid_at","settlement","customer_id","buyer_name","amount_net","amount_tax","version","versions_count","validation"]},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string","description":"Event ID (`evt_…`). Identical on every retry; use it to discard duplicates."},"created":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix time (seconds) the event was created."},"livemode":{"type":"boolean","description":"`true` for live events, `false` for test mode."},"type":{"type":"string","enum":["document.generated","document.failed","document.sent","document.delivery_updated","document.voided","document.paid"],"description":"Event type."},"data":{"type":"object","properties":{"object":{"$ref":"#/components/schemas/WebhookDocument"}},"required":["object"]}},"required":["id","created","livemode","type","data"]},"WebhookTestEvent":{"type":"object","properties":{"id":{"type":"string"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"livemode":{"type":"boolean"},"type":{"type":"string","const":"webhook.test"},"data":{"type":"object","properties":{"object":{"type":"object","properties":{"object":{"type":"string","const":"webhook_test"},"message":{"type":"string"}},"required":["object","message"]}},"required":["object"]}},"required":["id","created","livemode","type","data"]}},"responses":{"InvalidRequest":{"description":"`invalid_request`: invalid parameter, cursor or request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Invalid parameter: limit."}}}}},"InvalidApiKey":{"description":"`invalid_api_key`: key missing, wrong, revoked, or the app is uninstalled.","headers":{"WWW-Authenticate":{"description":"Always `Bearer realm=\"exportly-erechnung\"`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"Invalid API key provided."}}}}},"PlanRequired":{"description":"`plan_required`: live key without Business/Enterprise plan, or `/v1/sellers` in live mode without Enterprise.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"plan_required","message":"Live mode API access requires the Business or Enterprise plan. Test mode keys work on every plan."}}}}},"NotFound":{"description":"`not_found`: unknown document or seller (or it belongs to another account or mode). `seller_not_found` on `/v1/sellers/{account}…`: the account is not a connected account of your platform (with a platform key stored in the app) or, without a platform key, no seller was created for it yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such document: 'in_1QxUnknown'."}}}}},"ConnectKeyRejected":{"description":"`connect_key_rejected`: Stripe rejects the platform key (restricted key `rk_…`) stored in the app (revoked, deleted or permissions changed). Store a new key in the app under Sellers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"connect_key_rejected","message":"Stripe rejected the platform key stored in the app. Store a new restricted key in the app."}}}}},"SenderDomainConflict":{"description":"`sender_domain_conflict`: another domain is already set up for this mode (delete it first), or the domain belongs to another account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"sender_domain_conflict","message":"Another sender domain is already set up. Delete it first."}}}}},"RateLimited":{"description":"`rate_limited`: more than 60 requests per minute for this key.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests. Limit: 60 requests per minute per API key."}}}}},"InternalError":{"description":"`internal_error`: unexpected error, retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Internal server error."}}}}}}}}