diff --git a/independent-publisher-connectors/FreeAgent/README.md b/independent-publisher-connectors/FreeAgent/README.md new file mode 100644 index 000000000..7893824c3 --- /dev/null +++ b/independent-publisher-connectors/FreeAgent/README.md @@ -0,0 +1,70 @@ +# FreeAgent + +FreeAgent is a cloud based accounting system. It brings everything together, from invoice and expense management to project management and sales tax. FreeAgent made specifically for freelancers, small business owners and their accountants. This Connector helps you to retrieve and update data in your FreeAgent Account. This connectors supports only core operations dealing with Invoice, Recurring Invoice and Contacts. + + +## Publisher: Nirmal + +## Prerequisites + +To use this connector, you need the following + +- A Microsoft Power Apps or Power Automate plan with custom connector feature +- You need to have an FreeAgent account. You can [sign up](https://signup.freeagent.com/signup) for free. +- A FreeAgent developer account with a configured OAuth 2.0 application. https://dev.freeagent.com/ + +## Obtaining Credentials +- Create a New Developer Account here : https://dev.freeagent.com/signup + +- Create a New App +- Update the App OAuth Redirect URI's to " +https://global.consent.azure-apim.net/redirect" +- Get the OAuth identifier (ClientID),OAuth secret (Client Secret) +- Deploy the connector using the oAuth Credentials. + + + +### Supported Operations +Freeagent API has more than 40 operations. Currentlt this connector the most important operations related to Invoice, Contact and Recurring Invoices. + +#### 1. Contact +- List all contacts : Retrieves list of Contacts +- Create Contact : Creates a New Contact +- Delete Contact : Delete a Contact based on Contact Url +- Update Contact : Update a Contact based on Contact Url +- Get a single contact : Retrieve a Contact by Contact Url. + + +#### 2. Invoice +- Create Invoice : Creates a New Invoice +- List Invoices : List all Invoices +- Delete Invoice : Delete a Invoice +- Show Invoice : Retrieve a Invoice based on Invoice Url +- Update Invoice : Update a Invoice based on Invoice Url + +#### 3. Invoice Flag + +- Mark invoice as sent : Update a Invoice with Status Sent +- Mark invoice as cancelled : Update a Invoice Status as Cancelled. +- Mark invoice as scheduled : Update a Invoice as Scheduled +- Mark invoice as draft : Update a Invoice as Draft + + +#### 4. Recurring Invoice +- List all recurring invoices : Retrieves the list of recurring invoices +- Show Recurring Invoice : Retrieve details about a recurring invoice + +Note : The API doesn't support creating/updating/deleting Recurring Invoices. + + + +## Known Issues and Limitations +There are no known issues at time of publishing. + +## Rate Limits +FreeAgent API has some usage rate limits. Please refer the "Rate Limits" Section in this page https://dev.freeagent.com/docs/introduction + + +## Deployment Instructions +Follow the instructions provided on the [Power Automate blog](https://flow.microsoft.com/en-us/blog/import-a-connector-from-github-as-a-custom-connector/). + diff --git a/independent-publisher-connectors/FreeAgent/apiDefinition.swagger.json b/independent-publisher-connectors/FreeAgent/apiDefinition.swagger.json new file mode 100644 index 000000000..9d452ecbb --- /dev/null +++ b/independent-publisher-connectors/FreeAgent/apiDefinition.swagger.json @@ -0,0 +1,1837 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0.0", + "title": "FreeAgent", + "contact": { + "name": "Nirmal", + "url": "https://nkdews.me", + "email": "nirmalk.web@gmail.com" + }, + "description": "Freeagent Connector helps you to retrieve and update data in your FreeAgent Account. This connectors supports only core operations dealing with Invoice, Recurring Invoice and Contacts." + }, + "host": "api.freeagent.com", + "basePath": "/v2", + "schemes": [ + "https" + ], + "consumes": [], + "produces": [ + "application/json" + ], + "paths": { + "/contacts": { + "get": { + "responses": { + "200": { + "description": "200", + "schema": { + "type": "object", + "properties": { + "contacts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "url": { + "type": "string", + "x-ms-summary": "Url", + "description": "Url" + }, + "id": { + "type": "string", + "x-ms-summary": "id", + "description": "id", + "x-ms-visibility": "internal" + }, + "first_name": { + "type": "string", + "x-ms-summary": "First Name", + "description": "First Name" + }, + "last_name": { + "type": "string", + "x-ms-summary": "Last Name", + "description": "Last Name" + }, + "organisation_name": { + "type": "string", + "x-ms-summary": "Organisation Name", + "description": "Organisation Name" + }, + "email": { + "type": "string", + "x-ms-summary": "Email", + "description": "Email" + }, + "billing_email": { + "type": "string", + "x-ms-summary": "Billing Email", + "description": "Billing Email" + }, + "phone_number": { + "type": "string", + "x-ms-summary": "Phone Number", + "description": "Phone Number" + }, + "mobile": { + "type": "string", + "x-ms-summary": "Mobile", + "description": "Mobile" + }, + "address1": { + "type": "string", + "x-ms-summary": "Address1", + "description": "Address1" + }, + "address2": { + "type": "string", + "x-ms-summary": "Address2", + "description": "Address2" + }, + "address3": { + "type": "string", + "x-ms-summary": "Address3", + "description": "Address3" + }, + "town": { + "type": "string", + "x-ms-summary": "Town", + "description": "Town" + }, + "region": { + "type": "string", + "x-ms-summary": "Region", + "description": "Region" + }, + "postcode": { + "type": "string", + "x-ms-summary": "Postcode", + "description": "Postcode" + }, + "country": { + "type": "string", + "x-ms-summary": "Country", + "description": "Country" + }, + "contact_name_on_invoices": { + "type": "boolean", + "x-ms-summary": "Contact Name On Invoices", + "description": "Contact Name On Invoices" + }, + "default_payment_terms_in_days": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Default Payment Terms In Days", + "description": "Default Payment Terms In Days" + }, + "locale": { + "type": "string", + "x-ms-summary": "Locale", + "description": "Locale" + }, + "account_balance": { + "type": "string", + "x-ms-summary": "Account Balance", + "description": "Account Balance" + }, + "uses_contact_invoice_sequence": { + "type": "boolean", + "x-ms-summary": "Uses Contact Invoice Sequence", + "description": "Uses Contact Invoice Sequence" + }, + "charge_sales_tax": { + "type": "string", + "x-ms-summary": "Charge Sales Tax", + "description": "Charge Sales Tax" + }, + "sales_tax_registration_number": { + "type": "string", + "x-ms-summary": "Sales Tax Registration Number", + "description": "Sales Tax Registration Number" + }, + "active_projects_count": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Active Projects Count", + "description": "Active Projects Count" + }, + "direct_debit_mandate_state": { + "type": "string", + "x-ms-summary": "Direct Debit Mandate State", + "description": "Direct Debit Mandate State" + }, + "status": { + "type": "string", + "x-ms-summary": "Status", + "description": "Status" + }, + "created_at": { + "type": "string", + "x-ms-summary": "Created At", + "description": "Created At" + }, + "updated_at": { + "type": "string", + "x-ms-summary": "Updated At", + "description": "Updated At" + } + } + }, + "x-ms-summary": "Contacts", + "description": "Contacts" + } + } + } + } + }, + "summary": "List all contacts", + "x-ms-summary": "List all contacts", + "description": "List all contacts", + "operationId": "GetContacts", + "parameters": [] + }, + "post": { + "summary": "Create Contact", + "x-ms-summary": "Create Contact", + "description": "Create Contact", + "operationId": "CreateContact", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "contact": { + "type": "object", + "properties": { + "first_name": { + "type": "string", + "x-ms-summary": "First Name", + "description": "First Name" + }, + "last_name": { + "type": "string", + "x-ms-summary": "Last Name", + "description": "Last Name" + }, + "email": { + "type": "string", + "x-ms-summary": "Email", + "description": "Email" + } + }, + "x-ms-summary": "Contact", + "description": "Contact" + } + } + }, + "required": true + } + ], + "responses": { + "201": { + "x-ms-summary": "201", + "description": "201", + "schema": { + "type": "object", + "properties": { + "contact": { + "type": "object", + "properties": { + "url": { + "type": "string", + "x-ms-summary": "Url", + "description": "Url" + }, + "first_name": { + "type": "string", + "x-ms-summary": "First Name", + "description": "First Name" + }, + "last_name": { + "type": "string", + "x-ms-summary": "Last Name", + "description": "Last Name" + }, + "organisation_name": { + "type": "string", + "x-ms-summary": "Organisation Name", + "description": "Organisation Name" + }, + "email": { + "type": "string", + "x-ms-summary": "Email", + "description": "Email" + }, + "billing_email": { + "type": "string", + "x-ms-summary": "Billing Email", + "description": "Billing Email" + }, + "phone_number": { + "type": "string", + "x-ms-summary": "Phone Number", + "description": "Phone Number" + }, + "mobile": { + "type": "string", + "x-ms-summary": "Mobile", + "description": "Mobile" + }, + "address1": { + "type": "string", + "x-ms-summary": "Address1", + "description": "Address1" + }, + "address2": { + "type": "string", + "x-ms-summary": "Address2", + "description": "Address2" + }, + "address3": { + "type": "string", + "x-ms-summary": "Address3", + "description": "Address3" + }, + "town": { + "type": "string", + "x-ms-summary": "Town", + "description": "Town" + }, + "region": { + "type": "string", + "x-ms-summary": "Region", + "description": "Region" + }, + "postcode": { + "type": "string", + "x-ms-summary": "Postcode", + "description": "Postcode" + }, + "country": { + "type": "string", + "x-ms-summary": "Country", + "description": "Country" + }, + "contact_name_on_invoices": { + "type": "boolean", + "x-ms-summary": "Contact Name On Invoices", + "description": "Contact Name On Invoices" + }, + "default_payment_terms_in_days": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Default Payment Terms In Days", + "description": "Default Payment Terms In Days" + }, + "locale": { + "type": "string", + "x-ms-summary": "Locale", + "description": "Locale" + }, + "account_balance": { + "type": "string", + "x-ms-summary": "Account Balance", + "description": "Account Balance" + }, + "uses_contact_invoice_sequence": { + "type": "boolean", + "x-ms-summary": "Uses Contact Invoice Sequence", + "description": "Uses Contact Invoice Sequence" + }, + "charge_sales_tax": { + "type": "string", + "x-ms-summary": "Charge Sales Tax", + "description": "Charge Sales Tax" + }, + "sales_tax_registration_number": { + "type": "string", + "x-ms-summary": "Sales Tax Registration Number", + "description": "Sales Tax Registration Number" + }, + "active_projects_count": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Active Projects Count", + "description": "Active Projects Count" + }, + "status": { + "type": "string", + "x-ms-summary": "Status", + "description": "Status" + }, + "created_at": { + "type": "string", + "x-ms-summary": "Created At", + "description": "Created At" + }, + "updated_at": { + "type": "string", + "x-ms-summary": "Updated At", + "description": "Updated At" + } + }, + "x-ms-summary": "Contact", + "description": "Contact" + } + } + } + } + } + } + }, + "/contacts/{contact_id}": { + "delete": { + "summary": "Delete Contact", + "x-ms-summary": "Delete Contact", + "description": "Delete Contact", + "operationId": "DeleteContact", + "parameters": [ + { + "name": "contact_id", + "default": "", + "in": "path", + "x-ms-url-encoding": "single", + "type": "string", + "x-ms-summary": "Contact", + "description": "Contact", + "required": true, + "x-ms-dynamic-values": { + "operationId": "GetContacts", + "value-collection": "contacts", + "value-path": "id", + "value-title": "organisation_name" + } + } + ], + "responses": { + "200": { + "description": "200" + } + } + }, + "put": { + "summary": "Update Contact", + "x-ms-summary": "Update Contact", + "description": "Update Contact", + "operationId": "UpdateContact", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "name": "contact_id", + "default": "", + "in": "path", + "x-ms-url-encoding": "single", + "type": "string", + "x-ms-summary": "Contact", + "description": "Contact", + "x-ms-dynamic-values": { + "operationId": "GetContacts", + "value-collection": "contacts", + "value-path": "id", + "value-title": "organisation_name" + }, + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "contact": { + "type": "object", + "properties": { + "contact_name_on_invoices": { + "type": "boolean", + "x-ms-summary": "Contact Name On Invoices", + "description": "Contact Name On Invoices" + }, + "default_payment_terms_in_days": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Default Payment Terms In Days", + "description": "Default Payment Terms In Days" + }, + "locale": { + "type": "string", + "x-ms-summary": "Locale", + "description": "Locale" + }, + "country": { + "type": "string", + "x-ms-summary": "Country", + "description": "Country" + } + }, + "x-ms-summary": "Contact", + "description": "Contact" + } + } + }, + "required": true + } + ], + "responses": { + "200": { + "description": "200" + } + } + }, + "get": { + "responses": { + "200": { + "description": "200", + "schema": { + "type": "object", + "properties": { + "contact": { + "type": "object", + "properties": { + "url": { + "type": "string", + "x-ms-summary": "Url", + "description": "Url" + }, + "first_name": { + "type": "string", + "x-ms-summary": "First Name", + "description": "First Name" + }, + "last_name": { + "type": "string", + "x-ms-summary": "Last Name", + "description": "Last Name" + }, + "organisation_name": { + "type": "string", + "x-ms-summary": "Organisation Name", + "description": "Organisation Name" + }, + "email": { + "type": "string", + "x-ms-summary": "Email", + "description": "Email" + }, + "billing_email": { + "type": "string", + "x-ms-summary": "Billing Email", + "description": "Billing Email" + }, + "phone_number": { + "type": "string", + "x-ms-summary": "Phone Number", + "description": "Phone Number" + }, + "mobile": { + "type": "string", + "x-ms-summary": "Mobile", + "description": "Mobile" + }, + "address1": { + "type": "string", + "x-ms-summary": "Address1", + "description": "Address1" + }, + "address2": { + "type": "string", + "x-ms-summary": "Address2", + "description": "Address2" + }, + "address3": { + "type": "string", + "x-ms-summary": "Address3", + "description": "Address3" + }, + "town": { + "type": "string", + "x-ms-summary": "Town", + "description": "Town" + }, + "region": { + "type": "string", + "x-ms-summary": "Region", + "description": "Region" + }, + "postcode": { + "type": "string", + "x-ms-summary": "Postcode", + "description": "Postcode" + }, + "country": { + "type": "string", + "x-ms-summary": "Country", + "description": "Country" + }, + "contact_name_on_invoices": { + "type": "boolean", + "x-ms-summary": "Contact Name On Invoices", + "description": "Contact Name On Invoices" + }, + "default_payment_terms_in_days": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Default Payment Terms In Days", + "description": "Default Payment Terms In Days" + }, + "locale": { + "type": "string", + "x-ms-summary": "Locale", + "description": "Locale" + }, + "account_balance": { + "type": "string", + "x-ms-summary": "Account Balance", + "description": "Account Balance" + }, + "uses_contact_invoice_sequence": { + "type": "boolean", + "x-ms-summary": "Uses Contact Invoice Sequence", + "description": "Uses Contact Invoice Sequence" + }, + "charge_sales_tax": { + "type": "string", + "x-ms-summary": "Charge Sales Tax", + "description": "Charge Sales Tax" + }, + "sales_tax_registration_number": { + "type": "string", + "x-ms-summary": "Sales Tax Registration Number", + "description": "Sales Tax Registration Number" + }, + "active_projects_count": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Active Projects Count", + "description": "Active Projects Count" + }, + "direct_debit_mandate_state": { + "type": "string", + "x-ms-summary": "Direct Debit Mandate State", + "description": "Direct Debit Mandate State" + }, + "status": { + "type": "string", + "x-ms-summary": "Status", + "description": "Status" + }, + "created_at": { + "type": "string", + "x-ms-summary": "Created At", + "description": "Created At" + }, + "updated_at": { + "type": "string", + "x-ms-summary": "Updated At", + "description": "Updated At" + } + }, + "x-ms-summary": "Contact", + "description": "Contact" + } + } + } + } + }, + "summary": "Get a single contact", + "x-ms-summary": "Get a single contact", + "description": "Get a single contact", + "operationId": "GetContact", + "parameters": [ + { + "name": "contact_id", + "in": "path", + "x-ms-url-encoding": "single", + "x-ms-summary": "Contact", + "description": "Contact", + "required": true, + "x-ms-dynamic-values": { + "operationId": "GetContacts", + "value-collection": "contacts", + "value-path": "id", + "value-title": "organisation_name" + }, + "type": "string" + } + ] + } + }, + "/invoices/{id}/transitions/mark_as_sent": { + "put": { + "summary": "Mark invoice as sent", + "x-ms-summary": "Mark invoice as sent", + "description": "Mark invoice as sent", + "operationId": "MarkInvoiceAsSent", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "name": "id", + "default": "", + "in": "path", + "x-ms-url-encoding": "single", + "type": "string", + "x-ms-summary": "Invoice Id", + "description": "Invoice Id", + "x-ms-dynamic-values": { + "operationId": "ListInvoices", + "value-collection": "invoices", + "value-path": "id", + "value-title": "title" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "200" + } + } + } + }, + "/invoices/{id}/transitions/mark_as_cancelled": { + "put": { + "summary": "Mark invoice as cancelled", + "x-ms-summary": "Mark invoice as cancelled", + "description": "Mark invoice as cancelled", + "operationId": "MarkInvoiceAsCancelled", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "name": "id", + "default": "", + "in": "path", + "x-ms-url-encoding": "single", + "type": "string", + "x-ms-summary": "Invoice Id", + "description": "Invoice Id", + "required": true + } + ], + "responses": { + "200": { + "description": "200" + } + } + } + }, + "/invoices/{id}/transitions/mark_as_scheduled": { + "put": { + "summary": "Mark invoice as scheduled", + "x-ms-summary": "Mark invoice as scheduled", + "description": "Mark invoice as scheduled", + "operationId": "MarkInvoiceAsScheduled", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "name": "id", + "default": "", + "in": "path", + "x-ms-url-encoding": "single", + "type": "string", + "x-ms-summary": "Invoice Id", + "description": "Invoice Id", + "x-ms-dynamic-values": { + "operationId": "ListInvoices", + "value-collection": "invoices", + "value-path": "id", + "value-title": "title" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "default" + } + } + } + }, + "/invoices/{id}/transitions/mark_as_draft": { + "put": { + "summary": "Mark invoice as draft", + "x-ms-summary": "Mark invoice as draft", + "description": "Mark invoice as draft", + "operationId": "MarkInvoiceAsDraft", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "name": "id", + "default": "", + "in": "path", + "x-ms-url-encoding": "single", + "type": "string", + "x-ms-summary": "Invoice Id", + "description": "Invoice Id", + "required": true, + "x-ms-dynamic-values": { + "operationId": "ListInvoices", + "value-collection": "invoices", + "value-path": "id", + "value-title": "title" + } + } + ], + "responses": { + "200": { + "description": "default" + } + } + } + }, + "/invoices": { + "post": { + "summary": "Create Invoice", + "x-ms-summary": "Create Invoice", + "description": "Create Invoice", + "operationId": "CreateInvoice", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "invoice": { + "type": "object", + "properties": { + "contact": { + "type": "string", + "x-ms-summary": "Contact", + "description": "Contact", + "x-ms-dynamic-values": { + "operationId": "GetContacts", + "value-collection": "contacts", + "value-path": "id", + "value-title": "organisation_name" + } + }, + "dated_on": { + "type": "string", + "x-ms-summary": "Dated On", + "description": "Dated On" + }, + "due_on": { + "type": "string", + "x-ms-summary": "Due On", + "description": "Due On" + }, + "currency": { + "type": "string", + "x-ms-summary": "Currency", + "description": "Currency" + }, + "omit_header": { + "type": "boolean", + "x-ms-summary": "Omit Header", + "description": "Omit Header" + }, + "always_show_bic_and_iban": { + "type": "boolean", + "x-ms-summary": "Always Show BIC And IBAN", + "description": "Always Show BIC And IBAN" + }, + "payment_terms_in_days": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Payment Terms In Days", + "description": "Payment Terms In Days" + } + }, + "x-ms-summary": "Invoice", + "description": "Invoice" + } + } + }, + "required": true + } + ], + "responses": { + "201": { + "x-ms-summary": "Created", + "description": "Created", + "schema": { + "type": "object", + "properties": { + "invoice": { + "type": "object", + "properties": { + "contact": { + "type": "string", + "x-ms-summary": "Contact", + "description": "Contact" + }, + "dated_on": { + "type": "string", + "x-ms-summary": "Dated On", + "description": "Dated On" + }, + "due_on": { + "type": "string", + "x-ms-summary": "Due On", + "description": "Due On" + }, + "reference": { + "type": "string", + "x-ms-summary": "Reference", + "description": "Reference" + }, + "currency": { + "type": "string", + "x-ms-summary": "Currency", + "description": "Currency" + }, + "exchange_rate": { + "type": "string", + "x-ms-summary": "Exchange Rate", + "description": "Exchange Rate" + }, + "net_value": { + "type": "string", + "x-ms-summary": "Net Value", + "description": "Net Value" + }, + "total_value": { + "type": "string", + "x-ms-summary": "Total Value", + "description": "Total Value" + }, + "paid_value": { + "type": "string", + "x-ms-summary": "Paid Value", + "description": "Paid Value" + }, + "due_value": { + "type": "string", + "x-ms-summary": "Due Value", + "description": "Due Value" + }, + "status": { + "type": "string", + "x-ms-summary": "Status", + "description": "Status" + }, + "long_status": { + "type": "string", + "x-ms-summary": "Long Status", + "description": "Long Status" + }, + "omit_header": { + "type": "boolean", + "x-ms-summary": "Omit Header", + "description": "Omit Header" + }, + "always_show_bic_and_iban": { + "type": "boolean", + "x-ms-summary": "Always Show BIC And IBAN", + "description": "Always Show BIC And IBAN" + }, + "send_thank_you_emails": { + "type": "boolean", + "x-ms-summary": "Send Thank You Emails", + "description": "Send Thank You Emails" + }, + "send_reminder_emails": { + "type": "boolean", + "x-ms-summary": "Send Reminder Emails", + "description": "Send Reminder Emails" + }, + "send_new_invoice_emails": { + "type": "boolean", + "x-ms-summary": "Send New Invoice Emails", + "description": "Send New Invoice Emails" + }, + "bank_account": { + "type": "string", + "x-ms-summary": "Bank Account", + "description": "Bank Account" + }, + "payment_terms_in_days": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Payment Terms In Days", + "description": "Payment Terms In Days" + }, + "payment_methods": { + "type": "object", + "properties": { + "paypal": { + "type": "boolean", + "x-ms-summary": "Paypal", + "description": "Paypal" + }, + "stripe": { + "type": "boolean", + "x-ms-summary": "Stripe", + "description": "Stripe" + } + }, + "x-ms-summary": "Payment Methods", + "description": "Payment Methods" + }, + "created_at": { + "type": "string", + "x-ms-summary": "Created At", + "description": "Created At" + }, + "updated_at": { + "type": "string", + "x-ms-summary": "Updated At", + "description": "Updated At" + }, + "invoice_items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string", + "x-ms-summary": "description", + "description": "description" + }, + "item_type": { + "type": "string", + "x-ms-summary": "Item Type", + "description": "Item Type" + }, + "price": { + "type": "string", + "x-ms-summary": "Price", + "description": "Price" + }, + "quantity": { + "type": "string", + "x-ms-summary": "Quantity", + "description": "Quantity" + } + } + }, + "x-ms-summary": "Invoice Items", + "description": "Invoice Items" + } + }, + "x-ms-summary": "Invoice", + "description": "Invoice" + } + } + } + } + } + }, + "get": { + "summary": "List Invoices", + "x-ms-summary": "List Invoices", + "description": "List Invoices", + "operationId": "ListInvoices", + "parameters": [], + "responses": { + "200": { + "description": "default", + "schema": { + "type": "object", + "properties": { + "invoices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "x-ms-summary": "id", + "description": "id", + "x-ms-visibility": "internal" + }, + "title": { + "type": "string", + "x-ms-summary": "title", + "description": "title", + "x-ms-visibility": "internal" + }, + "url": { + "type": "string", + "x-ms-summary": "Url", + "description": "Url" + }, + "contact": { + "type": "string", + "x-ms-summary": "Contact", + "description": "Contact" + }, + "dated_on": { + "type": "string", + "x-ms-summary": "Dated On", + "description": "Dated On" + }, + "due_on": { + "type": "string", + "x-ms-summary": "Due On", + "description": "Due On" + }, + "reference": { + "type": "string", + "x-ms-summary": "Reference", + "description": "Reference" + }, + "currency": { + "type": "string", + "x-ms-summary": "Currency", + "description": "Currency" + }, + "exchange_rate": { + "type": "string", + "x-ms-summary": "Exchange Rate", + "description": "Exchange Rate" + }, + "net_value": { + "type": "string", + "x-ms-summary": "Net Value", + "description": "Net Value" + }, + "sales_tax_value": { + "type": "string", + "x-ms-summary": "Sales Tax Value", + "description": "Sales Tax Value" + }, + "total_value": { + "type": "string", + "x-ms-summary": "Total Value", + "description": "Total Value" + }, + "paid_value": { + "type": "string", + "x-ms-summary": "Paid Value", + "description": "Paid Value" + }, + "due_value": { + "type": "string", + "x-ms-summary": "Due Value", + "description": "Due Value" + }, + "status": { + "type": "string", + "x-ms-summary": "Status", + "description": "Status" + }, + "long_status": { + "type": "string", + "x-ms-summary": "Long Status", + "description": "Long Status" + }, + "comments": { + "type": "string", + "x-ms-summary": "Comments", + "description": "Comments" + }, + "omit_header": { + "type": "boolean", + "x-ms-summary": "Omit Header", + "description": "Omit Header" + }, + "send_thank_you_emails": { + "type": "boolean", + "x-ms-summary": "Send Thank You Emails", + "description": "Send Thank You Emails" + }, + "send_reminder_emails": { + "type": "boolean", + "x-ms-summary": "Send Reminder Emails", + "description": "Send Reminder Emails" + }, + "send_new_invoice_emails": { + "type": "boolean", + "x-ms-summary": "Send New Invoice Emails", + "description": "Send New Invoice Emails" + }, + "bank_account": { + "type": "string", + "x-ms-summary": "Bank Account", + "description": "Bank Account" + }, + "always_show_bic_and_iban": { + "type": "boolean", + "x-ms-summary": "Always Show BIC And IBAN", + "description": "Always Show BIC And IBAN" + }, + "payment_terms_in_days": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Payment Terms In Days", + "description": "Payment Terms In Days" + }, + "ec_status": { + "type": "string", + "x-ms-summary": "Ec Status", + "description": "Ec Status" + }, + "payment_methods": { + "type": "object", + "properties": { + "paypal": { + "type": "boolean", + "x-ms-summary": "Paypal", + "description": "Paypal" + }, + "stripe": { + "type": "boolean", + "x-ms-summary": "Stripe", + "description": "Stripe" + } + }, + "x-ms-summary": "Payment Methods", + "description": "Payment Methods" + }, + "created_at": { + "type": "string", + "x-ms-summary": "Created At", + "description": "Created At" + }, + "updated_at": { + "type": "string", + "x-ms-summary": "Updated At", + "description": "Updated At" + } + } + }, + "x-ms-summary": "Invoices", + "description": "Invoices" + } + } + } + } + } + } + }, + "/invoices/{id}": { + "delete": { + "summary": "Delete Invoice", + "x-ms-summary": "Delete Invoice", + "description": "Delete Invoice", + "operationId": "DeleteInvoice", + "parameters": [ + { + "name": "id", + "default": "", + "in": "path", + "x-ms-url-encoding": "single", + "type": "string", + "x-ms-summary": "Invoice Id", + "description": "Invoice Id", + "x-ms-dynamic-values": { + "operationId": "ListInvoices", + "value-collection": "invoices", + "value-path": "id", + "value-title": "title" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "default" + } + } + }, + "get": { + "summary": "Show Invoice", + "x-ms-summary": "Show Invoice", + "description": "Show Invoice", + "operationId": "ShowInvoice", + "parameters": [ + { + "name": "id", + "default": "", + "in": "path", + "x-ms-url-encoding": "single", + "type": "string", + "x-ms-summary": "Invoice Id", + "description": "Invoice Id", + "x-ms-dynamic-values": { + "operationId": "ListInvoices", + "value-collection": "invoices", + "value-path": "id", + "value-title": "title" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "default", + "schema": { + "type": "object", + "properties": { + "invoice": { + "type": "object", + "properties": { + "contact": { + "type": "string", + "x-ms-summary": "Contact", + "description": "Contact" + }, + "project": { + "type": "string", + "x-ms-summary": "Project", + "description": "Project" + }, + "dated_on": { + "type": "string", + "x-ms-summary": "Dated On", + "description": "Dated On" + }, + "due_on": { + "type": "string", + "x-ms-summary": "Due On", + "description": "Due On" + }, + "reference": { + "type": "string", + "x-ms-summary": "Reference", + "description": "Reference" + }, + "currency": { + "type": "string", + "x-ms-summary": "Currency", + "description": "Currency" + }, + "exchange_rate": { + "type": "string", + "x-ms-summary": "Exchange Rate", + "description": "Exchange Rate" + }, + "net_value": { + "type": "string", + "x-ms-summary": "Net Value", + "description": "Net Value" + }, + "total_value": { + "type": "string", + "x-ms-summary": "Total Value", + "description": "Total Value" + }, + "paid_value": { + "type": "string", + "x-ms-summary": "Paid Value", + "description": "Paid Value" + }, + "due_value": { + "type": "string", + "x-ms-summary": "Due Value", + "description": "Due Value" + }, + "status": { + "type": "string", + "x-ms-summary": "Status", + "description": "Status" + }, + "long_status": { + "type": "string", + "x-ms-summary": "Long Status", + "description": "Long Status" + }, + "comments": { + "type": "string", + "x-ms-summary": "Comments", + "description": "Comments" + }, + "omit_header": { + "type": "boolean", + "x-ms-summary": "Omit Header", + "description": "Omit Header" + }, + "always_show_bic_and_iban": { + "type": "boolean", + "x-ms-summary": "Always Show BIC And IBAN", + "description": "Always Show BIC And IBAN" + }, + "send_thank_you_emails": { + "type": "boolean", + "x-ms-summary": "Send Thank You Emails", + "description": "Send Thank You Emails" + }, + "send_reminder_emails": { + "type": "boolean", + "x-ms-summary": "Send Reminder Emails", + "description": "Send Reminder Emails" + }, + "send_new_invoice_emails": { + "type": "boolean", + "x-ms-summary": "Send New Invoice Emails", + "description": "Send New Invoice Emails" + }, + "bank_account": { + "type": "string", + "x-ms-summary": "Bank Account", + "description": "Bank Account" + }, + "payment_terms_in_days": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Payment Terms In Days", + "description": "Payment Terms In Days" + }, + "ec_status": { + "type": "string", + "x-ms-summary": "Ec Status", + "description": "Ec Status" + }, + "payment_methods": { + "type": "object", + "properties": { + "paypal": { + "type": "boolean", + "x-ms-summary": "Paypal", + "description": "Paypal" + }, + "stripe": { + "type": "boolean", + "x-ms-summary": "Stripe", + "description": "Stripe" + } + }, + "x-ms-summary": "Payment Methods", + "description": "Payment Methods" + }, + "created_at": { + "type": "string", + "x-ms-summary": "Created At", + "description": "Created At" + }, + "updated_at": { + "type": "string", + "x-ms-summary": "Updated At", + "description": "Updated At" + }, + "invoice_items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string", + "x-ms-summary": "description", + "description": "description" + }, + "item_type": { + "type": "string", + "x-ms-summary": "Item Type", + "description": "Item Type" + }, + "price": { + "type": "string", + "x-ms-summary": "Price", + "description": "Price" + }, + "quantity": { + "type": "string", + "x-ms-summary": "Quantity", + "description": "Quantity" + } + } + }, + "x-ms-summary": "Invoice Items", + "description": "Invoice Items" + } + }, + "x-ms-summary": "Invoice", + "description": "Invoice" + } + } + } + } + } + }, + "put": { + "summary": "Update Invoice", + "x-ms-summary": "Update Invoice", + "description": "Update Invoice", + "operationId": "UpdateInvoice", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "name": "id", + "default": "", + "in": "path", + "x-ms-url-encoding": "single", + "type": "string", + "x-ms-summary": "Invoice Id", + "description": "Invoice Id", + "x-ms-dynamic-values": { + "operationId": "ListInvoices", + "value-collection": "invoices", + "value-path": "id", + "value-title": "title" + }, + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "invoice": { + "type": "object", + "properties": { + "notes": { + "type": "string", + "x-ms-summary": "Notes", + "description": "Notes" + } + }, + "x-ms-summary": "Invoice", + "description": "Invoice" + } + }, + "default": { + "invoice": { + "notes": "An example of some additional text." + } + } + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/recurring_invoices": { + "get": { + "summary": "List all recurring invoices", + "x-ms-summary": "List all recurring invoices", + "description": "List all recurring invoices", + "operationId": "ListAllRecurringInvoices", + "parameters": [], + "responses": { + "200": { + "description": "200", + "schema": { + "type": "object", + "properties": { + "recurring_invoices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "url": { + "type": "string", + "x-ms-summary": "Url", + "description": "Url" + }, + "contact": { + "type": "string", + "x-ms-summary": "Contact", + "description": "Contact" + }, + "dated_on": { + "type": "string", + "x-ms-summary": "Dated On", + "description": "Dated On" + }, + "frequency": { + "type": "string", + "x-ms-summary": "Frequency", + "description": "Frequency" + }, + "next_recurs_on": { + "type": "string", + "x-ms-summary": "Next Recurs On", + "description": "Next Recurs On" + }, + "recurring_end_date": { + "type": "string", + "x-ms-summary": "Recurring End Date", + "description": "Recurring End Date" + }, + "recurring_status": { + "type": "string", + "x-ms-summary": "Recurring Status", + "description": "Recurring Status" + }, + "reference": { + "type": "string", + "x-ms-summary": "Reference", + "description": "Reference" + }, + "currency": { + "type": "string", + "x-ms-summary": "Currency", + "description": "Currency" + }, + "exchange_rate": { + "type": "string", + "x-ms-summary": "Exchange Rate", + "description": "Exchange Rate" + }, + "net_value": { + "type": "string", + "x-ms-summary": "Net Value", + "description": "Net Value" + }, + "sales_tax_value": { + "type": "string", + "x-ms-summary": "Sales Tax Value", + "description": "Sales Tax Value" + }, + "total_value": { + "type": "string", + "x-ms-summary": "Total Value", + "description": "Total Value" + }, + "omit_header": { + "type": "boolean", + "x-ms-summary": "Omit Header", + "description": "Omit Header" + }, + "always_show_bic_and_iban": { + "type": "boolean", + "x-ms-summary": "Always Show BIC And IBAN", + "description": "Always Show BIC And IBAN" + }, + "payment_terms_in_days": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Payment Terms In Days", + "description": "Payment Terms In Days" + } + } + }, + "x-ms-summary": "Recurring Invoices", + "description": "Recurring Invoices" + } + } + } + } + } + } + }, + "/recurring_invoices/{id}": { + "get": { + "summary": "Show Recurring Invoice", + "x-ms-summary": "Show Recurring Invoice", + "description": "Show Recurring Invoice", + "operationId": "ShowRecurringInvoice", + "parameters": [ + { + "name": "id", + "default": "", + "in": "path", + "x-ms-url-encoding": "single", + "x-ms-summary": "Recurring Invoice Id", + "description": "Recurring Invoice Id", + "type": "string", + "required": true + } + ], + "responses": { + "200": { + "description": "200", + "schema": { + "type": "object", + "properties": { + "recurring_invoice": { + "type": "object", + "properties": { + "url": { + "type": "string", + "x-ms-summary": "Url", + "description": "Url" + }, + "contact": { + "type": "string", + "x-ms-summary": "Contact", + "description": "Contact" + }, + "dated_on": { + "type": "string", + "x-ms-summary": "Dated On", + "description": "Dated On" + }, + "frequency": { + "type": "string", + "x-ms-summary": "Frequency", + "description": "Frequency" + }, + "next_recurs_on": { + "type": "string", + "x-ms-summary": "Next Recurs On", + "description": "Next Recurs On" + }, + "recurring_end_date": { + "type": "string", + "x-ms-summary": "Recurring End Date", + "description": "Recurring End Date" + }, + "recurring_status": { + "type": "string", + "x-ms-summary": "Recurring Status", + "description": "Recurring Status" + }, + "reference": { + "type": "string", + "x-ms-summary": "Reference", + "description": "Reference" + }, + "currency": { + "type": "string", + "x-ms-summary": "Currency", + "description": "Currency" + }, + "exchange_rate": { + "type": "string", + "x-ms-summary": "Exchange Rate", + "description": "Exchange Rate" + }, + "net_value": { + "type": "string", + "x-ms-summary": "Net Value", + "description": "Net Value" + }, + "sales_tax_value": { + "type": "string", + "x-ms-summary": "Sales Tax Value", + "description": "Sales Tax Value" + }, + "total_value": { + "type": "string", + "x-ms-summary": "Total Value", + "description": "Total Value" + }, + "omit_header": { + "type": "boolean", + "x-ms-summary": "Omit Header", + "description": "Omit Header" + }, + "always_show_bic_and_iban": { + "type": "boolean", + "x-ms-summary": "Always Show BIC And IBAN", + "description": "Always Show BIC And IBAN" + }, + "payment_terms_in_days": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Payment Terms In Days", + "description": "Payment Terms In Days" + }, + "invoice_items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "url": { + "type": "string", + "x-ms-summary": "Url", + "description": "Url" + }, + "position": { + "type": "integer", + "format": "int32", + "x-ms-summary": "Position", + "description": "Position" + }, + "description": { + "type": "string", + "x-ms-summary": "description", + "description": "description" + }, + "item_type": { + "type": "string", + "x-ms-summary": "Item Type", + "description": "Item Type" + }, + "price": { + "type": "string", + "x-ms-summary": "Price", + "description": "Price" + }, + "quantity": { + "type": "string", + "x-ms-summary": "Quantity", + "description": "Quantity" + }, + "sales_tax_rate": { + "type": "string", + "x-ms-summary": "Sales Tax Rate", + "description": "Sales Tax Rate" + }, + "sales_tax_status": { + "type": "string", + "x-ms-summary": "Sales Tax Status", + "description": "Sales Tax Status" + }, + "category": { + "type": "string", + "x-ms-summary": "Category", + "description": "Category" + } + } + }, + "x-ms-summary": "Invoice Items", + "description": "Invoice Items" + } + }, + "x-ms-summary": "Recurring Invoice", + "description": "Recurring Invoice" + } + } + } + } + } + } + } + }, + "definitions": {}, + "parameters": {}, + "responses": {}, + "x-ms-connector-metadata": [ + { + "propertyName": "Website", + "propertyValue": "https://www.freeagent.com/" + }, + { + "propertyName": "Privacy policy", + "propertyValue": "https://www.freeagent.com/website/privacy/" + }, + { + "propertyName": "Categories", + "propertyValue": "Finance;Data" + } + ], + "securityDefinitions": { + "oauth2_auth": { + "type": "oauth2", + "flow": "accessCode", + "authorizationUrl": "https://api.freeagent.com/v2/approve_app", + "tokenUrl": "https://api.freeagent.com/v2/token_endpoint", + "scopes": {} + } + }, + "security": [ + { + "oauth2_auth": [] + } + ], + "tags": [] +} \ No newline at end of file diff --git a/independent-publisher-connectors/FreeAgent/apiProperties.json b/independent-publisher-connectors/FreeAgent/apiProperties.json new file mode 100644 index 000000000..eaae2ac4a --- /dev/null +++ b/independent-publisher-connectors/FreeAgent/apiProperties.json @@ -0,0 +1,80 @@ +{ + "properties": { + "connectionParameters": { + "token": { + "type": "oauthSetting", + "oAuthSettings": { + "identityProvider": "oauth2", + "clientId": "[[CLIENT ID]]", + "scopes": [], + "redirectMode": "Global", + "redirectUrl": "https://global.consent.azure-apim.net/redirect", + "properties": { + "IsFirstParty": "False", + "IsOnbehalfofLoginSupported": false + }, + "customParameters": { + "authorizationUrl": { + "value": "https://api.freeagent.com/v2/approve_app" + }, + "tokenUrl": { + "value": "https://api.freeagent.com/v2/token_endpoint" + }, + "refreshUrl": { + "value": "https://api.freeagent.com/v2/token_endpoint" + } + } + } + } + }, + "iconBrandColor": "#da3b01", + "capabilities": [], + "policyTemplateInstances": [ + { + "templateId": "stringreplace", + "title": "Replace Invoice Url to ID", + "parameters": { + "x-ms-apimTemplate-operationName": [ + "ListInvoices" + ], + "x-ms-apimTemplateParameter.propertyParentPath": "@body().invoices", + "x-ms-apimTemplateParameter.propertySubPath": "url", + "x-ms-apimTemplateParameter.sourceString": "https://api.freeagent.com/v2/invoices/", + "x-ms-apimTemplateParameter.replacementString": "", + "x-ms-apimTemplateParameter.newPropertyPath": "@item().id", + "x-ms-apimTemplate-policySection": "Response" + } + }, + { + "templateId": "setproperty", + "title": "Set Title for Invoice", + "parameters": { + "x-ms-apimTemplate-operationName": [ + "ListInvoices" + ], + "x-ms-apimTemplateParameter.newPropertyParentPathTemplate": "@body().invoices", + "x-ms-apimTemplateParameter.newPropertySubPathTemplate": "title", + "x-ms-apimTemplateParameter.propertyValuePathTemplate": "'{@item()['id']}-{@item()['reference']}'", + "x-ms-apimTemplate-policySection": "Response" + } + }, + { + "templateId": "stringreplace", + "title": "Replace Contact Url to ID", + "parameters": { + "x-ms-apimTemplate-operationName": [ + "GetContacts" + ], + "x-ms-apimTemplateParameter.propertyParentPath": "@body().contacts", + "x-ms-apimTemplateParameter.propertySubPath": "url", + "x-ms-apimTemplateParameter.sourceString": "https://api.freeagent.com/v2/contacts/", + "x-ms-apimTemplateParameter.replacementString": "", + "x-ms-apimTemplateParameter.newPropertyPath": "@item().id", + "x-ms-apimTemplate-policySection": "Response" + } + } + ], + "publisher": "Nirmal Kumar", + "stackOwner": "FreeAgent" + } +} \ No newline at end of file