### GraphQL API Request Example Source: https://developer.waveapps.com/hc/en-us/articles/360019493652-OAuth-Guide Example of making a request to the Wave GraphQL API using an access token. ```APIDOC ## GraphQL API Request Example ### Description This example demonstrates how to query the Wave GraphQL API using a POST request with an authorization header. ### Method POST ### Endpoint https://gql.waveapps.com/graphql/public ### Headers - Authorization: Bearer - Content-Type: application/json ### Request Body ```json { "query": "query { user { id defaultEmail } }", "variables": {} } ``` ### Response Example (Response structure depends on the query) ``` -------------------------------- ### JavaScript fetch Example Source: https://developer.waveapps.com/hc/en-us/articles/360018856171 Example of how to send a GraphQL query using the JavaScript fetch API, demonstrating asynchronous request handling. ```APIDOC ## JavaScript fetch Request Example ### Description This example shows how to use the JavaScript `fetch` API to send a POST request to the Wave GraphQL API. It configures the request with the appropriate headers and sends a JSON-encoded body containing the GraphQL query and variables. ### Method POST ### Endpoint https://gql.waveapps.com/graphql/public ### Headers - **Authorization**: Bearer - **Content-Type**: application/json ### Request Body ```json { "query": "query { user { id defaultEmail } }", "variables": {} } ``` ### Code ```javascript fetch('https://gql.waveapps.com/graphql/public', { method: 'POST', headers: { 'Authorization': 'Bearer ', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'query { user { id defaultEmail } }', variables: {} }) }) .then(r => r.json()) .then(data => console.log(data)); ``` ``` -------------------------------- ### GraphQL Response Example Source: https://developer.waveapps.com/hc/en-us/articles/360024906591-Variables This is an example of a successful GraphQL response when using variables. ```json { "data": { "business": { "name": "Smith Consulting", "phone": null } } } ``` -------------------------------- ### cURL Example Source: https://developer.waveapps.com/hc/en-us/articles/360018856171 Example of how to send a GraphQL query using cURL, including authentication and content type headers. ```APIDOC ## cURL Request Example ### Description This example demonstrates how to make a POST request to the Wave GraphQL API using cURL. It includes the necessary Authorization header with a Bearer token and the JSON payload containing the query. ### Method POST ### Endpoint https://gql.waveapps.com/graphql/public ### Headers - **Authorization**: Bearer - **Content-Type**: application/json ### Request Body ```json { "query": "query { user { id defaultEmail } }", "variables": {} } ``` ### Command ```bash curl -X POST "https://gql.waveapps.com/graphql/public" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "query": "query { user { id defaultEmail } }", "variables": {} }' ``` ``` -------------------------------- ### Callback URL Example Source: https://developer.waveapps.com/hc/en-us/articles/360019493652-OAuth-Guide This is an example of the callback URL Wave redirects users to after authorization. It includes the authorization code and state parameter for verification. ```HTTP https://your-site.com/callback?code=AUTH_CODE_HERE&state=abc123 ``` -------------------------------- ### Base64 Encoding Example for Business ID Source: https://developer.waveapps.com/hc/en-us/articles/47778664499220-Webhooks-Setup-Guide This example demonstrates how to encode a raw business ID into a Base64 string, which is often required for API requests. The format 'Business:{business_id}' is used before encoding. ```text Raw ID: test-business-id String to encode: Business:test-business-id Final encoded ID: QnVzaW5lc3M6dGVzdC1idXNpbmVzcy1pZA== ``` -------------------------------- ### Businesses Query with Pagination Source: https://developer.waveapps.com/hc/en-us/articles/360018856791 This example demonstrates how to query businesses with pagination parameters and retrieve page information. ```APIDOC ## Businesses Query with Pagination ### Description This operation allows you to retrieve a list of businesses with control over the number of results per page and the specific page number. It also supports fetching detailed pagination information. ### Method query ### Endpoint N/A (GraphQL Operation) ### Parameters #### Query Parameters - **page** (Int) - Optional - The page number to retrieve (1-based indexing). - **pageSize** (Int) - Optional - The number of results to return per page. ### Request Example ```graphql query { businesses(page: 1, pageSize: 10) { pageInfo { currentPage totalPages totalCount } edges { node { id name } } } } ``` ### Response #### Success Response (200) - **data.businesses.pageInfo.currentPage** (Int) - The current page number. - **data.businesses.pageInfo.totalPages** (Int) - The total number of available pages. - **data.businesses.pageInfo.totalCount** (Int) - The total number of items across all pages. - **data.businesses.edges** (Array) - A list of business edges, where each edge contains a node with business details. - **data.businesses.edges[].node.id** (String) - The unique identifier for the business. - **data.businesses.edges[].node.name** (String) - The name of the business. #### Response Example ```json { "data": { "businesses": { "pageInfo": { "currentPage": 1, "totalPages": 1, "totalCount": 2 }, "edges": [ { "node": { "id": "QnVzaW5lc3M6NzE1MjQ3NjEtZjYxMS00ODk0LWE3NDgtNzg3MmYwODgyNWIw", "name": "Personal" } }, { "node": { "id": "QnVzaW5lc3M6MWRhMmExNzctNzg2OC00NmMxLTgzMzktM2M4NjdlZDJlZGQ5", "name": "Smith Consulting" } } ] } } } ``` ``` -------------------------------- ### Get Product Source: https://developer.waveapps.com/hc/en-us/articles/360019968212 Retrieves a specific product or service of the business. ```APIDOC ## Get Product ### Description Retrieves a specific product or service of the business using its ID. ### Method GET ### Endpoint /business/product/{id} ### Parameters #### Path Parameters - **id** (ID!) - Required - ID of product. ### Response #### Success Response (200) - **product** (Product) - Details of the product. ``` -------------------------------- ### Base64 Encoding Example for Invoice ID Source: https://developer.waveapps.com/hc/en-us/articles/47778664499220-Webhooks-Setup-Guide This example shows the process of encoding a combined business and invoice ID into a Base64 string. The format 'Business:{business_id};Invoice:{invoice_id}' is used prior to encoding. ```text Raw Business ID: test-business-id Raw Invoice ID: test-invoice-id Combined String: Business:test-business-id;Invoice:test-invoice-id Final Base64 Value: QnVzaW5lc3M6dGVzdC1idXNpbmVzcy1pZDtJbnZvaWNlOnRlc3QtaW52b2ljZS1pZA== ``` -------------------------------- ### Fetch Currency Data by Code Source: https://developer.waveapps.com/hc/en-us/articles/360018937431-API-Playground This example demonstrates how to fetch currency data using a specific currency code as a variable. The `code` variable must be of type `CurrencyCode`. ```graphql query($code: CurrencyCode!) { currency(code: $code) { name symbol } } ``` -------------------------------- ### Authentication Error Example (Login Required) Source: https://developer.waveapps.com/hc/en-us/articles/360018571372 This example illustrates a GraphQL response when authentication fails, typically due to a missing or expired Authorization header. The error has an 'UNAUTHENTICATED' code, and the requested data field resolves to null. ```graphql query { user { id defaultEmail } } ``` ```json { "errors": [ { "extensions": { "id": "d9e441c5-8c54-421b-bcdb-f0c2012a9f9c", "code": "UNAUTHENTICATED" }, "message": "Login required.", "locations": [ { "line": 2, "column": 3 } ], "path": [ "user" ] } ], "data": { "user": null } } ``` -------------------------------- ### Resource Not Found Error Example Source: https://developer.waveapps.com/hc/en-us/articles/360018571372 This example shows a GraphQL response when a requested resource, like a Business, cannot be found by its ID. The response includes an error with a 'NOT_FOUND' code and the 'data' field shows the resolved field as null. ```graphql query { business(id: "BAD_ID") { id name } } ``` ```json { "errors": [ { "extensions": { "id": "d9e441c5-8c54-421b-bcdb-f0c2012a9f9c", "code": "NOT_FOUND" }, "message": "Business 'BAD_ID' could not be found.", "locations": [ { "line": 2, "column": 3 } ], "path": [ "business" ] } ], "data": { "business": null } } ``` -------------------------------- ### Making requests to the Wave GraphQL API Source: https://developer.waveapps.com/hc/en-us/articles/360019493652 An example of how to make a POST request to the Wave GraphQL API using an access token for authentication. ```APIDOC ## Making requests to the Wave GraphQL API ### Description This endpoint allows you to query the Wave GraphQL API using an access token. ### Method POST ### Endpoint `https://gql.waveapps.com/graphql/public` ### Headers - `Authorization`: Bearer - `Content-Type`: application/json ### Request Body ```json { "query": "query { user { id defaultEmail } }", "variables": {} } ``` ### Response Example (Response structure depends on the GraphQL query) ``` -------------------------------- ### Using Variables Source: https://developer.waveapps.com/hc/en-us/articles/360018937431-API-Playground This example demonstrates how to use variables in your GraphQL queries to fetch specific data, such as currency information by its code. ```APIDOC ## Using Variables ### Description This example demonstrates how to use variables in your GraphQL queries to fetch specific data, such as currency information by its code. ### Method POST ### Endpoint https://gql.waveapps.com/graphql/public ### Parameters #### Query Variables - **code** (CurrencyCode!) - Required - The currency code (e.g., USD). ### Request Body ```json { "query": "query($code: CurrencyCode!) { currency(code: $code) { name symbol } }", "variables": { "code": "USD" } } ``` ### Response #### Success Response (200) - **currency** (object) - Contains currency details. - **name** (string) - The name of the currency. - **symbol** (string) - The symbol of the currency. ### Request Example ```json { "query": "query($code: CurrencyCode!) { currency(code: $code) { name symbol } }", "variables": { "code": "USD" } } ``` ### Response Example ```json { "data": { "currency": { "name": "United States Dollar", "symbol": "$" } } } ``` ``` -------------------------------- ### Using Variables Source: https://developer.waveapps.com/hc/en-us/articles/360018937431 This example shows how to use variables in a GraphQL query to fetch specific data, in this case, currency information by its code. ```APIDOC ## Using Variables ### Description Fetches currency data by its code using query variables. ### Method POST ### Endpoint https://gql.waveapps.com/graphql/public ### Parameters #### Query Variables - **code** (CurrencyCode!) - Required - The currency code (e.g., "USD"). ### Request Body ```json { "query": "query($code: CurrencyCode!) { currency(code: $code) { name symbol } }", "variables": { "code": "USD" } } ``` ### Response #### Success Response (200) - **currency** (object) - Contains details of the currency. - **name** (string) - The name of the currency. - **symbol** (string) - The symbol of the currency. ``` -------------------------------- ### Create Money Transaction Variables Source: https://developer.waveapps.com/hc/en-us/articles/360057230751-Mutation-Create-Money-Transaction Provides an example of the variables required for the `moneyTransactionCreate` mutation. Pay close attention to `businessId`, `anchor.accountId`, and `lineItems.accountId`, ensuring they correspond to valid Wave account IDs. ```json { "input": { "businessId": "", "externalId": "some-reference-id", "date": "2021-02-05", "description": "My first sale", "anchor": { # Eg. Business checking account "accountId": "", "amount": 100.00, "direction": "DEPOSIT" }, "lineItems": [{ # Eg. Sales Account "accountId": "", "amount": 100.00, "balance": "INCREASE" }] } } ``` -------------------------------- ### Get User Source: https://developer.waveapps.com/hc/en-us/articles/360032552912-Query-Get-user Retrieves user information for the logged in user. ```APIDOC ## Query: Get user ### Description Retrieve user information for the logged in user. ### Operation ```graphql query { user { id firstName lastName defaultEmail createdAt modifiedAt } } ``` ### Response #### Success Response (200) - **id** (ID) - Unique identifier for the user. - **firstName** (String) - The first name of the user. - **lastName** (String) - The last name of the user. - **defaultEmail** (String) - The default email address of the user. - **createdAt** (DateTime) - The timestamp when the user was created. - **modifiedAt** (DateTime) - The timestamp when the user was last modified. ``` -------------------------------- ### Send GraphQL Request using JavaScript fetch Source: https://developer.waveapps.com/hc/en-us/articles/360018856171-Clients Example of sending a POST request to the GraphQL API endpoint using the JavaScript fetch API. This demonstrates how to structure the request headers and body. ```javascript fetch('https://gql.waveapps.com/graphql/public', { method: 'POST', headers: { 'Authorization': 'Bearer ', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'query { user { id defaultEmail } }', variables: {} }) }) .then(r => r.json()) .then(data => console.log(data)); ``` -------------------------------- ### Create Product/Service Mutation Source: https://developer.waveapps.com/hc/en-us/articles/360033284492-Mutation-Create-product-service This mutation creates a product or service. It requires a `name` and `unitPrice`, and optionally accepts a `description`. You can specify `incomeAccountId` and/or `expenseAccountId` to indicate sales or purchase details. Replace `` and `` with actual IDs. ```graphql mutation ($input: ProductCreateInput!) { productCreate(input: $input) { didSucceed inputErrors { code message path } product { id name description unitPrice incomeAccount { id name } expenseAccount { id name } isSold isBought isArchived createdAt modifiedAt } } } ``` ```json { "input": { "businessId": "", "name": "LED Bulb", "description": "5 Watt C7 light bulb", "unitPrice": "2.0625", "incomeAccountId": "" } } ``` -------------------------------- ### productCreate Source: https://developer.waveapps.com/hc/en-us/articles/360019968212-API-Reference Creates a new product. ```APIDOC ## Mutation productCreate ### Description Creates a new product. ### Arguments - **productCreateInput** (ProductCreateInput!) - Input object for creating a product. ### Request Example ```json { "productCreateInput": { "businessId": "ID!", "name": "String!", "unitPrice": "Decimal!", "description": "String", "defaultSalesTaxIds": ["ID!"], "incomeAccountId": "ID", "expenseAccountId": "ID" } } ``` ### Response #### Success Response (200) - **productCreate** (Product) - The created product. #### Response Example ```json { "data": { "productCreate": { "id": "ID!", "businessId": "ID!", "name": "String!", "unitPrice": "Decimal!", "description": "String", "defaultSalesTaxIds": ["ID!"], "incomeAccountId": "ID", "expenseAccountId": "ID" } } } ``` ``` -------------------------------- ### Create Product/Service Source: https://developer.waveapps.com/hc/en-us/articles/360033284492-Mutation-Create-product-service Creates a product or service under a specified business. Requires `name` and `unitPrice`, with optional `description`. You can link it to an `incomeAccountId` to indicate it's sold and/or an `expenseAccountId` to indicate it's bought. ```APIDOC ## Mutation: productCreate ### Description Creates a product or service under a business. Requires `name` and `unitPrice`, with optional `description`. You can link it to an `incomeAccountId` to indicate it's sold and/or an `expenseAccountId` to indicate it's bought. ### Method mutation ### Endpoint productCreate ### Parameters #### Request Body - **input** (ProductCreateInput!) - Required - The input object for creating a product. - **businessId** (String!) - Required - The ID of the business to which the product/service belongs. - **name** (String!) - Required - The name of the product or service. - **description** (String) - Optional - A description of the product or service. - **unitPrice** (String!) - Required - The unit price of the product or service. - **incomeAccountId** (String) - Optional - The ID of the income account to associate with the product/service if it is sold. - **expenseAccountId** (String) - Optional - The ID of the expense account to associate with the product/service if it is bought. ### Request Example ```json { "input": { "businessId": "", "name": "LED Bulb", "description": "5 Watt C7 light bulb", "unitPrice": "2.0625", "incomeAccountId": "" } } ``` ### Response #### Success Response (200) - **didSucceed** (Boolean) - Indicates if the operation was successful. - **inputErrors** (Array) - A list of errors encountered during the operation. - **code** (String) - The error code. - **message** (String) - The error message. - **path** (Array) - The path to the field with the error. - **product** (Object) - The created product object. - **id** (String) - The ID of the product. - **name** (String) - The name of the product. - **description** (String) - The description of the product. - **unitPrice** (String) - The unit price of the product. - **incomeAccount** (Object) - The associated income account. - **id** (String) - The ID of the income account. - **name** (String) - The name of the income account. - **expenseAccount** (Object) - The associated expense account. - **id** (String) - The ID of the expense account. - **name** (String) - The name of the expense account. - **isSold** (Boolean) - Indicates if the product is sold. - **isBought** (Boolean) - Indicates if the product is bought. - **isArchived** (Boolean) - Indicates if the product is archived. - **createdAt** (String) - The creation timestamp. - **modifiedAt** (String) - The last modification timestamp. #### Response Example ```json { "didSucceed": true, "inputErrors": [], "product": { "id": "prod_123", "name": "LED Bulb", "description": "5 Watt C7 light bulb", "unitPrice": "2.0625", "incomeAccount": { "id": "acc_456", "name": "Sales Revenue" }, "expenseAccount": null, "isSold": true, "isBought": false, "isArchived": false, "createdAt": "2023-10-27T10:00:00Z", "modifiedAt": "2023-10-27T10:00:00Z" } } ``` ``` -------------------------------- ### Internal Server Error Example Source: https://developer.waveapps.com/hc/en-us/articles/360018571372 This example shows a GraphQL response for an unexpected server-side error during request processing. The error has an 'INTERNAL_SERVER_ERROR' code, indicating a rare but possible issue on the server. ```graphql query { user { id defaultEmail } } ``` ```json { "errors": [ { "extensions": { "id": "d9e441c5-8c54-421b-bcdb-f0c2012a9f9c", "code": "INTERNAL_SERVER_ERROR" }, "message": "Unknown error.", "locations": [ { "line": 2, "column": 3 } ], "path": [ "user" ] } ], "data": { "user": null } } ``` -------------------------------- ### Malformed Query Error Example Source: https://developer.waveapps.com/hc/en-us/articles/360018571372 This example demonstrates a GraphQL response when a query fails validation due to an incorrect argument. The 'errors' field details the validation failure, including the message and location. ```graphql query { business(name: "Personal") { id } } ``` ```json { "errors": [ { "extensions": { "id": "e486c5f4-49b0-456f-897c-6d21bdabcde7", "code": "GRAPHQL_VALIDATION_FAILED" }, "message": "Unknown argument \"name\" on field \"business\" of type \"Query\".", "locations": [ { "line": 2, "column": 12 } ] } ] } ``` -------------------------------- ### productCreate Source: https://developer.waveapps.com/hc/en-us/articles/360019968212-API-Reference Creates a new product. Requires a ProductCreateInput object. ```APIDOC ## MUTATION productCreate ### Description Create a product. ### Arguments - **input** (ProductCreateInput!) - Required - Input object for creating a product. ``` -------------------------------- ### Mutation Input Validation Error Example Source: https://developer.waveapps.com/hc/en-us/articles/360018571372 This example demonstrates a mutation response where input validation fails due to a missing required field. The response includes GraphQL errors and potentially 'inputErrors' within the 'data' field. ```graphql mutation { customerCreate(input: { businessId: "" }) { didSucceed inputErrors { code message path } customer { id name } } } ``` ```json { "errors": [ { "extensions": { "id": "f99c027d-73ea-4ea7-8583-adfae6a65485", "code": "GRAPHQL_VALIDATION_FAILED" }, "message": "Argument \"input\" has invalid value {businessId: \"\").", "locations": [ { "line": 2, "column": 25 } ] }, { "extensions": { "id": "d5935ecf-d045-40b0-bc30-62bd2565e671", "code": "GRAPHQL_VALIDATION_FAILED" }, "message": "Field CustomerCreateInput.name of required type String! was not provided.", "locations": [ { "line": 2, "column": 25 } ] } ] } ``` -------------------------------- ### ProductCreateInput Source: https://developer.waveapps.com/hc/en-us/articles/360019968212 Input for the `productCreate` mutation. ```APIDOC ## ProductCreateInput ### Description Input to the `productCreate` mutation. ### Fields - **businessId** (ID!) - The unique identifier for the business. - **name** (String!) - Name of the product. - **unitPrice** (Decimal!) - Price per unit in the major currency unit (rounded to nearest 5 decimal places with ties going away from zero). - **description** (String) - Product description. - **defaultSalesTaxIds** (ID[]) - Default sales taxes to apply on product. - **incomeAccountId** (ID) - Income account to associate with this product. Account must be one of subtypes: `INCOME`, `DISCOUNTS`, `OTHER_INCOME`. - **expenseAccountId** (ID) - Expense account to associate with this product. Account must be one of subtypes: `EXPENSE`, `COST_OF_GOODS_SOLD`, `PAYMENT_PROCESSING_FEES`, `PAYROLL_EXPENSES`. ``` -------------------------------- ### Get Estimate Payment Source: https://developer.waveapps.com/hc/en-us/articles/360019968212-API-Reference Retrieves an estimate payment or refund. ```APIDOC ## Get Estimate Payment ### Description Retrieves a specific estimate payment or refund using its ID. ### Method GET ### Endpoint /estimate-payments/{id} ### Parameters #### Path Parameters - **id** (ID!) - Required - ID of estimate payment. ### Response #### Success Response (200) - **estimatePayment** (EstimatePayment) - The requested estimate payment or refund object. ``` -------------------------------- ### Create customer mutation Source: https://developer.waveapps.com/hc/en-us/articles/360032569232-Mutation-Create-customer Use this mutation to create a new customer under a specified business. You can include optional details such as first name, last name, email, address, and currency. Replace `` with the actual ID of the business. ```APIDOC ## Mutation: Create customer ### Description Creates a customer under a business with optional fields like `firstName`, `lastName`, `email`, `address`, and `currency`. ### Method mutation ### Endpoint Not applicable (GraphQL operation) ### Parameters #### Input Variable (`$input`) - **input** (CustomerCreateInput!) - Required - The input object for creating a customer. - **businessId** (String!) - Required - The ID of the business to associate the customer with. - **name** (String) - Optional - The name of the customer. - **firstName** (String) - Optional - The first name of the customer. - **lastName** (String) - Optional - The last name of the customer. - **email** (String) - Optional - The email address of the customer. - **address** (AddressInput) - Optional - The address details of the customer. - **addressLine1** (String) - Optional - **addressLine2** (String) - Optional - **city** (String) - Optional - **postalCode** (String) - Optional - **provinceCode** (String) - Optional - **countryCode** (String) - Optional - **currency** (String) - Optional - The currency code for the customer. ### Request Example (Variables) ```json { "input": { "businessId": "", "name": "Santa", "firstName": "Saint", "lastName": "Nicholas", "email": "santa@example.com", "address": { "city": "North Pole", "postalCode": "H0H 0H0", "provinceCode": "CA-NU", "countryCode": "CA" }, "currency": "CAD" } } ``` ### Response #### Success Response - **didSucceed** (Boolean) - Indicates if the operation was successful. - **inputErrors** (Array of InputError) - A list of errors encountered during input processing. - **code** (String) - The error code. - **message** (String) - The error message. - **path** (Array of String) - The path to the field with the error. - **customer** (Customer) - The created customer object. - **id** (ID) - **name** (String) - **firstName** (String) - **lastName** (String) - **email** (String) - **address** (Address) - **addressLine1** (String) - **addressLine2** (String) - **city** (String) - **province** (Province) - **code** (String) - **name** (String) - **country** (Country) - **code** (String) - **name** (String) - **postalCode** (String) - **currency** (Currency) - **code** (String) #### Response Example ```json { "data": { "customerCreate": { "didSucceed": true, "inputErrors": [], "customer": { "id": "some-customer-id", "name": "Santa", "firstName": "Saint", "lastName": "Nicholas", "email": "santa@example.com", "address": { "addressLine1": null, "addressLine2": null, "city": "North Pole", "province": { "code": "CA-NU", "name": "Nunavut" }, "country": { "code": "CA", "name": "Canada" }, "postalCode": "H0H 0H0" }, "currency": { "code": "CAD" } } } } } ``` ``` -------------------------------- ### accountCreate Source: https://developer.waveapps.com/hc/en-us/articles/360019968212-API-Reference Creates a new account. Requires an AccountCreateInput object. ```APIDOC ## MUTATION accountCreate ### Description Create an account. ### Arguments - **input** (AccountCreateInput!) - Required - Input object for creating an account. ``` -------------------------------- ### Get Vendor Source: https://developer.waveapps.com/hc/en-us/articles/360019968212 Retrieves a specific vendor associated with the business. ```APIDOC ## Get Vendor ### Description Retrieves a specific vendor of the business using its ID. ### Method GET ### Endpoint /business/vendor/{id} ### Parameters #### Path Parameters - **id** (ID!) - Required - Id of vendor ### Response #### Success Response (200) - **vendor** (Vendor) - Details of the vendor. ``` -------------------------------- ### productArchive Source: https://developer.waveapps.com/hc/en-us/articles/360019968212-API-Reference Archives a product. Requires a ProductArchiveInput object. ```APIDOC ## MUTATION productArchive ### Description Archive a product. ### Arguments - **input** (ProductArchiveInput!) - Required - Input object for archiving a product. ``` -------------------------------- ### Getting the Current User Source: https://developer.waveapps.com/hc/en-us/articles/360019968212-API-Reference Retrieves information about the currently authenticated user. ```APIDOC ## Query user ### Description The currently authenticated user. ### Query user ``` -------------------------------- ### Get Estimate Payment Source: https://developer.waveapps.com/hc/en-us/articles/360019968212 Retrieves a specific estimate payment or refund. ```APIDOC ## Get Estimate Payment ### Description Retrieves a specific estimate payment or refund using its ID. ### Method GET ### Endpoint /business/estimatePayment/{id} ### Parameters #### Path Parameters - **id** (ID!) - Required - ID of estimate payment. ### Response #### Success Response (200) - **estimatePayment** (EstimatePayment) - The requested estimate payment or refund object. ``` -------------------------------- ### Getting a Province by Code Source: https://developer.waveapps.com/hc/en-us/articles/360019968212-API-Reference Retrieves a specific province using its string code. ```APIDOC ## Query province ### Description Get a province. ### Query province(code: String!) ``` -------------------------------- ### customerCreate Source: https://developer.waveapps.com/hc/en-us/articles/360019968212-API-Reference Creates a new customer. Requires a CustomerCreateInput object. ```APIDOC ## MUTATION customerCreate ### Description Create a customer. ### Arguments - **input** (CustomerCreateInput!) - Required - Input object for creating a customer. ``` -------------------------------- ### Getting a Country by Code Source: https://developer.waveapps.com/hc/en-us/articles/360019968212-API-Reference Retrieves a specific country using its country code. ```APIDOC ## Query country ### Description Get a country. ### Query country(code: CountryCode!) ``` -------------------------------- ### Create Invoice Source: https://developer.waveapps.com/hc/en-us/articles/360038817812-Mutation-Create-invoice Creates an invoice for a customer with at least one product. Replace placeholders with actual IDs. Refer to the schema for all available options. ```APIDOC ## Mutation: Create invoice ### Description Creates an invoice for a customer with one product. See schema for all options. ### Operation ```graphql mutation ($input: InvoiceCreateInput!) { invoiceCreate(input: $input) { didSucceed inputErrors { message code path } invoice { id createdAt modifiedAt pdfUrl viewUrl status title subhead invoiceNumber invoiceDate poNumber customer { id name # Can add additional customer fields here } currency { code } dueDate amountDue { value currency { symbol } } amountPaid { value currency { symbol } } taxTotal { value currency { symbol } } total { value currency { symbol } } exchangeRate footer memo disableCreditCardPayments disableBankPayments itemTitle unitTitle priceTitle amountTitle hideName hideDescription hideUnit hidePrice hideAmount items { product { id name # Can add additional product fields here } description quantity price subtotal { value currency { symbol } } total { value currency { symbol } } account { id name subtype { name value } # Can add additional account fields here } taxes { amount { value } salesTax { id name # Can add additional sales tax fields here } } } lastSentAt lastSentVia lastViewedAt } } } ``` ### Operation Variables ```json { "input": { "businessId": "", "customerId": "", "items": [ { "productId": "" } ] } } ``` ``` -------------------------------- ### Getting a Currency by Code Source: https://developer.waveapps.com/hc/en-us/articles/360019968212-API-Reference Retrieves a specific currency using its currency code. ```APIDOC ## Query currency ### Description Get a currency. ### Query currency(code: CurrencyCode!) ``` -------------------------------- ### Create Customer Mutation Source: https://developer.waveapps.com/hc/en-us/articles/360032569232-Mutation-Create-customer Use this mutation to create a new customer. It requires a `CustomerCreateInput` object, which includes the business ID and customer details. Optional fields like `firstName`, `lastName`, `email`, `address`, and `currency` can be provided. ```graphql mutation ($input: CustomerCreateInput!) { customerCreate(input: $input) { didSucceed inputErrors { code message path } customer { id name firstName lastName email address { addressLine1 addressLine2 city province { code name } country { code name } postalCode } currency { code } } } } ``` -------------------------------- ### Invoice Sent Event Payload Source: https://developer.waveapps.com/hc/en-us/articles/47778664499220-Webhooks-Setup-Guide Example JSON payload for the 'invoice.sent' webhook event. ```json { "business_id": "63c77f29-875c-4cdc-947d-07430f628043", "data": { "currency_code": "USD", "customer_id": "21840161", "invoice_id": "2496756670638588934", "sent_at": "2026-04-29T16:58:36.818000+00:00", "sent_method": "WAVE" }, "event_id": "f670008d-ba99-5c77-8b5f-1294f06115ba", "event_type": "invoice.sent" } ``` -------------------------------- ### Invoice Overpaid Event Payload Source: https://developer.waveapps.com/hc/en-us/articles/47778664499220-Webhooks-Setup-Guide Example JSON payload for the 'invoice.overpaid' webhook event. ```json { "business_id": "63c77f29-875c-4cdc-947d-07430f628043", "data": { "amount_paid": "50.22", "currency_code": "USD", "customer_id": "21840161", "invoice_id": "2496760399374844951", "paid_date": "2026-04-29", "remaining_balance": "-10.00" }, "event_id": "3783d1d5-d9e6-5ade-8d41-97da0029cf0f", "event_type": "invoice.overpaid" } ``` -------------------------------- ### Invoice Paid Event Payload Source: https://developer.waveapps.com/hc/en-us/articles/47778664499220-Webhooks-Setup-Guide Example JSON payload for the 'invoice.paid' webhook event. ```json { "business_id": "63c77f29-875c-4cdc-947d-07430f628043", "data": { "amount_paid": "8.98", "currency_code": "USD", "customer_id": "21840161", "invoice_id": "2496756670638588934", "paid_date": "2026-04-29", "remaining_balance": "0.00" }, "event_id": "2f210c44-f1ab-551e-89fa-333fb8d2a5fe", "event_type": "invoice.paid" } ``` -------------------------------- ### Paginate list of products Source: https://developer.waveapps.com/hc/en-us/articles/360032572872-Query-Paginate-list-of-products For a specific business, fetches the first page of product/service data. Retrieves the first 50 records. See Pagination for an explanation of `page` and `pageSize`. Replace `` with a real business id. ```APIDOC ## Query: Paginate list of products ### Description Fetches a paginated list of products for a given business. ### Method query ### Endpoint N/A (GraphQL Operation) ### Parameters #### Query Parameters - **businessId** (ID!) - Required - The ID of the business. - **page** (Int!) - Required - The page number to retrieve. - **pageSize** (Int!) - Required - The number of records per page. ### Request Example ```json { "businessId": "", "page": 1, "pageSize": 50 } ``` ### Response #### Success Response (200) - **pageInfo** (object) - Information about the pagination. - **currentPage** (Int) - The current page number. - **totalPages** (Int) - The total number of pages. - **totalCount** (Int) - The total number of records. - **edges** (array) - A list of product edges. - **node** (object) - The product data. - **id** (ID) - The product ID. - **name** (String) - The product name. - **description** (String) - The product description. - **unitPrice** (Float) - The unit price of the product. - **defaultSalesTaxes** (array) - List of default sales taxes. - **id** (ID) - The tax ID. - **name** (String) - The tax name. - **abbreviation** (String) - The tax abbreviation. - **rate** (Float) - The tax rate. - **isSold** (Boolean) - Indicates if the product is sold. - **isBought** (Boolean) - Indicates if the product is bought. - **isArchived** (Boolean) - Indicates if the product is archived. - **createdAt** (String) - The creation timestamp. - **modifiedAt** (String) - The modification timestamp. #### Response Example ```json { "data": { "business": { "id": "", "products": { "pageInfo": { "currentPage": 1, "totalPages": 10, "totalCount": 500 }, "edges": [ { "node": { "id": "product-1", "name": "Sample Product", "description": "This is a sample product.", "unitPrice": 19.99, "defaultSalesTaxes": [ { "id": "tax-1", "name": "VAT", "abbreviation": "VAT", "rate": 0.20 } ], "isSold": true, "isBought": false, "isArchived": false, "createdAt": "2023-01-01T10:00:00Z", "modifiedAt": "2023-01-01T10:00:00Z" } } ] } } } } ``` ``` -------------------------------- ### ProductPatchInput Source: https://developer.waveapps.com/hc/en-us/articles/360019968212 Input for the `productPatch` mutation. ```APIDOC ## ProductPatchInput ### Description Input to the `productPatch` mutation. ### Fields - **id** (ID!) - The unique identifier for the product. - **name** (String) - Name of the product. - **description** (String) - Description of the product. - **unitPrice** (Decimal) - Price per unit in the major currency unit (rounded to nearest 5 decimal places with ties going away from zero). - **defaultSalesTaxIds** (ID[]) - Default sales taxes to apply on product. - **incomeAccountId** (ID) - Income account to associate with this product. Account must be one of subtypes: `INCOME`, `DISCOUNTS`, `OTHER_INCOME`. - **expenseAccountId** (ID) - Expense account to associate with this product. Account must be one of subtypes: `EXPENSE`, `COST_OF_GOODS_SOLD`, `PAYMENT_PROCESSING_FEES`, `PAYROLL_EXPENSES`. ``` -------------------------------- ### Invoice Approved Event Payload Source: https://developer.waveapps.com/hc/en-us/articles/47778664499220-Webhooks-Setup-Guide Example JSON payload for the 'invoice.approved' webhook event. ```json { "event_id": "test-event-id", "event_type": "invoice.approved", "business_id": "test-business-id", "data": { "invoice_id": "123", "customer_id": "123", "currency_code": "USD", "amount": "200.00", "issue_date": "2026-03-30" "due_date": "2026-03-30" } } ``` -------------------------------- ### Invoice Viewed Event Payload Source: https://developer.waveapps.com/hc/en-us/articles/47778664499220-Webhooks-Setup-Guide Example JSON payload for the 'invoice.viewed' webhook event. ```json { "event_id": "test-event-id", "event_type": "invoice.viewed", "business_id": "test-business-id", "data": { "invoice_id": "123", "customer_id": "123", "currency_code": "USD", "view_timestamp": "2026-03-30T06:18:01.212000+00:00", "invoice_balance": "200.00" } } ``` -------------------------------- ### GraphQL Mutation for Customer Creation Source: https://developer.waveapps.com/hc/en-us/articles/360018571372 Use this GraphQL mutation to create a new customer. Ensure all required fields, such as 'name', are provided in the input. ```graphql mutation ($name: String!) { customerCreate(input: { businessId: "", name: $name }) { didSucceed inputErrors { code message path } customer { id name } } } ``` -------------------------------- ### Invoice Overdue Event Payload Source: https://developer.waveapps.com/hc/en-us/articles/47778664499220-Webhooks-Setup-Guide Example JSON payload for the 'invoice.overdue' webhook event. ```json { "event_id": "test-event-id", "event_type": "invoice.overdue", "business_id": "test-business-id", "data": { "invoice_id": "123", "customer_id": "123", "currency_code": "USD", "due_date": "2026-03-30", "invoice_balance": "200.00", "issue_date": "2026-03-30" } } ``` -------------------------------- ### Invoice Partially Paid Event Payload Source: https://developer.waveapps.com/hc/en-us/articles/47778664499220-Webhooks-Setup-Guide Example JSON payload for the 'invoice.partially_paid' webhook event. ```json { "business_id": "63c77f29-875c-4cdc-947d-07430f628043", "data": { "amount_paid": "10.22", "currency_code": "USD", "customer_id": "21840161", "invoice_id": "2496760399374844951", "paid_date": "2026-04-29", "remaining_balance": "30.00" }, "event_id": "a704a98d-2e0a-5b5e-894a-0447fd56c5fb", "event_type": "invoice.partially_paid" } ``` -------------------------------- ### CustomerCreateOutput Source: https://developer.waveapps.com/hc/en-us/articles/360019968212-API-Reference Output structure for the `customerCreate` mutation, detailing the created customer, success status, and any input errors. ```APIDOC ## CustomerCreateOutput ### Description Output of the `customerCreate` mutation. ### Fields - **customer** (Customer) - Customer that was created. - **didSucceed** (Boolean!) - Indicates whether the customer was successfully created. - **inputErrors** ([InputError!]) - Mutation validation errors. ```