Connec API V2

This documentation presents all the entities available on Connec!™, provided by Maestrano.

API Host

Connec!™ API production host is: https://api-connec.maestrano.com

Path prefixing

All API path must be prefixed by the API version (v2) and customer group_id: /api/<version>/<group_id>

E.g: Assuming that my customer group_id is cld-sdf5751, the full path to /organizations will be:

/api/v2/cld-sdf5751/organizations

If you are using one of the Maestrano SDKs, this will automatically be handled for you.

Authentication

The Connec!™ V2 APIs use HTTP basic authentication:
username: <your API key>
password: <your API token>

If you are using one of the Maestrano SDKs, this will automatically be handled for you.

Authentication levels

The API proposes 3 levels of authentication:

Application credentials

When an application is registered on the Developer Platform, a set of API keys is automatically configured for this application. Access to user data is granted once this application has been added to a customer dashboard of applications. Using the Maestrano SDKs will handle the dynamic listing of your application on the various marketplaces available.

Developer credentials

After registering on the developer platform, you can access the Sandbox front-end to test your integration. Under your My Account settings, section Developer, you can enable your user credentials and access the Connec!™ API. This set of credentials has access to all the organizations created with your user.

With this set of credentials you can use your org-uid to query Connec!™

/api/v2/org-sdf5751/organizations
Tenant credentials

This set of credentials is only available to enterprise customers and has access to all your customers data.

Documentation

  • : Uniq attribute

  • : Read only attribute

  • : Mandatory attribute



API | JSON Schemas

JSON Schema for a collection

GET https://api-connec.maestrano.com/api/v2/json_schema/:collection_name
Responses200
Body
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "organizations": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name"
        ],
        "uniq": [
          "id",
          "code"
        ],
        "properties": {
          "resource_type": {
            "description": "Resource type name",
            "type": "string",
            "readOnly": true
          },
          "id": {
            "description": "Organization UUID",
            "type": "string",
            "readOnly": true
          },
          "channel_id": {
            "type": "string",
            "description": "Channel ID (cld-xxx)",
            "readOnly": true
          },
          "group_id": {
            "description": "Group ID (org-xxx)",
            "type": "string",
            "readOnly": true
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Code, auto-generated if not specified",
            "type": "string"
          },
          "status": {
            "description": "[ACTIVE, INACTIVE] - Default: ACTIVE",
            "type": "string",
            "format": "enum"
          },
          "name": {
            "description": "Organization name",
            "type": "string"
          },
          "reference": {
            "description": "Organization reference",
            "type": "string"
          },
          "industry": {
            "description": "Industry sector (banking, communication, construction, engineering, finance...)",
            "type": "string"
          },
          "annual_revenue": {
            "description": "Organization annual revenue",
            "type": "number"
          },
          "capital": {
            "description": "Organization capital",
            "type": "number"
          },
          "number_of_employees": {
            "description": "Organization number of employees",
            "type": "integer"
          },
          "is_customer": {
            "description": "Organization is classified as a Customer",
            "type": "boolean"
          },
          "is_supplier": {
            "description": "Organization is classified as a Supplier",
            "type": "boolean"
          },
          "is_lead": {
            "description": "Organization is classified as a Lead",
            "type": "boolean"
          },
          "contact_channel": {
            "description": "Channels to join the organization",
            "$ref": "#/definitions/contact_channel"
          },
          "email": {
            "description": "Organization email addresses",
            "$ref": "#/definitions/email"
          },
          "address": {
            "description": "Organization addresses",
            "$ref": "#/definitions/address"
          },
          "website": {
            "description": "Organization websites",
            "$ref": "#/definitions/website"
          },
          "phone": {
            "description": "Organization phone and fax numbers",
            "$ref": "#/definitions/phone"
          }
        }
      }
    }
  },
  "definitions": {
    "contact_channel": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "contact_channel": {
          "type": "object",
          "properties": {
            "skype": {
              "description": "Skype account",
              "type": "string"
            }
          }
        }
      }
    },
    "email": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "address": {
              "description": "Primary email address",
              "type": "string"
            },
            "address2": {
              "description": "Secondary email address",
              "type": "string"
            }
          }
        }
      }
    },
    "address": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "website": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "url": {
              "description": "Primary website url",
              "type": "string"
            },
            "url2": {
              "description": "Secondary website url",
              "type": "string"
            }
          }
        }
      }
    },
    "phone": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "price": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "price": {
          "type": "object",
          "properties": {
            "total_amount": {
              "description": "Total amount including taxes",
              "type": "number"
            },
            "net_amount": {
              "description": "Net amount excluding taxes",
              "type": "number"
            },
            "tax_amount": {
              "description": "Total tax amount",
              "type": "number"
            },
            "tax_rate": {
              "description": "Applicable tax rate",
              "type": "number"
            },
            "currency": {
              "description": "Price currency",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

JSON Schema for a collection
GET/api/v2/json_schema/:collection_name

JSON schemas are exposed for each collection

GET /api/v2/json_schema/organizations

API | Querying

List of resources

GET https://api-connec.maestrano.com/api/v2/:group_id/(root path)
Responses200
Body
{
  "_links": [
    {
      "company": {
        "href": "/api/v2/cld-945d2/company"
      }
    },
    {
      "accounts": {
        "href": "/api/v2/cld-945d2/accounts"
      }
    },
    {
      "invoices": {
        "href": "/api/v2/cld-945d2/invoices"
      }
    },
    {
      "credit_notes": {
        "href": "/api/v2/cld-945d2/credit_notes"
      }
    },
    {
      "credit_payments": {
        "href": "/api/v2/cld-945d2/credit_payments"
      }
    },
    {
      "sales_orders": {
        "href": "/api/v2/cld-945d2/sales_orders"
      }
    },
    {
      "...": "..."
    }
  ]
}

List of resources
GET/api/v2/:group_id/(root path)

The complete list of available resources can be retrieved from the API root endpoint (with group_id specified or not):

GET https://api-connec.maestrano.com/api/v2(/:group_id)

When a group_id is specified in the URL then all generated resource paths in the response will be scoped to that group_id. If not group_id is specified in the URL then all paths in the response will contain a generic :group_id resource parameter.

This resource listing can help you find your way when navigating through the API by returning the path of all available resources.


Resources collection

GET https://api-connec.maestrano.com/api/v2/:group_id/:collection_name
Responses200
Body
{
  "organizations": [
    {
      "id": "e32303c1-5102-0132-661e-600308937d74",
      "group_id": "cld-4d7f86",
      "created_at": "2014-11-18T03:42:45Z",
      "updated_at": "2014-11-18T03:42:45Z",
      "name": "DoeCorp Inc."
    },
    {
      "id": "e12303c1-7102-0032-661e-100304937d74",
      "group_id": "cld-4d7f86",
      "created_at": "2014-11-11T03:12:45Z",
      "updated_at": "2014-11-12T03:32:45Z",
      "name": "Jack Corp Inc."
    },
    {
      "...": "..."
    }
  ]
}

Resources collection
GET/api/v2/:group_id/:collection_name

To retrieve a collection of resources, an HTTP GET request is issued agains the resources endpoint. By default, only the first 100 elements of the collection ordered by creation date are returned. Refer to the filter and pagination section below for more details.

Assuming your application group_id is cld-dkg601, to retrieve the list of organizations the following request is sent

GET /api/v2/cld-dkg601/organizations

Single Resource

GET https://api-connec.maestrano.com/api/v2/:group_id/:collection_name/:id
Responses200
Body
{
  "organizations": {
    "id": "e32303c1-5102-0132-661e-600308937d74",
    "group_id": "cld-4d7f86",
    "created_at": "2014-11-18T03:42:45Z",
    "updated_at": "2014-11-18T03:42:45Z",
    "name": "DoeCorp Inc."
  }
}

Single Resource
GET/api/v2/:group_id/:collection_name/:id

To fetch a single resource by its unique identifier, a GET request against the resource URL can be sent.

GET /api/v2/cld-dkg601/organizations/e32303c1-5102-0132-661e-600308937d74

Pagination

GET https://api-connec.maestrano.com/api/v2/:group_id/:collection_name?$top=100&$skip=10
Responses200
Body
{
  "events": [
    {
      "id": "aace0181-a55a-0132-47cc-22000aac819e",
      "code": "EV87"
    },
    {
      "...": "..."
    }
  ],
  "pagination": {
    "skip": 0,
    "top": 10,
    "total": 37,
    "next": "https://api-connec.maestrano.com/api/v2/cld-dkg601/events?%24skip=10&%24top=10"
  }
}

Pagination
GET/api/v2/:group_id/:collection_name?$top=100&$skip=10

When retrieving a collection of resources, only the first 100 elements are returned by default. To fetch the entire collection, the pagination mechanism must be used. The following parameters can be specified in the URL:

$top the number of elements to return

$skip the index of the first element

$orderby the field(s) to order resources on

The pagination details are returned when fetching a collection, including the next and previous URL for convenience.

Examples:

Request to fetch the first 10 Events (response provided)

GET /api/v2/cld-dkg601/events?$top=10

Request to retrieve the last created Organization

GET /api/v2/cld-dkg601/organizations?$top=1&$orderby=created_at desc

Request to retrieve the Organizations from index 10 to 19 ordered by name

GET /api/v2/cld-dkg601/organizations?$top=10&$skip=10&$orderby=name asc

Filtering

GET https://api-connec.maestrano.com/api/v2/:group_id/:collection_name?$filter=:filter_query
Responses200
Body
{
  "organizations": [
    {
      "id": "e32303c1-5102-0132-661e-600308937d74",
      "group_id": "cld-4d7f86",
      "created_at": "2015-04-18T03:42:45Z",
      "updated_at": "2016-01-18T03:42:45Z",
      "name": "DoeCorp Inc."
    },
    {
      "id": "e12303c1-7102-0032-661e-100304937d74",
      "group_id": "cld-4d7f86",
      "created_at": "2015-05-11T03:12:45Z",
      "updated_at": "2015-06-12T03:32:45Z",
      "name": "Jack Corp Inc."
    }
  ]
}

Filtering
GET/api/v2/:group_id/:collection_name?$filter=:filter_query

To filter a request on the collection of resources, the $filter URL parameter can be specified. The following criteria are currently supported:

eq attribute must be equal to value

gt attribute must be greater than value

gte attribute must be greater or equal to value

lt attribute must be lower than value

lte attribute must be lower or equal to value

ne attribute must not be equal to value

nin attribute must not be included in the array

in attribute must be included in the array

Examples:

Retrieve the Organizations having 5 employees and created after 31/03/2015 (response provided)

GET /api/v2/cld-dkg601/organizations?$filter=number_of_employees eq 5 and created_at gt '2015-03-31'

Retrieve the Invoices that are neither at status “DRAFT” nor “VOIDED”

GET /api/v2/cld-dkg601/invoices?$filter=status nin ['DRAFT','VOIDED']

Retrieve Invoices providing a list of ids (the id field must be passed as _id):

GET /api/v2/cld-dkg601/invoices?$filter=_id in ['e32303c1-5102-0132-661e-600308937d74','e12303c1-7102-0032-661e-100304937d74']

Filters can be combined with Pagination parameters

api/v2/org-fnfv/organizations?$filter=name ne 'DOE Inc'&$orderby=updated_at desc

In order to filter using a nested field, use dotted notation

api/v2/org-fnfv/organizations?$filter=email.address ne 'johnsmith@test.com'&$orderby=created_at desc

Filtering can be used to return the total number of entries of a collection subset

api/v2/group_id/journals?$top=0&$filter=journal_lines.account_id eq 'c6c27b81-1577-0134-99b8-31e5d21a2769'

Custom headers

GET https://api-connec.maestrano.com/api/v2/:group_id/:collection_name

Custom headers
GET/api/v2/:group_id/:collection_name

Several custom headers are available to refine the data that you query:

CONNEC-COUNTRY-FORMAT=alpha2

The API returns by default the full name of countries, like Australia. With this header, it will returns a two letters code as definied by the ISO 3166, like AU.


API | Save Data

Resource creation

POST https://api-connec.maestrano.com/api/v2/:group_id/:collection_name
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "organizations": {
    "name": "Doe Corp Inc.",
    "is_customer": true
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
  "organizations": {
    "id": "e32303c1-5102-0132-661e-600308937d74",
    "group_id": "cld-4d7f86",
    "created_at": "2014-12-18T03:42:45Z",
    "updated_at": "2014-12-18T03:42:45Z",
    "name": "Doe Corp Inc.",
    "is_customer": true
  }
}

Resource creation
POST/api/v2/:group_id/:collection_name

To create a new resource, an HTTP POST request is issued against the resource collection endpoint. The payload of the request must contain the resource attributes as described in the resources schemas in the sections below.

Assuming your application group_id is cld-dkg601, to create a resource of type organizations the following request can be sent:

POST /api/v2/cld-dkg601/organizations

with the following payload:

{
  "organizations": {
    "name": "Doe Corp Inc.",
    "is_customer": true
  }
}

Smart merging

When creating an entity, you can specify which attributes you want to use to merge with an existing record. If a record is matched, it will behave like an update request and return the existing entity with a 200 status code. This can be specified with the option matching_fields

Match on a single field

POST /api/v2/cld-dkg601/organizations
{
  "organizations": {
    "opts": {"matching_fields": ["name"]},
    "name": "Doe Corp Inc.",
    "is_customer": true
  }
}

Match on multiple fields (matches name and reference)

POST /api/v2/cld-dkg601/organizations
{
  "organizations": {
    "opts": {"matching_fields": ["name", "reference"]},
    "name": "Doe Corp Inc.",
    "reference": "015401",
    "is_customer": true
  }
}

Match on multiple sets of fields (matches either name or reference)

POST /api/v2/cld-dkg601/organizations
{
  "organizations": {
    "opts": {"matching_fields": [["name"], ["reference"]]},
    "name": "Doe Corp Inc.",
    "reference": "015401",
    "is_customer": true
  }
}

Resource update

PUT https://api-connec.maestrano.com/:collection_name/:id
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "organizations": {
    "name": "DoeCorp Inc.",
    "is_supplier": true
  }
}
Responses200404
Body
{
  "organizations": {
    "id": "e32303c1-5102-0132-661e-600308937d74",
    "group_id": "cld-4d7f86",
    "created_at": "2014-12-18T03:42:45Z",
    "updated_at": "2014-12-18T03:42:45Z",
    "name": "Doe Corp Inc.",
    "is_customer": true
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Resource update
PUT/:collection_name/:id

To update a resource, an HTTP PUT request is issued against the single resource endpoint. The payload of the request must contain the resource attributes as described in the resources schemas in the sections below.

Assuming your application group_id is cld-dkg601, to update a resource of type organizations with the id e32303c1-5102-0132-661e-600308937d74 the following request can be sent:

PUT /api/v2/cld-dkg601/organizations/e32303c1-5102-0132-661e-600308937d74

with the following payload:

{
  "organizations": {
    "name": "Doe Corp Inc.",
    "is_customer": true
  }
}

Integration considerations

As new objects are created in Connec!™, it is required that you maintain a mapping between your application entities and the Connec!™ resources to perform updates against the resources. More information can be found on the Maestrano developer documentation: Multi-tenant > ID mapping

Nested collections operations

When updating an entity with nested fields (such as ‘lines’), you can specify the behaviour desired. This can be specified with the option sparse

“sparse”: true => collection elements not specified in the update requests are not modified

“sparse”: false => collection elements not specified in the update requests are deleted

Given the following record exists

{
  "employees": {
    "id": "4fc4d621-8037-0133-3e14-025dd6a1bb31",
    "first_name": "John",
    "last_name": "Doe",
    "birth_date": "1976-03-17",
    "work_locations": [
      {
        "id": "568f021e9537296f45004856",
        "role": "developer",
        "work_location_id": "c48ca3b1-97cb-0133-6118-060bcee6eb9d"
      },
      {
        "id": "568f021e9537296f45004858",
        "role": "developer",
        "work_location_id": "e9c39df1-97cb-0133-611c-060bcee6eb9d"
      }
    ],
    "channel_id": "org-abcd",
    "resource_type": "employees"
  }
}

Sending a sparse PUT request as follows:

{
  "employees": {
    "opts": {
      "sparse": true
    },
    "work_locations": [
      {
        "role": "software developer",
        "work_location_id": "c48ca3b1-97cb-0133-6118-060bcee6eb9d"
      }
    ]
  }
}

Will receive this response:

{
  "employees": {
    "id": "4fc4d621-8037-0133-3e14-025dd6a1bb31",
    "first_name": "John",
    "last_name": "Doe",
    "birth_date": "1976-03-17",
    "work_locations": [
      {
        "id": "568f021e9537296f45004856",
        "role": "software developer",
        "work_location_id": "c48ca3b1-97cb-0133-6118-060bcee6eb9d"
      },
      {
        "id": "568f021e9537296f45004858",
        "role": "developer",
        "work_location_id": "e9c39df1-97cb-0133-611c-060bcee6eb9d"
      }
    ],
    "channel_id": "org-abcd",
    "resource_type": "employees"
  }
}

Sending a non sparse PUT request:

{
  "employees": {
    "opts": {
      "sparse": false
    },
    "work_locations": [
      {
        "role": "software developer",
        "work_location_id": "c48ca3b1-97cb-0133-6118-060bcee6eb9d"
      }
    ]
  }
}

Response:

{
  "employees": {
    "id": "4fc4d621-8037-0133-3e14-025dd6a1bb31",
    "first_name": "John",
    "last_name": "Doe",
    "birth_date": "1976-03-17",
    "work_locations": [
      {
        "id": "568f021e9537296f45004856",
        "role": "software developer",
        "work_location_id": "c48ca3b1-97cb-0133-6118-060bcee6eb9d"
      }
    ],
    "channel_id": "org-abcd",
    "resource_type": "employees"
  }
}

API | Batch Calls

Batch Calls

POST https://api-connec.maestrano.com/batch
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "ops": [
    {
      "method": "get",
      "url": "/api/v2/cld-sdf5751/organizations",
      "params": {
        "sso_session": "572d934f3dd74e3749e451e5ccd55b840071f5c9",
        "$top": 1
      }
    },
    {
      "method": "post",
      "url": "/api/v2/cld-sdf5751/organization",
      "params": {
        "organizations": {
          "name": "Doe Corp Inc.",
          "is_customer": true
        }
      },
      "headers": {
        "Authorization": "Basic bWFlc3RyYW5vOmlzQXdlc29tZQ=="
      }
    },
    {
      "method": "delete",
      "url": "/oh/no/error",
      "headers": {
        "break": "fast"
      }
    }
  ],
  "sequential": true
}
Responses201
Headers
Content-Type: application/json
Body
{
  results: [
    {status: 200, body: {organizations:[{id: ...], headers: {"X-Frame-Options": "SAMEORIGIN" ...,},
    {status: 200, body: {organizations: {id: ...}, headers: {"X-Frame-Options": "SAMEORIGIN" ...,}},
    {status: 404, body: "Not Found", headers: {"X-Cascade": "pass"}}
  ]
}

Batch Calls
POST/batch

General Concepts

It is possible batch API queries/updates mixing multiple entities in one API call.

The example shows that each request in the batch - or “operation” in batch parlance - is equivalent to a regular API call as described for each API resource in this documentation.

Each operation contains the following attributes:

  • url: the API endpoint to hit, formatted exactly as you would for a regular REST API request, leading / and all. (required)

  • method: what type of request to make – GET, POST, PUT, etc. If no method is supplied, GET is assumed. (optional)

  • params: a hash of arguments to the API. This can be used for both GET and PUT/POST/PATCH requests. (optional)

  • headers: a hash of request-specific headers. The headers sent in the request will be included as well, with operation-specific headers taking precendence. (optional)

These individual operations are supplied as the “ops” parameter in the overall request. Other options include:

  • sequential: execute all operations sequentially, rather than in parallel. This parameter is currently REQUIRED and must be set to true. (In the future the Batch API will offer parallel processing for thread-safe apps, and hence this parameter must be supplied in order to explicitly preserve expected behavior.)

Authentication

Each operation call needs to be authenticated. Either with:

Responses

The Batch API will always return a 200, with a JSON body containing the individual responses under the “results” key. Those responses, in turn, contain the same main components of any HTTP response:

  • status: the HTTP status (200, 201, 400, etc.)

  • body: the rendered body

  • headers: any response headers

Errors

Errors in individual Batch API requests will be returned inline, with the same status code and body they would return as individual requests.

If the Batch API itself returns a non-200 status code, that indicates a global problem.


API Admin | Webhooks

To support third-party information systems integrations, Connec!™ can be configured to send notifications to webhooks. These webhooks must be configured using admin credentials and will be triggered for all the customers. Configuring a Webhook will POST the content of created/updated entities subscribed to the endpoint.

Note:

  • api_key, api_secret, endpoint, and name are all required fields, the others are optional

  • subscribed_entities must be in an array

  • detailed_notifications must be a boolean value

    • false: only the entity type and id are sent
    • true: the complete object content is sent
  • period (seconds - default: 60) must be an integer value. The updated entities will be batched together into notifications sent periodically. When period is set at 0, the notifications are sent in real time (one notification sent per entity updated)

  • max_size must be an integer value (default: 30)

  • timeout (seconds - default: 5) corresponds to the maximum timeout after which the webhook notification will fail and restart later

To delete an existing webhook make a DELETE request to ‘api/v2/admin/webhooks/:id’.

Webhooks List

GET https://api-connec.maestrano.com/api/v2/admin/webhooks
Responses200
Headers
Content-Type: application/vnd.api+json
Body
[
  {
    "_id": {
      "$oid": "57c63bca42a4fbbd4666f8f5"
    },
    "api_key": "username",
    "api_secret": "password",
    "detailed_notifications": true,
    "endpoint": "https://myapplication.com/api/notifications",
    "name": "my-application",
    "period": 60,
    "max_size": 30,
    "timeout": 5,
    "subscribed_entities": [
      "Journals",
      "Accounts",
      "People",
      "Organizations",
      "Invoices",
      "CreditNotes",
      "Employees",
      "PayRuns",
      "PayStubs",
      "Items",
      "Opportunities",
      "AppUsers",
      "PaySchedules",
      "PayItems"
    ]
  }
]

Get Webhooks
GET/api/v2/admin/webhooks

Get the list of webhooks.


POST https://api-connec.maestrano.com/api/v2/admin/webhooks
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "api_key": "username",
  "api_secret": "password",
  "detailed_notifications": true,
  "endpoint": "https://myapplication.com/api/notifications",
  "name": "my-application",
  "subscribed_entities": [
    "Journals"
  ],
  "period": 60,
  "max_size": 30,
  "timeout": 5
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
  "_id": {
    "$oid": "57c63bca42a4fbbd4666f8f5"
  },
  "api_key": "username",
  "api_secret": "password",
  "detailed_notifications": true,
  "endpoint": "https://myapplication.com/api/notifications",
  "name": "my-application",
  "subscribed_entities": [
    "Journals"
  ],
  "period": 60,
  "max_size": 30,
  "timeout": 5
}

Create New Webhook
POST/api/v2/admin/webhooks

Create a new Webhook.


Webhook

GET https://api-connec.maestrano.com/api/v2/admin/webhooks/e32303c1-5102-0132-661e-600308937d74
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "_id": {
    "$oid": "57c63bca42a4fbbd4666f8f5"
  },
  "api_key": "username",
  "api_secret": "password",
  "detailed_notifications": true,
  "endpoint": "https://myapplication.com/api/notifications",
  "name": "my-application",
  "subscribed_entities": [
    "Journals"
  ],
  "period": 60,
  "max_size": 30,
  "timeout": 5
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Get Webhook
GET/api/v2/admin/webhooks/{id}

Get a single webhook.

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The webhook ID


PUT https://api-connec.maestrano.com/api/v2/admin/webhooks/e32303c1-5102-0132-661e-600308937d74
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "api_key": "username",
  "api_secret": "password",
  "detailed_notifications": true,
  "endpoint": "https://myapplication.com/api/notifications",
  "name": "my-application",
  "subscribed_entities": [
    "Journals"
  ],
  "period": 60,
  "max_size": 30,
  "timeout": 5
}
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "_id": {
    "$oid": "57c63bca42a4fbbd4666f8f5"
  },
  "api_key": "username",
  "api_secret": "password",
  "detailed_notifications": true,
  "endpoint": "https://myapplication.com/api/notifications",
  "name": "my-application",
  "subscribed_entities": [
    "Journals"
  ],
  "period": 60,
  "max_size": 30,
  "timeout": 5
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Update a Webhook
PUT/api/v2/admin/webhooks/{id}

Update a single Webhook

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The webhook ID


DELETE https://api-connec.maestrano.com/api/v2/admin/webhooks/e32303c1-5102-0132-661e-600308937d74
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "_id": {
    "$oid": "57c63bca42a4fbbd4666f8f5"
  },
  "api_key": "username",
  "api_secret": "password",
  "detailed_notifications": true,
  "endpoint": "https://myapplication.com/api/notifications",
  "name": "my-application",
  "subscribed_entities": [
    "Journals"
  ],
  "period": 60,
  "max_size": 30,
  "timeout": 5
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Delete a Webhook
DELETE/api/v2/admin/webhooks/{id}

Delete a Webhook

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The webhook ID


API | Tracking Tags

All objects in Connec! can be attributed one or several Tracking Tag. A tracking tag is a simple structure that can be set on any entity or sub entity in Connec! and can be used to further classify entities.

A tag has the following structure, with a name indicating the tag category and a value indicating tag value:

"tags": [
  {
    "id": "58ca223abd44784f884f382f",
    "name": "Region",
    "value": "South"
  }
]

List of tags per resources

GET https://api-connec.maestrano.com/api/v2/:group_id/:collection_name/:id
Responses200
Body
{
  "journals": {
    "id": "43372dd0-ec38-0134-4938-0021cc6899a1",
    "status": "ACTIVE",
    ... ,
    "journal_lines": [
      {
        "id": "58ca2416bd44784f884f5495",
        "status": "ACTIVE",
        "posting_type": "DEBIT",
        "account_id": "74032b40-ec36-0134-3ddf-0021cc6899a1",
        ...,
        "tags": [
          {
            "id": "58ca223abd44784f884f382f",
            "tag_reference_value_id": "59641c9bbd447854b5ad751e"
          }
        ]
      },
      {
        ...
      }
    ],
    "created_at": "2017-03-16T05:35:19Z",
    "updated_at": "2017-03-16T05:35:19Z",
    "group_id": "org-fbbj",
    "channel_id": "org-fbbj",
    "resource_type": "journals"
  }
}

List of tags per resources
GET/api/v2/:group_id/:collection_name/:id

Tags attached to any entity will show in the response

For example, assuming you wan’t to retrieve a specific journal for the organization org-fbbj:

GET https://api-connec.maestrano.com/api/v2/org-fbbj/43372dd0-ec38-0134-4938-0021cc6899a1

The example shows a tag at the journal_line level


Assign a tag to an entity

PUT https://api-connec.maestrano.com/api/v2/:group_id/:collection_name/:id
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "invoices": {
    "id": "26058520-a443-0134-2a60-0021cc6899a1",
    "tags": [
      {
        "tag_reference_value_id": "59641c9bbd447854b5ad751e"
      }
    ]
  }
}
Responses200
Body
{
  "invoices": {
    "id": "26058520-a443-0134-2a60-0021cc6899a1",
    "code": "IN1",
    "...": "...",
    "tags": [
      {
        "id": "58d33160bd447835aaee6f62",
        "name": "Region",
        "value": "Test"
      }
    ]
  }
}

Assign a tag to an entity
PUT/api/v2/:group_id/:collection_name/:id

Post a tag on an entity to add it.

Assuming your application group_id is org-fbbj, and you want to add a tag to an invoice. tag_reference_value_id needs to refer to a valid Tag Reference Value Id

PUT https://api-connec.maestrano.com/api/v2/org-fbbj/26058520-a443-0134-2a60-0021cc6899a1

API | Attribute Types

Account Classifications

Accounts classification, type and subtype

Classification Type SubType
ASSET BANK CASHONHAND
CHECKING
MONEYMARKET
RENTSHELDINTRUST
SAVINGS
TRUSTACCOUNTS
OTHERCURRENTASSET EMPLOYEECASHADVANCES
ALLOWANCEFORBADDEBTS
DEVELOPMENTCOSTS
OTHERCURRENTASSETS
INVENTORY
LOANSTOOFFICERS
INVESTMENT_MORTGAGEREALESTATELOANS
INVESTMENT_OTHER
INVESTMENT_TAXEXEMPTSECURITIES
INVESTMENT_USGOVERNMENTOBLIGATIONS
LOANSTOOTHERS
LOANSTOSTOCKHOLDERS
PREPAIDEXPENSES
RETAINAGE
UNDEPOSITEDFUNDS
FIXEDASSET FURNITUREANDFIXTURES
ACCUMULATEDDEPLETION
ACCUMULATEDDEPRECIATION
DEPLETABLEASSETS
LAND
LEASEHOLDIMPROVEMENTS
OTHERFIXEDASSETS
ACCUMULATEDAMORTIZATION
BUILDINGS
INTANGIBLEASSETS
MACHINERYANDEQUIPMENT
VEHICLES
OTHERASSET LICENSES
LEASEBUYOUT
OTHERLONGTERMASSETS
SECURITYDEPOSITS
ACCUMULATEDAMORTIZATIONOFOTHERASSETS
GOODWILL
ORGANIZATIONALCOSTS
ACCOUNTSRECEIVABLE ACCOUNTSRECEIVABLE
EQUITY EQUITY OPENINGBALANCEEQUITY
PARTNERSEQUITY
RETAINEDEARNINGS
ACCUMULATEDADJUSTMENT
OWNERSEQUITY
PAIDINCAPITALORSURPLUS
PARTNERCONTRIBUTIONS
PARTNERDISTRIBUTIONS
PREFERREDSTOCK
COMMONSTOCK
TREASURYSTOCK
EXPENSE EXPENSE TRAVEL
ADVERTISINGPROMOTIONAL
BADDEBTS
BANKCHARGES
CHARITABLECONTRIBUTIONS
ENTERTAINMENT
ENTERTAINMENTMEALS
EQUIPMENTRENTAL
GLOBALTAXEXPENSE
INSURANCE
INTERESTPAID
LEGALPROFESSIONALFEES
OFFICEGENERALADMINISTRATIVEEXPENSES
OTHERMISCELLANEOUSSERVICECOST
PROMOTIONALMEALS
RENTORLEASEOFBUILDINGS
REPAIRMAINTENANCE
SHIPPINGFREIGHTDELIVERY
SUPPLIESMATERIALS
TRAVELMEALS
UTILITIES
AUTO
COSTOFLABOR
DUESSUBSCRIPTIONS
PAYROLLEXPENSES
TAXESPAID
OTHEREXPENSE DEPRECIATION
EXCHANGEGAINORLOSS
OTHERMISCELLANEOUSEXPENSE
PENALTIESSETTLEMENTS
AMORTIZATION
COSTOFGOODSSOLD COSTOFLABORCOS
EQUIPMENTRENTALCOS
OTHERCOSTSOFSERVICECOS
SHIPPINGFREIGHTDELIVERYCOS
SUPPLIESMATERIALSCOGS
LIABILITY ACCOUNTSPAYABLE ACCOUNTSPAYABLE
CREDITCARD CREDITCARD
LONGTERMLIABILITY NOTESPAYABLE
OTHERLONGTERMLIABILITIES
SHAREHOLDERNOTESPAYABLE
OTHERCURRENTLIABILITY OTHERCURRENTLIABILITIES
DIRECTDEPOSITPAYABLE
LINEOFCREDIT
LOANPAYABLE
GLOBALTAXPAYABLE
GLOBALTAXSUSPENSE
PAYROLLCLEARING
PAYROLLTAXPAYABLE
PREPAIDEXPENSESPAYABLE
RENTSINTRUSTLIABILITY
TRUSTACCOUNTSLIABILITIES
FEDERALINCOMETAXPAYABLE
INSURANCEPAYABLE
SALESTAXPAYABLE
STATELOCALINCOMETAXPAYABLE
REVENUE INCOME OTHERPRIMARYINCOME
NONPROFITINCOME
SALESOFPRODUCTINCOME
SERVICEFEEINCOME
DISCOUNTSREFUNDSGIVEN
OTHERINCOME OTHERINVESTMENTINCOME
DIVIDENDINCOME
INTERESTEARNED
OTHERMISCELLANEOUSINCOME
TAXEXEMPTINTEREST

Address

Sub type. Represents a postal address.

GET https://api-connec.maestrano.com/#/definitions/address
Responses200
Body
{
  "attention": "Mr John Smith",
  "line1": "Suite 102",
  "line2": "410 Elizabeth Street",
  "city": "Surry Hills",
  "region": "NSW",
  "postal_code": "2010",
  "country": "AU"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "address": {
      "type": "object",
      "properties": {
        "attention": {
          "description": "Contact name",
          "type": "string"
        },
        "attention_first_name": {
          "description": "Contact first name",
          "type": "string"
        },
        "attention_last_name": {
          "description": "Contact last name",
          "type": "string"
        },
        "line1": {
          "description": "First address line",
          "type": "string"
        },
        "line2": {
          "description": "Second address line",
          "type": "string"
        },
        "city": {
          "description": "City",
          "type": "string"
        },
        "region": {
          "description": "State, region or department",
          "type": "string"
        },
        "postal_code": {
          "description": "Zip or postal code",
          "type": "string"
        },
        "country": {
          "description": "Country alpha-2 code",
          "type": "string"
        }
      }
    }
  }
}

Address
GET/#/definitions/address

Address schema.

Attributes

Field Type Description
attention String Contact name. Concatenation of attention_first_name and attention_last_name if not provided
attention_first_name String Contact first name
attention_last_name String Contact last name
line1 String First address line
line2 String Second address line
city String City
region String State, region or department
postal_code String Zip or postal code
country String Country alpha-2 code

Address Group

Sub type. Represents shipping and billing addresses.

GET https://api-connec.maestrano.com/#/definitions/address_group
Responses200
Body
{
  "billing": {
    "line1": "Suite 102 ",
    "line2": "410 Elizabeth Street",
    "city": "Surry Hills",
    "region": "NSW",
    "postal_code": "2010",
    "country": "AU"
  },
  "billing2": {
    "line1": "3724 Divisadero Street ",
    "line2": "",
    "city": "San Francisco",
    "region": "CA",
    "postal_code": "94123",
    "country": "US"
  },
  "shipping": {
    "line1": "Suite 102 ",
    "line2": "410 Elizabeth Street",
    "city": "Surry Hills",
    "region": "NSW",
    "postal_code": "2010",
    "country": "AU"
  },
  "shipping2": {
    "line1": "Mr John Smith",
    "line2": "PO Box 99",
    "city": "Sydney",
    "region": "NSW",
    "postal_code": "2000",
    "country": "AU"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "address_group": {
      "type": "object",
      "properties": {
        "billing": {
          "description": "Primary billing address",
          "$ref": "#/definitions/address"
        },
        "billing2": {
          "description": "Secondary billing address",
          "$ref": "#/definitions/address"
        },
        "shipping": {
          "description": "Primary shipping address",
          "$ref": "#/definitions/address"
        },
        "shipping2": {
          "description": "Secondary shipping address",
          "$ref": "#/definitions/address"
        }
      }
    }
  }
}

Address Group
GET/#/definitions/address_group

Address Group schema.

Attributes

Field Type Description
billing Address Primary billing address
billing2 Address Secondary billing address
shipping Address Primary shipping address
shipping2 Address Secondary shipping address

Email Group

Sub type. Represents emails.

GET https://api-connec.maestrano.com/#/definitions/email_group
Responses200
Body
{
  "address": "john27@maestrano.com",
  "address2": "jack27@example.com"
}
Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",

    "definitions": {
      "email_group": {
        "type": "object",
        "properties": {
          "address": {
            "description": "Primary email address",
            "type": "string"
          },
          "address2": {
            "description": "Secondary email address",
            "type": "string"
          },
        }
      }
    }
}

Email Group
GET/#/definitions/email_group

Email Group schema.

Attributes

Field Type Description
address String Primary email address
address2 String Secondary email address

Price

Sub type. Represents a price detail including net, total and tax amounts.

Business Rules

The amounts and tax rates will be auto-computed in case of values missing. At the very least, one of the following attributes combinations must be provided:

  • total_amount and tax_rate

  • net_amount and tax_rate

  • net_amount and tax_amount The tax_rate may also be deduced from the associated object tax code (when applicable).

GET https://api-connec.maestrano.com/#/definitions/price
Responses200
Body
{
  "total_amount": 110,
  "net_amount": 100,
  "tax_amount": 10,
  "tax_rate": 10,
  "currency": "AUD"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "price": {
      "type": "object",
      "properties": {
        "total_amount": {
          "description": "Total amount including taxes",
          "type": "number"
        },
        "net_amount": {
          "description": "Net amount excluding taxes",
          "type": "number"
        },
        "tax_amount": {
          "description": "Total tax amount",
          "type": "number"
        },
        "tax_rate": {
          "description": "Applicable tax rate",
          "type": "number"
        },
        "currency": {
          "description": "Price currency",
          "type": "string"
        }
      }
    }
  }
}

Price
GET/#/definitions/price

Price schema.

Attributes

Field Type Description
total_amount Number Total amount including taxes
net_amount Number Net amount excluding taxes
tax_amount Number Total tax amount
tax_rate Number Applicable tax rate
currency String Price currency code

Telephone Group

Sub type. Represents phone numbers.

GET https://api-connec.maestrano.com/#/definitions/telephone_group
Responses200
Body
{
  "landline": "+61 (0) 2 9211 7532",
  "landline2": "+1 415 710 1939",
  "mobile": "+61 (0) 416 784 365",
  "mobile2": "+61 (0) 416 784 366",
  "fax": "+61 (0) 2 9211 7530",
  "fax2": "+1 415 710 1930",
  "pager": "61123456789",
  "pager2": "12481234567"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "address": {
      "type": "object",
      "properties": {
        "landline": {
          "description": "Primary phone number",
          "type": "string"
        },
        "landline2": {
          "description": "Secondary phone number",
          "type": "string"
        },
        "mobile": {
          "description": "Primary mobile number",
          "type": "string"
        },
        "mobile2": {
          "description": "Secondary mobile number",
          "type": "string"
        },
        "fax": {
          "description": "Primary fax number",
          "type": "string"
        },
        "fax2": {
          "description": "Secondary fax number",
          "type": "string"
        },
        "pager": {
          "description": "Primary pager number",
          "type": "string"
        },
        "pager2": {
          "description": "Secondary pager number",
          "type": "string"
        }
      }
    }
  }
}

