Contractors
Invoices

Preview a Contractor Invoice

Changed on

Returns a base64-encoded PDF preview of a contractor invoice built from the given parameters.

The document is a draft and is not persisted.

Authentication

This endpoint accepts any one of the following token types:

  • Company-scoped access token (OAuth2AuthorizationCode) — obtained by a company manager through the Authorization Code flow or the Refresh Token flow. See Authentication for partners.
  • Company-scoped access token (assertion) (OAuth2CompanyManagerAssertion) — obtained through the urn:ietf:params:oauth:grant-type:jwt-bearer grant for a company manager. See OAuth Assertion.
  • Customer API token (CustomerAPIToken) — generated by the customer on their Integration Settings page, with the scopes they choose there. See Authorization for customers.

Scopes

Any one of the scopes in a token type's row is enough. all:read and all:write work too.

Token typeCategoryRead only ScopeWrite only Scope (read access implicit)
Company-scoped access tokenManage invoices (invoices)View invoices (invoices:read)Manage invoices (invoices:write)
Company-scoped access token (assertion)Manage invoices (invoices)View invoices (invoices:read)Manage invoices (invoices:write)
Customer API tokenManage invoices (invoices)View invoices (invoices:read)Manage invoices (invoices:write)
post/v1/employments/{employment_id}/contractor-invoices/preview

Request

  • Base URL
    https://gateway.remote.com
  • Auth
    • OAuth 2
      Authorization code/auth/oauth2/authorize
      Token URL/auth/oauth2/token
      Scopeshttps://gateway.remote.com/company.manage
    • or OAuth 2
      Authorization code/auth/oauth2/authorize
      Token URL/auth/oauth2/token
      Scopesinvoices:read
    • or OAuth 2
      Authorization code/auth/oauth2/authorize
      Token URL/auth/oauth2/token
      Scopesall:read
    • or OAuth 2
      Authorization code/auth/oauth2/authorize
      Token URL/auth/oauth2/token
      Scopesall:write
    • or OAuth 2
      Client credentials
      Token URL/auth/oauth2/token
      Scopesinvoices:read
    • or OAuth 2
      Client credentials
      Token URL/auth/oauth2/token
      Scopesall:read
    • or OAuth 2
      Client credentials
      Token URL/auth/oauth2/token
      Scopesall:write
    • or HTTP bearer

Path parameters

employment_id, string uuid required

A unique identifier in UUID v4 format.

Example:663e0b79-c893-45ff-a1b2-f6dcabc098b5

Employment identifier

Request body

PreviewContractorInvoiceParams required

Payload shape used to preview a contractor invoice before it's created.

currency, string nullable required

Currency code in ISO 4217 format.

items, ContractorInvoiceScheduleItem[] required

List of invoice items that composes the overall invoice amount.

note, string nullable

Custom defined note.

number, string nullable

Invoice identifier.

start_date, string date required

UTC date in ISO 8601 format

Example request

{
  "currency": "USD",
  "items": [
    {
      "amount": 5000,
      "description": "Description"
    }
  ],
  "note": "Contractor invoice note",
  "number": "Num321",
  "start_date": "2021-07-01"
}

Response

Success

ContractorInvoicePreviewResponse required

Returns a base64 encoded Contractor Invoice preview document.

data, object required

Example response

{
  "data": {
    "contractor_invoice_preview": {
      "content": "data:application/pdf;base64,JVBERi0xLjQK...",
      "name": "contractor-invoice.pdf"
    }
  }
}

Changes

    • info

      the security scope https://gateway.remote.com/company.manage was added to the endpoint's security scheme OAuth2AuthorizationCode

    • info

      the security scope invoices:read was added to the endpoint's security scheme OAuth2CompanyManagerAssertion

    • info

      the security scope all:write was removed from the endpoint's security scheme OAuth2AuthorizationCode

    1 more change in this revision