Deel: Get invoice by id
Deel accounting.getInvoiceById: arguments, response, policy and SDK examples.
← Accounting operations · Get started
Operation deel.accounting_getinvoicebyid_v2026_01_01
Provider route: GET /invoices/{invoice_id}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/deel with npm, or alter-sdk-deel with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { DeelIntegration } from "@alter-ai/deel";
async function execute(input: Parameters<DeelIntegration["accounting"]["getInvoiceById"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new DeelIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.accounting.getInvoiceById(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_deel import DeelIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = DeelIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.accounting.get_invoice_by_id(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.invoice_id | string | Required within parent |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Get invoice by id — 200 response body |
Referenced models: Get invoice by id — 200 response body
Schemas
Section titled “Schemas”1 more schema is linked from the tables above, on the schema pages.
Get invoice by id — 200 response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | Model | Optional | Expand Get invoice by id — 200 response body — data The invoice resource returned |
Referenced models: Get invoice by id — 200 response body — data
Get invoice by id — 200 response body — data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The invoice resource returned |
contract_id | JSON | Optional | |
contract_id (anyOf 1) | string | Alternative | Unique identifier of the related contract. For invoices linked directly to a contract this is that contract; for invoices covering service reports it is the contract of the linked service report with the lowest id (for invoices spanning several contracts only that one is returned). Null when the invoice has no related contract (e.g. organization-level fee invoices). |
contract_id (anyOf 2) | null | Alternative | Unique identifier of the related contract. For invoices linked directly to a contract this is that contract; for invoices covering service reports it is the contract of the linked service report with the lowest id (for invoices spanning several contracts only that one is returned). Null when the invoice has no related contract (e.g. organization-level fee invoices). |
created_at | string | Optional | Timestamp of when the invoice was created in the system Format: date-time |
currency | string | Optional | Currency code for the invoice total |
due_date | string | Optional | The due date for the invoice payment Format: date-time |
id | string | Optional | Unique identifier for the invoice |
issued_at | string | Optional | Date and time when the invoice was issued Format: date-time |
label | string | Optional | Human-readable label or reference number for the invoice |
line_items | array | Optional | The individual line items associated with the invoice |
line_items[] | Model | Each item | Expand Get invoice by id — 200 response body — data line items item |
paid_at | string | Optional | Date and time when the invoice was paid Format: date-time |
recipient_legal_entity_id | string | Optional | Unique identifier for the recipient legal entity Format: uuid |
status | string | Optional | Current payment status of the invoice. Known values: open, pending, skipped, preprocessing, processing, credited, processed, paid, failed, cancelled, refunded, unpayable, awaiting_payment |
total | string | Optional | Total amount of the invoice |
worker_id | string | Optional | Unique identifier for the worker profile Format: uuid |
Referenced models: Get invoice by id — 200 response body — data line items item
Get invoice by id — 200 response body — data line items item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
adjustment_id | JSON | Optional | |
adjustment_id (anyOf 1) | string | Alternative | For line items sourced from an EOR adjustment payout, the id of the originating adjustment — matches the id returned by the Retrieve adjustments API (GET /contracts/{contract_id}/adjustments). Null for non-adjustment line items (e.g. fees, deposits). Global Payroll adjustment correlation is not yet supported. Note: for legacy (pre-migration) EOR adjustments the Retrieve adjustments API may return a legacy id instead; those historical line items may not correlate. |
adjustment_id (anyOf 2) | null | Alternative | For line items sourced from an EOR adjustment payout, the id of the originating adjustment — matches the id returned by the Retrieve adjustments API (GET /contracts/{contract_id}/adjustments). Null for non-adjustment line items (e.g. fees, deposits). Global Payroll adjustment correlation is not yet supported. Note: for legacy (pre-migration) EOR adjustments the Retrieve adjustments API may return a legacy id instead; those historical line items may not correlate. |
description | string | Optional | Main description of the line item |
fx_rate | string | Optional | Exchange rate used for this line item |
id | string | Optional | Unique identifier for the line item |
price_per_unit | JSON | Optional | |
price_per_unit (anyOf 1) | number | Alternative | Price charged per unit Format: double |
price_per_unit (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
pricing_fx_rate | string | Optional | Exchange rate used for pricing calculations on this line item |
quantity | JSON | Optional | |
quantity (anyOf 1) | integer | Alternative | Quantity of units billed in this line item |
quantity (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
sub_description | string | Optional | Optional additional description or detail |
tax_rate | string | Optional | Tax rate applied to this line item |
tax_type | JSON | Optional | |
tax_type (anyOf 1) | string | Alternative | Type of tax applied (if any); can be null |
tax_type (anyOf 2) | null | Alternative | Type of tax applied (if any); can be null |
total | string | Optional | Total amount for this line item |
type | Model | Optional | Expand Get invoice by id — 200 response body — data line items item type The type of this line item |
Referenced models: Get invoice by id — 200 response body — data line items item type
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: deel.accounting_getinvoicebyid_v2026_01_01. Catalog operation: accounting_getinvoicebyid_v2026_01_01. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["accounting:read"]
Pinned headers: {"X-Version": "2026-01-01"}