Telephone Group
GET/#/definitions/telephone_group

Telephone Group schema.

Attributes

Field Type Description
landline String Primary landline number
landline2 String Secondary landline number
mobile String Primary mobile number
mobile2 String Secondary mobile number
fax String Primary fax number
fax2 String Secondary fax number
pager String Primary pager number
pager2 String Secondary pager number

Bank Account

Sub type. Represents the payment details of a bank account.

GET https://api-connec.maestrano.com/#/definitions/bank_account
Responses200
Body
{
  "bic_code": "12345-12310",
  "account_number": "78945 4410",
  "bsb_number": "123-123"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "bank_account": {
      "type": "object",
      "properties": {
        "bic_code": {
          "description": "Bic code",
          "type": "string"
        },
        "account_number": {
          "description": "Account number",
          "type": "string"
        },
        "bsb_number": {
          "description": "BSB number",
          "type": "string"
        }
      }
    }
  }
}

Bank Account
GET/#/definitions/bank_account

Bank Account schema.

Attributes

Field Type Description
bic_code String Bic code
account_number String Account number
bsb_number String BSB number

Website Group

Sub type. Represents websites.

GET https://api-connec.maestrano.com/#/definitions/website_group
Responses200
Body
{
  "url": "maestrano.com",
  "url2": "enterprise.maestrano.com"
}
Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",

    "definitions": {
      "email_group": {
        "type": "object",
        "properties": {
          "url": {
            "description": "Primary website url",
            "type": "string"
          },
          "url2": {
            "description": "Secondary website url",
            "type": "string"
          },
        }
      }
    }
}

Website Group
GET/#/definitions/website_group

Website Group schema.

Attributes

Field Type Description
url String Primary website url
url2 String Secondary website url

Contact channel

Sub type. Represents ways to join the contact.

GET https://api-connec.maestrano.com/#/definitions/contact_channel
Responses200
Body
{
    "skype": "doecorp",
}
Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",

    "definitions": {
      "contact_channel": {
        "type": "object",
        "properties": {
          "skype": {
            "description": "Skype account",
            "type": "string"
          }
        }
      }
    }
}

Contact channel
GET/#/definitions/contact_channel

Contact channel schema.

Attributes

Field Type Description
skype String Skype account

Accounts

Describe an accounting account as one would find in a Chart of Accounts.

Accounts JSON schema

GET https://api-connec.maestrano.com/api/v2/json_schema/accounts
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "accounts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Account UUID",
            "type": "string",
            "readOnly": true
          },
          "group_id": {
            "description": "Group ID",
            "type": "string"
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Unique code, auto-generated if not specified",
            "type": "string"
          },
          "status": {
            "description": "Account status",
            "enum": [
              "ACTIVE",
              "INACTIVE"
            ],
            "default": "ACTIVE"
          },
          "name": {
            "description": "Account name",
            "type": "string"
          },
          "reference": {
            "description": "Account reference",
            "type": "string"
          },
          "description": {
            "description": "Account description",
            "type": "string"
          },
          "currency": {
            "description": "Account currency",
            "default": "USD",
            "type": "string"
          },
          "classification": {
            "description": "Concatenated value of the classification, type and sub type of the account",
            "type": "string"
          },
          "class": {
            "description": "Account classification. The classification is inferred by the account type if omitted on account creation",
            "enum": [
              "ASSET",
              "EQUITY",
              "EXPENSE",
              "LIABILITY",
              "REVENUE"
            ]
          },
          "type": {
            "description": "Account type",
            "enum": [
              "BANK",
              "OTHERCURRENTASSET",
              "FIXEDASSET",
              "OTHERASSET",
              "ACCOUNTSRECEIVABLE",
              "EQUITY",
              "EXPENSE",
              "OTHEREXPENSE",
              "COSTOFGOODSSOLD",
              "ACCOUNTSPAYABLE",
              "CREDITCARD",
              "LONGTERMLIABILITY",
              "OTHERCURRENTLIABILITY",
              "INCOME",
              "OTHERINCOME"
            ]
          },
          "sub_type": {
            "description": "Account sub type",
            "type": "string"
          },
          "bank_account": {
            "$ref": "#/definitions/bank_account"
          },
          "opening_balance": {
            "type": "number",
            "description": "Account opening balance"
          },
          "current_balance": {
            "type": "number",
            "description": "Account current balance"
          },
          "current_balance_with_sub_accounts": {
            "type": "number",
            "description": "Account current balance (including sub accounts balances)"
          },
          "parent_account_id": {
            "type": "string",
            "descritpion": "Id of the parent account"
          },
          "address": {
            "$ref": "#/definitions/address"
          }
        },
        "required": [
          "name",
          "type"
        ]
      }
    }
  },
  "definitions": {
    "contact_channel": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "contact_channel": {
          "type": "object",
          "properties": {
            "skype": {
              "description": "Skype account",
              "type": "string"
            }
          }
        }
      }
    },
    "email": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "address": {
              "description": "Primary email address",
              "type": "string"
            },
            "address2": {
              "description": "Secondary email address",
              "type": "string"
            }
          }
        }
      }
    },
    "address": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "website": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "url": {
              "description": "Primary website url",
              "type": "string"
            },
            "url2": {
              "description": "Secondary website url",
              "type": "string"
            }
          }
        }
      }
    },
    "phone": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "bank_account": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "bank_account": {
          "type": "object",
          "properties": {
            "bic_code": {
              "type": "string"
            },
            "account_number": {
              "type": "string"
            },
            "bsb_number": {
              "type": "string"
            }
          }
        }
      }
    },
    "price": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "price": {
          "type": "object",
          "properties": {
            "total_amount": {
              "description": "Total amount including taxes",
              "type": "number"
            },
            "net_amount": {
              "description": "Net amount excluding taxes",
              "type": "number"
            },
            "tax_amount": {
              "description": "Total tax amount",
              "type": "number"
            },
            "tax_rate": {
              "description": "Applicable tax rate",
              "type": "number"
            },
            "currency": {
              "description": "Price currency (defaults to Company currency)",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

Get schema
GET/api/v2/json_schema/accounts

Attributes

Field Type Description
id String Account UUID
group_id String Group ID
created_at Date Time Object creation timestamp
updated_at Date Time Object last update timestamp
code String Unique code, auto-generated if not specified
status Account status
name String Account name
reference String Account reference
description String Account description
currency String Account currency
classification String Concatenated value of the classification, type and sub type of the account
class Account classification. The classification is inferred by the account type if omitted on account creation
type Account type
sub_type String Account sub type
bank_account Bank Account
opening_balance Number Account opening balance
current_balance Number Account current balance
current_balance_with_sub_accounts Number Account current balance (including sub accounts balances)
parent_account_id String
address Address

Accounts List

GET https://api-connec.maestrano.com/api/v2/:group_id/accounts
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "accounts": [
    {
      "id": "8b378a81-5a96-0132-3097-600308937d74",
      "group_id": "cld-f45g7f5",
      "created_at": "2014-11-30T08:12:26Z",
      "updated_at": "2014-11-30T08:12:26Z",
      "code": "ACCRCV",
      "status": "ACTIVE",
      "name": "Accounts Receivable",
      "reference": "20001",
      "description": "Accounts Receivable",
      "currency": "USD",
      "classification": "ASSET",
      "type": "ACCOUNTSRECEIVABLE",
      "sub_type": "ACCOUNTSRECEIVABLE",
      "bank_account": {
        "bic_code": "12345-12310",
        "account_number": "78945 4410",
        "bsb_number": "123-123"
      },
      "opening_balance": 0,
      "tax_code_id": "5fasdd8a1-6t86-2162-3098-600308937e98",
      "parent_account_id": "8b37d8a1-5a96-0132-3098-600308937d74",
      "address": {
        "billing": {
          "line1": "62 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2062",
          "country": "AU"
        },
        "billing2": {
          "line1": "63 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2063",
          "country": "AU"
        },
        "shipping": {
          "line1": "64 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2064",
          "country": "AU"
        },
        "shipping2": {
          "line1": "65 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2065",
          "country": "AU"
        }
      }
    }
  ]
}

Get Accounts
GET/api/v2/:group_id/accounts

Get the list of accounts.

Attributes

Field Type Description
id String Account UUID
group_id String Group ID
created_at Date-time Account creation date
updated_at Date-time Account last update date
code String Code, auto-generated if not specified
status Enum [ACTIVE, INACTIVE] - Default: ACTIVE
name String Account name
reference String Account reference
description String Short description of the account
currency String Account currency code. The company currency is used if not provided
classification Enum Account classification. Inferred by the account type if omitted on creation
type Enum Account type. Refer to the Accounts classification section
sub_type Enum Account sub type. Refer to the Accounts classification section
opening_balance Number Account opening balance
tax_code_id Reference Id of the tax code associated with the account
parent_account_id Reference Id of the parent account
address Address group Account addresses
bank_account Bank account Account payment details

POST https://api-connec.maestrano.com/api/v2/:group_id/accounts
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
    "accounts": {
        "name": "Accounts Receivable",
        "code": "ACCRCV",
        "description": "Accounts Receivable",
        "status": "ACTIVE",
        "currency": "USD",
        "classification": "ASSET",
        "type": "ACCOUNTSRECEIVABLE",
        "sub_type": "ACCOUNTSRECEIVABLE",
    }
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
    "accounts": {
        "id": "e32303c1-5102-0132-661e-600308937d74",
        "group_id": "cld-4d7f86",
        "created_at": "2014-12-18T03:42:45Z",
        "updated_at": "2014-12-18T03:42:45Z",
        "name": "Accounts Receivable",
        "code": "ACCRCV",
        "description": "Accounts Receivable",
        "status": "ACTIVE",
        "currency": "USD",
        "classification": "ASSET",
        "type": "ACCOUNTSRECEIVABLE",
        "sub_type": "ACCOUNTSRECEIVABLE",
    }
}

Create New Account
POST/api/v2/:group_id/accounts

Create a new account.


Account

GET https://api-connec.maestrano.com/api/v2/:group_id/accounts/e32303c1-5102-0132-661e-600308937d74
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "accounts": {
    "id": "8b378a81-5a96-0132-3097-600308937d74",
    "group_id": "cld-f45g7f5",
    "created_at": "2014-11-30T08:12:26Z",
    "updated_at": "2014-11-30T08:12:26Z",
    "name": "Accounts Receivable",
    "code": "ACCRCV",
    "description": "Accounts Receivable",
    "status": "ACTIVE",
    "currency": "USD",
    "classification": "ASSET",
    "type": "ACCOUNTSRECEIVABLE",
    "sub_type": "ACCOUNTSRECEIVABLE",
    "bank_account": {
      "bic_code": "12345-12310",
      "account_number": "78945 4410",
      "bsb_number": "123-123"
    },
    "parent_account_id": "8b37d8a1-5a96-0132-3098-600308937d74",
    "address": {
      "billing": {
        "line1": "62 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2062",
        "country": "AU"
      },
      "billing2": {
        "line1": "63 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2063",
        "country": "AU"
      },
      "shipping": {
        "line1": "64 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2064",
        "country": "AU"
      },
      "shipping2": {
        "line1": "65 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2065",
        "country": "AU"
      }
    }
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Get Account
GET/api/v2/:group_id/accounts/{id}

Get a single account.

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The account ID


PUT https://api-connec.maestrano.com/api/v2/:group_id/accounts/e32303c1-5102-0132-661e-600308937d74
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "accounts": {
    "name": "Accounts Receivable",
    "code": "ACCRCV",
    "description": "Accounts Receivable"
  }
}
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "accounts": {
    "id": "8b378a81-5a96-0132-3097-600308937d74",
    "group_id": "cld-f45g7f5",
    "created_at": "2014-11-30T08:12:26Z",
    "updated_at": "2014-11-30T08:12:26Z",
    "name": "Accounts Receivable",
    "code": "ACCRCV",
    "description": "Accounts Receivable",
    "status": "ACTIVE",
    "currency": "USD",
    "classification": "ASSET",
    "type": "ACCOUNTSRECEIVABLE",
    "sub_type": "ACCOUNTSRECEIVABLE",
    "bank_account": {
      "bic_code": "12345-12310",
      "account_number": "78945 4410",
      "bsb_number": "123-123"
    },
    "parent_account_id": "8b37d8a1-5a96-0132-3098-600308937d74",
    "address": {
      "billing": {
        "line1": "62 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2062",
        "country": "AU"
      },
      "billing2": {
        "line1": "63 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2063",
        "country": "AU"
      },
      "shipping": {
        "line1": "64 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2064",
        "country": "AU"
      },
      "shipping2": {
        "line1": "65 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2065",
        "country": "AU"
      }
    }
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Update an Account
PUT/api/v2/:group_id/accounts/{id}

Update a single Account

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The account ID


AppUsers

Business Rules

  • Represents the users in the applications linked to a company

  • An Employee is not necessarily an AppUser. Example: a company that has a CRM application and an accounting package can have its accountants and its sales representatives as Employees AND AppUsers, but maybe its delivery men won’t be using any of these applications and therefore won’t be AppUsers

  • An AppUser can belong to several Teams, a Team can have several AppUsers

AppUsers List

GET https://api-connec.maestrano.com/app_users
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "app_users": [
    {
      "id": "76991ec1-ff01-0133-bfdc-5fbf8265841f",
      "code": "US4",
      "mno_user_id": "beadae47-0af6-4a3f-b7c8-b54401c717ba",
      "first_name": "User",
      "last_name": "Test",
      "role": "CEO",
      "is_admin": true,
      "email": {
        "address": "john17@maestrano.com",
        "address2": "jack17@example.com"
      },
      "address_work": {
        "billing": {
          "line1": "86 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2086",
          "country": "Australia"
        },
        "billing2": {
          "line1": "87 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2087",
          "country": "Australia"
        },
        "shipping": {
          "line1": "88 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2088",
          "country": "Australia"
        },
        "shipping2": {
          "line1": "89 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2089",
          "country": "Australia"
        }
      },
      "address_home": {
        "billing": {
          "line1": "90 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2090",
          "country": "Australia"
        },
        "billing2": {
          "line1": "91 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2091",
          "country": "Australia"
        },
        "shipping": {
          "line1": "92 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2092",
          "country": "Australia"
        },
        "shipping2": {
          "line1": "93 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2093",
          "country": "Australia"
        }
      },
      "phone_work": {
        "landline": "+61 2 8574 1222",
        "landline2": "+1 2 8574 1222",
        "mobile": "+61 449 785 122",
        "mobile2": "+1 449 785 122",
        "fax": "+61 2 9974 1222",
        "fax2": "+1 2 9974 1222",
        "pager": "+61 440 785 122",
        "pager2": "+1 440 785 122"
      },
      "phone_home": {
        "landline": "+61 2 8574 1223",
        "landline2": "+1 2 8574 1223",
        "mobile": "+61 449 785 123",
        "mobile2": "+1 449 785 123",
        "fax": "+61 2 9974 1223",
        "fax2": "+1 2 9974 1223",
        "pager": "+61 440 785 123",
        "pager2": "+1 440 785 123"
      },
      "teams": [
        {
          "id": "f811a2ca-ec61-4d2a-a987-9128a990f59b",
          "code": "TEA-1"
        }
      ],
      "group_id": "org-fbba",
      "channel_id": "org-fbba",
      "resource_type": "app_users"
    }
  ],
  "pagination": {
    "skip": 0,
    "top": 100,
    "total": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "app_users": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "mno_user_id": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "is_admin": {
            "type": "boolean"
          },
          "email": {
            "type": "object",
            "properties": {
              "address": {
                "type": "string"
              },
              "address2": {
                "type": "string"
              }
            }
          },
          "address_work": {
            "type": "object",
            "properties": {
              "billing": {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string"
                  },
                  "line2": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string"
                  },
                  "postal_code": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                }
              },
              "billing2": {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string"
                  },
                  "line2": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string"
                  },
                  "postal_code": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                }
              },
              "shipping": {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string"
                  },
                  "line2": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string"
                  },
                  "postal_code": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                }
              },
              "shipping2": {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string"
                  },
                  "line2": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string"
                  },
                  "postal_code": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "address_home": {
            "type": "object",
            "properties": {
              "billing": {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string"
                  },
                  "line2": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string"
                  },
                  "postal_code": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                }
              },
              "billing2": {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string"
                  },
                  "line2": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string"
                  },
                  "postal_code": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                }
              },
              "shipping": {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string"
                  },
                  "line2": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string"
                  },
                  "postal_code": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                }
              },
              "shipping2": {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string"
                  },
                  "line2": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string"
                  },
                  "postal_code": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "phone_work": {
            "type": "object",
            "properties": {
              "landline": {
                "type": "string"
              },
              "landline2": {
                "type": "string"
              },
              "mobile": {
                "type": "string"
              },
              "mobile2": {
                "type": "string"
              },
              "fax": {
                "type": "string"
              },
              "fax2": {
                "type": "string"
              },
              "pager": {
                "type": "string"
              },
              "pager2": {
                "type": "string"
              }
            }
          },
          "phone_home": {
            "type": "object",
            "properties": {
              "landline": {
                "type": "string"
              },
              "landline2": {
                "type": "string"
              },
              "mobile": {
                "type": "string"
              },
              "mobile2": {
                "type": "string"
              },
              "fax": {
                "type": "string"
              },
              "fax2": {
                "type": "string"
              },
              "pager": {
                "type": "string"
              },
              "pager2": {
                "type": "string"
              }
            }
          },
          "teams": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                }
              }
            }
          },
          "group_id": {
            "type": "string"
          },
          "channel_id": {
            "type": "string"
          },
          "resource_type": {
            "type": "string"
          }
        }
      }
    },
    "pagination": {
      "type": "object",
      "properties": {
        "skip": {
          "type": "integer"
        },
        "top": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        }
      }
    }
  }
}

Get AppUsers
GET/app_users

List the users of your applications.

Attributes

Field Type Description
id String AppUser UUID
code String Code, auto-generated if not specified
mno_user_id Reference Id of the corresponding User in Maestrano. Should be set to the Single Sign-On user_id
first_name String User’s first name
last_name String User’s last name
role String Optional user role (as defined in the application)
is_admin Boolean Flags users that are admins in the application
email Email group User’s email
address_work Address group User’s work address
address_home Address group User’s home address
phone_work Phone group User’s work telephone number
phone_home Phone group User’s home telephone number
[teams] Array Teams the user is a member of

POST https://api-connec.maestrano.com/app_users
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "app_users": {
    "mno_user_id": "beadae47-0af6-4a3f-b7c8-b54401c717ba",
    "first_name": "User",
    "last_name": "Test",
    "role": "CEO",
    "is_admin": true,
    "email": {
      "address": "john17@maestrano.com",
      "address2": "jack17@example.com"
    },
    "address_work": {
      "billing": {
        "line1": "86 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2086",
        "country": "Australia"
      },
      "billing2": {
        "line1": "87 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2087",
        "country": "Australia"
      },
      "shipping": {
        "line1": "88 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2088",
        "country": "Australia"
      },
      "shipping2": {
        "line1": "89 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2089",
        "country": "Australia"
      }
    },
    "address_home": {
      "billing": {
        "line1": "90 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2090",
        "country": "Australia"
      },
      "billing2": {
        "line1": "91 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2091",
        "country": "Australia"
      },
      "shipping": {
        "line1": "92 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2092",
        "country": "Australia"
      },
      "shipping2": {
        "line1": "93 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2093",
        "country": "Australia"
      }
    },
    "phone_work": {
      "landline": "+61 2 8574 1222",
      "landline2": "+1 2 8574 1222",
      "mobile": "+61 449 785 122",
      "mobile2": "+1 449 785 122",
      "fax": "+61 2 9974 1222",
      "fax2": "+1 2 9974 1222",
      "pager": "+61 440 785 122",
      "pager2": "+1 440 785 122"
    },
    "phone_home": {
      "landline": "+61 2 8574 1223",
      "landline2": "+1 2 8574 1223",
      "mobile": "+61 449 785 123",
      "mobile2": "+1 449 785 123",
      "fax": "+61 2 9974 1223",
      "fax2": "+1 2 9974 1223",
      "pager": "+61 440 785 123",
      "pager2": "+1 440 785 123"
    },
    "teams": [
      {
        "id": "f811a2ca-ec61-4d2a-a987-9128a990f59b",
        "code": "TEA-1"
      }
    ]
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
  "app_users": {
    "id": "76991ec1-ff01-0133-bfdc-5fbf8265841f",
    "code": "US4",
    "mno_user_id": "beadae47-0af6-4a3f-b7c8-b54401c717ba",
    "first_name": "User",
    "last_name": "Test",
    "role": "CEO",
    "is_admin": true,
    "email": {
      "address": "john17@maestrano.com",
      "address2": "jack17@example.com"
    },
    "address_work": {
      "billing": {
        "line1": "86 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2086",
        "country": "Australia"
      },
      "billing2": {
        "line1": "87 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2087",
        "country": "Australia"
      },
      "shipping": {
        "line1": "88 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2088",
        "country": "Australia"
      },
      "shipping2": {
        "line1": "89 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2089",
        "country": "Australia"
      }
    },
    "address_home": {
      "billing": {
        "line1": "90 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2090",
        "country": "Australia"
      },
      "billing2": {
        "line1": "91 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2091",
        "country": "Australia"
      },
      "shipping": {
        "line1": "92 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2092",
        "country": "Australia"
      },
      "shipping2": {
        "line1": "93 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2093",
        "country": "Australia"
      }
    },
    "phone_work": {
      "landline": "+61 2 8574 1222",
      "landline2": "+1 2 8574 1222",
      "mobile": "+61 449 785 122",
      "mobile2": "+1 449 785 122",
      "fax": "+61 2 9974 1222",
      "fax2": "+1 2 9974 1222",
      "pager": "+61 440 785 122",
      "pager2": "+1 440 785 122"
    },
    "phone_home": {
      "landline": "+61 2 8574 1223",
      "landline2": "+1 2 8574 1223",
      "mobile": "+61 449 785 123",
      "mobile2": "+1 449 785 123",
      "fax": "+61 2 9974 1223",
      "fax2": "+1 2 9974 1223",
      "pager": "+61 440 785 123",
      "pager2": "+1 440 785 123"
    },
    "teams": [
      {
        "id": "f811a2ca-ec61-4d2a-a987-9128a990f59b",
        "code": "TEA-1"
      }
    ],
    "group_id": "org-fbba",
    "channel_id": "org-fbba",
    "resource_type": "app_users"
  }
}

Create New AppUser
POST/app_users

Create a new AppUser.


AppUser

GET https://api-connec.maestrano.com/app_users/76991ec1-ff01-0133-bfdc-5fbf8265841f
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "app_users": {
    "id": "76991ec1-ff01-0133-bfdc-5fbf8265841f",
    "code": "US4",
    "mno_user_id": "beadae47-0af6-4a3f-b7c8-b54401c717ba",
    "first_name": "User",
    "last_name": "Test",
    "role": "CEO",
    "is_admin": true,
    "email": {
      "address": "john17@maestrano.com",
      "address2": "jack17@example.com"
    },
    "address_work": {
      "billing": {
        "line1": "86 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2086",
        "country": "Australia"
      },
      "billing2": {
        "line1": "87 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2087",
        "country": "Australia"
      },
      "shipping": {
        "line1": "88 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2088",
        "country": "Australia"
      },
      "shipping2": {
        "line1": "89 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2089",
        "country": "Australia"
      }
    },
    "address_home": {
      "billing": {
        "line1": "90 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2090",
        "country": "Australia"
      },
      "billing2": {
        "line1": "91 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2091",
        "country": "Australia"
      },
      "shipping": {
        "line1": "92 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2092",
        "country": "Australia"
      },
      "shipping2": {
        "line1": "93 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2093",
        "country": "Australia"
      }
    },
    "phone_work": {
      "landline": "+61 2 8574 1222",
      "landline2": "+1 2 8574 1222",
      "mobile": "+61 449 785 122",
      "mobile2": "+1 449 785 122",
      "fax": "+61 2 9974 1222",
      "fax2": "+1 2 9974 1222",
      "pager": "+61 440 785 122",
      "pager2": "+1 440 785 122"
    },
    "phone_home": {
      "landline": "+61 2 8574 1223",
      "landline2": "+1 2 8574 1223",
      "mobile": "+61 449 785 123",
      "mobile2": "+1 449 785 123",
      "fax": "+61 2 9974 1223",
      "fax2": "+1 2 9974 1223",
      "pager": "+61 440 785 123",
      "pager2": "+1 440 785 123"
    },
    "teams": [
      {
        "id": "f811a2ca-ec61-4d2a-a987-9128a990f59b",
        "code": "TEA-1"
      }
    ],
    "group_id": "org-fbba",
    "channel_id": "org-fbba",
    "resource_type": "app_users"
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "76991ec1-ff01-0133-bfdc-5fbf8265841f",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Get AppUser
GET/app_users/{id}

Get a single app user.

URI Parameters
HideShow
id
string (required) Example: 76991ec1-ff01-0133-bfdc-5fbf8265841f

The app user ID


PUT https://api-connec.maestrano.com/app_users/76991ec1-ff01-0133-bfdc-5fbf8265841f
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "app_users": {
    "first_name": "User2",
    "last_name": "Test2"
  }
}
Responses200404
Body
{
  "app_users": {
    "id": "76991ec1-ff01-0133-bfdc-5fbf8265841f",
    "code": "US4",
    "mno_user_id": "beadae47-0af6-4a3f-b7c8-b54401c717ba",
    "first_name": "User2",
    "last_name": "Test2",
    "role": "CEO",
    "is_admin": true,
    "email": {
      "address": "john17@maestrano.com",
      "address2": "jack17@example.com"
    },
    "address_work": {
      "billing": {
        "line1": "86 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2086",
        "country": "Australia"
      },
      "billing2": {
        "line1": "87 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2087",
        "country": "Australia"
      },
      "shipping": {
        "line1": "88 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2088",
        "country": "Australia"
      },
      "shipping2": {
        "line1": "89 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2089",
        "country": "Australia"
      }
    },
    "address_home": {
      "billing": {
        "line1": "90 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2090",
        "country": "Australia"
      },
      "billing2": {
        "line1": "91 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2091",
        "country": "Australia"
      },
      "shipping": {
        "line1": "92 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2092",
        "country": "Australia"
      },
      "shipping2": {
        "line1": "93 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2093",
        "country": "Australia"
      }
    },
    "phone_work": {
      "landline": "+61 2 8574 1222",
      "landline2": "+1 2 8574 1222",
      "mobile": "+61 449 785 122",
      "mobile2": "+1 449 785 122",
      "fax": "+61 2 9974 1222",
      "fax2": "+1 2 9974 1222",
      "pager": "+61 440 785 122",
      "pager2": "+1 440 785 122"
    },
    "phone_home": {
      "landline": "+61 2 8574 1223",
      "landline2": "+1 2 8574 1223",
      "mobile": "+61 449 785 123",
      "mobile2": "+1 449 785 123",
      "fax": "+61 2 9974 1223",
      "fax2": "+1 2 9974 1223",
      "pager": "+61 440 785 123",
      "pager2": "+1 440 785 123"
    },
    "teams": [
      {
        "id": "f811a2ca-ec61-4d2a-a987-9128a990f59b",
        "code": "TEA-1"
      }
    ],
    "group_id": "org-fbba",
    "channel_id": "org-fbba",
    "resource_type": "app_users"
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "76991ec1-ff01-0133-bfdc-5fbf8265841f",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Update an AppUser
PUT/app_users/{id}

Update a single AppUser.

URI Parameters
HideShow
id
string (required) Example: 76991ec1-ff01-0133-bfdc-5fbf8265841f

The app user ID


Bank Transactions

Business Rules

A Bank Transaction represents a transaction made to receive or spend money directly to/from a Bank account. As per any other transaction type, a Bank Transaction will be related to an account and a contact (Person / Organization), and will have some Journals attached.

Bank Transactions JSON schema

GET https://api-connec.maestrano.com/api/v2/json_schema/bank_transactions
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "bank_transactions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Bank transaction UUID",
            "type": "string",
            "readOnly": true
          },
          "group_id": {
            "description": "Group ID",
            "type": "string"
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Unique code, auto-generated if not specified",
            "type": "string"
          },
          "title": {
            "description": "Bank transaction friendly name",
            "type": "string"
          },
          "transaction_date": {
            "description": "Bank transaction creation date, defaults to today if not specified",
            "type": "date-time"
          },
          "status": {
            "description": "Bank transaction status",
            "enum": [
              "AUTHORISED",
              "INACTIVE"
            ],
            "default": "AUTHORISED"
          },
          "type": {
            "description": "Bank transaction type indicates if it is a RECEIVE or SPEND transaction",
            "enum": [
              "RECEIVE",
              "SPEND"
            ],
            "default": "RECEIVE"
          },
          "organization_id": {
            "description": "Reference of the Organization that originated the transaction",
            "type": "string"
          },
          "person_id": {
            "description": "Reference of the Person that originated the transaction",
            "type": "string"
          },
          "tax_code_id": {
            "description": "Reference of the applicable Tax Code",
            "type": "string"
          },
          "account_id": {
            "description": "Reference of the Account used for the Bank transaction",
            "type": "string"
          },
          "tax_calculation": {
            "description": "Tax calculation method for display purpose",
            "enum": [
              "TAX_EXCLUDED",
              "TAX_INCLUSIVE",
              "NOT_APPLICABLE"
            ]
          },
          "public_note": {
            "description": "Note visible to the customer on the Bank transaction",
            "type": "string"
          },
          "private_note": {
            "description": "Internal note not visible to the customer",
            "type": "string"
          },
          "amount": {
            "$ref": "#/definitions/price",
            "readOnly": true
          },
          "lines": {
            "type": "array",
            "items": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "description": "Transaction line ID",
                    "type": "string"
                  },
                  "line_number": {
                    "description": "Transaction line number used for ordering",
                    "type": "integer"
                  },
                  "description": {
                    "description": "Transaction line description",
                    "type": "string"
                  },
                  "status": {
                    "description": "Transaction line status",
                    "enum": [
                      "ACTIVE",
                      "INACTIVE"
                    ],
                    "default": "ACTIVE"
                  },
                  "quantity": {
                    "description": "Quantity of Items",
                    "type": "number"
                  },
                  "reduction_percent": {
                    "description": "Reduction percentage applicable",
                    "type": "number"
                  },
                  "unit_price": {
                    "$ref": "#/definitions/price"
                  },
                  "total_price": {
                    "$ref": "#/definitions/price",
                    "readOnly": true
                  },
                  "service_date": {
                    "description": "Delivery date of the item/service",
                    "type": "string",
                    "format": "date-time"
                  },
                  "tax_code_id": {
                    "description": "Reference to the Tax Code applicable on the transaction line",
                    "type": "string"
                  },
                  "item_id": {
                    "description": "Reference to the Item of the transaction line",
                    "type": "string"
                  },
                  "account_id": {
                    "description": "Reference to the Account of the transaction line",
                    "type": "string"
                  },
                  "organization_id": {
                    "description": "Reference of the Customer or Supplier applicable to the transaction line",
                    "type": "string"
                  },
                  "payment_method_id": {
                    "description": "Reference to the Payment Method of the transaction line",
                    "type": "string"
                  },
                  "linked_transactions": {
                    "type": "array",
                    "items": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "description": "LinkedTransaction line ID",
                            "type": "string"
                          },
                          "applied_amount": {
                            "description": "Amount applied on the linked transaction",
                            "type": "number"
                          },
                          "transactionable_id": {
                            "description": "Reference to the Transaction UUID",
                            "type": "string"
                          },
                          "transactionable_type": {
                            "description": "Reference to the Transaction type (Bank transaction, Payment, CreditNote, etc...)",
                            "type": "string"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        }
      }
    }
  },
  "definitions": {
    "contact_channel": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "contact_channel": {
          "type": "object",
          "properties": {
            "skype": {
              "description": "Skype account",
              "type": "string"
            }
          }
        }
      }
    },
    "email": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "address": {
              "description": "Primary email address",
              "type": "string"
            },
            "address2": {
              "description": "Secondary email address",
              "type": "string"
            }
          }
        }
      }
    },
    "address": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "website": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "url": {
              "description": "Primary website url",
              "type": "string"
            },
            "url2": {
              "description": "Secondary website url",
              "type": "string"
            }
          }
        }
      }
    },
    "phone": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "price": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "price": {
          "type": "object",
          "properties": {
            "total_amount": {
              "description": "Total amount including taxes",
              "type": "number"
            },
            "net_amount": {
              "description": "Net amount excluding taxes",
              "type": "number"
            },
            "tax_amount": {
              "description": "Total tax amount",
              "type": "number"
            },
            "tax_rate": {
              "description": "Applicable tax rate",
              "type": "number"
            },
            "currency": {
              "description": "Price currency (defaults to Company currency)",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

Get schema
GET/api/v2/json_schema/bank_transactions

Attributes

Field Type Description
id String Bank transaction UUID
group_id String Group ID
created_at Date Time Object creation timestamp
updated_at Date Time Object last update timestamp
code String Unique code, auto-generated if not specified
title String Bank transaction friendly name
transaction_date Date Time Bank transaction creation date, defaults to today if not specified
status Bank transaction status
type Bank transaction type indicates if it is a RECEIVE or SPEND transaction
organization_id String Reference of the Organization that originated the transaction
person_id String Reference of the Person that originated the transaction
tax_code_id String Reference of the applicable Tax Code
account_id String Reference of the Account used for the Bank transaction
tax_calculation Tax calculation method for display purpose
public_note String Note visible to the customer on the Bank transaction
private_note String Internal note not visible to the customer
amount Price
lines Array
BankTransactions Lines attributes
Field Type Description
id String Transaction line ID
line_number Integer Transaction line number used for ordering
description String Transaction line description
status Transaction line status
quantity Number Quantity of Items
reduction_percent Number Reduction percentage applicable
unit_price Price
total_price Price
service_date Date Time Delivery date of the item/service
tax_code_id String Reference to the Tax Code applicable on the transaction line
item_id String Reference to the Item of the transaction line
account_id String Reference to the Account of the transaction line
organization_id String Reference of the Customer or Supplier applicable to the transaction line
payment_method_id String Reference to the Payment Method of the transaction line
linked_transactions Array
BankTransactions LinkedTransactions attributes
Field Type Description
id String LinkedTransaction line ID
applied_amount Number Amount applied on the linked transaction
transactionable_id String Reference to the Transaction UUID
transactionable_type String Reference to the Transaction type (Bank transaction, Payment, CreditNote, etc…)

Bank Transactions List

GET https://api-connec.maestrano.com/api/v2/:group_id/bank_transactions
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
    "bank_transactions": [
        {
            "id"=>"6d0d64ad-3297-4e34-bee8-eb90dac34ae2",
            "account_id"=>"qwertyui-3297-4e34-bee8-eb90dac34ae2",
            "code"=>"BT001",
            "title"=>"Bank transaction",
            "transaction_date"=>"2015-01-12T00:00:00Z",
            "status"=>"AUTHORISED",
            "type"=>"RECEIVE",
            "amount"=>{
                "total_amount"=>26.0,
                "net_amount"=>26.0,
                "tax_amount"=>0.0,
                "tax_rate"=>0.0,
                "currency"=>"USD"
            },
            "currency_rate"=>1.0,
            "organization_id"=>"4d0078b2-e724-4abb-a8a7-d6bf65c122be",
            "person_id"=>"b3d0c280-5a96-0132-30cd-600308937d74",
            "is_reconciled"=>true,
            "lines"=>[
                {
                    "id"=>"line01",
                    "line_number"=>1,
                    "status"=>"ACTIVE",
                    "quantity"=>1.0,
                    "unit_price"=>{
                      "total_amount"=>10.0,
                      "net_amount"=>10.0,
                      "tax_amount"=>0.0,
                      "tax_rate"=>0.0,
                      "currency"=>"USD"
                    },
                    "total_price"=>{
                      "total_amount"=>10.0,
                      "net_amount"=>10.0,
                      "tax_amount"=>0.0,
                      "tax_rate"=>0.0,
                      "currency"=>"USD"
                    },
                    "tax_code_id"=>"b3d88ac1-5a96-0132-30d1-600308937d74",
                    "item_id"=>"b3d52f61-5a96-0132-30ce-600308937d74"
                },
                {
                    "id"=>"line02",
                    "line_number"=>2,
                    "status"=>"ACTIVE",
                    "quantity"=>2.0,
                    "unit_price"=>{
                        "total_amount"=>8.0,
                        "net_amount"=>8.0,
                        "tax_amount"=>0.0,
                        "tax_rate"=>0.0,
                        "currency"=>"USD"
                    },
                    "total_price"=>{
                        "total_amount"=>16.0,
                        "net_amount"=>16.0,
                        "tax_amount"=>0.0,
                        "tax_rate"=>0.0,
                        "currency"=>"USD"
                    },
                    "tax_code_id"=>"b3d88ac1-5a96-0132-30d1-600308937d74",
                    "item_id"=>"b3d6dd11-5a96-0132-30cf-600308937d74"
                }
            ],
            "created_at": "2014-11-30T08:13:34Z",
            "updated_at": "2014-11-30T08:13:34Z"
        }
    ]
}

Get Bank Transactions
GET/api/v2/:group_id/bank_transactions

Get the list of Bank Transactions.


POST https://api-connec.maestrano.com/api/v2/:group_id/bank_transactions
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
    "bank_transactions": {
        "transaction_date" => "2014-01-14T13:00:00Z",
        "status" => 'INACTIVE',
        'type' => 'RECEIVE-TRANSFER',
        'organization_id' => "4d0078b2-e724-4abb-a8a7-d6bf65c122be",
        'account_id' => "qwertyui-3297-4e34-bee8-eb90dac34ae2",
        'currency_rate' => 0.647,
        'is_reconciled' => false,
        'lines' => [
            {
                "line_number" => 1,
                "quantity" => 10.0,
                "unit_price"=>{
                    "net_amount"=>36.0,
                    "tax_rate"=>10.0,
                    "currency"=>"USD"
                },
                "item_id" => "b3d52f61-5a96-0132-30ce-600308937d74"
            },
            {
                "line_number" => 2,
                "quantity" => 1.0,
                "unit_price"=>{
                    "net_amount"=>27.0,
                    "tax_rate"=>10.0,
                    "currency"=>"USD"
                },
                "item_id" => "b3d6dd11-5a96-0132-30cf-600308937d74"
              }
        ]
    }
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
    "bank_transactions": {
        "id"=>"6d0d64ad-3297-4e34-bee8-eb90dac34ae2",
        "account_id"=>"qwertyui-3297-4e34-bee8-eb90dac34ae2",
        "code"=>"BT001",
        "title"=>"Bank transaction",
        "transaction_date"=>"2015-01-12T00:00:00Z",
        "status"=>"AUTHORISED",
        "type"=>"RECEIVE",
        "amount"=>{
            "total_amount"=>425.7,
            "net_amount"=>387.0,
            "tax_amount"=>38.7,
            "tax_rate"=>10.0,
            "currency"=>"USD"
        },
        "currency_rate"=>1.0,
        "organization_id"=>"4d0078b2-e724-4abb-a8a7-d6bf65c122be",
        "person_id"=>"b3d0c280-5a96-0132-30cd-600308937d74",
        "is_reconciled"=>true,
        "lines"=>[
            {
                "id"=>"line01",
                "line_number"=>1,
                "status"=>"ACTIVE",
                "quantity"=>10.0,
                "unit_price"=>{
                  "total_amount"=>39.6,
                  "net_amount"=>36.0,
                  "tax_amount"=>3.6,
                  "tax_rate"=>10.0,
                  "currency"=>"USD"
                },
                "total_price"=>{
                  "total_amount"=>396.0,
                  "net_amount"=>360.0,
                  "tax_amount"=>36.0,
                  "tax_rate"=>10.0,
                  "currency"=>"USD"
                },
                "tax_code_id"=>"b3d88ac1-5a96-0132-30d1-600308937d74",
                "item_id"=>"b3d52f61-5a96-0132-30ce-600308937d74"
            },
            {
                "id"=>"line02",
                "line_number"=>2,
                "status"=>"ACTIVE",
                "quantity"=>1.0,
                "unit_price"=>{
                    "total_amount"=>29.7,
                    "net_amount"=>27.0,
                    "tax_amount"=>2.7,
                    "tax_rate"=>10.0,
                    "currency"=>"USD"
                },
                "total_price"=>{
                    "total_amount"=>29.7,
                    "net_amount"=>27.0,
                    "tax_amount"=>2.7,
                    "tax_rate"=>10.0,
                    "currency"=>"USD"
                },
                "tax_code_id"=>"b3d88ac1-5a96-0132-30d1-600308937d74",
                "item_id"=>"b3d6dd11-5a96-0132-30cf-600308937d74"
            }
        ],
        "created_at": "2014-11-30T08:13:34Z",
        "updated_at": "2014-11-30T08:13:34Z"
    }
}

Create New Bank Transaction
POST/api/v2/:group_id/bank_transactions

Create a new Bank Transaction.


Bank Transaction

GET https://api-connec.maestrano.com/api/v2/:group_id/bank_transactions/e32303c1-5102-0132-661e-600308937d74
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
    "bank_transactions": {
        "id"=>"6d0d64ad-3297-4e34-bee8-eb90dac34ae2",
        "account_id"=>"qwertyui-3297-4e34-bee8-eb90dac34ae2",
        "code"=>"BT001",
        "title"=>"Bank transaction",
        "transaction_date"=>"2015-01-12T00:00:00Z",
        "status"=>"AUTHORISED",
        "type"=>"RECEIVE",
        "amount"=>{
            "total_amount"=>26.0,
            "net_amount"=>26.0,
            "tax_amount"=>0.0,
            "tax_rate"=>0.0,
            "currency"=>"USD"
        },
        "currency_rate"=>1.0,
        "organization_id"=>"4d0078b2-e724-4abb-a8a7-d6bf65c122be",
        "person_id"=>"b3d0c280-5a96-0132-30cd-600308937d74",
        "is_reconciled"=>true,
        "lines"=>[
            {
                "id"=>"line01",
                "line_number"=>1,
                "status"=>"ACTIVE",
                "quantity"=>1.0,
                "unit_price"=>{
                  "total_amount"=>10.0,
                  "net_amount"=>10.0,
                  "tax_amount"=>0.0,
                  "tax_rate"=>0.0,
                  "currency"=>"USD"
                },
                "total_price"=>{
                  "total_amount"=>10.0,
                  "net_amount"=>10.0,
                  "tax_amount"=>0.0,
                  "tax_rate"=>0.0,
                  "currency"=>"USD"
                },
                "tax_code_id"=>"b3d88ac1-5a96-0132-30d1-600308937d74",
                "item_id"=>"b3d52f61-5a96-0132-30ce-600308937d74"
            },
            {
                "id"=>"line02",
                "line_number"=>2,
                "status"=>"ACTIVE",
                "quantity"=>2.0,
                "unit_price"=>{
                    "total_amount"=>8.0,
                    "net_amount"=>8.0,
                    "tax_amount"=>0.0,
                    "tax_rate"=>0.0,
                    "currency"=>"USD"
                },
                "total_price"=>{
                    "total_amount"=>16.0,
                    "net_amount"=>16.0,
                    "tax_amount"=>0.0,
                    "tax_rate"=>0.0,
                    "currency"=>"USD"
                },
                "tax_code_id"=>"b3d88ac1-5a96-0132-30d1-600308937d74",
                "item_id"=>"b3d6dd11-5a96-0132-30cf-600308937d74"
            }
        ],
        "created_at": "2014-11-30T08:13:34Z",
        "updated_at": "2014-11-30T08:13:34Z"
    }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Get Bank Transaction
GET/api/v2/:group_id/bank_transactions/{id}

Get a single Bank Transaction.

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The Bank Transaction ID


PUT https://api-connec.maestrano.com/api/v2/:group_id/bank_transactions/e32303c1-5102-0132-661e-600308937d74
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
    "bank_transactions": {
        "due_date": "2015-31-01T00:00:00Z",
        "status": "INACTIVE",
        "lines: [
            {
                "id": "54b323b30202cbd6da000be5",
                "quantity": 6
            }
        }
    }
}
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
    "bank_transactions": {
        "id"=>"6d0d64ad-3297-4e34-bee8-eb90dac34ae2",
        "account_id"=>"qwertyui-3297-4e34-bee8-eb90dac34ae2",
        "code"=>"BT001",
        "title"=>"Bank transaction",
        "transaction_date"=>"2015-01-12T00:00:00Z",
        "status"=>"AUTHORISED",
        "type"=>"RECEIVE",
        "amount"=>{
            "total_amount"=>26.0,
            "net_amount"=>26.0,
            "tax_amount"=>0.0,
            "tax_rate"=>0.0,
            "currency"=>"USD"
        },
        "currency_rate"=>1.0,
        "organization_id"=>"4d0078b2-e724-4abb-a8a7-d6bf65c122be",
        "person_id"=>"b3d0c280-5a96-0132-30cd-600308937d74",
        "is_reconciled"=>true,
        "lines"=>[
            {
                "id"=>"line01",
                "line_number"=>1,
                "status"=>"ACTIVE",
                "quantity"=>1.0,
                "unit_price"=>{
                  "total_amount"=>10.0,
                  "net_amount"=>10.0,
                  "tax_amount"=>0.0,
                  "tax_rate"=>0.0,
                  "currency"=>"USD"
                },
                "total_price"=>{
                  "total_amount"=>10.0,
                  "net_amount"=>10.0,
                  "tax_amount"=>0.0,
                  "tax_rate"=>0.0,
                  "currency"=>"USD"
                },
                "tax_code_id"=>"b3d88ac1-5a96-0132-30d1-600308937d74",
                "item_id"=>"b3d52f61-5a96-0132-30ce-600308937d74"
            },
            {
                "id"=>"line02",
                "line_number"=>2,
                "status"=>"ACTIVE",
                "quantity"=>2.0,
                "unit_price"=>{
                    "total_amount"=>8.0,
                    "net_amount"=>8.0,
                    "tax_amount"=>0.0,
                    "tax_rate"=>0.0,
                    "currency"=>"USD"
                },
                "total_price"=>{
                    "total_amount"=>16.0,
                    "net_amount"=>16.0,
                    "tax_amount"=>0.0,
                    "tax_rate"=>0.0,
                    "currency"=>"USD"
                },
                "tax_code_id"=>"b3d88ac1-5a96-0132-30d1-600308937d74",
                "item_id"=>"b3d6dd11-5a96-0132-30cf-600308937d74"
            }
        ],
        "created_at": "2014-11-30T08:13:34Z",
        "updated_at": "2014-11-30T08:13:34Z"
    }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Update a Bank Transaction
