Orders-Module (v1)

http://github.com/folio-org/mod-orders-storage

Table of contents

mod-orders (Adjustment)

CRUD APIs used to manage adjustments.

/adjustment

Collection of adjustment items.

GET /adjustment

Get list of alerts

GET /adjustment
Query Parameters
  • query: (string)

    A query expressed as a CQL string (see 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", "="]
    
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response

    Example:

    10
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of adjustment items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of adjustment records",
  "type": "object",
  "properties": {
    "adjustments": {
      "description": "array of adjustment records",
      "type": "array",
      "id": "adjustments",
      "items": {
        "type": "object",
        "$ref": "adjustment.json"
      }
    },
    "total_records": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    },
    "first": {
      "description": "The index of the first object contained in this collection",
      "type": "integer"
    },
    "last": {
      "description": "The index of the last object contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "adjustments",
    "total_records"
  ]
}

Example:

{
    "adjustments":
        [
          {
            "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
            "credit": 0.0,
            "discount": 0.0,
            "insurance": 0.0,
            "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
            "overhead": 0.0,
            "shipment": 0.0,
            "tax_1": 0.0,
            "tax_2": 0.0,
            "use_pro_rate": false,
            "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
          }
        ],
    "total_records": 1,
    "first": 1,
    "last": 1
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

unable to list adjustment -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list adjustment -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /adjustment

Create a new adjustment item.

POST /adjustment
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "purchase order adjustments",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this adjustment record",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "credit": {
      "description": "amount of credits",
      "type": "number"
    },
    "discount": {
      "description": "amount of discounts",
      "type": "number"
    },
    "insurance": {
      "description": "amount of insurance cost",
      "type": "number"
    },
    "invoice_id": {
      "description": "UUID of the invoice record associated with this adjustment",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "overhead": {
      "description": "amount of overhead costs",
      "type": "number"
    },
    "shipment": {
      "description": "amount of shipment costs",
      "type": "number"
    },
    "tax_1": {
      "description": "amount of taxes (line 1, e.g. state)",
      "type": "number"
    },
    "tax_2": {
      "description": "amount of taxes (line 2, e.g. federal)",
      "type": "number"
    },
    "use_pro_rate": {
      "description": "whether or not to pro-rate the order cost",
      "type": "boolean"
    },
    "po_line_id": {
      "description": "UUID of the purchase order line this alert is associated with",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
  "credit": 0.0,
  "discount": 0.0,
  "insurance": 0.0,
  "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
  "overhead": 0.0,
  "shipment": 0.0,
  "tax_1": 0.0,
  "tax_2": 0.0,
  "use_pro_rate": false,
  "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created adjustment item

Body

Media type: application/json

Type: any

Example:

{
  "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
  "credit": 0.0,
  "discount": 0.0,
  "insurance": 0.0,
  "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
  "overhead": 0.0,
  "shipment": 0.0,
  "tax_1": 0.0,
  "tax_2": 0.0,
  "use_pro_rate": false,
  "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to add adjustment -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create adjustment -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /adjustment/{id}

Retrieve adjustment item with given {adjustmentId}

GET /adjustment/{id}
URI Parameters
  • id: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "purchase order adjustments",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this adjustment record",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "credit": {
      "description": "amount of credits",
      "type": "number"
    },
    "discount": {
      "description": "amount of discounts",
      "type": "number"
    },
    "insurance": {
      "description": "amount of insurance cost",
      "type": "number"
    },
    "invoice_id": {
      "description": "UUID of the invoice record associated with this adjustment",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "overhead": {
      "description": "amount of overhead costs",
      "type": "number"
    },
    "shipment": {
      "description": "amount of shipment costs",
      "type": "number"
    },
    "tax_1": {
      "description": "amount of taxes (line 1, e.g. state)",
      "type": "number"
    },
    "tax_2": {
      "description": "amount of taxes (line 2, e.g. federal)",
      "type": "number"
    },
    "use_pro_rate": {
      "description": "whether or not to pro-rate the order cost",
      "type": "boolean"
    },
    "po_line_id": {
      "description": "UUID of the purchase order line this alert is associated with",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
  "credit": 0.0,
  "discount": 0.0,
  "insurance": 0.0,
  "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
  "overhead": 0.0,
  "shipment": 0.0,
  "tax_1": 0.0,
  "tax_2": 0.0,
  "use_pro_rate": false,
  "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"adjustment not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /adjustment/{id}

Delete adjustment item with given {adjustmentId}

DELETE /adjustment/{id}
URI Parameters
  • id: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to delete adjustment -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"adjustment not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /adjustment/{id}

Update adjustment item with given {adjustmentId}

PUT /adjustment/{id}
URI Parameters
  • id: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "purchase order adjustments",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this adjustment record",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "credit": {
      "description": "amount of credits",
      "type": "number"
    },
    "discount": {
      "description": "amount of discounts",
      "type": "number"
    },
    "insurance": {
      "description": "amount of insurance cost",
      "type": "number"
    },
    "invoice_id": {
      "description": "UUID of the invoice record associated with this adjustment",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "overhead": {
      "description": "amount of overhead costs",
      "type": "number"
    },
    "shipment": {
      "description": "amount of shipment costs",
      "type": "number"
    },
    "tax_1": {
      "description": "amount of taxes (line 1, e.g. state)",
      "type": "number"
    },
    "tax_2": {
      "description": "amount of taxes (line 2, e.g. federal)",
      "type": "number"
    },
    "use_pro_rate": {
      "description": "whether or not to pro-rate the order cost",
      "type": "boolean"
    },
    "po_line_id": {
      "description": "UUID of the purchase order line this alert is associated with",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
  "credit": 0.0,
  "discount": 0.0,
  "insurance": 0.0,
  "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
  "overhead": 0.0,
  "shipment": 0.0,
  "tax_1": 0.0,
  "tax_2": 0.0,
  "use_pro_rate": false,
  "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
}

Response 204

Item successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update adjustment -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"adjustment not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator