{ "openapi" : "3.0.1", "info" : { "title" : "Accounting Extension", "description" : "These APIs allow you to interact with HubSpot's Accounting Extension. It allows you to:\n* Specify the URLs that HubSpot will use when making webhook requests to your external accounting system.\n* Respond to webhook calls made to your external accounting system by HubSpot\n", "version" : "v3" }, "servers" : [ { "url" : "https://api.hubapi.com/crm/v3/extensions/accounting" } ], "tags" : [ { "name" : "Settings", "description" : "Operations to interact with URL settings for an external accounting system." }, { "name" : "Callbacks", "description" : "Endpoints that an external accounting system should call when it has finished performing a task requested by HubSpot.\n_Note that all responses to the callback endpoints should contain a `\"@result\"` field, that has a value of either `\"OK\"` or `\"ERR'`, which indicates if the response represents a success or failure of the requested task._\n" }, { "name" : "UserAccounts", "description" : "Operations to inform HubSpot about some required account details for users in an external accounting system." }, { "name" : "Sync", "description" : "Operations to synchronize external accounting system contacts and products with HubSpot." }, { "name" : "Invoice" } ], "paths" : { "/callback/customer-create/{requestId}" : { "post" : { "tags" : [ "Callbacks" ], "summary" : "Endpoint for customer creation response", "description" : "Call this endpoint with the response to a customer creation request.", "operationId" : "post-/crm/v3/extensions/accounting/callback/customer-create/{requestId}", "parameters" : [ { "name" : "requestId", "in" : "path", "description" : "The ID of the request that this response is for", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The ID of the created customer.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ResultIdAccountingResponse" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/callback/customer-search/{requestId}" : { "post" : { "tags" : [ "Callbacks" ], "summary" : "Endpoint for customer search response", "description" : "Call this endpoint with the response to a customer search request.", "operationId" : "post-/crm/v3/extensions/accounting/callback/customer-search/{requestId}", "parameters" : [ { "name" : "requestId", "in" : "path", "description" : "The ID of the request that this response is for", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The result of the customer search request.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CustomerSearchResponseExternal" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/callback/exchange-rate/{requestId}" : { "post" : { "tags" : [ "Callbacks" ], "summary" : "Endpoint for exchange rate response", "description" : "Call this endpoint with the response to an exchange rate request.", "operationId" : "post-/crm/v3/extensions/accounting/callback/exchange-rate/{requestId}", "parameters" : [ { "name" : "requestId", "in" : "path", "description" : "The ID of the request that this response is for", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The result of the exchange rate request.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ExchangeRateResponse" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/callback/invoice-create/{requestId}" : { "post" : { "tags" : [ "Callbacks" ], "summary" : "Endpoint for invoice creation response", "description" : "Call this endpoint with the response to a invoice creation request.", "operationId" : "post-/crm/v3/extensions/accounting/callback/invoice-create/{requestId}", "parameters" : [ { "name" : "requestId", "in" : "path", "description" : "The ID of the request that this response is for", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The ID of the created invoice.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ResultIdAccountingResponse" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/callback/invoice-pdf/{requestId}" : { "post" : { "tags" : [ "Callbacks" ], "summary" : "Endpoint for PDF content of invoice", "description" : "Call this endpoint with the PDF content of a requested invoice.", "operationId" : "post-/crm/v3/extensions/accounting/callback/invoice-pdf/{requestId}", "parameters" : [ { "name" : "requestId", "in" : "path", "description" : "The ID of the request that this response is for", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The bytes of the invoice PDF.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/InvoicePdfResponse" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/callback/invoice-search/{requestId}" : { "post" : { "tags" : [ "Callbacks" ], "summary" : "Endpoint for invoice search response", "description" : "Call this endpoint with the response to a invoice search request.", "operationId" : "post-/crm/v3/extensions/accounting/callback/invoice-search/{requestId}", "parameters" : [ { "name" : "requestId", "in" : "path", "description" : "The ID of the request that this response is for", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The result of the invoice search request.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/InvoiceSearchResponse" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/callback/invoices/{requestId}" : { "post" : { "tags" : [ "Callbacks" ], "summary" : "Endpoint for invoice get-by-id response", "description" : "Call this endpoint with the response to a invoice get-by-id request.", "operationId" : "post-/crm/v3/extensions/accounting/callback/invoices/{requestId}", "parameters" : [ { "name" : "requestId", "in" : "path", "description" : "The ID of the request that this response is for", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The result of the invoice request.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/InvoicesResponseExternal" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/callback/product-search/{requestId}" : { "post" : { "tags" : [ "Callbacks" ], "summary" : "Endpoint for product search response", "description" : "Call this endpoint with the response to a product search request.", "operationId" : "post-/crm/v3/extensions/accounting/callback/product-search/{requestId}", "parameters" : [ { "name" : "requestId", "in" : "path", "description" : "The ID of the request that this response is for", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The result of the product search request.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ProductSearchResponse" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/callback/tax-search/{requestId}" : { "post" : { "tags" : [ "Callbacks" ], "summary" : "Endpoint for taxes search response", "description" : "Call this endpoint with the response to a taxes search request.", "operationId" : "post-/crm/v3/extensions/accounting/callback/tax-search/{requestId}", "parameters" : [ { "name" : "requestId", "in" : "path", "description" : "The ID of the request that this response is for", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The result of the taxes search request.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/TaxSearchResponse" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/callback/terms/{requestId}" : { "post" : { "tags" : [ "Callbacks" ], "summary" : "Endpoint for terms search response", "description" : "Call this endpoint with the response to a terms search request.", "operationId" : "post-/crm/v3/extensions/accounting/callback/terms/{requestId}", "parameters" : [ { "name" : "requestId", "in" : "path", "description" : "The ID of the request that this response is for", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The result of the terms search", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/TermsResponse" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/invoice/{invoiceId}" : { "get" : { "tags" : [ "Invoice" ], "summary" : "Get invoice data", "description" : "Returns invoice data for an Accounting account from the specified ID", "operationId" : "get-/crm/v3/extensions/accounting/invoice/{invoiceId}", "parameters" : [ { "name" : "invoiceId", "in" : "path", "description" : "The ID of the invoice. This is the invoice ID from the external accounting system.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } }, { "name" : "accountId", "in" : "query", "description" : "The ID of the account that the invoice belongs to. This is the account ID from the external accounting system.", "required" : true, "style" : "form", "explode" : true, "schema" : { "type" : "string" } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/InvoiceReadResponse" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] }, "patch" : { "tags" : [ "Invoice" ], "summary" : "Update an invoice", "description" : "Updates an Invoice by the given ID.", "operationId" : "patch-/crm/v3/extensions/accounting/invoice/{invoiceId}", "parameters" : [ { "name" : "invoiceId", "in" : "path", "description" : "The ID of the invoice. This is the invoice ID from the external accounting system.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } }, { "name" : "accountId", "in" : "query", "description" : "The ID of the account that the invoice belongs to. This is the account ID from the external accounting system.", "required" : true, "style" : "form", "explode" : true, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The invoice data to update", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/InvoiceUpdateRequest" } } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/InvoiceUpdateResponse" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/invoice/{invoiceId}/payment" : { "post" : { "tags" : [ "Invoice" ], "summary" : "Records an invoice payment", "description" : "Records an payment against an invoice.", "operationId" : "post-/crm/v3/extensions/accounting/invoice/{invoiceId}/payment", "parameters" : [ { "name" : "invoiceId", "in" : "path", "description" : "The ID of the invoice. This is the invoice ID from the external accounting system.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } }, { "name" : "accountId", "in" : "query", "description" : "The ID of the account that the invoice belongs to. This is the account ID from the external accounting system.", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "string" } } ], "requestBody" : { "description" : "The payment information", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/InvoiceCreatePaymentRequest" } } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/InvoiceUpdateResponse" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/settings/{appId}" : { "get" : { "tags" : [ "Settings" ], "summary" : "Get URL settings", "description" : "Returns the URL settings for an accounting app with the specified ID.", "operationId" : "get-/crm/v3/extensions/accounting/settings/{appId}", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "The ID of the accounting app. This is the identifier of the application created in your HubSpot developer portal.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32" } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/AccountingAppSettings" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ ] }, "put" : { "tags" : [ "Settings" ], "summary" : "Add/Update URL Settings", "description" : "Add/Update the URL settings for an accounting app with the specified ID. All URLs must use the `https` protocol.", "operationId" : "put-/crm/v3/extensions/accounting/settings/{appId}", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "The ID of the accounting app. This is the identifier of the application created in your HubSpot developer portal.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/AccountingAppSettings" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ ] } }, "/sync/{appId}/contacts" : { "post" : { "tags" : [ "Sync" ], "summary" : "Import contacts", "description" : "Imports contacts' properties from an external accounting system to HubSpot. Import details, including property mappings, must be configured previously in HubSpot infrastructure.", "operationId" : "post-/crm/v3/extensions/accounting/sync/{appId}/contacts", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "The ID of the accounting app. This is the identifier of the application created in your HubSpot developer portal.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/SyncContactsRequest" } } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ActionResponse" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/sync/{appId}/products" : { "post" : { "tags" : [ "Sync" ], "summary" : "Import products", "description" : "Imports products' properties from an external accounting system to HubSpot. Import details, including property mappings, must be configured previously in HubSpot infrastructure.", "operationId" : "post-/crm/v3/extensions/accounting/sync/{appId}/products", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "The ID of the accounting app. This is the identifier of the application created in your HubSpot developer portal.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/SyncProductsRequest" } } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ActionResponse" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/user-accounts" : { "put" : { "tags" : [ "UserAccounts" ], "summary" : "Create a user account", "description" : "Creates an account which contains the information about the account in the external accounting system. This *must* be called after a user connects their HubSpot account to the external accounting system, as there is no other way for HubSpot to obtain the external account details.", "operationId" : "put-/crm/v3/extensions/accounting/user-accounts", "requestBody" : { "description" : "The external accounting system user account information.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CreateUserAccountRequestExternal" } } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } }, "/user-accounts/{accountId}" : { "delete" : { "tags" : [ "UserAccounts" ], "summary" : "Delete user account", "description" : "Deletes a user account from HubSpot, meaning that HubSpot will no longer send requests to the external accounting system for this user.", "operationId" : "delete-/crm/v3/extensions/accounting/user-accounts/{accountId}", "parameters" : [ { "name" : "accountId", "in" : "path", "description" : "The ID of the user account to delete.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string" } } ], "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "accounting" ] }, { "oauth2_legacy" : [ "accounting" ] } ] } } }, "components" : { "schemas" : { "ProductSearchResponse" : { "required" : [ "products" ], "type" : "object", "properties" : { "@result" : { "type" : "string", "description" : "Designates if the response is a success ('OK') or failure ('ERR').", "example" : "OK", "enum" : [ "OK", "ERR" ] }, "products" : { "type" : "array", "description" : "The list of products that matched the search criteria.", "items" : { "$ref" : "#/components/schemas/Product" } } }, "description" : "A response to a search for products." }, "ImportInvoiceFeature" : { "required" : [ "enabled" ], "type" : "object", "properties" : { "enabled" : { "type" : "boolean", "description" : "Indicates if importing invoices from the external account system into HubSpot." } }, "description" : "Indicates if importing invoices from the external account system into HubSpot is supported for the integration." }, "Address" : { "type" : "object", "properties" : { "country" : { "type" : "string", "description" : "The country of the address.", "example" : "United States" }, "countrySubDivisionCode" : { "type" : "string", "description" : "A region of the county of the address. May represent county, state etc.", "example" : "NY" }, "city" : { "type" : "string", "description" : "The city of the address.", "example" : "New York" }, "postalCode" : { "type" : "string", "description" : "The postcode/zipcode of the address.", "example" : "10001" }, "lineOne" : { "type" : "string", "description" : "The first line of the address.", "example" : "1 Example Way" } }, "description" : "Represents an address of a customer" }, "ObjectSyncFeature" : { "required" : [ "toHubSpot" ], "type" : "object", "properties" : { "toHubSpot" : { "type" : "boolean", "description" : "Indicates if syncing the object type from the external accounting system into HubSpot is supported." } } }, "TermsResponse" : { "required" : [ "terms" ], "type" : "object", "properties" : { "@result" : { "type" : "string", "description" : "Designates if the response is a success ('OK') or failure ('ERR').", "example" : "OK", "enum" : [ "OK", "ERR" ] }, "terms" : { "type" : "array", "description" : "The list of payment terms that matched the search criteria.", "items" : { "$ref" : "#/components/schemas/AccountingExtensionTerm" } } }, "description" : "A response to a search for payment terms." }, "CreateInvoiceSubFeatures" : { "required" : [ "createCustomer", "exchangeRates", "invoiceComments", "invoiceDiscounts", "taxes", "terms" ], "type" : "object", "properties" : { "createCustomer" : { "type" : "boolean", "description" : "Indicates if a new customer can be created in the external accounting system." }, "taxes" : { "type" : "boolean", "description" : "Indicates if taxes can be specified by the HubSpot user for line items." }, "exchangeRates" : { "type" : "boolean", "description" : "Indicates if the external accounting system supports fetching exchange rates when create an invoice in HubSpot for a customer billed in a different currency." }, "terms" : { "type" : "boolean", "description" : "Indicates if the external accounting system supports fetching payment terms." }, "invoiceComments" : { "type" : "boolean", "description" : "Indicates if a visible comment can be added to invoices." }, "invoiceDiscounts" : { "type" : "boolean", "description" : "Indicates if invoice-level discounts can be added to invoices." } }, "description" : "Lists the individual aspects of creating invoices that are enabled for the integration, as part of the create invoice flow in HubSpot." }, "Product" : { "required" : [ "id", "name", "taxExempt", "unitPrice" ], "type" : "object", "properties" : { "unitPrice" : { "$ref" : "#/components/schemas/UnitPrice" }, "taxExempt" : { "type" : "boolean", "description" : "Identifies if the product is tax exempt or not." }, "salesTaxType" : { "$ref" : "#/components/schemas/TaxType" }, "name" : { "type" : "string", "description" : "The display name of the product.", "example" : "Marketing Services" }, "description" : { "type" : "string", "description" : "The description of the product.", "example" : "Website design, Online advertising and SEO." }, "id" : { "type" : "string", "description" : "The ID of the product in the external accounting system.", "example" : "prod-123" } }, "description" : "Representation of a product in the external accounting system." }, "AccountingFeatures" : { "required" : [ "createInvoice", "importInvoice", "sync" ], "type" : "object", "properties" : { "createInvoice" : { "$ref" : "#/components/schemas/CreateInvoiceFeature" }, "importInvoice" : { "$ref" : "#/components/schemas/ImportInvoiceFeature" }, "sync" : { "type" : "object", "additionalProperties" : { "$ref" : "#/components/schemas/ObjectSyncFeature" }, "description" : "Indicates if syncing objects from the external account system into HubSpot is supported for the integration.\nThis is a map, where the key is one of `CONTACT` or `PRODUCT`, to indicate which type of object you do or don't support syncing.\nFor example:\n```\n \"sync\": {\n \"CONTACT\": {\n \"toHubSpot\": true\n },\n \"PRODUCT\": {\n \"toHubSpot\": true\n }\n }\n```\n" } }, "description" : "Outlines the features that are supported by the external accounting system." }, "Tax" : { "required" : [ "code", "name", "percentage" ], "type" : "object", "properties" : { "code" : { "type" : "string", "description" : "The code/ID of the tax in the external accounting system.", "example" : "tax-1" }, "percentage" : { "type" : "number", "description" : "The tax percentage. For example, 8.05 represents a 8.05% tax rate.", "example" : 8.05 }, "name" : { "type" : "string", "description" : "The display name of the tax.", "example" : "Local Sales Tax" } }, "description" : "Representation of a tax defined in the external accounting system." }, "InvoiceUpdateRequest" : { "type" : "object", "properties" : { "externalInvoiceNumber" : { "type" : "string" }, "currencyCode" : { "type" : "string", "description" : "The ISO 4217 currency code that represents the currency used in the invoice to bill the recipient", "example" : "USD" }, "dueDate" : { "type" : "string", "description" : "The ISO-8601 due date of the invoice.", "format" : "date" }, "externalRecipientId" : { "type" : "string", "description" : "The ID of the invoice recipient. This is the recipient ID from the external accounting system.", "example" : "152" }, "receivedByRecipientDate" : { "type" : "integer", "format" : "int64" }, "isVoided" : { "type" : "boolean", "description" : "States if the invoice is voided or not." }, "receivedByCustomerDate" : { "type" : "string", "description" : "The ISO-8601 datetime of when the customer received the invoice.", "example" : "2020-04-01T13:14:15.678Z" }, "invoiceNumber" : { "type" : "string", "description" : "The number / name of the invoice.", "example" : "Joe Bloggs #42" } }, "description" : "The invoice data to update in HubSpot" }, "ErrorDetail" : { "required" : [ "message" ], "type" : "object", "properties" : { "message" : { "type" : "string", "description" : "A human readable message describing the error along with remediation steps where appropriate" }, "in" : { "type" : "string", "description" : "The name of the field or parameter in which the error was found." }, "code" : { "type" : "string", "description" : "The status code associated with the error detail" }, "subCategory" : { "type" : "string", "description" : "A specific category that contains more specific detail about the error" }, "context" : { "type" : "object", "additionalProperties" : { "type" : "array", "items" : { "type" : "string" } }, "description" : "Context about the error condition", "example" : { "missingScopes" : [ "scope1", "scope2" ] } } } }, "CustomerSearchResponseExternal" : { "required" : [ "@result", "customers" ], "type" : "object", "properties" : { "@result" : { "type" : "string", "description" : "Designates if the response is a success ('OK') or failure ('ERR').", "example" : "OK", "enum" : [ "OK", "ERR" ] }, "customers" : { "type" : "array", "description" : "The list of customers that matched the search criteria.", "items" : { "$ref" : "#/components/schemas/AccountingExtensionCustomer" } } }, "description" : "A response to a search for customers." }, "UpdatedProduct" : { "required" : [ "id", "price", "properties", "syncAction", "updatedAt" ], "type" : "object", "properties" : { "syncAction" : { "type" : "string", "description" : "The operation to be performed.", "enum" : [ "CREATE", "UPDATE", "DELETE" ] }, "updatedAt" : { "type" : "string", "description" : "The timestamp (ISO8601 format) when the product was updated in the external accounting system.", "format" : "date-time" }, "price" : { "type" : "number", "description" : "The price of the product." }, "currencyCode" : { "type" : "string", "description" : "The ISO 4217 currency code that represents the currency of the product price." }, "id" : { "type" : "string", "description" : "The ID of the product in the external accounting system." }, "properties" : { "type" : "object", "additionalProperties" : { "type" : "string" }, "description" : "A map of key-value product properties to be imported." } }, "description" : "A request to import external accounting product properties in HubSpot" }, "ResultIdAccountingResponse" : { "required" : [ "@result", "id" ], "type" : "object", "properties" : { "@result" : { "type" : "string", "description" : "Designates if the response is a success ('OK') or failure ('ERR').", "example" : "OK", "enum" : [ "OK", "ERR" ] }, "id" : { "type" : "string", "description" : "The ID of created entity.", "example" : "js-1" } }, "description" : "A response to the creation of an entity (eg. invoice, customer)." }, "AccountingExtensionInvoice" : { "required" : [ "amountDue", "currency", "customerName", "dueDate", "invoiceLink", "status" ], "type" : "object", "properties" : { "amountDue" : { "type" : "number", "description" : "The total amount due.", "example" : 100.5 }, "balance" : { "type" : "number", "description" : "The remaining outstanding balance due.", "example" : 5E+1 }, "dueDate" : { "type" : "string", "description" : "The due date for payment of the invoice, in ISO-8601 date format (yyyy-MM-dd)", "format" : "date" }, "invoiceNumber" : { "type" : "string", "description" : "The invoice number", "example" : "INV-123" }, "customerId" : { "type" : "string", "description" : "The ID of the customer that this invoice is for.", "example" : "cust-123" }, "currency" : { "type" : "string", "description" : "The ISO 4217 currency code that represents the currency of this invoice.", "example" : "USD" }, "invoiceLink" : { "type" : "string", "description" : "A link to the invoice in the external accounting system.", "example" : "https://myapp.com/invoices/1243a2" }, "customerName" : { "type" : "string", "description" : "The name of the customer that this invoice is for.", "example" : "John Smith" }, "status" : { "type" : "string", "description" : "The currency status of the invoice.", "example" : "OVERDUE", "enum" : [ "CREATED", "SENT", "PAID", "CLOSED", "OVERDUE", "VOIDED" ] } }, "description" : "Representation of an invoice in the external accounting system." }, "TaxSearchResponse" : { "required" : [ "taxes" ], "type" : "object", "properties" : { "@result" : { "type" : "string", "description" : "Designates if the response is a success ('OK') or failure ('ERR').", "example" : "OK", "enum" : [ "OK", "ERR" ] }, "taxes" : { "type" : "array", "description" : "The list of taxes that matched the search criteria", "items" : { "$ref" : "#/components/schemas/Tax" } } }, "description" : "A response to a search for taxes." }, "InvoiceCreatePaymentRequest" : { "required" : [ "amountPaid", "currencyCode", "externalPaymentId", "paymentDateTime" ], "type" : "object", "properties" : { "amountPaid" : { "type" : "number", "description" : "The amount that this payment is for." }, "currencyCode" : { "type" : "string", "description" : "The ISO 4217 currency code that represents the currency of the payment." }, "paymentDateTime" : { "type" : "string", "description" : "The datetime that this payment was received.", "format" : "date-time" }, "externalPaymentId" : { "type" : "string", "description" : "The id of this payment in the external accounting system." } } }, "CreateUserAccountRequestExternal" : { "required" : [ "accountId", "accountName", "currencyCode" ], "type" : "object", "properties" : { "accountId" : { "type" : "string", "description" : "The id of the account in your system." }, "accountName" : { "type" : "string", "description" : "The name of the account in your system. This is normally the name visible to your users." }, "currencyCode" : { "type" : "string", "description" : "The default currency that this account uses." } }, "description" : "Information about the account in your external account system." }, "AccountingExtensionTerm" : { "required" : [ "id", "name" ], "type" : "object", "properties" : { "dueDate" : { "type" : "string", "description" : "The due date for payment of the invoice, in ISO-8601 date format (yyyy-MM-dd)", "format" : "date" }, "name" : { "type" : "string", "description" : "The display name of the payment terms.", "example" : "Net 30" }, "id" : { "type" : "string", "description" : "The ID of the payment terms in the external accounting system.", "example" : "net-30" }, "dueDays" : { "type" : "integer", "description" : "The number of days that these payment terms represent.", "format" : "int32", "example" : 30 } }, "description" : "Representation of payment terms that are defined in the external accounting system. One of 'dueDays' or 'dueDate' is required." }, "AccountingAppUrls" : { "required" : [ "customerUrlTemplate", "getInvoicePdfUrl", "getInvoiceUrl", "invoiceUrlTemplate", "productUrlTemplate", "searchCustomerUrl" ], "type" : "object", "properties" : { "getInvoiceUrl" : { "type" : "string", "description" : "A URL that specifies the endpoint where invoices can be retrieved." }, "searchCustomerUrl" : { "type" : "string", "description" : "A URL that specifies the endpoint where a customer search can be performed." }, "getInvoicePdfUrl" : { "type" : "string", "description" : "A URL that specifies the endpoint where an invoice PDF can be retrieved." }, "customerUrlTemplate" : { "type" : "string", "description" : "A template URL that indicates the endpoint where a customer can be fetched by ID. Note that ${CUSTOMER_ID} in this URL will be replaced by the actual customer ID. For example: https://myapp.com/api/customers/${CUSTOMER_ID}" }, "productUrlTemplate" : { "type" : "string", "description" : "A template URL that indicates the endpoint where a product can be fetched by ID. Note that ${PRODUCT_ID} in this URL will be replaced by the actual product ID. For example: https://myapp.com/api/products/${PRODUCT_ID}" }, "invoiceUrlTemplate" : { "type" : "string", "description" : "A template URL that indicates the endpoint where an invoice can be fetched by ID. Note that ${INVOICE_ID} in this URL will be replaced by the actual invoice ID. For example: https://myapp.com/api/invoices/${INVOICE_ID}" }, "createInvoiceUrl" : { "type" : "string", "description" : "A URL that specifies the endpoint where an invoices can be created." }, "searchInvoiceUrl" : { "type" : "string", "description" : "A URL that specifies the endpoint where an invoice search can be performed." }, "searchProductUrl" : { "type" : "string", "description" : "A URL that specifies the endpoint where a product search can be performed." }, "getTermsUrl" : { "type" : "string", "description" : "A URL that specifies the endpoint where payment terms can be retrieved." }, "createCustomerUrl" : { "type" : "string", "description" : "A URL that specifies the endpoint where a new customer can be created." }, "searchTaxUrl" : { "type" : "string", "description" : "A URL that specifies the endpoint where a tax search can be performed." }, "exchangeRateUrl" : { "type" : "string", "description" : "A URL that specifies the endpoint where exchange rates can be queried." }, "searchUrl" : { "type" : "string" }, "searchCountUrl" : { "type" : "string" } }, "description" : "The URL endpoints that HubSpot will send requests to an external accounting system for certain actions." }, "InvoiceReadResponse" : { "required" : [ "archived", "balanceDue", "createdAt", "currencyCode", "dueDate", "externalAccountId", "externalRecipientId", "id", "invoiceStatus", "isVoided", "totalAmountBilled", "updatedAt" ], "type" : "object", "properties" : { "externalInvoiceNumber" : { "type" : "string", "description" : "The invoice number. Note that this is _not_ the ID of the invoice, but the number that the billed customer will see." }, "totalAmountBilled" : { "type" : "number", "description" : "The total amount that this invoice is for." }, "balanceDue" : { "type" : "number", "description" : "The remaining balance due for the invoice." }, "currencyCode" : { "type" : "string", "description" : "The ISO 4217 currency code that represents the currency of the invoice." }, "dueDate" : { "type" : "string", "description" : "The due date of the invoice", "format" : "date" }, "externalRecipientId" : { "type" : "string", "description" : "The id of the customer in the external accounting system that the invoice was sent to." }, "receivedByRecipientDate" : { "type" : "integer", "description" : "The datetime that that invoice was sent to the customer.", "format" : "int64" }, "externalCreateDateTime" : { "type" : "integer", "description" : "The datetime that the invoice was created in the external accounting system.", "format" : "int64" }, "isVoided" : { "type" : "boolean", "description" : "Indicated is the invoice has been voided or not." }, "createdAt" : { "type" : "string", "description" : "The datetime that the invoice was created in HubSpot.", "format" : "date-time" }, "updatedAt" : { "type" : "string", "description" : "The datetime that the invoice was last updated in HubSpot.", "format" : "date-time" }, "archivedAt" : { "type" : "string", "format" : "date-time" }, "archived" : { "type" : "boolean" }, "externalAccountId" : { "type" : "string", "description" : "The id of the account in the external accounting system that this invoice is related to." }, "invoiceStatus" : { "type" : "string", "description" : "The status of the invoice", "enum" : [ "CREATED", "SENT", "PAID", "CLOSED", "OVERDUE", "VOIDED", "NONE", "UNPAID" ] }, "id" : { "type" : "string", "description" : "The id of this invoice in the external accounting system." } }, "description" : "The invoice data stored in HubSpot" }, "InvoiceUpdateResponse" : { "required" : [ "archived", "balanceDue", "createdAt", "currencyCode", "dueDate", "externalAccountId", "externalRecipientId", "id", "invoiceStatus", "isVoided", "totalAmountBilled", "updatedAt" ], "type" : "object", "properties" : { "externalInvoiceNumber" : { "type" : "string" }, "totalAmountBilled" : { "type" : "number" }, "balanceDue" : { "type" : "number" }, "currencyCode" : { "type" : "string" }, "dueDate" : { "type" : "string", "format" : "date" }, "externalRecipientId" : { "type" : "string" }, "receivedByRecipientDate" : { "type" : "integer", "format" : "int64" }, "externalCreateDateTime" : { "type" : "integer", "format" : "int64" }, "isVoided" : { "type" : "boolean" }, "createdAt" : { "type" : "string", "format" : "date-time" }, "updatedAt" : { "type" : "string", "format" : "date-time" }, "archivedAt" : { "type" : "string", "format" : "date-time" }, "archived" : { "type" : "boolean" }, "externalAccountId" : { "type" : "string" }, "invoiceStatus" : { "type" : "string", "enum" : [ "CREATED", "SENT", "PAID", "CLOSED", "OVERDUE", "VOIDED", "NONE", "UNPAID" ] }, "id" : { "type" : "string" } } }, "AccountingAppSettings" : { "required" : [ "appId", "urls" ], "type" : "object", "properties" : { "appId" : { "type" : "integer", "description" : "The ID of the accounting app. This is the identifier of the application created in your HubSpot developer portal.", "format" : "int32" }, "urls" : { "$ref" : "#/components/schemas/AccountingAppUrls" }, "features" : { "$ref" : "#/components/schemas/AccountingFeatures" } }, "description" : "The URL Settings, which defines the URL endpoints that HubSpot will send requests to an external accounting application for certain actions." }, "AccountingExtensionCustomer" : { "required" : [ "id", "name" ], "type" : "object", "properties" : { "emailAddress" : { "type" : "string", "description" : "The customer's email address", "example" : "johnsmith@example.com" }, "name" : { "type" : "string", "description" : "The customer's full name", "example" : "John Smith" }, "id" : { "type" : "string", "description" : "The ID of the customer in the external accounting system.", "example" : "js-1" }, "billingAddress" : { "$ref" : "#/components/schemas/Address" }, "currencyCode" : { "type" : "string", "description" : "The ISO 4217 currency code that represents the currency the customer should be billed in.", "example" : "USD" } }, "description" : "Representation of a customer in the external accounting system." }, "InvoicesResponseExternal" : { "required" : [ "invoices" ], "type" : "object", "properties" : { "@result" : { "type" : "string", "description" : "Designates if the response is a success ('OK') or failure ('ERR').", "example" : "OK", "enum" : [ "OK", "ERR" ] }, "invoices" : { "type" : "array", "description" : "The list of invoices that were found for the request.", "items" : { "$ref" : "#/components/schemas/AccountingExtensionInvoice" } } }, "description" : "A response to a request for invoices." }, "InvoiceSearchResponse" : { "required" : [ "invoices" ], "type" : "object", "properties" : { "@result" : { "type" : "string", "description" : "Designates if the response is a success ('OK') or failure ('ERR').", "example" : "OK", "enum" : [ "OK", "ERR" ] }, "invoices" : { "type" : "array", "description" : "The list of invoices that matched the search criteria.", "items" : { "$ref" : "#/components/schemas/AccountingExtensionInvoice" } } }, "description" : "A response to a search for invoices." }, "Error" : { "required" : [ "category", "correlationId", "message" ], "type" : "object", "properties" : { "message" : { "type" : "string", "description" : "A human readable message describing the error along with remediation steps where appropriate", "example" : "An error occurred" }, "correlationId" : { "type" : "string", "description" : "A unique identifier for the request. Include this value with any error reports or support tickets", "format" : "uuid", "example" : "aeb5f871-7f07-4993-9211-075dc63e7cbf" }, "category" : { "type" : "string", "description" : "The error category" }, "subCategory" : { "type" : "string", "description" : "A specific category that contains more specific detail about the error" }, "errors" : { "type" : "array", "description" : "further information about the error", "items" : { "$ref" : "#/components/schemas/ErrorDetail" } }, "context" : { "type" : "object", "additionalProperties" : { "type" : "array", "items" : { "type" : "string" } }, "description" : "Context about the error condition", "example" : { "invalidPropertyName" : [ "propertyValue" ], "missingScopes" : [ "scope1", "scope2" ] } }, "links" : { "type" : "object", "additionalProperties" : { "type" : "string" }, "description" : "A map of link names to associated URIs containing documentation about the error or recommended remediation steps" } }, "example" : { "message" : "Invalid input (details will vary based on the error)", "correlationId" : "aeb5f871-7f07-4993-9211-075dc63e7cbf", "category" : "VALIDATION_ERROR", "links" : { "knowledge-base" : "https://www.hubspot.com/products/service/knowledge-base" } } }, "UpdatedContact" : { "required" : [ "emailAddress", "id", "syncAction", "updatedAt" ], "type" : "object", "properties" : { "syncAction" : { "type" : "string", "description" : "The operation to be performed.", "example" : "UPDATE", "enum" : [ "CREATE", "UPDATE", "DELETE" ] }, "updatedAt" : { "type" : "string", "description" : "The timestamp (ISO8601 format) when the customer was updated in the external accounting system.", "format" : "date-time" }, "emailAddress" : { "type" : "string", "description" : "The customer's email address", "example" : "johndoe@company.com" }, "id" : { "type" : "string", "description" : "The ID of the customer in the external accounting system.", "example" : "acct-app-123" }, "customerType" : { "type" : "string", "description" : "Designates the type of the customer object.", "example" : "CONTACT", "enum" : [ "CONTACT", "COMPANY" ] } }, "description" : "A request to import external accounting contact properties in HubSpot" }, "InvoicePdfResponse" : { "required" : [ "invoice" ], "type" : "object", "properties" : { "@result" : { "type" : "string", "description" : "Designates if the response is a success ('OK') or failure ('ERR').", "example" : "OK", "enum" : [ "OK", "ERR" ] }, "invoice" : { "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", "type" : "string", "description" : "The bytes of the invoice PDF.", "format" : "byte" } }, "description" : "A response that contains the PDF of an invoice" }, "CreateInvoiceFeature" : { "required" : [ "enabled", "subFeatures" ], "type" : "object", "properties" : { "enabled" : { "type" : "boolean", "description" : "Indicates if creating invoices in HubSpot is supported for the integration." }, "subFeatures" : { "$ref" : "#/components/schemas/CreateInvoiceSubFeatures" } }, "description" : "Indicates what elements of creating invoices in HubSpot is supported for the integration." }, "SyncProductsRequest" : { "required" : [ "accountId", "products" ], "type" : "object", "properties" : { "accountId" : { "type" : "string", "description" : "The ID of the account in the external accounting system. This is the value that will be passed as `accountId` for all outbound calls for the user from HubSpot to the external accounting system." }, "products" : { "type" : "array", "description" : "A list of products to be imported.", "items" : { "$ref" : "#/components/schemas/UpdatedProduct" } } }, "description" : "A request to import external accounting product properties in HubSpot" }, "ExchangeRateResponse" : { "required" : [ "@result", "exchangeRate", "sourceCurrencyCode", "targetCurrencyCode" ], "type" : "object", "properties" : { "@result" : { "type" : "string", "description" : "Designates if the response is a success ('OK') or failure ('ERR').", "example" : "OK", "enum" : [ "OK", "ERR" ] }, "exchangeRate" : { "type" : "number", "description" : "The exchange rate between the 2 currencies", "example" : 1.003 }, "sourceCurrencyCode" : { "type" : "string", "description" : "The ISO 4217 currency code that represents the source currency of the exchange rate.", "example" : "JPY" }, "targetCurrencyCode" : { "type" : "string", "description" : "The ISO 4217 currency code that represents the target currency of the exchange rate.", "example" : "USD" } }, "description" : "A response to the request for an exchange rate value. It represents the exchange rate from the source currency to the target currency." }, "ActionResponse" : { "required" : [ "completedAt", "startedAt", "status" ], "type" : "object", "properties" : { "status" : { "type" : "string", "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] }, "requestedAt" : { "type" : "string", "format" : "date-time" }, "startedAt" : { "type" : "string", "format" : "date-time" }, "completedAt" : { "type" : "string", "format" : "date-time" }, "links" : { "type" : "object", "additionalProperties" : { "type" : "string" } } } }, "TaxType" : { "required" : [ "code" ], "type" : "object", "properties" : { "code" : { "type" : "string", "description" : "The code/ID of the tax in the external accounting system.", "example" : "tax-1" }, "name" : { "type" : "string", "description" : "The display name of the tax.", "example" : "Local Sales Tax" } }, "description" : "Represents a tax in the external accounting system." }, "UnitPrice" : { "required" : [ "taxIncluded" ], "type" : "object", "properties" : { "amount" : { "type" : "number", "description" : "The actual unit price amount.", "example" : 10.99 }, "taxIncluded" : { "type" : "boolean", "description" : "Indicates if the unit price amount already includes taxes." } }, "description" : "Represents a unit price" }, "SyncContactsRequest" : { "required" : [ "accountId", "contacts" ], "type" : "object", "properties" : { "accountId" : { "type" : "string", "description" : "The ID of the account in the external accounting system. This is the value that will be passed as `accountId` for all outbound calls for the user from HubSpot to the external accounting system.", "example" : "acct-app-123" }, "contacts" : { "type" : "array", "description" : "A list of contacts to be imported.", "items" : { "$ref" : "#/components/schemas/UpdatedContact" } } }, "description" : "A request to import external accounting contact properties in HubSpot" } }, "responses" : { "Error" : { "description" : "An error occurred.", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/Error" } } } } }, "securitySchemes" : { "oauth2_legacy" : { "type" : "oauth2", "flows" : { "authorizationCode" : { "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", "scopes" : { "accounting" : "Invoice Information" } } } }, "private_apps_legacy" : { "type" : "apiKey", "name" : "private-app-legacy", "in" : "header" } } }, "x-hubspot-available-client-libraries" : [ "PHP", "Node", "Python", "Ruby" ] }