foliolib.folio.api.organizationsStorage.Organization

class foliolib.folio.api.organizationsStorage.Organization(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

Organizations

CRUD APIs used to manage organizations.

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

delete_organization(organizationsId)

Delete organization item with given {organizationId}

get_organization(organizationsId)

Retrieve organization item with given {organizationId}

get_organizations(**kwargs)

Get list of organizations

modify_organization(organizationsId, ...)

Update organization with 'organization_id'

set_organization(organization)

Create a new organization item.

delete_organization(organizationsId: str)

Delete organization item with given {organizationId}

DELETE /organizations-storage/organizations/{organizationsId}

Parameters

organizationsId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_organization(organizationsId: str)

Retrieve organization item with given {organizationId}

GET /organizations-storage/organizations/{organizationsId}

Parameters

organizationsId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "The record of an organization",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique UUID for this organization",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "The name of this organization",
      "type": "string"
    },
    "code": {
      "description": "The code for this organization",
      "type": "string",
      "pattern": "[\\S ]{1,}"
    },
    "description": {
      "description": "The description for this organization",
      "type": "string"
    },
    "exportToAccounting": {
      "description": "This would keep the invoice from being feed into the batch process (i.e. not generate an external voucher/payment) but would still move values in the system. This might be defined by the vendor relationship and exposed for override on the invoice.",
      "type": "boolean",
      "default": false
    },
    "status": {
      "description": "The status of this organization",
      "type": "string",
      "enum": [
        "Active",
        "Inactive",
        "Pending"
      ]
    },
    "organizationTypes": {
      "description": "A list of organization types assigned to this organization",
      "type": "array",
      "items": {
        "description": "UUID of an organization type record",
        "$ref": "../../common/schemas/uuid.json"
      },
      "uniqueItems": true
    },
    "language": {
      "description": "The language for this organization",
      "type": "string"
    },
    "aliases": {
      "id": "aliases",
      "description": "The list of aliases for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "alias.json"
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "address.json"
      }
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "email.json"
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "url.json"
      }
    },
    "contacts": {
      "id": "contact",
      "description": "An array of contact record IDs",
      "type": "array",
      "items": {
        "description": "UUID of a contact record",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "agreements": {
      "id": "agreement",
      "description": "The the list of agreements for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "agreement.json"
      }
    },
    "erpCode": {
      "description": "The ERP code for this organization",
      "type": "string"
    },
    "paymentMethod": {
      "description": "The payment method for this organization",
      "type": "string"
    },
    "accessProvider": {
      "description": "The access provider for this organization",
      "type": "boolean"
    },
    "governmental": {
      "description": "The setting to mark this organization as governmental",
      "type": "boolean"
    },
    "licensor": {
      "description": "The setting to mark this organization as a licensor",
      "type": "boolean"
    },
    "materialSupplier": {
      "description": "The setting to mark this organization as a material supplier",
      "type": "boolean"
    },
    "vendorCurrencies": {
      "id": "vendorCurrencies",
      "description": "The list of currencies used by this organization",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "claimingInterval": {
      "description": "The claim interval for this organization",
      "type": "integer"
    },
    "discountPercent": {
      "description": "The discount percentage for this organization",
      "type": "number"
    },
    "expectedActivationInterval": {
      "description": "The expected activation interval (in days) for this organization",
      "type": "integer"
    },
    "expectedInvoiceInterval": {
      "description": "The expected invoice interval (in days) for this organization",
      "type": "integer"
    },
    "renewalActivationInterval": {
      "description": "The revewal activation interval (in days) for this organization",
      "type": "integer"
    },
    "subscriptionInterval": {
      "description": "The subscription interval (in days) for this organization",
      "type": "integer"
    },
    "expectedReceiptInterval": {
      "description": "The receipt interval (in days) for this organization",
      "type": "integer"
    },
    "taxId": {
      "description": "The tax ID for this organization",
      "type": "string"
    },
    "liableForVat": {
      "description": "The setting to mark this organization liable to collect VAT",
      "type": "boolean"
    },
    "taxPercentage": {
      "description": "The tax percentage value for this organization",
      "type": "number"
    },
    "edi": {
      "description": "The EDI object for this organization (only applicable when isVendor is true)",
      "type": "object",
      "properties": {
        "vendorEdiCode": {
          "description": "The organization code for this EDI",
          "type": "string"
        },
        "vendorEdiType": {
          "description": "The organization type for this EDI",
          "type": "string",
          "enum": [
            "014/EAN",
            "31B/US-SAN",
            "091/Vendor-assigned",
            "092/Customer-assigned"
          ]
        },
        "libEdiCode": {
          "description": "The library code for this EDI",
          "type": "string"
        },
        "libEdiType": {
          "description": "The library type for this EDI",
          "type": "string",
          "enum": [
            "014/EAN",
            "31B/US-SAN",
            "091/Vendor-assigned",
            "092/Customer-assigned"
          ]
        },
        "prorateTax": {
          "description": "The setting to prorate tax for this EDI",
          "type": "boolean"
        },
        "prorateFees": {
          "description": "The setting to prorate fees for this EDI",
          "type": "boolean"
        },
        "ediNamingConvention": {
          "description": "The naming convention for this EDI",
          "type": "string"
        },
        "sendAcctNum": {
          "description": "The setting to send the account number for this EDI",
          "type": "boolean"
        },
        "supportOrder": {
          "description": "The setting to support order for this EDI",
          "type": "boolean"
        },
        "supportInvoice": {
          "description": "The setting to support invoice for this EDI",
          "type": "boolean"
        },
        "notes": {
          "description": "The notes for this EDI",
          "type": "string"
        },
        "ediFtp": {
          "description": "The FTP object for this EDI",
          "type": "object",
          "properties": {
            "ftpFormat": {
              "description": "The FTP format for this EDI",
              "type": "string",
              "enum": [
                "SFTP",
                "FTP"
              ]
            },
            "serverAddress": {
              "description": "The server address for this EDI",
              "type": [
                "string",
                "null"
              ],
              "pattern": "^$|(([Hh][Tt][Tt][Pp]|[Ff][Tt][Pp])([Ss])?://.+$)"
            },
            "username": {
              "description": "The login username for this EDI",
              "type": "string"
            },
            "password": {
              "description": "The login password for this EDI",
              "type": "string"
            },
            "ftpMode": {
              "description": "The FTP mode for this EDI",
              "type": "string",
              "enum": [
                "ASCII",
                "Binary"
              ]
            },
            "ftpConnMode": {
              "description": "The FTP connection mode for this EDI",
              "type": "string",
              "enum": [
                "Active",
                "Passive"
              ]
            },
            "ftpPort": {
              "description": "The port for this EDI",
              "type": "integer"
            },
            "orderDirectory": {
              "description": "The order directory for this EDI",
              "type": "string"
            },
            "invoiceDirectory": {
              "description": "The invoice directory for this EDI",
              "type": "string"
            },
            "notes": {
              "description": "The notes for this EDI",
              "type": "string"
            }
          }
        },
        "ediJob": {
          "description": "The job object for this EDI",
          "type": "object",
          "properties": {
            "scheduleEdi": {
              "description": "Activate the schedule for this EDI job",
              "type": "boolean"
            },
            "schedulingDate": {
              "description": "The date (MM/DD/YYYY) for this EDI job to start running",
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "time": {
              "description": "The time (h:mm A) for this EDI job",
              "type": [
                "string",
                "null"
              ],
              "format": "time"
            },
            "isMonday": {
              "description": "The setting to run this EDI job on Mondays",
              "type": "boolean"
            },
            "isTuesday": {
              "description": "The setting to run this EDI job on Tuesdays",
              "type": "boolean"
            },
            "isWednesday": {
              "description": "The setting to run this EDI job on Wednesdays",
              "type": "boolean"
            },
            "isThursday": {
              "description": "The setting to run this EDI job on Thursdays",
              "type": "boolean"
            },
            "isFriday": {
              "description": "The setting to run this EDI job on Fridays",
              "type": "boolean"
            },
            "isSaturday": {
              "description": "The setting to run this EDI job on Saturdays",
              "type": "boolean"
            },
            "isSunday": {
              "description": "The setting to run this EDI job on Sundays",
              "type": "boolean"
            },
            "sendToEmails": {
              "description": "The comma delimited list of email addresses to notify when this EDI job runs",
              "type": "string"
            },
            "notifyAllEdi": {
              "description": "The setting to notify all receivers when this EDI job runs",
              "type": "boolean"
            },
            "notifyInvoiceOnly": {
              "description": "The setting to notify only the invoice receiver when this EDI job runs",
              "type": "boolean"
            },
            "notifyErrorOnly": {
              "description": "The setting to notiry on the error receiver when this EDI job runs",
              "type": "boolean"
            },
            "schedulingNotes": {
              "description": "The schedule notes for this EDI job",
              "type": "string"
            }
          }
        }
      }
    },
    "interfaces": {
      "id": "interfaces",
      "description": "The list of interfaces assigned to this organization",
      "type": "array",
      "items": {
        "description": "UUID of an interface record",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "accounts": {
      "id": "accounts",
      "description": "The list of accounts for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "account.json"
      }
    },
    "isVendor": {
      "id": "isVendor",
      "description": "Used to indicate that this organization is also a vendor",
      "type": "boolean",
      "default": false
    },
    "sanCode": {
      "description": "The SAN code for this organization address",
      "type": "string"
    },
    "changelogs": {
      "id": "changelogs",
      "description": "The list of changes applied to this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "changelog.json"
      }
    },
    "acqUnitIds": {
      "description": "Acquisition unit UUIDs associated with this organization",
      "type": "array",
      "items": {
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "tags": {
      "type": "object",
      "description": "arbitrary tags associated with this organization",
      "$ref": "../../../raml-util/schemas/tags.schema"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "status",
    "code"
  ]
}
get_organizations(**kwargs)

Get list of organizations

GET /organizations-storage/organizations

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • query (str) –

    A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://dev.folio.org/reference/glossary#cql)) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    with valid searchable fields: for example code

    Example

    • (username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode

    • [“code”, “MEDGRANT”, “=”]

  • totalRecords (str) –

    (default=auto) How to calculate the totalRecords property. “exact” for the correct number, “estimated” for an estimation, “auto” to automatically select “exact” or “estimated”, “none” for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example

    • none

  • offset (int) –

    (default=0) Skip over a number of elements by specifying an offset value for the query

    Example

    • 0

  • limit (int) –

    (default=10) Limit the number of elements returned in the response

    Example

    • 10

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of organization records",
  "type": "object",
  "properties": {
    "organizations": {
      "description": "The list of organizations in this collection",
      "type": "array",
      "id": "organizationData",
      "items": {
        "type": "object",
        "$ref": "organization.json"
      }
    },
    "totalRecords": {
      "description": "The number of organization records returned in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "organizations",
    "totalRecords"
  ]
}
modify_organization(organizationsId: str, organization: dict)

Update organization with ‘organization_id’

PUT /organizations-storage/organizations/{organizationsId}

Parameters
  • organizationsId (str) –

  • organization (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "The record of an organization",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique UUID for this organization",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "The name of this organization",
      "type": "string"
    },
    "code": {
      "description": "The code for this organization",
      "type": "string",
      "pattern": "[\\S ]{1,}"
    },
    "description": {
      "description": "The description for this organization",
      "type": "string"
    },
    "exportToAccounting": {
      "description": "This would keep the invoice from being feed into the batch process (i.e. not generate an external voucher/payment) but would still move values in the system. This might be defined by the vendor relationship and exposed for override on the invoice.",
      "type": "boolean",
      "default": false
    },
    "status": {
      "description": "The status of this organization",
      "type": "string",
      "enum": [
        "Active",
        "Inactive",
        "Pending"
      ]
    },
    "organizationTypes": {
      "description": "A list of organization types assigned to this organization",
      "type": "array",
      "items": {
        "description": "UUID of an organization type record",
        "$ref": "../../common/schemas/uuid.json"
      },
      "uniqueItems": true
    },
    "language": {
      "description": "The language for this organization",
      "type": "string"
    },
    "aliases": {
      "id": "aliases",
      "description": "The list of aliases for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "alias.json"
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "address.json"
      }
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "email.json"
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "url.json"
      }
    },
    "contacts": {
      "id": "contact",
      "description": "An array of contact record IDs",
      "type": "array",
      "items": {
        "description": "UUID of a contact record",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "agreements": {
      "id": "agreement",
      "description": "The the list of agreements for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "agreement.json"
      }
    },
    "erpCode": {
      "description": "The ERP code for this organization",
      "type": "string"
    },
    "paymentMethod": {
      "description": "The payment method for this organization",
      "type": "string"
    },
    "accessProvider": {
      "description": "The access provider for this organization",
      "type": "boolean"
    },
    "governmental": {
      "description": "The setting to mark this organization as governmental",
      "type": "boolean"
    },
    "licensor": {
      "description": "The setting to mark this organization as a licensor",
      "type": "boolean"
    },
    "materialSupplier": {
      "description": "The setting to mark this organization as a material supplier",
      "type": "boolean"
    },
    "vendorCurrencies": {
      "id": "vendorCurrencies",
      "description": "The list of currencies used by this organization",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "claimingInterval": {
      "description": "The claim interval for this organization",
      "type": "integer"
    },
    "discountPercent": {
      "description": "The discount percentage for this organization",
      "type": "number"
    },
    "expectedActivationInterval": {
      "description": "The expected activation interval (in days) for this organization",
      "type": "integer"
    },
    "expectedInvoiceInterval": {
      "description": "The expected invoice interval (in days) for this organization",
      "type": "integer"
    },
    "renewalActivationInterval": {
      "description": "The revewal activation interval (in days) for this organization",
      "type": "integer"
    },
    "subscriptionInterval": {
      "description": "The subscription interval (in days) for this organization",
      "type": "integer"
    },
    "expectedReceiptInterval": {
      "description": "The receipt interval (in days) for this organization",
      "type": "integer"
    },
    "taxId": {
      "description": "The tax ID for this organization",
      "type": "string"
    },
    "liableForVat": {
      "description": "The setting to mark this organization liable to collect VAT",
      "type": "boolean"
    },
    "taxPercentage": {
      "description": "The tax percentage value for this organization",
      "type": "number"
    },
    "edi": {
      "description": "The EDI object for this organization (only applicable when isVendor is true)",
      "type": "object",
      "properties": {
        "vendorEdiCode": {
          "description": "The organization code for this EDI",
          "type": "string"
        },
        "vendorEdiType": {
          "description": "The organization type for this EDI",
          "type": "string",
          "enum": [
            "014/EAN",
            "31B/US-SAN",
            "091/Vendor-assigned",
            "092/Customer-assigned"
          ]
        },
        "libEdiCode": {
          "description": "The library code for this EDI",
          "type": "string"
        },
        "libEdiType": {
          "description": "The library type for this EDI",
          "type": "string",
          "enum": [
            "014/EAN",
            "31B/US-SAN",
            "091/Vendor-assigned",
            "092/Customer-assigned"
          ]
        },
        "prorateTax": {
          "description": "The setting to prorate tax for this EDI",
          "type": "boolean"
        },
        "prorateFees": {
          "description": "The setting to prorate fees for this EDI",
          "type": "boolean"
        },
        "ediNamingConvention": {
          "description": "The naming convention for this EDI",
          "type": "string"
        },
        "sendAcctNum": {
          "description": "The setting to send the account number for this EDI",
          "type": "boolean"
        },
        "supportOrder": {
          "description": "The setting to support order for this EDI",
          "type": "boolean"
        },
        "supportInvoice": {
          "description": "The setting to support invoice for this EDI",
          "type": "boolean"
        },
        "notes": {
          "description": "The notes for this EDI",
          "type": "string"
        },
        "ediFtp": {
          "description": "The FTP object for this EDI",
          "type": "object",
          "properties": {
            "ftpFormat": {
              "description": "The FTP format for this EDI",
              "type": "string",
              "enum": [
                "SFTP",
                "FTP"
              ]
            },
            "serverAddress": {
              "description": "The server address for this EDI",
              "type": [
                "string",
                "null"
              ],
              "pattern": "^$|(([Hh][Tt][Tt][Pp]|[Ff][Tt][Pp])([Ss])?://.+$)"
            },
            "username": {
              "description": "The login username for this EDI",
              "type": "string"
            },
            "password": {
              "description": "The login password for this EDI",
              "type": "string"
            },
            "ftpMode": {
              "description": "The FTP mode for this EDI",
              "type": "string",
              "enum": [
                "ASCII",
                "Binary"
              ]
            },
            "ftpConnMode": {
              "description": "The FTP connection mode for this EDI",
              "type": "string",
              "enum": [
                "Active",
                "Passive"
              ]
            },
            "ftpPort": {
              "description": "The port for this EDI",
              "type": "integer"
            },
            "orderDirectory": {
              "description": "The order directory for this EDI",
              "type": "string"
            },
            "invoiceDirectory": {
              "description": "The invoice directory for this EDI",
              "type": "string"
            },
            "notes": {
              "description": "The notes for this EDI",
              "type": "string"
            }
          }
        },
        "ediJob": {
          "description": "The job object for this EDI",
          "type": "object",
          "properties": {
            "scheduleEdi": {
              "description": "Activate the schedule for this EDI job",
              "type": "boolean"
            },
            "schedulingDate": {
              "description": "The date (MM/DD/YYYY) for this EDI job to start running",
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "time": {
              "description": "The time (h:mm A) for this EDI job",
              "type": [
                "string",
                "null"
              ],
              "format": "time"
            },
            "isMonday": {
              "description": "The setting to run this EDI job on Mondays",
              "type": "boolean"
            },
            "isTuesday": {
              "description": "The setting to run this EDI job on Tuesdays",
              "type": "boolean"
            },
            "isWednesday": {
              "description": "The setting to run this EDI job on Wednesdays",
              "type": "boolean"
            },
            "isThursday": {
              "description": "The setting to run this EDI job on Thursdays",
              "type": "boolean"
            },
            "isFriday": {
              "description": "The setting to run this EDI job on Fridays",
              "type": "boolean"
            },
            "isSaturday": {
              "description": "The setting to run this EDI job on Saturdays",
              "type": "boolean"
            },
            "isSunday": {
              "description": "The setting to run this EDI job on Sundays",
              "type": "boolean"
            },
            "sendToEmails": {
              "description": "The comma delimited list of email addresses to notify when this EDI job runs",
              "type": "string"
            },
            "notifyAllEdi": {
              "description": "The setting to notify all receivers when this EDI job runs",
              "type": "boolean"
            },
            "notifyInvoiceOnly": {
              "description": "The setting to notify only the invoice receiver when this EDI job runs",
              "type": "boolean"
            },
            "notifyErrorOnly": {
              "description": "The setting to notiry on the error receiver when this EDI job runs",
              "type": "boolean"
            },
            "schedulingNotes": {
              "description": "The schedule notes for this EDI job",
              "type": "string"
            }
          }
        }
      }
    },
    "interfaces": {
      "id": "interfaces",
      "description": "The list of interfaces assigned to this organization",
      "type": "array",
      "items": {
        "description": "UUID of an interface record",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "accounts": {
      "id": "accounts",
      "description": "The list of accounts for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "account.json"
      }
    },
    "isVendor": {
      "id": "isVendor",
      "description": "Used to indicate that this organization is also a vendor",
      "type": "boolean",
      "default": false
    },
    "sanCode": {
      "description": "The SAN code for this organization address",
      "type": "string"
    },
    "changelogs": {
      "id": "changelogs",
      "description": "The list of changes applied to this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "changelog.json"
      }
    },
    "acqUnitIds": {
      "description": "Acquisition unit UUIDs associated with this organization",
      "type": "array",
      "items": {
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "tags": {
      "type": "object",
      "description": "arbitrary tags associated with this organization",
      "$ref": "../../../raml-util/schemas/tags.schema"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "status",
    "code"
  ]
}
set_organization(organization: dict)

Create a new organization item.

POST /organizations-storage/organizations

Parameters

organization (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created organization item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "The record of an organization",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique UUID for this organization",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "The name of this organization",
      "type": "string"
    },
    "code": {
      "description": "The code for this organization",
      "type": "string",
      "pattern": "[\\S ]{1,}"
    },
    "description": {
      "description": "The description for this organization",
      "type": "string"
    },
    "exportToAccounting": {
      "description": "This would keep the invoice from being feed into the batch process (i.e. not generate an external voucher/payment) but would still move values in the system. This might be defined by the vendor relationship and exposed for override on the invoice.",
      "type": "boolean",
      "default": false
    },
    "status": {
      "description": "The status of this organization",
      "type": "string",
      "enum": [
        "Active",
        "Inactive",
        "Pending"
      ]
    },
    "organizationTypes": {
      "description": "A list of organization types assigned to this organization",
      "type": "array",
      "items": {
        "description": "UUID of an organization type record",
        "$ref": "../../common/schemas/uuid.json"
      },
      "uniqueItems": true
    },
    "language": {
      "description": "The language for this organization",
      "type": "string"
    },
    "aliases": {
      "id": "aliases",
      "description": "The list of aliases for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "alias.json"
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "address.json"
      }
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "email.json"
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "url.json"
      }
    },
    "contacts": {
      "id": "contact",
      "description": "An array of contact record IDs",
      "type": "array",
      "items": {
        "description": "UUID of a contact record",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "agreements": {
      "id": "agreement",
      "description": "The the list of agreements for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "agreement.json"
      }
    },
    "erpCode": {
      "description": "The ERP code for this organization",
      "type": "string"
    },
    "paymentMethod": {
      "description": "The payment method for this organization",
      "type": "string"
    },
    "accessProvider": {
      "description": "The access provider for this organization",
      "type": "boolean"
    },
    "governmental": {
      "description": "The setting to mark this organization as governmental",
      "type": "boolean"
    },
    "licensor": {
      "description": "The setting to mark this organization as a licensor",
      "type": "boolean"
    },
    "materialSupplier": {
      "description": "The setting to mark this organization as a material supplier",
      "type": "boolean"
    },
    "vendorCurrencies": {
      "id": "vendorCurrencies",
      "description": "The list of currencies used by this organization",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "claimingInterval": {
      "description": "The claim interval for this organization",
      "type": "integer"
    },
    "discountPercent": {
      "description": "The discount percentage for this organization",
      "type": "number"
    },
    "expectedActivationInterval": {
      "description": "The expected activation interval (in days) for this organization",
      "type": "integer"
    },
    "expectedInvoiceInterval": {
      "description": "The expected invoice interval (in days) for this organization",
      "type": "integer"
    },
    "renewalActivationInterval": {
      "description": "The revewal activation interval (in days) for this organization",
      "type": "integer"
    },
    "subscriptionInterval": {
      "description": "The subscription interval (in days) for this organization",
      "type": "integer"
    },
    "expectedReceiptInterval": {
      "description": "The receipt interval (in days) for this organization",
      "type": "integer"
    },
    "taxId": {
      "description": "The tax ID for this organization",
      "type": "string"
    },
    "liableForVat": {
      "description": "The setting to mark this organization liable to collect VAT",
      "type": "boolean"
    },
    "taxPercentage": {
      "description": "The tax percentage value for this organization",
      "type": "number"
    },
    "edi": {
      "description": "The EDI object for this organization (only applicable when isVendor is true)",
      "type": "object",
      "properties": {
        "vendorEdiCode": {
          "description": "The organization code for this EDI",
          "type": "string"
        },
        "vendorEdiType": {
          "description": "The organization type for this EDI",
          "type": "string",
          "enum": [
            "014/EAN",
            "31B/US-SAN",
            "091/Vendor-assigned",
            "092/Customer-assigned"
          ]
        },
        "libEdiCode": {
          "description": "The library code for this EDI",
          "type": "string"
        },
        "libEdiType": {
          "description": "The library type for this EDI",
          "type": "string",
          "enum": [
            "014/EAN",
            "31B/US-SAN",
            "091/Vendor-assigned",
            "092/Customer-assigned"
          ]
        },
        "prorateTax": {
          "description": "The setting to prorate tax for this EDI",
          "type": "boolean"
        },
        "prorateFees": {
          "description": "The setting to prorate fees for this EDI",
          "type": "boolean"
        },
        "ediNamingConvention": {
          "description": "The naming convention for this EDI",
          "type": "string"
        },
        "sendAcctNum": {
          "description": "The setting to send the account number for this EDI",
          "type": "boolean"
        },
        "supportOrder": {
          "description": "The setting to support order for this EDI",
          "type": "boolean"
        },
        "supportInvoice": {
          "description": "The setting to support invoice for this EDI",
          "type": "boolean"
        },
        "notes": {
          "description": "The notes for this EDI",
          "type": "string"
        },
        "ediFtp": {
          "description": "The FTP object for this EDI",
          "type": "object",
          "properties": {
            "ftpFormat": {
              "description": "The FTP format for this EDI",
              "type": "string",
              "enum": [
                "SFTP",
                "FTP"
              ]
            },
            "serverAddress": {
              "description": "The server address for this EDI",
              "type": [
                "string",
                "null"
              ],
              "pattern": "^$|(([Hh][Tt][Tt][Pp]|[Ff][Tt][Pp])([Ss])?://.+$)"
            },
            "username": {
              "description": "The login username for this EDI",
              "type": "string"
            },
            "password": {
              "description": "The login password for this EDI",
              "type": "string"
            },
            "ftpMode": {
              "description": "The FTP mode for this EDI",
              "type": "string",
              "enum": [
                "ASCII",
                "Binary"
              ]
            },
            "ftpConnMode": {
              "description": "The FTP connection mode for this EDI",
              "type": "string",
              "enum": [
                "Active",
                "Passive"
              ]
            },
            "ftpPort": {
              "description": "The port for this EDI",
              "type": "integer"
            },
            "orderDirectory": {
              "description": "The order directory for this EDI",
              "type": "string"
            },
            "invoiceDirectory": {
              "description": "The invoice directory for this EDI",
              "type": "string"
            },
            "notes": {
              "description": "The notes for this EDI",
              "type": "string"
            }
          }
        },
        "ediJob": {
          "description": "The job object for this EDI",
          "type": "object",
          "properties": {
            "scheduleEdi": {
              "description": "Activate the schedule for this EDI job",
              "type": "boolean"
            },
            "schedulingDate": {
              "description": "The date (MM/DD/YYYY) for this EDI job to start running",
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "time": {
              "description": "The time (h:mm A) for this EDI job",
              "type": [
                "string",
                "null"
              ],
              "format": "time"
            },
            "isMonday": {
              "description": "The setting to run this EDI job on Mondays",
              "type": "boolean"
            },
            "isTuesday": {
              "description": "The setting to run this EDI job on Tuesdays",
              "type": "boolean"
            },
            "isWednesday": {
              "description": "The setting to run this EDI job on Wednesdays",
              "type": "boolean"
            },
            "isThursday": {
              "description": "The setting to run this EDI job on Thursdays",
              "type": "boolean"
            },
            "isFriday": {
              "description": "The setting to run this EDI job on Fridays",
              "type": "boolean"
            },
            "isSaturday": {
              "description": "The setting to run this EDI job on Saturdays",
              "type": "boolean"
            },
            "isSunday": {
              "description": "The setting to run this EDI job on Sundays",
              "type": "boolean"
            },
            "sendToEmails": {
              "description": "The comma delimited list of email addresses to notify when this EDI job runs",
              "type": "string"
            },
            "notifyAllEdi": {
              "description": "The setting to notify all receivers when this EDI job runs",
              "type": "boolean"
            },
            "notifyInvoiceOnly": {
              "description": "The setting to notify only the invoice receiver when this EDI job runs",
              "type": "boolean"
            },
            "notifyErrorOnly": {
              "description": "The setting to notiry on the error receiver when this EDI job runs",
              "type": "boolean"
            },
            "schedulingNotes": {
              "description": "The schedule notes for this EDI job",
              "type": "string"
            }
          }
        }
      }
    },
    "interfaces": {
      "id": "interfaces",
      "description": "The list of interfaces assigned to this organization",
      "type": "array",
      "items": {
        "description": "UUID of an interface record",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "accounts": {
      "id": "accounts",
      "description": "The list of accounts for this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "account.json"
      }
    },
    "isVendor": {
      "id": "isVendor",
      "description": "Used to indicate that this organization is also a vendor",
      "type": "boolean",
      "default": false
    },
    "sanCode": {
      "description": "The SAN code for this organization address",
      "type": "string"
    },
    "changelogs": {
      "id": "changelogs",
      "description": "The list of changes applied to this organization",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "changelog.json"
      }
    },
    "acqUnitIds": {
      "description": "Acquisition unit UUIDs associated with this organization",
      "type": "array",
      "items": {
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "tags": {
      "type": "object",
      "description": "arbitrary tags associated with this organization",
      "$ref": "../../../raml-util/schemas/tags.schema"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "status",
    "code"
  ]
}