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