Fee Service (v1)

Download OpenAPI specification:Download

The Fee Service allows to manage the fees in the system. The Fees are agreed-upon amounts someone pays for a service or privilege.

Fee management

Retrieving fees

Retrieves all fees for tenant.

SecurityOAuth2
Request
path Parameters
tenant
required
string

the tenant to work on.

Example: testtenant
query Parameters
siteCode
string
Default: "main"

A list of site codes.

code
string

A list of fee codes.

id
string

A list of feeIds.

pageNumber
integer >= 1
Default: 1

The page number to be retrieved where the size of the pages must be specified by the pageSize parameter. The number of the first page is 1.

pageSize
integer >= 1
Default: 16

The number of documents being retrieved on one page.

header Parameters
Accept-Language
string >= 1
Default: *

The value of the locale identifier of the language in which the attribute should be returned. Provide several values separated by comma, in order to specify fallback languages.

Responses
200

Request was successful.

400

Request was syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

500

Some server-side error occurred. Details will be provided in the response payload.

get/{tenant}/fees
Request samples
Response samples
application/json
[
  • {
    },
  • {
    }
]

Creating fee

Creates a new fee.


Required scopes

  • fee.fee_create
SecurityOAuth2
Request
path Parameters
tenant
required
string

the tenant to work on.

Example: testtenant
header Parameters
Content-Language
string

The locale identifier of the language of the updated attribute.

Request Body schema: application/json
id
string

Unique identifier of the fee.

required
string or object

The localized fee name.

string or object

The localized fee description.

code
required
string <= 100 characters

The code-name, unique for the tenant.

feeType
required
string

'PERCENT' for relative values, 'ABSOLUTE' for float values or 'ABSOLUTE_MULTIPLY_ITEMQUANTITY' for float values to be multiplied by the quantity of the item.

Enum: "PERCENT" "ABSOLUTE" "ABSOLUTE_MULTIPLY_ITEMQUANTITY"
feePercentage
number >= 0

The fee rate in percentage. Required if feeType is 'PERCENT'.

object (Monetary Amount)

The fee as an absolute amount. Required if type is 'ABSOLUTE'.

itemType
string

The itemtype the fee can belong to. It could be for a cart, product, paymenttype etc. If there is no itemType set this fee can be applied to all itemTypes

Enum: "CART" "PRODUCT" "PAYMENTTYPE" "NULL"
siteCode
required
string

The SiteCode the fee belongs to.

active
required
boolean

Flag indicating whether the fee is currently active or not.

taxable
boolean

Flag indicating whether the fee is taxable or not.

taxCode
string

The tax code.

object (Timespan)

Restricts the active fees to be only applied in the specified timespan.

yrn
string (YRN) non-empty

A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant.

Responses
201

The resource has been successfully created.

400

Request was syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

409

Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.

500

Some server-side error occurred. Details will be provided in the response payload.

post/{tenant}/fees
Request samples
application/json
{
  • "name": {
    },
  • "code": "apple_picking_fee",
  • "feeType": "ABSOLUTE",
  • "siteCode": "main",
  • "feeAbsolute": {
    },
  • "active": true,
  • "taxable": false
}
Response samples
application/json
{
  • "id": "5d80a39ceec29e04726e921f",
  • "yrn": "urn:yaas:saasag:fee:id:tenantName;5d80a39ceec29e04726e921f"
}

Retrieving fee by id.

Retrieving a fee by given id.

SecurityOAuth2
Request
path Parameters
id
required
string

The unique identifier of the requested fee.

tenant
required
string

the tenant to work on.

Example: testtenant
query Parameters
withItems
boolean
Default: false

Boolean parameter that enables the retrieval of item YRNs the fee is assigned to. By default, this value is false.

header Parameters
Accept-Language
string >= 1
Default: *

The value of the locale identifier of the language in which the attribute should be returned. Provide several values separated by comma, in order to specify fallback languages.

Responses
200

Fee successfully retrieved.

400

Request was syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

404

The requested resource does not exist.

500

Some server-side error occurred. Details will be provided in the response payload.

get/{tenant}/fees/{id}
Request samples
Response samples
application/json
{
  • "fee": {
    },
  • "itemYRNs": {
    }
}

Updating a fee

Updates a fee.


Required scopes

  • fee.fee_update