PUT/api/v2/:group_id/bank_transactions/{id}

Update a single Bank Transaction. For a bank transaction line to be deleted, the status of the line must be set to “INACTIVE”

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The Bank Transaction ID


Company

This is the actual customer company - only one company exists per group_id.

Business Rules

name is mandatory

logo information is read-only

Company JSON schema

GET https://api-connec.maestrano.com/api/v2/json_schema/company
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "company": {
      "type": "object",
      "required": [
        "name"
      ],
      "uniq": [
        "id"
      ],
      "properties": {
        "resource_type": {
          "description": "Resource type name",
          "type": "string",
          "readOnly": true
        },
        "id": {
          "description": "Company UUID",
          "type": "string",
          "readOnly": true
        },
        "channel_id": {
          "description": "Channel ID (org-xxx)",
          "type": "string",
          "readOnly": true
        },
        "group_id": {
          "description": "Group ID (cld-xxx)",
          "type": "string",
          "readOnly": true
        },
        "created_at": {
          "description": "Company creation timestamp",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "updated_at": {
          "description": "Company last update timestamp",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "name": {
          "description": "Company name",
          "type": "string"
        },
        "currency": {
          "description": "Company currency (default: USD)",
          "default": "USD",
          "type": "string"
        },
        "note": {
          "description": "Note associated to the Company",
          "type": "string"
        },
        "timezone": {
          "description": "Company timezone in TZ format (e.g. Australia/Sydney). See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones",
          "type": "string"
        },
        "industry": {
          "description": "Company industry sector",
          "type": "string"
        },
        "managers": {
          "description": "Company managers (CEO name, ...)",
          "type": "string"
        },
        "capital": {
          "description": "Company capital",
          "type": "number"
        },
        "juridical_status": {
          "description": "Company juridical status (pty, ltd, ...)",
          "type": "string"
        },
        "tax_number": {
          "description": "Company tax number (TFN, TIN, ...)",
          "type": "string"
        },
        "business_number": {
          "description": "Company unique business number (ABN in Australia)",
          "type": "string"
        },
        "employer_id": {
          "description": "Company employer id (EIN in the US)",
          "type": "string"
        },
        "fiscal_year_first_month": {
          "description": "First month of the company fiscal year",
          "type": "string"
        },
        "email": {
          "description": "Company email addresses",
          "$ref": "#/definitions/email"
        },
        "address": {
          "description": "Company addresses",
          "$ref": "#/definitions/address"
        },
        "website": {
          "description": "Company websites",
          "$ref": "#/definitions/website"
        },
        "phone": {
          "description": "Company phone and fax numbers",
          "$ref": "#/definitions/phone"
        },
        "logo": {
          "type": "object",
          "properties": {
            "logo": {
              "description": "Absolute URL to the Company logo",
              "type": "string",
              "readOnly": true
            },
            "thumb": {
              "description": "Absolute URL to the Company logo thumb (64x64)",
              "type": "string",
              "readOnly": true
            },
            "mini_thumb": {
              "description": "Absolute URL to the Company logo mni thumb (40x40)",
              "type": "string",
              "readOnly": true
            }
          }
        }
      }
    }
  },
  "definitions": {
    "contact_channel": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "contact_channel": {
          "type": "object",
          "properties": {
            "skype": {
              "description": "Skype account",
              "type": "string"
            }
          }
        }
      }
    },
    "email": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "address": {
              "description": "Primary email address",
              "type": "string"
            },
            "address2": {
              "description": "Secondary email address",
              "type": "string"
            }
          }
        }
      }
    },
    "address": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "website": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "url": {
              "description": "Primary website url",
              "type": "string"
            },
            "url2": {
              "description": "Secondary website url",
              "type": "string"
            }
          }
        }
      }
    },
    "phone": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "price": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "price": {
          "type": "object",
          "properties": {
            "total_amount": {
              "description": "Total amount including taxes",
              "type": "number"
            },
            "net_amount": {
              "description": "Net amount excluding taxes",
              "type": "number"
            },
            "tax_amount": {
              "description": "Total tax amount",
              "type": "number"
            },
            "tax_rate": {
              "description": "Applicable tax rate",
              "type": "number"
            },
            "currency": {
              "description": "Price currency (defaults to Company currency)",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

Get schema
GET/api/v2/json_schema/company

Attributes

Field Type Description
resource_type String Resource type name
id String Company UUID
channel_id String Channel ID (org-xxx)
group_id String Group ID (cld-xxx)
created_at Date Time Company creation timestamp
updated_at Date Time Company last update timestamp
name String Company name
currency String Company currency (default: USD)
note String Note associated to the Company
timezone String Company timezone in TZ format (e.g. Australia/Sydney). See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
industry String Company industry sector
managers String Company managers (CEO name, …)
capital Number Company capital
juridical_status String Company juridical status (pty, ltd, …)
tax_number String Company tax number (TFN, TIN, …)
business_number String Company unique business number (ABN in Australia)
employer_id String Company employer id (EIN in the US)
fiscal_year_first_month String First month of the company fiscal year
email Email Company email addresses
address Address Company addresses
website Website Company websites
phone Phone Company phone and fax numbers
logo Object
Company Logo attributes
Field Type Description
logo String Absolute URL to the Company logo
thumb String Absolute URL to the Company logo thumb (64x64)
mini_thumb String Absolute URL to the Company logo mni thumb (40x40)
Company Logo attributes
Field Type Description
logo String Absolute URL to the Company logo
thumb String Absolute URL to the Company logo thumb (64x64)
mini_thumb String Absolute URL to the Company logo mni thumb (40x40)

Company

GET https://api-connec.maestrano.com/api/v2/:group_id/company
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "company": {
    "id": "5724bcf1-5103-0132-6651-600308937d74",
    "group_id": "cld-7gr8e5",
    "created_at": "2014-11-18T03:45:59Z",
    "updated_at": "2014-11-18T03:45:59Z",
    "name": "My Company",
    "currency": "USD",
    "note": "This is my own company profile",
    "timezone": "Australia/Sydney",
    "industry": "IT",
    "managers": "John Doe (CTO)",
    "capital": 42000,
    "juridical_status": "Pty",
    "tax_number": "01234567891",
    "business_number": "01234567891",
    "employer_id": "01234567891",
    "fiscal_year_first_month": "January",
    "email": {
      "address": "john27@maestrano.com",
      "address2": "jack27@example.com"
    },
    "address": {
      "billing": {
        "line1": "118 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2118",
        "country": "AU"
      },
      "billing2": {
        "line1": "119 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2119",
        "country": "AU"
      },
      "shipping": {
        "line1": "120 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2120",
        "country": "AU"
      },
      "shipping2": {
        "line1": "121 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2121",
        "country": "AU"
      }
    },
    "website": {
      "url": "www.website27.com",
      "url2": "www.mywebsite27.com"
    },
    "phone": {
      "landline": "+61 2 8574 1230",
      "landline2": "+1 2 8574 1230",
      "mobile": "+61 449 785 130",
      "mobile2": "+1 449 785 130",
      "fax": "+61 2 9974 1230",
      "fax2": "+1 2 9974 1230",
      "pager": "+61 440 785 130",
      "pager2": "+1 440 785 130"
    },
    "logo": {
      "logo": "http://s3.images/logo.png",
      "thumb": "http://s3.images/thumb.png",
      "mini_thumb": "http://s3.images/mini_thumb.png"
    }
  }
}

Get Company
GET/api/v2/:group_id/company

Get the company.


PUT https://api-connec.maestrano.com/api/v2/:group_id/company
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
    "company": {
        "name": "My Company",
        "note": "This is my own company profile",
    }

}
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "company": {
    "id": "5724bcf1-5103-0132-6651-600308937d74",
    "group_id": "cld-7gr8e5",
    "created_at": "2014-11-18T03:45:59Z",
    "updated_at": "2014-11-18T03:45:59Z",
    "name": "My Company",
    "currency": "USD",
    "note": "This is my own company profile",
    "timezone": "Australia/Sydney",
    "industry": "IT",
    "managers": "John Doe (CTO)",
    "capital": 42000,
    "juridical_status": "Pty",
    "tax_number": "01234567891",
    "business_number": "01234567891",
    "employer_id": "01234567891",
    "fiscal_year_first_month": "January",
    "email": {
      "address": "john27@maestrano.com",
      "address2": "jack27@example.com"
    },
    "address": {
      "billing": {
        "line1": "118 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2118",
        "country": "AU"
      },
      "billing2": {
        "line1": "119 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2119",
        "country": "AU"
      },
      "shipping": {
        "line1": "120 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2120",
        "country": "AU"
      },
      "shipping2": {
        "line1": "121 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2121",
        "country": "AU"
      }
    },
    "website": {
      "url": "www.website27.com",
      "url2": "www.mywebsite27.com"
    },
    "phone": {
      "landline": "+61 2 8574 1230",
      "landline2": "+1 2 8574 1230",
      "mobile": "+61 449 785 130",
      "mobile2": "+1 449 785 130",
      "fax": "+61 2 9974 1230",
      "fax2": "+1 2 9974 1230",
      "pager": "+61 440 785 130",
      "pager2": "+1 440 785 130"
    },
    "logo": {
      "logo": "http://s3.images/logo.png",
      "thumb": "http://s3.images/thumb.png",
      "mini_thumb": "http://s3.images/mini_thumb.png"
    }
  }
}

Update Company
PUT/api/v2/:group_id/company

Update the company


Contacts

A Contact represent an individual contact or an organization and can be flagged as customer, supplier and lead. Contacts may have a parent Contact to represent a hierarchical structure. As an example, an organization would be the parent contact of all individual contacts belonging to it.

Contacts JSON schema

GET https://api-connec.maestrano.com/api/v2/json_schema/contacts
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "people": {
      "type": "array",
      "items": {
        "type": "object",
        "uniq": [
          "id",
          "code"
        ],
        "properties": {
          "resource_type": {
            "description": "Resource type name",
            "type": "string",
            "readOnly": true
          },
          "id": {
            "description": "Contact UUID",
            "type": "string",
            "readOnly": true
          },
          "channel_id": {
            "type": "string",
            "description": "Channel ID (org-xxx)",
            "readOnly": true
          },
          "group_id": {
            "description": "Group ID (cld-xxx)",
            "type": "string",
            "readOnly": true
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Code, auto-generated if not specified",
            "type": "string"
          },
          "status": {
            "description": "[ACTIVE, INACTIVE] - Default: ACTIVE",
            "type": "string",
            "format": "enum"
          },
          "title": {
            "description": "Contact title (Mr, Mrs, ...)",
            "type": "string"
          },
          "first_name": {
            "description": "Contact first name",
            "type": "string"
          },
          "last_name": {
            "description": "Contact last name",
            "type": "string"
          },
          "job_title": {
            "description": "Contact job title",
            "type": "string"
          },
          "birth_date": {
            "description": "Contact date of birth",
            "type": "string",
            "format": "date-time"
          },
          "organization_id": {
            "description": "#Organization the person belongs to",
            "type": "string",
            "format": "reference"
          },
          "is_customer": {
            "description": "Contact is classified as a Customer",
            "type": "boolean"
          },
          "is_supplier": {
            "description": "Contact is classified as a Supplier",
            "type": "boolean"
          },
          "is_lead": {
            "description": "Contact is classified as a Lead",
            "type": "boolean"
          },
          "is_organization": {
            "description": "Contact is an organization",
            "type": "boolean"
          },
          "is_person": {
            "description": "Contact is a Person (individual)",
            "type": "boolean"
          },
          "contact_channel": {
            "description": "Channels to join the contact",
            "$ref": "#/definitions/contact_channel"
          },
          "address_work": {
            "description": "Contact work address",
            "$ref": "#/definitions/address"
          },
          "address_home": {
            "description": "Contact home address",
            "$ref": "#/definitions/address"
          },
          "email": {
            "description": "Contact email addresses",
            "$ref": "#/definitions/email"
          },
          "website": {
            "description": "Contact websites",
            "$ref": "#/definitions/website"
          },
          "phone_work": {
            "description": "Contact work phone and fax numbers",
            "$ref": "#/definitions/phone"
          },
          "phone_home": {
            "description": "Contact home phone and fax numbers",
            "$ref": "#/definitions/phone"
          },
          "lead_status": {
            "description": "Lead status as defined in the CRM application",
            "type": "string"
          },
          "lead_source": {
            "description": "Lead origin as defined in the CRM application",
            "type": "string"
          },
          "lead_status_changes": {
            "description": "History track of the lead statuses",
            "type": "array",
            "readOnly": true,
            "items": {
              "type": "object",
              "properties": {
                "status": {
                  "description": "Lead satus",
                  "type": "string"
                },
                "created_at": {
                  "description": "Date of the lead status change",
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "lead_referent_type": {
            "description": "Entity type of the lead’s referent [Person,Organization]",
            "type": "string",
            "format": "enum"
          },
          "lead_referent_id": {
            "description": "Lead’s referent, can be a #Person or an #Organization",
            "type": "string",
            "format": "reference"
          },
          "assignee_type": {
            "description": "Entity type of the lead’s assignee [AppUser, Team]",
            "type": "string",
            "format": "enum"
          },
          "assignee_id": {
            "description": "Lead’s assignee can be an #AppUser or a #Team",
            "type": "string",
            "format": "reference"
          },
          "notes": {
            "description": "Notes about the person",
            "type": "array",
            "items": {
              "type": "object",
              "uniq": [
                "id"
              ],
              "properties": {
                "id": {
                  "description": "Note id",
                  "type": "string"
                },
                "description": {
                  "description": "Note content",
                  "type": "string"
                },
                "tag": {
                  "description": "Note tag",
                  "type": "string"
                },
                "value": {
                  "description": "Note value",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "contact_channel": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "contact_channel": {
          "type": "object",
          "properties": {
            "skype": {
              "description": "Skype account",
              "type": "string"
            }
          }
        }
      }
    },
    "email": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "address": {
              "description": "Primary email address",
              "type": "string"
            },
            "address2": {
              "description": "Secondary email address",
              "type": "string"
            }
          }
        }
      }
    },
    "address": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "website": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "url": {
              "description": "Primary website url",
              "type": "string"
            },
            "url2": {
              "description": "Secondary website url",
              "type": "string"
            }
          }
        }
      }
    },
    "phone": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "price": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "price": {
          "type": "object",
          "properties": {
            "total_amount": {
              "description": "Total amount including taxes",
              "type": "number"
            },
            "net_amount": {
              "description": "Net amount excluding taxes",
              "type": "number"
            },
            "tax_amount": {
              "description": "Total tax amount",
              "type": "number"
            },
            "tax_rate": {
              "description": "Applicable tax rate",
              "type": "number"
            },
            "currency": {
              "description": "Price currency (defaults to Company currency)",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

Get schema
GET/api/v2/json_schema/contacts

Attributes

Field Type Description
resource_type String Resource type name
id String Contact UUID
channel_id String Channel ID (org-xxx)
group_id String Group ID (cld-xxx)
created_at Date Time Object creation timestamp
updated_at Date Time Object last update timestamp
code String Code, auto-generated if not specified
status Enum [ACTIVE, INACTIVE] - Default: ACTIVE
title String Contact title (Mr, Mrs, …)
first_name String Contact first name
last_name String Contact last name
job_title String Contact job title
birth_date Date Time Contact date of birth
organization_id Reference Organization the person belongs to
is_customer Boolean Contact is classified as a Customer
is_supplier Boolean Contact is classified as a Supplier
is_lead Boolean Contact is classified as a Lead
is_organization Boolean Contact is an organization
is_person Boolean Contact is a Person (individual)
contact_channel Contact Channel Channels to join the contact
address_work Address Contact work address
address_home Address Contact home address
email Email Contact email addresses
website Website Contact websites
phone_work Phone Contact work phone and fax numbers
phone_home Phone Contact home phone and fax numbers
lead_status String Lead status as defined in the CRM application
lead_source String Lead origin as defined in the CRM application
lead_referent_type Enum Entity type of the lead’s referent [Person,Organization]
lead_referent_id Reference Lead’s referent, can be a Person or an Organization
assignee_type Enum Entity type of the lead’s assignee [AppUser, Team]
assignee_id Reference Lead’s assignee can be an AppUser or a Team
lead_status_changes Array History track of the lead statuses
notes Array Notes about the person
Contacts LeadStatusChanges attributes
Field Type Description
status String Lead satus
created_at Date Time Date of the lead status change
Contacts Notes attributes
Field Type Description
id String Note id
description String Note content
tag String Note tag
value String Note value

Contacts List

GET https://api-connec.maestrano.com/api/v2/:group_id/contacts
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "contacts": [
    {
      "id": "e32303c1-5102-0132-661e-600308937d74",
      "group_id": "cld-4d7f86",
      "created_at": "2014-11-18T03:42:45Z",
      "updated_at": "2014-11-18T03:42:45Z",
      "name": "DoeCorp Inc.",
      "reference": "77456",
      "code": "OR2",
      "industry": "Banking",
      "annual_revenue": 1000000,
      "capital": 150000,
      "number_of_employees": 12,
      "is_customer": true,
      "is_supplier": true,
      "is_lead": false,
      "is_organization": true,
      "is_person": false,
      "contact_channel": {
        "skype": "doecorp"
      },
      "address_work": {
        "billing": {
          "line1": "62 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2062",
          "country": "AU"
        },
        "billing2": {
          "line1": "63 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2063",
          "country": "AU"
        },
        "shipping": {
          "line1": "64 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2064",
          "country": "AU"
        },
        "shipping2": {
          "line1": "65 Elizabeth Street",
          "line2": "",
          "city": "Sydney",
          "region": "NSW",
          "postal_code": "2065",
          "country": "AU"
        }
      },
      "email": {
        "address": "contact@doecorp.com",
        "address2": "info@doecorp.com"
      },
      "website": {
        "url": "http://www.doecorp.com",
        "url2": "http://www.doecorp.com/contactus"
      },
      "phone_work": {
        "landline": "+61 2 8574 1216",
        "landline2": "+1 2 8574 1216",
        "mobile": "+61 449 785 116",
        "mobile2": "+1 449 785 116",
        "fax": "+61 2 9974 1216",
        "fax2": "+1 2 9974 1216",
        "pager": "+61 440 785 116",
        "pager2": "+1 440 785 116"
      }
    }
  ]
}

Get Contacts
GET/api/v2/:group_id/contacts

Get the list of contacts.


POST https://api-connec.maestrano.com/api/v2/:group_id/contacts
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "contacts": {
    "name": "Doe Corp Inc.",
    "is_customer": true
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
  "contacts": {
    "id": "e32303c1-5102-0132-661e-600308937d74",
    "group_id": "cld-4d7f86",
    "created_at": "2014-12-18T03:42:45Z",
    "updated_at": "2014-12-18T03:42:45Z",
    "name": "Doe Corp Inc.",
    "is_customer": true
  }
}

Create New Contact
POST/api/v2/:group_id/contacts

Create a new organization.


Contact

GET https://api-connec.maestrano.com/api/v2/:group_id/contacts/e32303c1-5102-0132-661e-600308937d74
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "contacts": {
    "id": "e32303c1-5102-0132-661e-600308937d74",
    "group_id": "cld-4d7f86",
    "created_at": "2014-11-18T03:42:45Z",
    "updated_at": "2014-11-18T05:42:45Z",
    "name": "DoeCorp Inc.",
    "industry": "Banking",
    "annual_revenue": 800,
    "capital": 8000,
    "number_of_employees": 80,
    "is_customer": true,
    "is_supplier": true,
    "is_lead": true,
    "address_work": {
      "billing": {
        "line1": "62 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2062",
        "country": "AU"
      },
      "billing2": {
        "line1": "63 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2063",
        "country": "AU"
      },
      "shipping": {
        "line1": "64 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2064",
        "country": "AU"
      },
      "shipping2": {
        "line1": "65 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2065",
        "country": "AU"
      }
    },
    "email": {
      "address": "john13@maestrano.com",
      "address2": "jack13@example.com"
    },
    "website": {
      "url": "www.website13.com",
      "url2": "www.mywebsite13.com"
    },
    "phone_work": {
      "landline": "+61 2 8574 1216",
      "landline2": "+1 2 8574 1216",
      "mobile": "+61 449 785 116",
      "mobile2": "+1 449 785 116",
      "fax": "+61 2 9974 1216",
      "fax2": "+1 2 9974 1216",
      "pager": "+61 440 785 116",
      "pager2": "+1 440 785 116"
    }
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Get Contact
GET/api/v2/:group_id/contacts/{id}

Get a single organization.

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The organization ID


PUT https://api-connec.maestrano.com/api/v2/:group_id/contacts/e32303c1-5102-0132-661e-600308937d74
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "contacts": {
    "name": "DoeCorp Inc.",
    "is_supplier": true
  }
}
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "contacts": {
    "id": "e32303c1-5102-0132-661e-600308937d74",
    "group_id": "cld-4d7f86",
    "created_at": "2014-11-18T03:42:45Z",
    "updated_at": "2014-11-18T05:42:45Z",
    "name": "DoeCorp Inc.",
    "industry": "Banking",
    "annual_revenue": 800,
    "capital": 8000,
    "number_of_employees": 80,
    "is_customer": true,
    "is_supplier": true,
    "is_lead": true,
    "address_work": {
      "billing": {
        "line1": "62 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2062",
        "country": "AU"
      },
      "billing2": {
        "line1": "63 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2063",
        "country": "AU"
      },
      "shipping": {
        "line1": "64 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2064",
        "country": "AU"
      },
      "shipping2": {
        "line1": "65 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2065",
        "country": "AU"
      }
    },
    "email": {
      "address": "john13@maestrano.com",
      "address2": "jack13@example.com"
    },
    "website": {
      "url": "www.website13.com",
      "url2": "www.mywebsite13.com"
    },
    "phone_work": {
      "landline": "+61 2 8574 1216",
      "landline2": "+1 2 8574 1216",
      "mobile": "+61 449 785 116",
      "mobile2": "+1 449 785 116",
      "fax": "+61 2 9974 1216",
      "fax2": "+1 2 9974 1216",
      "pager": "+61 440 785 116",
      "pager2": "+1 440 785 116"
    }
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Update an Contact
PUT/api/v2/:group_id/contacts/{id}

Update a single Contact

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The organization ID


Credit Notes

A CreditNote is a transaction representing a refund or credit of payment for goods or services that have been sold or purchased.

Business Rules

  • If a tax_code_id is specified for a CreditNote line, the associated tax rate is used to calculate the total_price of the line:

    • CUSTOMER CreditNote, the tax_code sale_tax_rate is used
    • SUPPLIER CreditNote, the tax_code purchase_tax_rate is used
  • If a refund of credit has been made on the CreditNote, it must be specified using the linked_transactions

  • If the remaining_credit of a CreditNote is equal to 0.0, its status is set to APPLIED

Credit Notes JSON schema

GET https://api-connec.maestrano.com/api/v2/json_schema/credit_notes
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "invoices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "CreditNote UUID",
            "type": "string",
            "readOnly": true
          },
          "group_id": {
            "description": "Group ID",
            "type": "string"
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Unique code, auto-generated if not specified",
            "type": "string"
          },
          "title": {
            "description": "CreditNote friendly name",
            "type": "string"
          },
          "transaction_number": {
            "description": "Reference number of the CreditNote",
            "type": "string"
          },
          "transaction_date": {
            "description": "CreditNote creation date, defaults to today if not specified",
            "type": "date-time"
          },
          "due_date": {
            "description": "CreditNote due date, defaults to today if not specified",
            "type": "date-time"
          },
          "payment_term": {
            "description": "Payment term",
            "enum": [
              "IMMEDIATE",
              "PIA",
              "NET7",
              "NET10",
              "NET30",
              "NET60",
              "NET90",
              "EOM"
            ]
          },
          "status": {
            "description": "CreditNote status",
            "enum": [
              "DRAFT",
              "SUBMITTED",
              "AUTHORISED",
              "PAID",
              "VOIDED",
              "INACTIVE"
            ],
            "default": "DRAFT"
          },
          "type": {
            "description": "CreditNote type indicates if it is based on a sale invoice or a purchase invoice",
            "enum": [
              "CUSTOMER",
              "SUPPLIER"
            ],
            "default": "CUSTOMER"
          },
          "balance": {
            "description": "Amount left to be applied",
            "type": "number"
          },
          "deposit": {
            "description": "Amount applied to date",
            "type": "number"
          },
          "remaining_credit": {
            "description": "Remaining credit to date",
            "type": "number"
          },
          "discount_percent": {
            "description": "Total discount percentage deducted on the invoice total",
            "type": "number"
          },
          "discount_amount": {
            "description": "Fixed discount amount deducted on the invoice total",
            "type": "number"
          },
          "organization_id": {
            "description": "Reference of the customer or supplier Organization",
            "type": "string"
          },
          "person_id": {
            "description": "Reference of the customer or supplier Person",
            "type": "string"
          },
          "warehouse_id": {
            "description": "Reference of the Warehouse to use for inventory management",
            "type": "string"
          },
          "tax_code_id": {
            "description": "Reference of the applicable Tax Code",
            "type": "string"
          },
          "freight_tax_code_id": {
            "description": "Reference of the applicable shipping Tax Code",
            "type": "string"
          },
          "account_id": {
            "description": "Reference of the Account used for the CreditNote",
            "type": "string"
          },
          "tax_calculation": {
            "description": "Tax calculation method for display purpose",
            "enum": [
              "TAX_EXCLUDED",
              "TAX_INCLUSIVE",
              "NOT_APPLICABLE"
            ]
          },
          "invoice_id": {
            "description": "Reference of parent Invoice",
            "type": "string"
          },
          "public_note": {
            "description": "Note visible to the customer on the invoice",
            "type": "string"
          },
          "private_note": {
            "description": "Internal note not visible to the customer",
            "type": "string"
          },
          "amount": {
            "$ref": "#/definitions/price",
            "readOnly": true
          },
          "billing_address": {
            "$ref": "#/definitions/address"
          },
          "shipping_address": {
            "$ref": "#/definitions/address"
          },
          "lines": {
            "type": "array",
            "items": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "description": "Transaction line ID",
                    "type": "string"
                  },
                  "line_number": {
                    "description": "Transaction line number used for ordering",
                    "type": "integer"
                  },
                  "description": {
                    "description": "Transaction line description",
                    "type": "string"
                  },
                  "status": {
                    "description": "Transaction line status",
                    "enum": [
                      "ACTIVE",
                      "INACTIVE"
                    ],
                    "default": "ACTIVE"
                  },
                  "quantity": {
                    "description": "Quantity of Items",
                    "type": "number"
                  },
                  "reduction_percent": {
                    "description": "Reduction percentage applicable",
                    "type": "number"
                  },
                  "unit_price": {
                    "$ref": "#/definitions/price"
                  },
                  "total_price": {
                    "$ref": "#/definitions/price",
                    "readOnly": true
                  },
                  "service_date": {
                    "description": "Delivery date of the item/service",
                    "type": "string",
                    "format": "date-time"
                  },
                  "tax_code_id": {
                    "description": "Reference to the Tax Code applicable on the transaction line",
                    "type": "string"
                  },
                  "item_id": {
                    "description": "Reference to the Item of the transaction line",
                    "type": "string"
                  },
                  "account_id": {
                    "description": "Reference to the Account of the transaction line",
                    "type": "string"
                  },
                  "organization_id": {
                    "description": "Reference of the Customer or Supplier applicable to the transaction line",
                    "type": "string"
                  },
                  "payment_method_id": {
                    "description": "Reference to the Payment Method of the transaction line",
                    "type": "string"
                  },
                  "linked_transactions": {
                    "type": "array",
                    "items": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "description": "LinkedTransaction line ID",
                            "type": "string"
                          },
                          "applied_amount": {
                            "description": "Amount applied on the linked transaction",
                            "type": "number"
                          },
                          "transactionable_id": {
                            "description": "Reference to the Transaction UUID",
                            "type": "string"
                          },
                          "transactionable_type": {
                            "description": "Reference to the Transaction type (Invoice, Payment, CreditNote, etc...)",
                            "type": "string"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        }
      }
    }
  },
  "definitions": {
    "contact_channel": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "contact_channel": {
          "type": "object",
          "properties": {
            "skype": {
              "description": "Skype account",
              "type": "string"
            }
          }
        }
      }
    },
    "email": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "address": {
              "description": "Primary email address",
              "type": "string"
            },
            "address2": {
              "description": "Secondary email address",
              "type": "string"
            }
          }
        }
      }
    },
    "address": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "website": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "url": {
              "description": "Primary website url",
              "type": "string"
            },
            "url2": {
              "description": "Secondary website url",
              "type": "string"
            }
          }
        }
      }
    },
    "phone": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "price": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "price": {
          "type": "object",
          "properties": {
            "total_amount": {
              "description": "Total amount including taxes",
              "type": "number"
            },
            "net_amount": {
              "description": "Net amount excluding taxes",
              "type": "number"
            },
            "tax_amount": {
              "description": "Total tax amount",
              "type": "number"
            },
            "tax_rate": {
              "description": "Applicable tax rate",
              "type": "number"
            },
            "currency": {
              "description": "Price currency (defaults to Company currency)",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

Get schema
GET/api/v2/json_schema/credit_notes

Attributes

Field Type Description
id String CreditNote UUID
group_id String Group ID
created_at Date Time Object creation timestamp
updated_at Date Time Object last update timestamp
code String Unique code, auto-generated if not specified
title String CreditNote friendly name
transaction_number String Reference number of the CreditNote
transaction_date Date Time CreditNote creation date, defaults to today if not specified
due_date Date Time CreditNote due date, defaults to today if not specified
payment_term Payment term
status CreditNote status
type CreditNote type indicates if it is based on a sale invoice or a purchase invoice
balance Number Amount left to be applied
deposit Number Amount applied to date
remaining_credit Number Remaining credit to date
discount_percent Number Total discount percentage deducted on the invoice total
discount_amount Number Fixed discount amount deducted on the invoice total
organization_id String Reference of the customer or supplier Organization
person_id String Reference of the customer or supplier Person
warehouse_id String Reference of the Warehouse to use for inventory management
tax_code_id String Reference of the applicable Tax Code
freight_tax_code_id String Reference of the applicable shipping Tax Code
account_id String Reference of the Account used for the CreditNote
tax_calculation Tax calculation method for display purpose
invoice_id String Reference of parent Invoice
public_note String Note visible to the customer on the invoice
private_note String Internal note not visible to the customer
amount Price
billing_address Address
shipping_address Address
lines Array
CreditNotes Lines attributes
Field Type Description
id String Transaction line ID
line_number Integer Transaction line number used for ordering
description String Transaction line description
status Transaction line status
quantity Number Quantity of Items
reduction_percent Number Reduction percentage applicable
unit_price Price
total_price Price
service_date Date Time Delivery date of the item/service
tax_code_id String Reference to the Tax Code applicable on the transaction line
item_id String Reference to the Item of the transaction line
account_id String Reference to the Account of the transaction line
organization_id String Reference of the Customer or Supplier applicable to the transaction line
payment_method_id String Reference to the Payment Method of the transaction line
linked_transactions Array
CreditNotes LinkedTransactions attributes
Field Type Description
id String LinkedTransaction line ID
applied_amount Number Amount applied on the linked transaction
transactionable_id String Reference to the Transaction UUID
transactionable_type String Reference to the Transaction type (Invoice, Payment, CreditNote, etc…)

CreditNotes List

GET https://api-connec.maestrano.com/api/v2/:group_id/credit_notes
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "credit_notes": [
    {
      "id": "b3f169f0-5a96-0132-30de-600308937d74",
      "group_id": "cld-fd45gf12",
      "created_at": "2014-11-30T08:13:34Z",
      "updated_at": "2014-11-30T08:13:34Z",
      "code": "171",
      "title": "Stationery supplies for 2015",
      "transaction_number": "SUP2015",
      "transaction_date": "2015-01-12T00:00:00Z",
      "due_date": "2015-01-31T00:00:00Z",
      "status": "UNAPPLIED",
      "type": "CUSTOMER",
      "balance": 22,
      "deposit": 11,
      "remaining_credit": 22,
      "discount_percent": 0,
      "discount_amount": 0,
      "public_note": "Enjoy!",
      "organization_id": "b3ce0371-5a96-0132-30cb-600308937d74",
      "person_id": "b3d0c280-5a96-0132-30cd-600308937d74",
      "currency_rate": 0.8794,
      "amount": {
        "total_amount": 33,
        "net_amount": 30,
        "tax_amount": 3,
        "tax_rate": 10,
        "currency": "USD"
      },
      "billing_address": {
        "line1": "210 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2000",
        "country": "AU"
      },
      "shipping_address": {
        "line1": "210 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2000",
        "country": "AU"
      },
      "invoice_id": "b3f169f0-5a96-0132-30de-600308937d74",
      "linked_transactions": [
        {
          "applied_amount": 11,
          "id": "a4e27ae1-6b87-0123-29ed-700419848e75",
          "class": "Invoice"
        }
      ],
      "lines": [
        {
          "id": "54b323b30202cbd6da000be5",
          "line_number": 1,
          "description": "2015 notebook",
          "status": "ACTIVE",
          "quantity": 10,
          "unit_price": {
            "total_amount": 1.1,
            "net_amount": 1,
            "tax_amount": 0.1,
            "tax_rate": 10,
            "currency": "USD"
          },
          "total_price": {
            "total_amount": 11,
            "net_amount": 10,
            "tax_amount": 1,
            "tax_rate": 10,
            "currency": "USD"
          },
          "tax_code_id": "b3d88ac1-5a96-0132-30d1-600308937d74",
          "item_id": "b3d52f61-5a96-0132-30ce-600308937d74",
          "account_id": "t4d6dd11-5a96-0132-30cf-600308937d21"
        },
        {
          "id": "54b323b70202cbd6da000dbb",
          "line_number": 2,
          "description": "2015 calendar A3 format",
          "status": "ACTIVE",
          "quantity": 2,
          "unit_price": {
            "total_amount": 11,
            "net_amount": 10,
            "tax_amount": 1,
            "tax_rate": 10,
            "currency": "USD"
          },
          "total_price": {
            "total_amount": 22,
            "net_amount": 20,
            "tax_amount": 2,
            "tax_rate": 10,
            "currency": "USD"
          },
          "tax_code_id": "b3d88ac1-5a96-0132-30d1-600308937d74",
          "item_id": "b3d6dd11-5a96-0132-30cf-600308937d74",
          "account_id": "t4d6dd11-5a96-0132-30cf-600308937d21"
        }
      ]
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",

  "type": "object",
  "properties": {
    "credit_notes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "CreditNote UUID",
            "type": "string",
            "readOnly": true
          },
          "group_id": {
            "description": "Group ID",
            "type": "string"
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Unique code, auto-generated if not specified",
            "type": "string"
          },
          "title": {
            "description": "CreditNote friendly name",
            "type": "string"
          },
          "transaction_number": {
            "description": "Reference number of the CreditNote",
            "type": "string"
          },
          "transaction_date": {
            "description": "CreditNote creation date, defaults to today if not specified",
            "type": "date-time"
          },
          "due_date": {
            "description": "CreditNote due date, defaults to today if not specified",
            "type": "date-time"
          },
          "payment_term": {
            "description": "Payment term",
            "enum": ["IMMEDIATE", "PIA", "NET7", "NET10", "NET30", "NET60", "NET90", "EOM"]
          },
          "status": {
            "description": "CreditNote status",
            "enum": ["DRAFT", "APPLIED", "UNAPPLIED"],
            "default": "DRAFT"
          },
          "type": {
            "description": "CreditNote type indicates if it is a customer CreditNote or a supplier CreditNote",
            "enum": ["CUSTOMER", "SUPPLIER"],
            "default": "CUSTOMER"
          },
          "balance": {
            "description": "Amount left on the CreditNote",
            "type": "number",
            "readOnly": true
          },
          "deposit": {
            "description": "Amount refund to date",
            "type": "number",
            "readOnly": true
          },
          "remaining_credit": {
            "description": "Credit amount still avaible",
            "type": "number",
            "readOnly": true
          },
          "discount_percent": {
            "description": "Total discount percentage deducted on the CreditNote total",
            "type": "number"
          },
          "discount_amount": {
            "description": "Fixed discount amount deducted on the CreditNote total",
            "type": "number"
          },
          "organization_id": {
            "description": "Reference of the customer or supplier Organization",
            "type": "string"
          },
          "person_id": {
            "description": "Reference of the customer or supplier Person",
            "type": "string"
          },
          "tax_code_id": {
            "description": "Reference of the applicable Tax Code",
            "type": "string"
          },
          "freight_tax_code_id": {
            "description": "Reference of the applicable shipping Tax Code",
            "type": "string"
          },
          "account_id": {
            "description": "Reference of the Account used for the CreditNote",
            "type": "string"
          },
          "tax_calculation": {
            "description": "Tax calculation method for display purpose",
            "enum": ["TAX_EXCLUDED", "TAX_INCLUSIVE", "NOT_APPLICABLE"]
          },
          "sales_order_id": {
            "description": "Reference of parent Sales Order",
            "type": "string"
          },
          "public_note": {
            "description": "Note visible to the customer on the CreditNote",
            "type": "string"
          },
          "private_note": {
            "description": "Internal note not visible to the customer",
            "type": "string"
          },
          "currency_rate": {
            "description": "Rate for the currency pair at the date of the transaction.",
            "type": "number"
          },
          "amount": {
            "$ref": "#/definitions/price",
            "readOnly": true
          },
          "billing_address": {
            "$ref": "#/definitions/address"
          },
          "shipping_address": {
            "$ref": "#/definitions/address"
          },
          "linked_transactions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "applied_amount": {
                  "description": "Transaction reference ID",
                  "type": "string"
                },
                "id": {
                  "description": "Transaction reference ID",
                  "type": "string"
                },
                "class": {
                  "description": "Transaction reference type",
                  "type": "string",
                  "enum": ["Invoice", "SalesOrder", "PurchaseOrder", "Quote", Payment]
                }
              }
          },
          "lines": {
            "type": "array",
            "items": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "description": "CreditNote line ID",
                    "type": "string"
                  },
                  "line_number": {
                    "description": "CreditNote line number used for ordering",
                    "type": "integer"
                  },
                  "status": {
                    "description": "CreditNote line status",
                    "enum": ["ACTIVE", "INACTIVE"],
                    "default": "ACTIVE"
                  },
                  "quantity": {
                    "description": "Quantity of Items",
                    "type": "number"
                  },
                  "reduction_percent": {
                    "description": "Reduction percentage applicable",
                    "type": "number"
                  },
                  "unit_price": {
                    "$ref": "#/definitions/price"
                  },
                  "total_price": {
                    "$ref": "#/definitions/price",
                    "readOnly": true
                  },
                  "service_date": {
                    "description": "Delivery date of the item/service",
                    "type": "string",
                    "format": "date-time"
                  },
                  "tax_code_id": {
                    "description": "Reference to the Tax Code applicable on the CreditNote line",
                    "type": "string"
                  },
                  "item_id": {
                    "description": "Reference to the Item of the CreditNote line",
                    "type": "string"
                  },
                  "account_id": {
                    "description": "Reference to the Account of the CreditNote line",
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Get CreditNotes
GET/api/v2/:group_id/credit_notes

Get the list of CreditNotes.

Attributes

Field Type Description
id String Credit note UUID
group_id String Group ID
created_at Date-time Credit note creation date
updated_at Date-time Credit note last update date
code String Code, auto-generated if not specified
status Enum [DRAFT, UNAPPLIED, APPLIED, VOIDED, INACTIVE] - Default: DRAFT
title String Credit note title
transaction_number String Credit note number
transaction_date Date-time Credit note date
due_date Date-time Credit note due date
payment_term Enum [IMMEDIATE, PIA, NET7, NET10, NET30, NET60, NET90, EOM]
type Enum [CUSTOMER (owing a customer), SUPPLIER (debt from a supplier)] - Default: CUSTOMER
balance Number Credit note balance, calculated with remaining_credit
deposit Number Credit note deposit, calculated with the total applied amounts of linked_transactions
remaining_credit Number Credit note remaining credit, calculated with amount and the total applied amounts of linked_transactions
discount_percent Number Total discount percentage deducted on the credit note total
discount_amount Number Total discount amount deducted on the credit note total
currency_rate Number Rate for the currency pair at the date of the transaction
public_note String Note visible by the customer on the credit note
private_note String Internal note not visible by the customer
tax_calculation Enum [TAX_EXCLUDED, TAX_INCLUSIVE, NOT_APPLICABLE] (display purpose only)
tax_code_id Reference Tax code applied to the credit note
freight_tax_code_id Reference Shipping tax code applied to the credit_note
organization_id Reference The credit_note customer/supplier organization
person_id Reference The credit_note customer/supplier contact
account_id Reference Account used for the credit_note
invoice_id Reference Invoice the credit note has been created from
amount Price Credit note total amount, calculated with the credit_note lines
billing_address Address Credit note billing address
shipping_address Address Credit note shipping address
linked_transactions Array Transactions covered by the credit note
lines Array Credit note detail
Credit note linked transactions attributes
Field Type Description
applied_amount Number Amount of the credit note applied on the transaction
id String UUID of the transaction
class Enum Transaction type: [Quote, Invoice, SalesOrder, PurchaseOrder, Payment]
Credit note lines attributes
Field Type Description
id String Line id
status Enum ACTIVE, INACTIVE] - Default: ACTIVE
line_number String Line number
description String Line description
reduction_percent Number Reduction percentage applicable
service_date Date-time Delivery date of the item/service
quantity Number Item quantity
unit_price Price Item unit price
total_price Price Line total price, calculated with unit_price and quantity
tax_code_id Reference Tax code applied to this line
account_id Reference Account used for this line
item_id Reference Item concerned by this line

POST https://api-connec.maestrano.com/api/v2/:group_id/credit_notes
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
    "credit_notes": {
        "due_date": "2014-12-05T08:13:31Z",
        "title": "Team meeting catering 12-01-2015",
        "status": "APPLIED",
        "type": "SUPPLIER",
        "organization_id": "b3ce0371-5a96-0132-30cb-600308937d74",
        "person_id": "b3d0c280-5a96-0132-30cd-600308937d74",
        "linked_transactions": [
          {
            "applied_amount": 125.4,
            "id": "a4e27ae1-6b87-0123-29ed-700419848e75",
            "class": "Invoice"
          }
        ],
        "lines: [
            {
                "id: "54b323b30202cbd6da000be5",
                "line_number": 1,
                "description: "Medium size pizza",
                "quantity: 6,
                "unit_price: {
                    "total_amount: 16.5,
                    "net_amount: 15.0,
                    "tax_amount: 1.5,
                    "tax_rate: 10.0
                },
                "tax_code_id: "75810aa1-7c28-0132-a5d9-56847afe9799",
                "item_id: "ddc285c1-5a96-0132-31b8-600308937d74"
            },
            {
                "id: "54b323b70202cbd6da000dbb",
                "line_number": 2,
                "description: "Mixed salad",
                "quantity: 2,
                "unit_price: {
                    "total_amount: 13.2,
                    "net_amount: 12.0,
                    "tax_amount: 1.2,
                    "tax_rate: 10.0
                },
                "tax_code_id: "75810aa1-7c28-0132-a5d9-56847afe9799"
            }
        ]
    }
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
    "credit_notes": {
        "id": "e32303c1-5102-0132-661e-600308937d74",
        "group_id": "cld-4d7f86",
        "created_at": "2014-12-18T03:42:45Z",
        "updated_at": "2014-12-18T03:42:45Z",
        "due_date": "2014-12-05T08:13:31Z",
        "status": "DRAFT",
        "type": "SUPPLIER",
        "balance": 0.0,
        "deposit": 125.4,
        "remaining_credit": 0.0,
        "organization_id": "b3ce0371-5a96-0132-30cb-600308937d74",
        "person_id": "b3d0c280-5a96-0132-30cd-600308937d74",
        "currency_rate": 0.8794,
        "amount": {
            "total_amount": 125.4,
            "net_amount": 113.0,
            "tax_amount": 11.4,
            "tax_rate": 10.0,
            "currency": "USD"
        },
        "linked_transactions": [
          {
            "applied_amount": 125.4,
            "id": "a4e27ae1-6b87-0123-29ed-700419848e75",
            "class": "Invoice"
          }
        ],
        "lines: [
            {
                "id: "line1",
                "line_number": 1,
                "description: "Medium size pizza",
                "quantity: 6,
                "unit_price: {
                    "total_amount: 16.5,
                    "net_amount: 15.0,
                    "tax_amount: 1.5,
                    "tax_rate: 10.0
                },
                "total_price: {
                    "total_amount: 99.0,
                    "net_amount: 90.0,
                    "tax_amount: 9.0,
                    "tax_rate: 10.0
                },
                "tax_code_id: "75810aa1-7c28-0132-a5d9-56847afe9799",
                "item_id: "ddc285c1-5a96-0132-31b8-600308937d74"
            },
            {
                "id: "line2",
                "line_number": 2,
                "description: "Mixed salad",
                "quantity: 2,
                "unit_price: {
                    "total_amount: 13.2,
                    "net_amount: 12.0,
                    "tax_amount: 1.2,
                    "tax_rate: 10.0
                },
                "total_price: {
                    "total_amount: 26.4,
                    "net_amount: 24.0,
                    "tax_amount: 2.4,
                    "tax_rate: 10.0
                },
                "tax_code_id: "75810aa1-7c28-0132-a5d9-56847afe9799"
            }
        ]
    }
}