SecurityOAuth2
Request
path Parameters
id
required
string

The unique identifier of the requested fee.

tenant
required
string

the tenant to work on.

Example: testtenant
query Parameters
partial
boolean
Default: false

Boolean parameter that defines the update type. By default, its value is false. For partial updates, the value is true.

header Parameters
Content-Language
string

The locale identifier of the language of the updated attribute.

Request Body schema: application/json
id
string

Unique identifier of the fee.

required
string or object

The localized fee name.

string or object

The localized fee description.

code
required
string <= 100 characters

The code-name, unique for the tenant.

feeType
required
string

'PERCENT' for relative values, 'ABSOLUTE' for float values or 'ABSOLUTE_MULTIPLY_ITEMQUANTITY' for float values to be multiplied by the quantity of the item.

Enum: "PERCENT" "ABSOLUTE" "ABSOLUTE_MULTIPLY_ITEMQUANTITY"
feePercentage
number >= 0

The fee rate in percentage. Required if feeType is 'PERCENT'.

object (Monetary Amount)

The fee as an absolute amount. Required if type is 'ABSOLUTE'.

itemType
string

The itemtype the fee can belong to. It could be for a cart, product, paymenttype etc. If there is no itemType set this fee can be applied to all itemTypes

Enum: "CART" "PRODUCT" "PAYMENTTYPE" "NULL"
siteCode
required
string

The SiteCode the fee belongs to.

active
required
boolean

Flag indicating whether the fee is currently active or not.

taxable
boolean

Flag indicating whether the fee is taxable or not.

taxCode
string

The tax code.

object (Timespan)

Restricts the active fees to be only applied in the specified timespan.

yrn
string (YRN) non-empty

A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant.

Responses
200

Fee successfully updated.

400

Request was syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

404

The requested resource does not exist.

409

Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.

500

Some server-side error occurred. Details will be provided in the response payload.

put/{tenant}/fees/{id}
Request samples
application/json
{
  • "name": {
    },
  • "code": "apple_picking_fee",
  • "feeType": "ABSOLUTE",
  • "siteCode": "main",
  • "feeAbsolute": {
    },
  • "active": true,
  • "taxable": false
}
Response samples
application/json
{
  • "status": 400,
  • "message": "must be greater than or equal to 1, see details for more info\"",
  • "moreInfo": "",
  • "type": "validation_violation",
  • "details": [
    ]
}

Deleting a fee.

Deletes a fee by given id.


Required scopes

  • fee.fee_delete
SecurityOAuth2
Request
path Parameters
id
required
string

The unique identifier of the requested fee.

tenant
required
string

the tenant to work on.

Example: testtenant
Responses
204

The resource has been successfully deleted.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

404

The requested resource does not exist.

500

Some server-side error occurred. Details will be provided in the response payload.

delete/{tenant}/fees/{id}
Request samples
Response samples
application/json
{
  • "fault": {
    }
}

Item Fee management

Retrieve all itemFees

Retrieve all itemFees.

SecurityOAuth2
Request
path Parameters
tenant
required
string

the tenant to work on.

Example: testtenant
query Parameters
siteCode
string
Default: "main"

A list of site codes.

feeIds
string

A list of feeIds.

productIds
string

A list of product Ids.

expand
boolean
Default: false

Whether only the fee-id is in the response or the full fees.

pageNumber
integer >= 1
Default: 1

The page number to be retrieved where the size of the pages must be specified by the pageSize parameter. The number of the first page is 1.

pageSize
integer >= 1
Default: 16

The number of documents being retrieved on one page.

siteFallback
boolean
Default: false
header Parameters
Accept-Language
string >= 1
Default: *

The value of the locale identifier of the language in which the attribute should be returned. Provide several values separated by comma, in order to specify fallback languages.

Responses
200

Request was successful.

400

Request was syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

500

Some server-side error occurred. Details will be provided in the response payload.

get/{tenant}/itemFees
Request samples
Response samples
application/json
[
  • {
    },
  • {
    }
]

Creating itemFee

Creates a new itemFee.


Required scopes

  • fee.item_create
SecurityOAuth2
Request
path Parameters
tenant
required
string

the tenant to work on.

Example: testtenant
header Parameters
Content-Language
string

The locale identifier of the language of the updated attribute.

Request Body schema: application:json
id
string

Unique identifier of the item fee.

siteCode
required
string

The SiteCode this fee belongs to.

itemYrn
required
string

YRN of the item to assign fees to.

feeIds
required
Array of strings

List of unique identifiers of fees to assign to the item.

Array of objects (Fee)

List of fees to assign to the item.

Responses
201

The resource has been successfully created.

400

Request was syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

409

Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.

500

Some server-side error occurred. Details will be provided in the response payload.

post/{tenant}/itemFees
Request samples
application:json
{
  • "siteCode": "main",
  • "itemYrn": "urn:yaas:saasag:caasproduct:product:tenantName;5c2e4957a46b0e0008491095",
  • "feeIds": [
    ],
  • "fees": [
    ]
}
Response samples
application/json
{
  • "id": "5d80a196eec29e04726e921e",
  • "yrn": "urn:yaas:saasag:fee:id:tenantName;5d80a196eec29e04726e921e"
}

Retrieving all item fees

Retrieves all item fees for specified itemYRN.

SecurityOAuth2
Request
path Parameters
itemYRN
required
string
tenant
required
string

the tenant to work on.

Example: testtenant
query Parameters
siteCode
string
Default: "main"

A list of site codes.

expand
boolean
Default: false

Whether only the fee-id is in the response or the full fees.

header Parameters
Accept-Language
string >= 1
Default: *

The value of the locale identifier of the language in which the attribute should be returned. Provide several values separated by comma, in order to specify fallback languages.

Responses
200
400

Request syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

get/{tenant}/itemFees/{itemYRN}/fees
Request samples
Response samples
application/json
[
  • {
    },
  • {
    }
]

Adding a list of feeIds to the itemYRN

Adds a list of feeIds to the itemYRN.


Required scopes

  • fee.item_update
SecurityOAuth2
Request
path Parameters
itemYRN
required
string
tenant
required
string

the tenant to work on.

Example: testtenant
query Parameters
partial
boolean
Default: false

Boolean parameter that defines the update type. By default, its value is false. For partial updates, the value is true.

Request Body schema: application/json
feeIds
required
Array of strings
Responses
200

FeeIds successfully added.

400

Request was syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

put/{tenant}/itemFees/{itemYRN}/fees
Request samples
application/json
{
  • "feeIds": [
    ]
}
Response samples
application/json
{
  • "status": 400,
  • "message": "Fees Not Added",
  • "moreInfo": "",
  • "type": "application/json",
  • "details": [
    ]
}

Deleting item fee with itemYRN

Deletes item fee with the specified itemYRN.


Required scopes

  • fee.item_delete
SecurityOAuth2
Request
path Parameters
itemYRN
required
string
tenant
required
string

the tenant to work on.

Example: testtenant
Responses
204

Item fee successfully deleted

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

delete/{tenant}/itemFees/{itemYRN}/fees
Request samples
Response samples
application/json
{
  • "fault": {
    }
}

Deleting a fee from the itemYRN

Deletes a fee for the specified itemYRN and optionally deletes item fee if does not contain any more fee ids.


Required scopes

  • fee.item_delete
SecurityOAuth2
Request
path Parameters
itemYRN
required
string
tenant
required
string

the tenant to work on.

Example: testtenant
feeId
required
string
Responses
204

Fee successfully deleted from itemYRN.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

404

The requested resource does not exist.

delete/{tenant}/itemFees/{itemYRN}/fees/{feeId}
Request samples
Response samples
application/json
{
  • "fault": {
    }
}

Product Fees management

Retrieving all fees with given productId

Retrieve all fees with given productId.

SecurityOAuth2
Request
path Parameters
tenant
required
string

the tenant to work on.

Example: testtenant
productId
required
string

The unique identifier of the requested product.

query Parameters
siteCode
string
Default: "main"

A list of site codes.

expand
boolean
Default: false

Whether only the fee-id is in the response or the full fees.

header Parameters
Accept-Language
string >= 1
Default: *

The value of the locale identifier of the language in which the attribute should be returned. Provide several values separated by comma, in order to specify fallback languages.

Responses
200
400

Request syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

get/{tenant}/productFees/{productId}/fees
Request samples
Response samples
application/json
[
  • {
    },
  • {
    }
]

Adding a list of feeIds to the itemYRN

Adds a list of feeIds to the itemYRN.


Required scopes

  • fee.item_update
SecurityOAuth2
Request
path Parameters
tenant
required
string

the tenant to work on.

Example: testtenant
productId
required
string

The unique identifier of the requested product.

query Parameters
siteCode
string
Default: "main"

A list of site codes.

partial
boolean
Default: false

Boolean parameter that defines the update type. By default, its value is false. For partial updates, the value is true.

Request Body schema: application/json
feeIds
required
Array of strings
Responses
200

Resource updated successfully.

400

Request was syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

put/{tenant}/productFees/{productId}/fees
Request samples
application/json
{
  • "feeIds": [
    ]
}
Response samples
application/json
{
  • "status": 400,
  • "message": "Fees Not Added",
  • "moreInfo": "",
  • "type": "application/json",
  • "details": [
    ]
}

Deleting all fees of an itemYRN

Deletes item fee with specified productId in the itemYRN


Required scopes

  • fee.fee_delete and/or
  • fee.item_delete
SecurityOAuth2
Request
path Parameters
tenant
required
string

the tenant to work on.

Example: testtenant
productId
required
string

The unique identifier of the requested product.

Responses
204

Resource deleted successfully.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

delete/{tenant}/productFees/{productId}/fees
Request samples
Response samples
application/json
{
  • "fault": {
    }
}

Deleting a fee from the itemYRN

Deletes a fee for the specified productId and optionally deletes item fee if does not contain any more fee ids.


Required scopes

  • fee.fee_delete and/or
  • fee.item_delete
SecurityOAuth2
Request
path Parameters
feeId
required
string
tenant
required
string

the tenant to work on.

Example: testtenant
productId
required
string

The unique identifier of the requested product.

Responses
204

Resource deleted successfully.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

404

The requested resource does not exist.

delete/{tenant}/productFees/{productId}/fees/{feeId}
Request samples
Response samples
application/json
{
  • "fault": {
    }
}

Searching itemFees by product ID.

Search itemFees by product ID.

SecurityOAuth2
Request
path Parameters
tenant
required
string

the tenant to work on.

Example: testtenant
Request Body schema: application/json
productId
required
string
siteCodes
required
Array of strings
pageNumber
integer
Default: 1
pageSize
integer
Default: 16
Responses
200
400

Request was syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

post/{tenant}/itemFees/searchByProductId
Request samples
application/json
{
  • "productId": "Apple_A_productId",
  • "siteCodes": [
    ],
  • "pageNumber": 1,
  • "pageSize": 10
}
Response samples
application/json
[
  • {
    },
  • {
    }
]

Searching itemFees by product IDs.

Search itemFees by multiple product IDs.

SecurityOAuth2
Request
path Parameters
tenant
required
string

the tenant to work on.

Example: testtenant
query Parameters
siteFallback
boolean
Default: false
Request Body schema: application/json
productIds
required
string
siteCode
required
string
pageNumber
integer
Default: 1
pageSize
integer
Default: 16
Responses
200
400

Request was syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

post/{tenant}/itemFees/searchByProductIds
Request samples
application/json
{
  • "productIds": "Apple_A_productId,Apple_B_productId",
  • "siteCode": "example_site_code",
  • "pageNumber": 1,
  • "pageSize": 10
}
Response samples
application/json
[
  • {
    },
  • {
    }
]

Checking if a fee has been applied.

Checks if the itemYrns in the request have a fee applied to. Responds with the itemYRN and the corresponding fees.

SecurityOAuth2
Request
path Parameters
tenant
required
string

the tenant to work on.

Example: testtenant
query Parameters
siteCode
string
Default: "main"

A list of site codes.

Request Body schema: application/json
itemYrns
required
Array of strings
siteCode
required
string
Responses
200
400

Request was syntactically incorrect. Any details will be provided within the response payload.

401

Given request is unauthorized - the authorization token is invalid or has expired.

Details will be provided in the response payload.

403

Access token does not contain necessary scopes or tenant in path does not match tenant from token.

post/{tenant}/itemFees/search
Request samples
application/json
{
  • "itemYrns": [
    ],
  • "siteCode": "main"
}
Response samples
application/json
[
  • {
    },
  • {
    }
]