Create New CreditNote
POST/api/v2/:group_id/credit_notes

Create a new CreditNote.


CreditNote

GET https://api-connec.maestrano.com/api/v2/:group_id/credit_notes/e32303c1-5102-0132-661e-600308937d74
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "credit_notes": {
    "id": "b3f169f0-5a96-0132-30de-600308937d74",
    "group_id": "cld-fd45gf12",
    "created_at": "2014-11-30T08:13:34Z",
    "updated_at": "2014-11-30T08:13:34Z",
    "transaction_number": "txn_00005",
    "transaction_date": "2014-11-30T08:13:31Z",
    "due_date": "2014-12-05T08:13:31Z",
    "status": "DRAFT",
    "type": "CUSTOMER",
    "balance": 33,
    "deposit": 0,
    "remaining_credit": 33,
    "discount_percent": 0,
    "discount_amount": 0,
    "organization_id": "b3ce0371-5a96-0132-30cb-600308937d74",
    "person_id": "b3d0c280-5a96-0132-30cd-600308937d74",
    "currency_rate": 0.8794,
    "amount": {
      "total_amount": 33,
      "net_amount": 30,
      "tax_amount": 3,
      "tax_rate": 10,
      "currency": "USD"
    },
    "billing_address": {
      "line1": "62 Elizabeth Street",
      "line2": "",
      "city": "Sydney",
      "region": "NSW",
      "postal_code": "2062",
      "country": "AU"
    },
    "shipping_address": {
      "line1": "64 Elizabeth Street",
      "line2": "",
      "city": "Sydney",
      "region": "NSW",
      "postal_code": "2064",
      "country": "AU"
    },
    "lines": [
      {
        "id": "54b323b30202cbd6da000be5",
        "type": "ITEM_LINE_DETAIL",
        "line_number": 1,
        "status": "ACTIVE",
        "quantity": 1,
        "unit_price": {
          "total_amount": 11,
          "net_amount": 10,
          "tax_amount": 1,
          "tax_rate": 10,
          "currency": "USD"
        },
        "total_price": {
          "total_amount": 10,
          "net_amount": 9,
          "tax_amount": 1,
          "tax_rate": 10,
          "currency": "USD"
        },
        "tax_code_id": "b3d88ac1-5a96-0132-30d1-600308937d74",
        "item_id": "b3d52f61-5a96-0132-30ce-600308937d74"
      },
      {
        "id": "54b323b70202cbd6da000dbb",
        "type": "ITEM_LINE_DETAIL",
        "line_number": 2,
        "status": "ACTIVE",
        "quantity": 2,
        "unit_price": {
          "total_amount": 11,
          "net_amount": 10,
          "tax_amount": 1,
          "tax_rate": 10,
          "currency": "USD"
        },
        "total_price": {
          "total_amount": 22,
          "net_amount": 20,
          "tax_amount": 2,
          "tax_rate": 10,
          "currency": "USD"
        },
        "tax_code_id": "b3d88ac1-5a96-0132-30d1-600308937d74",
        "item_id": "b3d6dd11-5a96-0132-30cf-600308937d74"
      }
    ]
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Get CreditNote
GET/api/v2/:group_id/credit_notes/{id}

Get a single CreditNote.

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The CreditNote ID


PUT https://api-connec.maestrano.com/api/v2/:group_id/credit_notes/e32303c1-5102-0132-661e-600308937d74
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
    "credit_notes": {
        "due_date": "2015-31-01T00:00:00Z",
        "status": "AUTHORIZED",
        "lines: [
            {
                "id": "54b323b30202cbd6da000be5",
                "quantity": 6
            }
        }
    }
}
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "credit_notes": {
    "id": "b3f169f0-5a96-0132-30de-600308937d74",
    "group_id": "cld-fd45gf12",
    "created_at": "2014-11-30T08:13:34Z",
    "updated_at": "2014-11-30T08:13:34Z",
    "transaction_number": "txn_00005",
    "transaction_date": "2014-11-30T08:13:31Z",
    "due_date": "2014-12-05T08:13:31Z",
    "status": "DRAFT",
    "type": "CUSTOMER",
    "balance": 33,
    "deposit": 0,
    "remaining_credit": 33,
    "discount_percent": 0,
    "discount_amount": 0,
    "organization_id": "b3ce0371-5a96-0132-30cb-600308937d74",
    "person_id": "b3d0c280-5a96-0132-30cd-600308937d74",
    "currency_rate": 0.8794,
    "amount": {
      "total_amount": 33,
      "net_amount": 30,
      "tax_amount": 3,
      "tax_rate": 10,
      "currency": "USD"
    },
    "billing_address": {
      "line1": "62 Elizabeth Street",
      "line2": "",
      "city": "Sydney",
      "region": "NSW",
      "postal_code": "2062",
      "country": "AU"
    },
    "shipping_address": {
      "line1": "64 Elizabeth Street",
      "line2": "",
      "city": "Sydney",
      "region": "NSW",
      "postal_code": "2064",
      "country": "AU"
    },
    "lines": [
      {
        "id": "54b323b30202cbd6da000be5",
        "type": "ITEM_LINE_DETAIL",
        "line_number": 1,
        "status": "ACTIVE",
        "quantity": 1,
        "unit_price": {
          "total_amount": 11,
          "net_amount": 10,
          "tax_amount": 1,
          "tax_rate": 10,
          "currency": "USD"
        },
        "total_price": {
          "total_amount": 10,
          "net_amount": 9,
          "tax_amount": 1,
          "tax_rate": 10,
          "currency": "USD"
        },
        "tax_code_id": "b3d88ac1-5a96-0132-30d1-600308937d74",
        "item_id": "b3d52f61-5a96-0132-30ce-600308937d74"
      },
      {
        "id": "54b323b70202cbd6da000dbb",
        "type": "ITEM_LINE_DETAIL",
        "line_number": 2,
        "status": "ACTIVE",
        "quantity": 2,
        "unit_price": {
          "total_amount": 11,
          "net_amount": 10,
          "tax_amount": 1,
          "tax_rate": 10,
          "currency": "USD"
        },
        "total_price": {
          "total_amount": 22,
          "net_amount": 20,
          "tax_amount": 2,
          "tax_rate": 10,
          "currency": "USD"
        },
        "tax_code_id": "b3d88ac1-5a96-0132-30d1-600308937d74",
        "item_id": "b3d6dd11-5a96-0132-30cf-600308937d74"
      }
    ]
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Update a CreditNote
PUT/api/v2/:group_id/credit_notes/{id}

Update a single CreditNote. For a CreditNote line to be deleted, the status of the CreditNote line must be set to “INACTIVE”

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The CreditNote ID


Credit Payments

Credit Payments JSON schema

GET https://api-connec.maestrano.com/api/v2/json_schema/credit_payments
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "credit_payments": {
      "type": "array",
      "items": {
        "type": "object",
        "uniq": [
          "id",
          "code"
        ],
        "properties": {
          "resource_type": {
            "description": "Resource type name",
            "type": "string",
            "readOnly": true
          },
          "id": {
            "description": "Credit payment UUID",
            "type": "string",
            "readOnly": true
          },
          "channel_id": {
            "type": "string",
            "description": "Channel ID (org-xxx)",
            "readOnly": true
          },
          "group_id": {
            "description": "Group ID (cld-xxx)",
            "type": "string",
            "readOnly": true
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Code, auto-generated if not specified",
            "type": "string"
          },
          "status": {
            "description": "[DRAFT, SUBMITTED, AUTHORISED, INACTIVE, APPLIED, UNAPPLIED] - Default: DRAFT",
            "type": "string",
            "format": "enum"
          },
          "type": {
            "description": "[CUSTOMER, SUPPLIER] - Default: CUSTOMER",
            "type": "string",
            "format": "enum"
          },
          "title": {
            "description": "Credit payment title",
            "type": "string"
          },
          "transaction_date": {
            "description": "Transaction date",
            "type": "string",
            "format": "date-time"
          },
          "transaction_number": {
            "description": "Transaction reference",
            "type": "string"
          },
          "public_note": {
            "description": "Note visible on the document",
            "type": "string"
          },
          "private_note": {
            "description": "Private internal note",
            "type": "string"
          },
          "organization_id": {
            "description": "#Organization that made the credit payment",
            "type": "string",
            "format": "reference"
          },
          "person_id": {
            "description": "#Person that made the credit payment",
            "type": "string",
            "format": "reference"
          },
          "account_id": {
            "description": "#Account the credit payment was made on",
            "type": "string",
            "format": "reference"
          },
          "payment_method_id": {
            "description": "#PaymentMethod used for the credit payment",
            "type": "string",
            "format": "reference"
          },
          "amount": {
            "description": "Credit payment total amount, calculated with the lines",
            "$ref": "#/definitions/price",
            "readOnly": true
          },
          "unapplied_amount": {
            "description": "Credit payment total unapplied amount",
            "type": "number"
          },
          "process_payment": {
            "description": "Is the credit payment processed",
            "type": "boolean"
          },
          "linked_transactions": {
            "description": "Credit payment linked transactions",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "applied_amount": {
                  "description": "Linked transaction applied amount",
                  "type": "number"
                },
                "class": {
                  "description": "Linked transaction class: [Invoice, Payment, ...]",
                  "type": "string",
                  "format": "enum"
                },
                "id": {
                  "description": "Linked transaction UUID",
                  "type": "string"
                }
              }
            }
          },
          "lines": {
            "description": "Transaction details",
            "type": "array",
            "items": {
              "type": "object",
              "uniq": [
                "id"
              ],
              "required": [
                "quantity",
                "unit_price"
              ],
              "properties": {
                "id": {
                  "description": "Line id",
                  "type": "string"
                },
                "status": {
                  "description": "[ACTIVE, INACTIVE] - Default: ACTIVE",
                  "type": "string",
                  "format": "enum"
                },
                "line_number": {
                  "description": "Line number",
                  "type": "number"
                },
                "description": {
                  "description": "Line description",
                  "type": "string"
                },
                "quantity": {
                  "description": "Line quantity",
                  "type": "number"
                },
                "unit_price": {
                  "description": "Line unit price",
                  "$ref": "#/definitions/price"
                },
                "total_price": {
                  "description": "Line total price, calculated using unit_price and quantity",
                  "$ref": "#/definitions/price",
                  "readOnly": true
                }
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "contact_channel": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "contact_channel": {
          "type": "object",
          "properties": {
            "skype": {
              "description": "Skype account",
              "type": "string"
            }
          }
        }
      }
    },
    "email": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "address": {
              "description": "Primary email address",
              "type": "string"
            },
            "address2": {
              "description": "Secondary email address",
              "type": "string"
            }
          }
        }
      }
    },
    "address": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "website": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "url": {
              "description": "Primary website url",
              "type": "string"
            },
            "url2": {
              "description": "Secondary website url",
              "type": "string"
            }
          }
        }
      }
    },
    "phone": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "price": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "price": {
          "type": "object",
          "properties": {
            "total_amount": {
              "description": "Total amount including taxes",
              "type": "number"
            },
            "net_amount": {
              "description": "Net amount excluding taxes",
              "type": "number"
            },
            "tax_amount": {
              "description": "Total tax amount",
              "type": "number"
            },
            "tax_rate": {
              "description": "Applicable tax rate",
              "type": "number"
            },
            "currency": {
              "description": "Price currency (defaults to Company currency)",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

Get schema
GET/api/v2/json_schema/credit_payments

Attributes

Field Type Description
resource_type String Resource type name
id String Credit payment UUID
channel_id String Channel ID (org-xxx)
group_id String Group ID (cld-xxx)
created_at Date Time Object creation timestamp
updated_at Date Time Object last update timestamp
code String Code, auto-generated if not specified
status Enum [DRAFT, SUBMITTED, AUTHORISED, INACTIVE, APPLIED, UNAPPLIED] - Default: DRAFT
type Enum [CUSTOMER, SUPPLIER] - Default: CUSTOMER
title String Credit payment title
transaction_date Date Time Transaction date
transaction_number String Transaction reference
public_note String Note visible on the document
private_note String Private internal note
organization_id Reference Organization that made the credit payment
person_id Reference Person that made the credit payment
account_id Reference Account the credit payment was made on
payment_method_id Reference PaymentMethod used for the credit payment
amount Price Credit payment total amount, calculated with the lines
unapplied_amount Number Credit payment total unapplied amount
process_payment Boolean Is the credit payment processed
linked_transactions Array Credit payment linked transactions
lines Array Transaction details
CreditPayments LinkedTransactions attributes
Field Type Description
applied_amount Number Linked transaction applied amount
class Enum Linked transaction class: [Invoice, Payment, …]
id String Linked transaction UUID
CreditPayments Lines attributes
Field Type Description
id String Line id
status Enum [ACTIVE, INACTIVE] - Default: ACTIVE
line_number Number Line number
description String Line description
quantity Number Line quantity
unit_price Price Line unit price
total_price Price Line total price, calculated using unit_price and quantity

Credit Payments List

GET https://api-connec.maestrano.com/api/v2/:group_id/credit_payments
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "credit_payments": [
    {
      "id": "815743a0-1915-0134-bd38-745c899ef027",
      "code": "DE3",
      "transaction_number": "112",
      "title": "Credit payment",
      "amount": {
        "total_amount": 12,
        "net_amount": 12,
        "currency": "USD"
      },
      "unapplied_amount": 0,
      "transaction_date": "2015-10-01T23:00:00Z",
      "status": "DRAFT",
      "private_note": "private note",
      "public_note": "public note",
      "organization_id": "3f58c721-5102-0132-6600-600308937d74",
      "person_id": "1258c721-5102-0132-6600-600308937d71",
      "account_id": "f258c721-5102-0132-6600-600308937d04",
      "lines": [
        {
          "id": "12",
          "line_number": 0,
          "description": "...",
          "status": "ACTIVE",
          "quantity": 1,
          "unit_price": {
            "net_amount": 12
          },
          "total_price": {
            "net_amount": 12
          }
        }
      ],
      "linked_transactions": [
        {
          "applied_amount": 12,
          "class": "Invoice",
          "id": "q258c721-5102-0132-6600-600308937d01"
        }
      ],
      "created_at": "2016-06-20T13:04:54Z",
      "updated_at": "2016-06-20T13:04:54Z",
      "group_id": "org-fbba",
      "channel_id": "org-fbba",
      "resource_type": "credit_payments"
    }
  ]
}

Get Credit Payments
GET/api/v2/:group_id/credit_payments

Get the list of credPt payments.


POST https://api-connec.maestrano.com/api/v2/:group_id/credit_payments
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "credit_payments": {
    "title": "Credit payment"
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
  "credit_payments": {
    "id": "e32303c1-5102-0132-661e-600308937d74",
    "group_id": "cld-4d7f86",
    "created_at": "2014-12-18T03:42:45Z",
    "updated_at": "2014-12-18T03:42:45Z",
    "title": "Credit payment"
  }
}

Create New Credit payment
POST/api/v2/:group_id/credit_payments

Create a new credit payment.


Credit payment

GET https://api-connec.maestrano.com/api/v2/:group_id/credit_payments/815743a0-1915-0134-bd38-745c899ef027
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "credit_payments": {
    "id": "815743a0-1915-0134-bd38-745c899ef027",
    "code": "DE3",
    "transaction_number": "112",
    "title": "Credit payment",
    "amount": {
      "net_amount": 12
    },
    "transaction_date": "2015-10-01T23:00:00Z",
    "status": "DRAFT",
    "private_note": "private note",
    "public_note": "public note",
    "organization_id": "3f58c721-5102-0132-6600-600308937d74",
    "person_id": "1258c721-5102-0132-6600-600308937d71",
    "account_id": "f258c721-5102-0132-6600-600308937d04",
    "lines": [
      {
        "id": "12",
        "line_number": 0,
        "description": "...",
        "status": "ACTIVE",
        "quantity": 1,
        "unit_price": {
          "net_amount": 12
        },
        "total_price": {
          "net_amount": 12
        }
      }
    ],
    "linked_transactions": [
      {
        "applied_amount": 12,
        "class": "Invoice",
        "id": "q258c721-5102-0132-6600-600308937d01"
      }
    ],
    "created_at": "2016-06-20T13:04:54Z",
    "updated_at": "2016-06-20T13:04:54Z",
    "group_id": "org-fbba",
    "channel_id": "org-fbba",
    "resource_type": "credit_payments"
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "48427741-0395-0134-53b9-5969c36333f5",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Get Credit payment
GET/api/v2/:group_id/credit_payments/{id}

Get a single credit payment.

URI Parameters
HideShow
id
string (required) Example: 815743a0-1915-0134-bd38-745c899ef027

The credit payment ID


PUT https://api-connec.maestrano.com/api/v2/:group_id/credit_payments/815743a0-1915-0134-bd38-745c899ef027
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "credit_payments": {
    "title": "Credit payment"
  }
}
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "credit_payments": {
    "id": "815743a0-1915-0134-bd38-745c899ef027",
    "code": "DE3",
    "transaction_number": "112",
    "title": "Credit payment",
    "amount": {
      "net_amount": 12
    },
    "transaction_date": "2015-10-01T23:00:00Z",
    "status": "DRAFT",
    "private_note": "private note",
    "public_note": "public note",
    "organization_id": "3f58c721-5102-0132-6600-600308937d74",
    "person_id": "1258c721-5102-0132-6600-600308937d71",
    "account_id": "f258c721-5102-0132-6600-600308937d04",
    "lines": [
      {
        "id": "12",
        "line_number": 0,
        "description": "...",
        "status": "ACTIVE",
        "quantity": 1,
        "unit_price": {
          "net_amount": 12
        },
        "total_price": {
          "net_amount": 12
        }
      }
    ],
    "linked_transactions": [
      {
        "applied_amount": 12,
        "class": "Invoice",
        "id": "q258c721-5102-0132-6600-600308937d01"
      }
    ],
    "created_at": "2016-06-20T13:04:54Z",
    "updated_at": "2016-06-20T13:04:54Z",
    "group_id": "org-fbba",
    "channel_id": "org-fbba",
    "resource_type": "credit_payments"
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "48427741-0395-0134-53b9-5969c36333f5",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Update a Credit payment
PUT/api/v2/:group_id/credit_payments/{id}

Update a single credit payment

URI Parameters
HideShow
id
string (required) Example: 815743a0-1915-0134-bd38-745c899ef027

The credit payment ID


Deposits

Deposits JSON schema

A deposit object is a transaction that records one or more deposits of fund to the specified account.

GET https://api-connec.maestrano.com/api/v2/json_schema/deposits
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "deposits": {
      "type": "array",
      "items": {
        "type": "object",
        "uniq": [
          "id",
          "code"
        ],
        "properties": {
          "resource_type": {
            "description": "Resource type name",
            "type": "string",
            "readOnly": true
          },
          "id": {
            "description": "Deposit UUID",
            "type": "string",
            "readOnly": true
          },
          "channel_id": {
            "type": "string",
            "description": "Channel ID (org-xxx)",
            "readOnly": true
          },
          "group_id": {
            "description": "Group ID (cld-xxx)",
            "type": "string",
            "readOnly": true
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Code, auto-generated if not specified",
            "type": "string"
          },
          "status": {
            "description": "[DRAFT, SUBMITTED, AUTHORISED, INACTIVE, APPLIED, UNAPPLIED] - Default: DRAFT",
            "type": "string",
            "format": "enum"
          },
          "title": {
            "description": "Deposit title",
            "type": "string"
          },
          "transaction_number": {
            "description": "Transaction reference",
            "type": "string"
          },
          "transaction_date": {
            "description": "Transaction date",
            "type": "string",
            "format": "date-time"
          },
          "public_note": {
            "description": "Note visible on the document",
            "type": "string"
          },
          "private_note": {
            "description": "Private internal note",
            "type": "string"
          },
          "organization_id": {
            "description": "#Organization that made the deposit",
            "type": "string",
            "format": "reference"
          },
          "person_id": {
            "description": "#Person that made the deposit",
            "type": "string",
            "format": "reference"
          },
          "account_id": {
            "description": "#Account the deposit was made on",
            "type": "string",
            "format": "reference"
          },
          "amount": {
            "description": "Deposit total amount, calculated with the lines",
            "$ref": "#/definitions/price",
            "readOnly": true
          },
          "lines": {
            "description": "Transaction details",
            "type": "array",
            "items": {
              "type": "object",
              "uniq": [
                "id"
              ],
              "required": [
                "quantity",
                "unit_price"
              ],
              "properties": {
                "id": {
                  "description": "Line id",
                  "type": "string"
                },
                "status": {
                  "description": "[ACTIVE, INACTIVE] - Default: ACTIVE",
                  "type": "string",
                  "format": "enum"
                },
                "line_number": {
                  "description": "Line number",
                  "type": "number"
                },
                "description": {
                  "description": "Line description",
                  "type": "string"
                },
                "quantity": {
                  "description": "Line quantity",
                  "type": "number"
                },
                "unit_price": {
                  "description": "Line unit price",
                  "$ref": "#/definitions/price"
                },
                "total_price": {
                  "description": "Line total price, calculated using unit_price and quantity",
                  "$ref": "#/definitions/price",
                  "readOnly": true
                }
              }
            }
          },
          "cash_back": {
            "type": "object",
            "properties": {
              "account_id": {
                "description": "Cash back #account",
                "type": "string",
                "format": "reference"
              },
              "amount": {
                "description": "Cash back amount",
                "type": "number"
              },
              "memo": {
                "description": "Cash back memo",
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "contact_channel": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "contact_channel": {
          "type": "object",
          "properties": {
            "skype": {
              "description": "Skype account",
              "type": "string"
            }
          }
        }
      }
    },
    "email": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "address": {
              "description": "Primary email address",
              "type": "string"
            },
            "address2": {
              "description": "Secondary email address",
              "type": "string"
            }
          }
        }
      }
    },
    "address": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "website": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "url": {
              "description": "Primary website url",
              "type": "string"
            },
            "url2": {
              "description": "Secondary website url",
              "type": "string"
            }
          }
        }
      }
    },
    "phone": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "price": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "price": {
          "type": "object",
          "properties": {
            "total_amount": {
              "description": "Total amount including taxes",
              "type": "number"
            },
            "net_amount": {
              "description": "Net amount excluding taxes",
              "type": "number"
            },
            "tax_amount": {
              "description": "Total tax amount",
              "type": "number"
            },
            "tax_rate": {
              "description": "Applicable tax rate",
              "type": "number"
            },
            "currency": {
              "description": "Price currency (defaults to Company currency)",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

Get schema
GET/api/v2/json_schema/deposits

Attributes

Field Type Description
resource_type String Resource type name
id String Deposit UUID
channel_id String Channel ID (org-xxx)
group_id String Group ID (cld-xxx)
created_at Date Time Object creation timestamp
updated_at Date Time Object last update timestamp
code String Code, auto-generated if not specified
status Enum [DRAFT, SUBMITTED, AUTHORISED, INACTIVE, APPLIED, UNAPPLIED] - Default: DRAFT
title String Deposit title
transaction_number String Transaction reference
transaction_date Date Time Transaction date
public_note String Note visible on the document
private_note String Private internal note
organization_id Reference Organization that made the deposit
person_id Reference Person that made the deposit
account_id Reference Account the deposit was made on
amount Price Deposit total amount, calculated with the lines
lines Array Transaction details
cash_back Object
Deposits Lines attributes
Field Type Description
id String Line id
status Enum [ACTIVE, INACTIVE] - Default: ACTIVE
line_number Number Line number
description String Line description
quantity Number Line quantity
unit_price Price Line unit price
total_price Price Line total price, calculated using unit_price and quantity
Deposits CashBack attributes
Field Type Description
account_id Reference Cash back account
amount Number Cash back amount
memo String Cash back memo

Deposits List

GET https://api-connec.maestrano.com/api/v2/:group_id/deposits
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "deposits": [
    {
      "id": "815743a0-1915-0134-bd38-745c899ef027",
      "code": "DE3",
      "transaction_number": "112",
      "title": "Deposit",
      "amount": {
        "net_amount": 12
      },
      "transaction_date": "2015-10-01T23:00:00Z",
      "status": "DRAFT",
      "private_note": "private note",
      "public_note": "public note",
      "organization_id": "3f58c721-5102-0132-6600-600308937d74",
      "person_id": "1258c721-5102-0132-6600-600308937d71",
      "account_id": "f258c721-5102-0132-6600-600308937d04",
      "lines": [
        {
          "id": "12",
          "line_number": 0,
          "description": "...",
          "status": "ACTIVE",
          "quantity": 1,
          "unit_price": {
            "net_amount": 12
          },
          "total_price": {
            "net_amount": 12
          }
        }
      ],
      "cash_back": {
        "account_id": "4r58c721-5102-0132-6600-600308937d23",
        "amount": 2,
        "memo": "..."
      },
      "created_at": "2016-06-20T13:04:54Z",
      "updated_at": "2016-06-20T13:04:54Z",
      "group_id": "org-fbba",
      "channel_id": "org-fbba",
      "resource_type": "deposits"
    }
  ]
}

Get Deposits
GET/api/v2/:group_id/deposits

Get the list of deposits.


POST https://api-connec.maestrano.com/api/v2/:group_id/deposits
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "deposits": {
    "title": "Deposit"
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
  "deposits": {
    "id": "e32303c1-5102-0132-661e-600308937d74",
    "group_id": "cld-4d7f86",
    "created_at": "2014-12-18T03:42:45Z",
    "updated_at": "2014-12-18T03:42:45Z",
    "title": "Deposit"
  }
}

Create New Deposit
POST/api/v2/:group_id/deposits

Create a new deposit.


Deposit

GET https://api-connec.maestrano.com/api/v2/:group_id/deposits/815743a0-1915-0134-bd38-745c899ef027
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "deposits": {
    "id": "815743a0-1915-0134-bd38-745c899ef027",
    "code": "DE3",
    "transaction_number": "112",
    "title": "Deposit",
    "amount": {
      "net_amount": 12
    },
    "transaction_date": "2015-10-01T23:00:00Z",
    "status": "DRAFT",
    "private_note": "private note",
    "public_note": "public note",
    "organization_id": "3f58c721-5102-0132-6600-600308937d74",
    "person_id": "1258c721-5102-0132-6600-600308937d71",
    "account_id": "f258c721-5102-0132-6600-600308937d04",
    "lines": [
      {
        "id": "12",
        "line_number": 0,
        "description": "...",
        "status": "ACTIVE",
        "quantity": 1,
        "unit_price": {
          "net_amount": 12
        },
        "total_price": {
          "net_amount": 12
        }
      }
    ],
    "cash_back": {
      "account_id": "4r58c721-5102-0132-6600-600308937d23",
      "amount": 2,
      "memo": "..."
    },
    "created_at": "2016-06-20T13:04:54Z",
    "updated_at": "2016-06-20T13:04:54Z",
    "group_id": "org-fbba",
    "channel_id": "org-fbba",
    "resource_type": "deposits"
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "48427741-0395-0134-53b9-5969c36333f5",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Get Deposit
GET/api/v2/:group_id/deposits/{id}

Get a single deposit.

URI Parameters
HideShow
id
string (required) Example: 815743a0-1915-0134-bd38-745c899ef027

The deposit ID


PUT https://api-connec.maestrano.com/api/v2/:group_id/deposits/815743a0-1915-0134-bd38-745c899ef027
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "deposits": {
    "title": "Deposit"
  }
}
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "deposits": {
    "id": "815743a0-1915-0134-bd38-745c899ef027",
    "code": "DE3",
    "transaction_number": "112",
    "title": "Deposit",
    "amount": {
      "net_amount": 12
    },
    "transaction_date": "2015-10-01T23:00:00Z",
    "status": "DRAFT",
    "private_note": "private note",
    "public_note": "public note",
    "organization_id": "3f58c721-5102-0132-6600-600308937d74",
    "person_id": "1258c721-5102-0132-6600-600308937d71",
    "account_id": "f258c721-5102-0132-6600-600308937d04",
    "lines": [
      {
        "id": "12",
        "line_number": 0,
        "description": "...",
        "status": "ACTIVE",
        "quantity": 1,
        "unit_price": {
          "net_amount": 12
        },
        "total_price": {
          "net_amount": 12
        }
      }
    ],
    "cash_back": {
      "account_id": "4r58c721-5102-0132-6600-600308937d23",
      "amount": 2,
      "memo": "..."
    },
    "created_at": "2016-06-20T13:04:54Z",
    "updated_at": "2016-06-20T13:04:54Z",
    "group_id": "org-fbba",
    "channel_id": "org-fbba",
    "resource_type": "deposits"
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "48427741-0395-0134-53b9-5969c36333f5",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Update a Deposit
PUT/api/v2/:group_id/deposits/{id}

Update a single deposit

URI Parameters
HideShow
id
string (required) Example: 815743a0-1915-0134-bd38-745c899ef027

The deposit ID


Employees

An employee represents a person employed by your company.

Employees JSON schema

GET https://api-connec.maestrano.com/api/v2/json_schema/employees
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "people": {
      "type": "array",
      "items": {
        "type": "object",
        "uniq": [
          "id",
          "code"
        ],
        "properties": {
          "resource_type": {
            "description": "Resource type name",
            "type": "string",
            "readOnly": true
          },
          "id": {
            "description": "Employee UUID",
            "type": "string",
            "readOnly": true
          },
          "channel_id": {
            "type": "string",
            "description": "Channel ID (org-xxx)",
            "readOnly": true
          },
          "group_id": {
            "description": "Group ID (cld-xxx)",
            "type": "string",
            "readOnly": true
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Code, auto-generated if not specified",
            "type": "string"
          },
          "status": {
            "description": "[ACTIVE, INACTIVE] - Default: ACTIVE",
            "type": "string",
            "format": "enum"
          },
          "title": {
            "description": "Employee title (Mr, Mrs, ...)",
            "type": "string"
          },
          "first_name": {
            "description": "Employee first name",
            "type": "string"
          },
          "last_name": {
            "description": "Employee last name",
            "type": "string"
          },
          "middle_name": {
            "description": "Employee middle name",
            "type": "string"
          },
          "full_name": {
            "description": "Employee full name",
            "type": "string"
          },
          "birth_date": {
            "description": "Employee date of birth",
            "type": "string",
            "format": "date-time"
          },
          "gender": {
            "description": "Gender, one of [MALE, FEMALE]",
            "type": "string",
            "format": "enum"
          },
          "mno_user_id": {
            "description": "Maestrano User ID to match a User created via SSO if applicable",
            "type": "string"
          },
          "social_security_number": {
            "description": "Employee Social Security Number",
            "type": "string"
          },
          "hired_date": {
            "description": "Employment start date",
            "type": "string",
            "format": "date-time"
          },
          "released_date": {
            "description": "Employment end date",
            "type": "string",
            "format": "date-time"
          },
          "job_status": {
            "description": "Job status (Current, Released, etc...)",
            "type": "string"
          },
          "bill_rate": {
            "description": "Employee default billing rate",
            "type": "number"
          },
          "location": {
            "description": "Employee location",
            "type": "string"
          },
          "supervisor": {
            "description": "Employee supervisor name",
            "type": "string"
          },
          "job_title": {
            "description": "Employee job title",
            "type": "string"
          },
          "note": {
            "description": "Employee private note",
            "type": "string"
          },
          "address": {
            "description": "Employee personal address",
            "$ref": "#/definitions/address"
          },
          "email": {
            "description": "Person email addresses",
            "$ref": "#/definitions/email"
          },
          "phone": {
            "description": "Person work phone and fax numbers",
            "$ref": "#/definitions/phone"
          },
          "bank_accounts": {
            "description": "Person bank accounts details",
            "type": "array",
            "items": {
              "$ref": "#/definitions/bank_account"
            }
          },
          "pay_schedule_id": {
            "description": "Employee Pay Schedule reference",
            "type": "string"
          },
          "employee_salaries": {
            "description": "Employee default salary breakdown",
            "type": "array",
            "readOnly": true,
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "EmployeeSalary ID",
                  "type": "string"
                },
                "type": {
                  "description": "EmployeeSalary Type (ANNUALSALARY, HOURLY, USEEARNINGSRATE, ENTEREARNINGSRATE)",
                  "type": "string"
                },
                "name": {
                  "description": "EmployeeSalary Name",
                  "type": "string"
                },
                "frequency": {
                  "description": "EmployeeSalary Frequency (WEEKLY, FORTNIGHTLY, MONTHLY)",
                  "type": "string"
                },
                "currency": {
                  "description": "EmployeeSalary currency",
                  "type": "string"
                },
                "annual_salary": {
                  "description": "Annual salary amount",
                  "type": "number"
                },
                "hourly_rate": {
                  "description": "Hourly rate",
                  "type": "number"
                },
                "hours_per_week": {
                  "description": "Default number of hours worked per week",
                  "type": "number"
                },
                "effective_date": {
                  "description": "Date of salary payment",
                  "type": "string",
                  "format": "date-time"
                },
                "pay_item_id": {
                  "description": "Pay Item reference",
                  "type": "string"
                }
              }
            }
          },
          "work_locations": {
            "description": "Employee Work Locations",
            "type": "array",
            "readOnly": true,
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "EmployeeWorkLocation ID",
                  "type": "string"
                },
                "role": {
                  "description": "Employee role at location",
                  "type": "string"
                },
                "description": {
                  "description": "Employee work location description",
                  "type": "string"
                },
                "primary": {
                  "description": "Employee primary work location (only one work location can be flagged as promary)",
                  "type": "boolean"
                },
                "work_location_id": {
                  "description": "Work Location reference",
                  "type": "string"
                }
              }
            }
          },
          "opening_balances": {
            "description": "Employee Opening Balances",
            "type": "array",
            "readOnly": true,
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "Employee Opening Balance ID",
                  "type": "string"
                },
                "status": {
                  "description": "Employee Opening Balance (ACTIVE or INACTIVE)",
                  "type": "string"
                },
                "type": {
                  "description": "Employee Opening Balance type",
                  "type": "string"
                },
                "name": {
                  "description": "Employee Opening Balance name",
                  "type": "string"
                },
                "description": {
                  "description": "Employee Opening Balance description",
                  "type": "string"
                },
                "pay_item_id": {
                  "description": "Pay Item reference",
                  "type": "string"
                },
                "units": {
                  "description": "Units allocated",
                  "type": "number"
                },
                "amount": {
                  "description": "Amount allocated",
                  "type": "number"
                },
                "hours": {
                  "description": "Hours allocated",
                  "type": "number"
                },
                "balance": {
                  "description": "Balance allocated",
                  "type": "number"
                },
                "percentage": {
                  "description": "Percentage allocated",
                  "type": "number"
                },
                "rate_per_unit": {
                  "description": "Rate per unit",
                  "type": "string"
                },
                "type_of_units": {
                  "description": "Type on units allocated (HOURS, UNITS)",
                  "type": "string"
                },
                "calculation_type": {
                  "description": "(FIXEDAMOUNT, PERCENTAGEOFEARNINGS, UNIT)",
                  "type": "string"
                },
                "contribution_type": {
                  "description": "(SGC, SALARYSACRIFICE)",
                  "type": "string"
                },
                "tax_type": {
                  "description": "(PAYG Tax, ...)",
                  "type": "string"
                },
                "currency": {
                  "description": "Currency",
                  "type": "string"
                }
              }
            }
          },
          "current_balances": {
            "description": "Employee Current Balances",
            "type": "array",
            "readOnly": true,
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "Employee Current Balance ID",
                  "type": "string"
                },
                "status": {
                  "description": "Employee Current Balance (ACTIVE or INACTIVE)",
                  "type": "string"
                },
                "type": {
                  "description": "Employee Current Balance type",
                  "type": "string"
                },
                "name": {
                  "description": "Employee Current Balance name",
                  "type": "string"
                },
                "description": {
                  "description": "Employee Current Balance description",
                  "type": "string"
                },
                "pay_item_id": {
                  "description": "Pay Item reference",
                  "type": "string"
                },
                "units": {
                  "description": "Units allocated",
                  "type": "number"
                },
                "amount": {
                  "description": "Amount allocated",
                  "type": "number"
                },
                "hours": {
                  "description": "Hours allocated",
                  "type": "number"
                },
                "balance": {
                  "description": "Balance allocated",
                  "type": "number"
                },
                "percentage": {
                  "description": "Percentage allocated",
                  "type": "number"
                },
                "rate_per_unit": {
                  "description": "Rate per unit",
                  "type": "string"
                },
                "type_of_units": {
                  "description": "Type on units allocated (HOURS, UNITS)",
                  "type": "string"
                },
                "calculation_type": {
                  "description": "(FIXEDAMOUNT, PERCENTAGEOFEARNINGS, UNIT)",
                  "type": "string"
                },
                "contribution_type": {
                  "description": "(SGC, SALARYSACRIFICE)",
                  "type": "string"
                },
                "tax_type": {
                  "description": "(PAYG Tax, ...)",
                  "type": "string"
                },
                "currency": {
                  "description": "Currency",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "contact_channel": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "contact_channel": {
          "type": "object",
          "properties": {
            "skype": {
              "description": "Skype account",
              "type": "string"
            }
          }
        }
      }
    },
    "email": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "address": {
              "description": "Primary email address",
              "type": "string"
            },
            "address2": {
              "description": "Secondary email address",
              "type": "string"
            }
          }
        }
      }
    },
    "address": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "website": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "url": {
              "description": "Primary website url",
              "type": "string"
            },
            "url2": {
              "description": "Secondary website url",
              "type": "string"
            }
          }
        }
      }
    },
    "phone": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "bank_account": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "bank_account": {
          "type": "object",
          "properties": {
            "bic_code": {
              "type": "string"
            },
            "account_number": {
              "type": "string"
            },
            "bsb_number": {
              "type": "string"
            }
          }
        }
      }
    },
    "price": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "price": {
          "type": "object",
          "properties": {
            "total_amount": {
              "description": "Total amount including taxes",
              "type": "number"
            },
            "net_amount": {
              "description": "Net amount excluding taxes",
              "type": "number"
            },
            "tax_amount": {
              "description": "Total tax amount",
              "type": "number"
            },
            "tax_rate": {
              "description": "Applicable tax rate",
              "type": "number"
            },
            "currency": {
              "description": "Price currency (defaults to Company currency)",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

Get schema
GET/api/v2/json_schema/employees

Attributes

Field Type Description
resource_type String Resource type name
id String Employee UUID
channel_id String Channel ID (org-xxx)
group_id String Group ID (cld-xxx)
created_at Date Time Object creation timestamp
updated_at Date Time Object last update timestamp
code String Code, auto-generated if not specified
status Enum [ACTIVE, INACTIVE] - Default: ACTIVE
title String Employee title (Mr, Mrs, …)
first_name String Employee first name
last_name String Employee last name
middle_name String Employee middle name
full_name String Employee full name
birth_date Date Time Employee date of birth
gender Enum Gender, one of [MALE, FEMALE]
mno_user_id String Maestrano User ID to match a User created via SSO if applicable
social_security_number String Employee Social Security Number
hired_date Date Time Employment start date
released_date Date Time Employment end date
job_status String Job status (Current, Released, etc…)
bill_rate Number Employee default billing rate
location String Employee location
supervisor String Employee supervisor name
job_title String Employee job title
note String Employee private note
address Address Employee personal address
email Email Person email addresses
phone Phone Person work phone and fax numbers
pay_schedule_id String Employee Pay Schedule reference
bank_accounts Array Person bank accounts details
employee_salaries Array Employee default salary breakdown
work_locations Array Employee Work Locations
opening_balances Array Employee Opening Balances
current_balances Array Employee Current Balances
Employees BankAccounts attributes
Field Type Description
Employees EmployeeSalaries attributes
Field Type Description
id String EmployeeSalary ID
type String EmployeeSalary Type (ANNUALSALARY, HOURLY, USEEARNINGSRATE, ENTEREARNINGSRATE)
name String EmployeeSalary Name
frequency String EmployeeSalary Frequency (WEEKLY, FORTNIGHTLY, MONTHLY)
currency String EmployeeSalary currency
annual_salary Number Annual salary amount
hourly_rate Number Hourly rate
hours_per_week Number Default number of hours worked per week
effective_date Date Time Date of salary payment
pay_item_id String Pay Item reference
Employees WorkLocations attributes
Field Type Description
id String EmployeeWorkLocation ID
role String Employee role at location
description String Employee work location description
primary Boolean Employee primary work location (only one work location can be flagged as promary)
work_location_id String Work Location reference
Employees OpeningBalances attributes
Field Type Description
id String Employee Opening Balance ID
status String Employee Opening Balance (ACTIVE or INACTIVE)
type String Employee Opening Balance type
name String Employee Opening Balance name
description String Employee Opening Balance description
pay_item_id String Pay Item reference
units Number Units allocated
amount Number Amount allocated
hours Number Hours allocated
balance Number Balance allocated
percentage Number Percentage allocated
rate_per_unit String Rate per unit
type_of_units String Type on units allocated (HOURS, UNITS)
calculation_type String (FIXEDAMOUNT, PERCENTAGEOFEARNINGS, UNIT)
contribution_type String (SGC, SALARYSACRIFICE)
tax_type String (PAYG Tax, …)
currency String Currency
Employees CurrentBalances attributes
Field Type Description
id String Employee Current Balance ID
status String Employee Current Balance (ACTIVE or INACTIVE)
type String Employee Current Balance type
name String Employee Current Balance name
description String Employee Current Balance description
pay_item_id String Pay Item reference
units Number Units allocated
amount Number Amount allocated
hours Number Hours allocated
balance Number Balance allocated
percentage Number Percentage allocated
rate_per_unit String Rate per unit
type_of_units String Type on units allocated (HOURS, UNITS)
calculation_type String (FIXEDAMOUNT, PERCENTAGEOFEARNINGS, UNIT)
contribution_type String (SGC, SALARYSACRIFICE)
tax_type String (PAYG Tax, …)
currency String Currency

Employee List

GET https://api-connec.maestrano.com/api/v2/:group_id/employees
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
    "employees": [
        {
          "id": "68d63921-bee9-0132-2fbd-56847afe9799",
          "code": "EM9110",
          "first_name": "Benjamin",
          "last_name": "Wilson",
          "employee_id": "001450",
          "mno_user_id": "usr-afd4",
          "birth_date": "1980-10-17",
          "gender": "MALE",
          "social_security_number": "512-17-4444",
          "hired_date": "2015-04-18",
          "job_title": "Sales Manger",
          "pay_schedule_id": "50847c11-bee9-0132-2f6e-56847afe9799",
          "address": {
            "billing": {
              "line1": "342 De Carlo Ave",
              "city": "Richmond",
              "region": "CA",
              "postal_code": "94801",
              "country": "United States"
            },
            "shipping": {
              "line1": "342 De Carlo Ave",
              "city": "Richmond",
              "region": "CA",
              "postal_code": "94801",
              "country": "United States"
            }
          },
          "email": {
            "address": "ben.wilson@test.com"
          },
          "phone": {
            "landline": "408-123-4567"
          },
          "bank_accounts": [
            {
                "bic_code": "12345-12310",
                "account_number": "78945 4410",
                "bsb_number": "123-123"
            },
          ]
          "employee_salaries": [
            {
              "id": "5523221d0202cb423200d888",
              "type": "HOURLY",
              "name": "Regular Hours",
              "currency": "USD",
              "hourly_rate": 32.5,
              "hours_per_week": 40,
              "pay_item_id": "54fc6fa1-bee9-0132-2f72-56847afe9799"
            },
            {
              "id": "6623221d0202cb423200d8ef",
              "type": "SALARY",
              "frequency": "TWICEAMONTH",
              "name": "Bonus",
              "currency": "USD",
              "hourly_rate": 10.5,
              "hours_per_week": 40,
              "annual_salary": 10000,
              "pay_item_id": "54fc6fa1-bee9-0132-2f72-56847afe9799"
            }
          ],
          "work_locations": [
            {
              "id": "561ef5f30202cbfc3300236b",
              "work_location_id": "398cb8f1-5503-0133-9e89-56847afe9799",
              "role": "Responsible",
              "description": "Responsible for the San Francisco office",
              "primary": true
            },
            {
              "id": "561ef5f30202cbfc3300236d",
              "work_location_id": "3990d7a0-5503-0133-9e8f-56847afe9799",
              "role": "Manager"
            }
          ],
          "updated_at": "2015-04-22T00:58:39.000Z",
          "created_at": "2015-04-07T00:17:33.199Z"
        }
    ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",

  "type": "object",
  "properties": {
    "employees": {
      "id": "employees",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Employee UUID",
            "type": "string",
            "readOnly": true
          },
          "group_id": {
            "description": "Group ID",
            "type": "string"
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Unique code, auto-generated if not specified",
            "type": "string"
          },
          "title": {
            "description": "Employee title",
            "type": "string"
          },
          "first_name": {
            "description": "Employee first name",
            "type": "string"
          },
          "last_name": {
            "description": "Employee last name",
            "type": "string"
          },
          "middle_name": {
            "description": "Employee middle name",
            "type": "string"
          },
          "full_name": {
            "description": "Employee full name",
            "type": "string"
          },
          "birth_date": {
            "description": "Employee date of birth",
            "type": "string",
            "format": "date-time"
          },
          "gender": {
            "description": "Employee gender",
            "enum": ["MALE", "FEMALE"]
          },
          "employee_id": {
            "description": "A unique Employee ID",
            "type": "string"
          },
          "mno_user_id": {
            "description": "Maestrano unique user_id",
            "type": "string"
          },
          "social_security_number": {
            "description": "Employee social security number",
            "type": "string"
          },
          hired_date": {
            "description": "Employee work start date",
            "type": "string",
            "format": "date-time"
          },
          released_date": {
            "description": "Employee work end date",
            "type": "string",
            "format": "date-time"
          },
          "job_status": {
            "description": "Employee job status",
            "type": "string"
          },
          "bill_rate": {
            "description": "Employee bill rate",
            "type": "number"
          },
          "location": {
            "description": "Employee work location",
            "type": "string"
          },
          "supervisor": {
            "description": "Employee supervisor name",
            "type": "string"
          },
          "job_title": {
            "description": "Employee job title",
            "type": "string"
          },
          "note": {
            "description": "Note",
            "type": "string"
          },
          "address": {
            "$ref": "#/definitions/address_group"
          },
          "email": {
            "type": "object",
            "properties": {
              "address": {"type": "string", "description": "Primary email address"},
              "address2": {"type": "string", "description": "Secondary email address"}
            }
          },
          "phone": {
            "$ref": "#/definitions/telephone_group"
          },
          "bank_accounts": {
            "description": "Person bank accounts details",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
              "$ref": "#/definitions/bank_account"
          },
          "pay_schedule_id": {
            "description": "Pay Schedule UUID the employee is attached to",
            "type": "string"
          },
          "employee_salaries": {
            "description": "The list of salary components the employee is entitled to",
            "type": "array",
            "items": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "description": "Employee Salary ID",
                    "type": "string"
                  },
                  "type": {
                    "description": "Salary period type",
                    "enum": ["SALARY", "MONTHLY", "HOURLY"]
                  },
                  "frequency": {
                    "description": "Pay frequency, applicable when type is set to SALARY",
                    "enum": ["WEEKLY", "FORTHNIGHTLY", "TWICEAMONTH", "MONTHLY", "YEARLY"]
                  },
                  "name": {
                    "description": "Salary name",
                    "type": "string"
                  },
                  "currency": {
                    "description": "Price currency",
                    "type": "string"
                  },
                  "hourly_rate": {
                    "description": "Salary hourly rate (applicable if type is HOURLY)",
                    "type": "number"
                  },
                  "hours_per_week": {
                    "description": "Regular hours worked per week",
                    "type": "number"
                  },
                  "pay_item_id": {
                    "description": "Reference to the Pay Item",
                    "type": "string"
                  }
                }
              }
            }
          },
          "work_locations": {
            "description": "The list of Work Locations an employee is attached to",
            "type": "array",
            "items": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "description": "Reference of the Work Location",
                    "type": "string"
                  },
                  "work_location_id": {
                    "description": "Reference to the Work Location,
                    "type": "string"
                  },
                  "role": {
                    "description": "Role of the employee for this Work Location,
                    "type": "string"
                  },
                  "description": {
                    "description": "Description of the Employee position at this Work Location,
                    "type": "string"
                  },
                  "primary": {
                    "description": "Is the Employee primary Work Location,
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Get Employee
GET/api/v2/:group_id/employees

Get the list of employees.

Attributes

Field Type Description
id String Employee UUID
group_id String Group ID
created_at Date-time Employee creation date
updated_at Date-time Employee last update date
code String Code, auto-generated if not specified
title String Employee title
first_name String Employee first_name
last_name String Employee last_name
full_name String Employee full_name. Concatenation of title, first_name and last_name if not specified
birth_date Date-time Employee date of birth
gender Enum [FEMALE, MALE]
social_security_number String Employee social security number
job_title String Employee job title
hired_date Date-time Employee work start date
released_date Date-time Employee work end date
job_status String Employee job status
bill_rate Number Employee bill rate
location String Employee work location
supervisor String Employee supervisor name
note String A short note about the employee
employee_id String A uniq employee id
mno_user_id String A uniq Maestrano user id (given during a SSO process)
pay_schedule_id Reference Pay schedule the employee is attached to
address Address group Employee addresses
email Email group Employee emails
phone Phone group Employee phone and fax numbers
bank_accounts Array Employee payment details
employee_salaries Array Salaries the employee may be entitled to
work_locations Array Work locations the employee may work at
Employee salaries attributes
Field Type Description
id String Salary id
type Enum [SALARY, MONTHLY, HOURLY]
frequency Enum Pay frequency, applicable when type is set to SALARY. [WEEKLY, FORTHNIGHTLY, TWICEAMONTH, MONTHLY, YEARLY]
name String Salary name
currency String Salary currency code
annual_salary Number Salary annual amount
hourly_rate Number Salary hourly rate
hours_per_week Number Salary number of hours per week
pay_item_id Reference Pay item associated with the salary
Employee work locations attributes
Field Type Description
id String Employee work location id
work_location_id Reference Work location
role String Employee role at this work location
description String Description of the employee position at this work location
primary Boolean Is the employee primary work location
Bank accounts attributes
Field Type Description
bank_account Bank account Employee bank account payment details

POST https://api-connec.maestrano.com/api/v2/:group_id/employees
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "employees": {
    "first_name": "John",
    "last_name": "Doe",
    "employee_id": "EM0220"
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
  "employees": {
    "id": "e32303c1-5102-0132-661e-600308937d74",
    "group_id": "cld-4d7f86",
    "created_at": "2014-12-18T03:42:45Z",
    "updated_at": "2014-12-18T03:42:45Z",
    "code": "EM17",
    "first_name": "John",
    "last_name": "Doe",
    "employee_id": "EM0220"
  }
}

Create New Employee
POST/api/v2/:group_id/employees

Create a new employee.


Employee

GET https://api-connec.maestrano.com/api/v2/:group_id/employees/e32303c1-5102-0132-661e-600308937d74
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "employees": {
    "id": "3f58a011-5102-0132-65ff-600308937d74",
    "group_id": "cld-f4g8r2g",
    "created_at": "2014-11-18T03:38:13Z",
    "updated_at": "2014-11-18T03:38:13Z",
    "title": "Mr",
    "first_name": "John",
    "last_name": "Doe",
    "full_name": "Mr John Doe",
    "birth_date": "1986-04-02T00:00:00Z",
    "gender": "Male",
    "employee_id": "01410",
    "social_security_number": "554-78562-1140",
    "hired_date": "2012-02-17",
    "released_date": "2012-02-17",
    "job_status": "EMPLOYED",
    "bill_rate": 32.75,
    "location": "San Francisco office",
    "job_title": "Marketing Manager",
    "address": {
      "shipping": {
        "line1": "88 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2088",
        "country": "AU"
      }
    },
    "email": {
      "address": "john@mycompany.com"
    },
    "phone": {
      "landline": "+61 2 8574 1222",
      "mobile": "+61 449 785 122"
    },
    "bank_accounts": [
      {
        "bic_code": "12345-12310",
        "account_number": "78945 4410",
        "bsb_number": "123-123"
      }
    ]
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Get Employee
GET/api/v2/:group_id/employees/{id}

Get a single employee.

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The employee ID


PUT https://api-connec.maestrano.com/api/v2/:group_id/employees/e32303c1-5102-0132-661e-600308937d74
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "employees": {
    "first_name": "John",
    "last_name": "Doe"
  }
}
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "employees": {
    "id": "3f58a011-5102-0132-65ff-600308937d74",
    "group_id": "cld-f4g8r2g",
    "created_at": "2014-11-18T03:38:13Z",
    "updated_at": "2014-11-18T03:38:13Z",
    "title": "Mr",
    "first_name": "John",
    "last_name": "Doe",
    "full_name": "Mr John Doe",
    "birth_date": "1986-04-02T00:00:00Z",
    "gender": "Male",
    "employee_id": "01410",
    "social_security_number": "554-78562-1140",
    "hired_date": "2012-02-17",
    "released_date": "2012-02-17",
    "job_status": "EMPLOYED",
    "bill_rate": 32.75,
    "location": "San Francisco office",
    "job_title": "Marketing Manager",
    "address": {
      "shipping": {
        "line1": "88 Elizabeth Street",
        "line2": "",
        "city": "Sydney",
        "region": "NSW",
        "postal_code": "2088",
        "country": "AU"
      }
    },
    "email": {
      "address": "john@mycompany.com"
    },
    "phone": {
      "landline": "+61 2 8574 1222",
      "mobile": "+61 449 785 122"
    },
    "bank_accounts": [
      {
        "bic_code": "12345-12310",
        "account_number": "78945 4410",
        "bsb_number": "123-123"
      }
    ]
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Update an Employee
PUT/api/v2/:group_id/employees/{id}

Update a single Employee

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The employee ID


Events

Business Rules

It is possible to automatically generate items from an event ticket_classes using the option generate_items. This is useful for an integration with a CRM to generate items to be used for invoicing.

{
  "events": {
    "opts": {"generate_items": true},
    "ticket_classes": [...]
  }
}

Events JSON schema

GET https://api-connec.maestrano.com/api/v2/json_schema/events
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "organizations": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name"
        ],
        "uniq": [
          "id",
          "code"
        ],
        "properties": {
          "resource_type": {
            "description": "Resource type name",
            "type": "string",
            "readOnly": true
          },
          "id": {
            "description": "Event UUID",
            "type": "string",
            "readOnly": true
          },
          "channel_id": {
            "type": "string",
            "description": "Channel ID (org-xxx)",
            "readOnly": true
          },
          "group_id": {
            "description": "Group ID (cld-xxx)",
            "type": "string",
            "readOnly": true
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Code, auto-generated if not specified",
            "type": "string"
          },
          "status": {
            "description": "[DRAFT, LIVE, INACTIVE] - Default: DRAFT",
            "type": "string",
            "format": "enum"
          },
          "name": {
            "description": "Event name",
            "type": "string"
          },
          "description": {
            "description": "Event description",
            "type": "string"
          },
          "url": {
            "description": "Event public page URL",
            "type": "string"
          },
          "timezone": {
            "description": "Event timezone of reference",
            "type": "string"
          },
          "start_date": {
            "description": "Event starting date",
            "type": "string",
            "format": "date-time"
          },
          "end_date": {
            "description": "Event termination date",
            "type": "string",
            "format": "date-time"
          },
          "capacity": {
            "description": "Event total capacity",
            "type": "number"
          },
          "currency": {
            "description": "Event default currency",
            "type": "string"
          },
          "organization_id": {
            "description": "#Organization owning the event",
            "type": "string",
            "format": "reference"
          },
          "person_id": {
            "description": "#Person owning the event",
            "type": "string",
            "format": "reference"
          },
          "venue_id": {
            "description": "#Venue of the Event",
            "type": "string",
            "format": "reference"
          },
          "ticket_classes": {
            "description": "Event tickets types",
            "type": "array",
            "items": {
              "type": "object",
              "uniq": [
                "id"
              ],
              "required": [
                "name"
              ],
              "properties": {
                "id": {
                  "description": "Ticket id",
                  "type": "string"
                },
                "code": {
                  "description": "Code, auto-generated if not specified",
                  "type": "string"
                },
                "name": {
                  "description": "Ticket name",
                  "type": "string"
                },
                "description": {
                  "description": "Ticket description",
                  "type": "string"
                },
                "donation": {
                  "description": "Is based on donations",
                  "type": "boolean"
                },
                "free": {
                  "description": "Is a free ticket",
                  "type": "boolean"
                },
                "minimum_quantity": {
                  "description": "Minimum quantity to purchase in a single transaction",
                  "type": "number"
                },
                "maximum_quantity": {
                  "description": "Maximum quantity to purchase in a single transaction",
                  "type": "number"
                },
                "quantity_total": {
                  "description": "Total number of tickets available",
                  "type": "number"
                },
                "quantity_sold": {
                  "description": "Total number of tickets sold",
                  "type": "number"
                },
                "sales_end": {
                  "description": "Ticket sale ending date",
                  "type": "string",
                  "format": "date-time"
                },
                "cost": {
                  "description": "Ticket base price",
                  "$ref": "#/definitions/price"
                },
                "fee": {
                  "description": "Ticket extra fees",
                  "$ref": "#/definitions/price"
                },
                "item_id": {
                  "description": "#Item used in invoices to reference this ticket",
                  "type": "string",
                  "format": "reference"
                }
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "contact_channel": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "contact_channel": {
          "type": "object",
          "properties": {
            "skype": {
              "description": "Skype account",
              "type": "string"
            }
          }
        }
      }
    },
    "email": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "address": {
              "description": "Primary email address",
              "type": "string"
            },
            "address2": {
              "description": "Secondary email address",
              "type": "string"
            }
          }
        }
      }
    },
    "address": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "website": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "email_group": {
          "type": "object",
          "properties": {
            "url": {
              "description": "Primary website url",
              "type": "string"
            },
            "url2": {
              "description": "Secondary website url",
              "type": "string"
            }
          }
        }
      }
    },
    "phone": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "address": {
          "type": "object",
          "properties": {
            "landline": {
              "description": "Primary phone number",
              "type": "string"
            },
            "landline2": {
              "description": "Secondary phone number",
              "type": "string"
            },
            "mobile": {
              "description": "Primary mobile number",
              "type": "string"
            },
            "mobile2": {
              "description": "Secondary mobile number",
              "type": "string"
            },
            "fax": {
              "description": "Primary fax number",
              "type": "string"
            },
            "fax2": {
              "description": "Secondary fax number",
              "type": "string"
            },
            "pager": {
              "description": "Primary pager number",
              "type": "string"
            },
            "pager2": {
              "description": "Secondary pager number",
              "type": "string"
            }
          }
        }
      }
    },
    "price": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "definitions": {
        "price": {
          "type": "object",
          "properties": {
            "total_amount": {
              "description": "Total amount including taxes",
              "type": "number"
            },
            "net_amount": {
              "description": "Net amount excluding taxes",
              "type": "number"
            },
            "tax_amount": {
              "description": "Total tax amount",
              "type": "number"
            },
            "tax_rate": {
              "description": "Applicable tax rate",
              "type": "number"
            },
            "currency": {
              "description": "Price currency (defaults to Company currency)",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

Get schema
GET/api/v2/json_schema/events

Attributes

Field Type Description
resource_type String Resource type name
id String Event UUID
channel_id String Channel ID (org-xxx)
group_id String Group ID (cld-xxx)
created_at Date Time Object creation timestamp
updated_at Date Time Object last update timestamp
code String Code, auto-generated if not specified
status Enum [DRAFT, LIVE, INACTIVE] - Default: DRAFT
name String Event name
description String Event description
url String Event public page URL
timezone String Event timezone of reference
start_date Date Time Event starting date
end_date Date Time Event termination date
capacity Number Event total capacity
currency String Event default currency
organization_id Reference Organization owning the event
person_id Reference Person owning the event
venue_id Reference Venue of the Event
ticket_classes Array Event tickets types
Events TicketClasses attributes
Field Type Description
id String Ticket id
code String Code, auto-generated if not specified
name String Ticket name
description String Ticket description
donation Boolean Is based on donations
free Boolean Is a free ticket
minimum_quantity Number Minimum quantity to purchase in a single transaction
maximum_quantity Number Maximum quantity to purchase in a single transaction
quantity_total Number Total number of tickets available
quantity_sold Number Total number of tickets sold
sales_end Date Time Ticket sale ending date
cost Price Ticket base price
fee Price Ticket extra fees
item_id Reference Item used in invoices to reference this ticket

Events List

GET https://api-connec.maestrano.com/api/v2/:group_id/events
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "events": [
    {
      "id": "8d654e30-d8aa-0133-31c9-027f396e04cb",
      "code": "EV1",
      "status": "LIVE",
      "name": "Xavier concert",
      "description": "<P>Music and stuff</P>",
      "url": "http://www.eventbrite.com.au/e/xavier-concert-tickets-24287850615",
      "start_date": "2016-05-09T23:00:00Z",
      "end_date": "2016-05-10T02:00:00Z",
      "capacity": 102,
      "currency": "USD",
      "organization_id": "d9c3491-d8ab-2345-31ea-027f396e08ui",
      "person_id": "p5c3491-d8ab-3344-31ea-027f396e02qw",
      "venue_id": "b7c3491-d8ab-0133-31ea-027f396e04cb",
      "ticket_classes": [
        {
          "id": "56fbd6bcdace114f85136eba",
          "name": "Friends",
          "donation": false,
          "free": true,
          "minimum_quantity": 1,
          "quantity_total": 2,
          "quantity_sold": 1,
          "sales_end": "2016-05-09T22:00:00Z",
          "cost": {},
          "fee": {},
          "item_id": "8d6ffc91-d8aa-0133-31cf-027f396e04cb"
        },
        {
          "id": "56fbd6bcdace114f85136ebc",
          "name": "People",
          "donation": false,
          "free": false,
          "minimum_quantity": 1,
          "quantity_total": 100,
          "quantity_sold": 0,
          "sales_end": "2016-05-09T22:00:00Z",
          "cost": {
            "total_amount": 8.54,
            "currency": "USD"
          },
          "fee": {
            "total_amount": 1.2,
            "currency": "USD"
          },
          "item_id": "8d76da50-d8aa-0133-31d3-027f396e04cb"
        }
      ],
      "created_at": "2016-03-30T13:38:04Z",
      "updated_at": "2016-03-30T13:47:22Z",
      "channel_id": "org-fgjg",
      "resource_type": "events"
    }
  ],
  "pagination": {
    "skip": 0,
    "top": 100,
    "total": 1
  }
}

Get Events
GET/api/v2/:group_id/events

Get the list of events.

Attributes

Field Type Description
id String Event UUID
group_id String Group ID
created_at Date-time Event creation date
updated_at Date-time Event last update date
code String Code, auto-generated if not specified
status Enum [DRAFT, LIVE, INACTIVE] - Default: DRAFT
name String Event name
description String Event description
url String Url of the event website or tickets
start_date Date-time Event start date
end_date Date-time Event end date
capacity Number Maximum number of attendees
currency String Event currency code
organization_id Reference The organization organizing the event
person_id Reference The contact organizing the event
venue_id Reference Venue the event occurs at
ticket_classes Array Types of ticket available for this event
Ticket classes attributes
Field Type Description
id String Ticket class id
name String Ticket class name
description String Ticket class description
donation Boolean Can guests make donations
free Boolean Is ticket class free
minimum_quantity Number Minimum number of ticket per order
maximum_quantity Number Maximum number of ticket per order
quantity_total Number Number of available tickets of this class
quantity_total Number Number of sold tickets of this class
sales_end Date-time Last date to buy ticket
cost Price Ticket price
fee Price Additional fee for ticket purchase
item_id Reference Item representing such a ticket. An item should be created to be able to create invoices relative to this ticket

POST https://api-connec.maestrano.com/api/v2/:group_id/events
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
    "events": {
        "name": "Birthday",
        "start_date": "2016-05-09T23:00:00Z",
    }
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
  "events": {
    "id": "fafc0751-d8b3-0133-c94c-067594f4f433",
    "code": "EV7",
    "status": "DRAFT",
    "name": "Birthday",
    "start_date": "2016-05-09T23:00:00Z",
    "ticket_classes": [],
    "created_at": "2016-03-30T14:45:33Z",
    "updated_at": "2016-03-30T14:45:33Z",
    "channel_id": "org-fgjg",
    "resource_type": "events"
  }
}

Create New Event
POST/api/v2/:group_id/events

Create a new event.


Event

GET https://api-connec.maestrano.com/api/v2/:group_id/events/e32303c1-5102-0132-661e-600308937d74
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "events": {
    "id": "8d654e30-d8aa-0133-31c9-027f396e04cb",
    "code": "EV1",
    "status": "LIVE",
    "name": "concert",
    "description": "<P>Music and stuff</P>",
    "url": "http://www.eventbrite.com.au/e/xavier-concert-tickets-24287850615",
    "start_date": "2016-05-09T23:00:00Z",
    "end_date": "2016-05-10T02:00:00Z",
    "capacity": 102,
    "currency": "USD",
    "venue_id": "b7c3491-d8ab-0133-31ea-027f396e04cb",
    "ticket_classes": [
      {
        "id": "56fbd6bcdace114f85136eba",
        "name": "Friends",
        "donation": false,
        "free": true,
        "minimum_quantity": 1,
        "quantity_total": 2,
        "quantity_sold": 1,
        "sales_end": "2016-05-09T22:00:00Z",
        "cost": {},
        "fee": {},
        "item_id": "8d6ffc91-d8aa-0133-31cf-027f396e04cb"
      },
      {
        "id": "56fbd6bcdace114f85136ebc",
        "name": "People",
        "donation": false,
        "free": false,
        "minimum_quantity": 1,
        "quantity_total": 100,
        "quantity_sold": 0,
        "sales_end": "2016-05-09T22:00:00Z",
        "cost": {
          "total_amount": 8.54,
          "currency": "USD"
        },
        "fee": {
          "total_amount": 1.2,
          "currency": "USD"
        },
        "item_id": "8d76da50-d8aa-0133-31d3-027f396e04cb"
      }
    ],
    "created_at": "2016-03-30T13:38:04Z",
    "updated_at": "2016-03-30T13:47:22Z",
    "channel_id": "org-fgjg",
    "resource_type": "events"
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Get Event
GET/api/v2/:group_id/events/{id}

Get a single event.

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The event ID


PUT https://api-connec.maestrano.com/api/v2/:group_id/events/e32303c1-5102-0132-661e-600308937d74
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "events": {
    "name": "concert"
  }
}
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "events": {
    "id": "8d654e30-d8aa-0133-31c9-027f396e04cb",
    "code": "EV1",
    "status": "LIVE",
    "name": "concert",
    "description": "<P>Music and stuff</P>",
    "url": "http://www.eventbrite.com.au/e/xavier-concert-tickets-24287850615",
    "start_date": "2016-05-09T23:00:00Z",
    "end_date": "2016-05-10T02:00:00Z",
    "capacity": 102,
    "currency": "USD",
    "venue_id": "b7c3491-d8ab-0133-31ea-027f396e04cb",
    "ticket_classes": [
      {
        "id": "56fbd6bcdace114f85136eba",
        "name": "Friends",
        "donation": false,
        "free": true,
        "minimum_quantity": 1,
        "quantity_total": 2,
        "quantity_sold": 1,
        "sales_end": "2016-05-09T22:00:00Z",
        "cost": {},
        "fee": {},
        "item_id": "8d6ffc91-d8aa-0133-31cf-027f396e04cb"
      },
      {
        "id": "56fbd6bcdace114f85136ebc",
        "name": "People",
        "donation": false,
        "free": false,
        "minimum_quantity": 1,
        "quantity_total": 100,
        "quantity_sold": 0,
        "sales_end": "2016-05-09T22:00:00Z",
        "cost": {
          "total_amount": 8.54,
          "currency": "USD"
        },
        "fee": {
          "total_amount": 1.2,
          "currency": "USD"
        },
        "item_id": "8d76da50-d8aa-0133-31d3-027f396e04cb"
      }
    ],
    "created_at": "2016-03-30T13:38:04Z",
    "updated_at": "2016-03-30T13:47:22Z",
    "channel_id": "org-fgjg",
    "resource_type": "events"
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Update an Event
PUT/api/v2/:group_id/events/{id}

Update a single event

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The event ID


Event Orders

An event order is an order placed on an event by a person for several tickets and people

Business Rules

It is possible to automatically generate invoices and payments from an order using the options generate_invoice and generate_payment. This is useful for an integration with an accounting software to generate invoices and payments for financial reporting.

When generating an Invoice cost, process_fee and attendees_cost are calculated by default from attendees data.

{
  "event_orders": {
    "opts": {"generate_invoice": true, "generate_payment": true},
    "ticket_classes": [...]
  }
}

Event Orders List

GET https://api-connec.maestrano.com/api/v2/:group_id/event_orders
Responses200
Headers
Content-Type: application/vnd.api+json
Body
{
  "event_orders": [
    {
      "id": "91a9aea1-d8aa-0133-31dd-027f396e04cb",
      "code": "EO1",
      "status": "PLACED",
      "event_id": "8d654e30-d8aa-0133-31c9-027f396e04cb",
      "person_id": "8f806600-d8aa-0133-31d7-027f396e04cb",
      "invoice_id": "2q806600-d8aa-2322-31d7-027f396e09uh",
      "payment_id": "6630df75-c47d-426f-a100-ba1054b79084",
      "cost": {
        "total_amount": 0,
        "tax_amount": 0,
        "currency": "USD"
      },
      "process_fee": {
        "net_amount": 0,
        "currency": "USD"
      },
      "payment_fee": {
        "net_amount": 0,
        "currency": "USD"
      },
      "attendees": [
        {
          "id": "91b03e51-d8aa-0133-31e0-027f396e04cb",
          "status": "ATTENDING",
          "quantity": 1,
          "event_ticket_id": "56fbd6bcdace114f85136eba",
          "cost": {
            "total_amount": 0,
            "tax_amount": 0,
            "currency": "USD"
          },
          "process_fee": {
            "net_amount": 0,
            "currency": "USD"
          },
          "payment_fee": {
            "net_amount": 0,
            "currency": "USD"
          },
          "person_id": "8f806600-d8aa-0133-31d7-027f396e04cb"
        }
      ],
      "created_at": "2016-03-30T13:38:11Z",
      "updated_at": "2016-03-30T13:38:11Z",
      "channel_id": "org-fgjg",
      "resource_type": "event_orders"
    }
  ],
  "pagination": {
    "skip": 0,
    "top": 100,
    "total": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "events": {
      "id": "events",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Event order UUID",
            "type": "string",
            "readOnly": true
          },
          "channel_id": {
            "description": "Channel ID",
            "type": "string"
          },
          "created_at": {
            "description": "Object creation timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "description": "Object last update timestamp",
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "code": {
            "description": "Unique code, auto-generated if not specified",
            "type": "string"
          },
          "status": {
            "description": "Event order status",
            "enum": [
              "PLACED",
              "REFUNDED",
              "CANCELLED"
            ],
            "default": "PLACED"
          },
          "event_id": {
            "description": "Event UUID the order applies to",
            "type": "string"
          },
          "cost": {
            "$ref": "#/definitions/price"
          },
          "process_fee": {
            "$ref": "#/definitions/price"
          },
          "payment_fee": {
            "$ref": "#/definitions/price"
          },
          "invoice_id": {
            "description": "UUID of the invoice attached",
            "type": "string"
          },
          "payment_id": {
            "description": "UUID of the payment attached",
            "type": "string"
          },
          "attendees": {
            "id": "attendees",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "Attendee id",
                  "type": "string"
                },
                "status": {
                  "description": "Attendee status",
                  "enum": [
                    "ATTENDING",
                    "NOT ATTENDING",
                    "REFUNDED",
                    "CANCELLED"
                  ],
                  "default": "ATTENDING"
                },
                "quantity": {
                  "description": "Quantity of ticket for this attendee",
                  "type": "number"
                },
                "event_ticket_id": {
                  "description": "UUID of the ticket class",
                  "type": "string"
                },
                "cost": {
                  "$ref": "#/definitions/price"
                },
                "process_fee": {
                  "$ref": "#/definitions/price"
                },
                "payment_fee": {
                  "$ref": "#/definitions/price"
                },
                "person_id": {
                  "description": "UUID of the attendee person",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}

Get Event Orders
GET/api/v2/:group_id/event_orders

Get the list of event orders.

Attributes

Field Type Description
id String Event order UUID
group_id String Group ID
created_at Date-time Event order creation date
updated_at Date-time Event order last update date
code String Code, auto-generated if not specified
status Enum [PLACED, REFUNDED, CANCELLED] - Default: PLACED
event_id Reference Event the order applies to
person_id Reference Person the order was placed by
cost Price Cost of the order
process_fee Price Process fee of the order
payment_fee Price Payment fee of the order
invoice_id Reference Invoice linked to the order
attendees Array Attendees concerned by this order
Event order attendees attributes
Field Type Description
id String Attendee id
status Enum [ATTENDING, NOT ATTENDING, REFUNDED, CANCELLED] - Default: ATTENDING
quantity Number Quantity of ticket for this attendee
event_ticket_id Reference Event ticket class
cost Price Cost for this attendee
process_fee Price Process fee for this attendee
payment_fee Price Payment fee for this attendee
person_id Reference Person representing this attendee

POST https://api-connec.maestrano.com/api/v2/:group_id/event_orders
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
    "event_orders": {
        "status": "PLACED",
    }
}
Responses201
Headers
Content-Type: application/vnd.api+json
Body
{
  "event_orders": {
    "id": "9907dbc1-d8b6-0133-1ff2-027f396e04cb",
    "code": "EO3",
    "status": "PLACED",
    "cost": {},
    "process_fee": {},
    "payment_fee": {},
    "attendees": [],
    "created_at": "2016-03-30T15:04:17Z",
    "updated_at": "2016-03-30T15:04:17Z",
    "channel_id": "org-fgjg",
    "resource_type": "event_orders"
  }
}

Create New Event Order
POST/api/v2/:group_id/event_orders

Create a new event order.


Event Order

GET https://api-connec.maestrano.com/api/v2/:group_id/event_orders/e32303c1-5102-0132-661e-600308937d74
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "events": {
    "id": "8d654e30-d8aa-0133-31c9-027f396e04cb",
    "code": "EV1",
    "status": "LIVE",
    "name": "concert",
    "description": "<P>Music and stuff</P>",
    "url": "http://www.eventbrite.com.au/e/xavier-concert-tickets-24287850615",
    "start_date": "2016-05-09T23:00:00Z",
    "end_date": "2016-05-10T02:00:00Z",
    "capacity": 102,
    "currency": "USD",
    "venue_id": "b7c3491-d8ab-0133-31ea-027f396e04cb",
    "ticket_classes": [
      {
        "id": "56fbd6bcdace114f85136eba",
        "name": "Friends",
        "donation": false,
        "free": true,
        "minimum_quantity": 1,
        "quantity_total": 2,
        "quantity_sold": 1,
        "sales_end": "2016-05-09T22:00:00Z",
        "cost": {},
        "fee": {},
        "item_id": "8d6ffc91-d8aa-0133-31cf-027f396e04cb"
      },
      {
        "id": "56fbd6bcdace114f85136ebc",
        "name": "People",
        "donation": false,
        "free": false,
        "minimum_quantity": 1,
        "quantity_total": 100,
        "quantity_sold": 0,
        "sales_end": "2016-05-09T22:00:00Z",
        "cost": {
          "total_amount": 8.54,
          "currency": "USD"
        },
        "fee": {
          "total_amount": 1.2,
          "currency": "USD"
        },
        "item_id": "8d76da50-d8aa-0133-31d3-027f396e04cb"
      }
    ],
    "created_at": "2016-03-30T13:38:04Z",
    "updated_at": "2016-03-30T13:47:22Z",
    "channel_id": "org-fgjg",
    "resource_type": "events"
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Get Event
GET/api/v2/:group_id/event_orders/{id}

Get a single event.

URI Parameters
HideShow
id
string (required) Example: e32303c1-5102-0132-661e-600308937d74

The event ID


PUT https://api-connec.maestrano.com/api/v2/:group_id/event_orders/e32303c1-5102-0132-661e-600308937d74
Requestsexample 1
Headers
Content-Type: application/vnd.api+json
Body
{
  "events_order": {
    "satuts": "REFUNDED"
  }
}
Responses200404
Headers
Content-Type: application/vnd.api+json
Body
{
  "event_orders": {
    "id": "91a9aea1-d8aa-0133-31dd-027f396e04cb",
    "status": "REFUNDED",
    "event_id": "8d654e30-d8aa-0133-31c9-027f396e04cb",
    "person_id": "8f806600-d8aa-0133-31d7-027f396e04cb",
    "cost": {
      "total_amount": 0,
      "tax_amount": 0,
      "currency": "USD"
    },
    "process_fee": {
      "net_amount": 0,
      "currency": "USD"
    },
    "payment_fee": {
      "net_amount": 0,
      "currency": "USD"
    },
    "attendees": [
      {
        "id": "91b03e51-d8aa-0133-31e0-027f396e04cb",
        "status": "ATTENDING",
        "quantity": 1,
        "event_ticket_id": "56fbd6bcdace114f85136eba",
        "cost": {
          "total_amount": 0,
          "tax_amount": 0,
          "currency": "USD"
        },
        "process_fee": {
          "net_amount": 0,
          "currency": "USD"
        },
        "payment_fee": {
          "net_amount": 0,
          "currency": "USD"
        },
        "person_id": "8f806600-d8aa-0133-31d7-027f396e04cb"
      }
    ],
    "created_at": "2016-03-30T13:38:11Z",
    "updated_at": "2016-03-30T13:38:11Z",
    "channel_id": "org-fgjg",
    "resource_type": "event_orders"
  }
}
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "id": "e33303c1-5102-0142-661e-600308937d84",
      "status": "404",
      "code": "not-found",
      "title": "Resource not found"
    }
  ]
}

Update an Event Order
PUT/api/v2/:group_id/event_orders/{id}

Update a single event order

URI Parameters
HideShow
id
string (requi