# Charges

Charges are additional fees that are added to the order on certain conditions. for example delivery charges, charges can be added automatically and can be edited by users.

# The Charge Object

# Sample

{
  "id": "8d10c353",
  "name": "Service Charge",
  "name_localized": null,
  "type": 2,
  "order_types": [
    1,
    3
  ],
  "is_auto_applied": true,
  "value": 10,
  "created_at": "2019-02-24 18:02:40",
  "updated_at": "2019-02-24 18:02:40",
  "deleted_at": null,
  "is_open_charge": true,
  "tax_group": {
    "id": "8d84bdcf"
  },
  "branches": [
    {
      "id": "8d84b5d2"
    }
  ]
}

# Attributes

Field Type Rule Description
id string Unique identifier for the charge.
name* string updatable Name of the charge.
name_localized string nullable updatable Localized name of the charge.
type* integer nullable updatable The Charge Type.
order_types* array updatable The list of Order Types the charge can be applied on.
is_auto_applied boolean updatable Determines if the charge is applied on orders automatically.
value* double updatable The values of the charge.
is_open_charge* boolean updatable Determine if the charge is open. Open means the charge percent/amount is entered manually by the user
tax_group object updatable includable The Tax Group attached to the charge.
branches array updatable includable List of Branches attached to the charge.
created_at string sortable Time YYYY-MM-DD HH-MM-SS in UTC at which the charge was created.
updated_at string sortable Time YYYY-MM-DD HH-MM-SS in UTC at which the charge was updated.
deleted_at string nullable Time YYYY-MM-DD HH-MM-SS in UTC at which the charge was deleted.

# Charge Types

Type Description
1 Amount.
2 Percentage.

# List Charges

GET /charges

# Scope

general.read

# Filters

  • id
  • name
  • name_localized
  • type
  • is_auto_applied
  • updated_after
  • is_deleted
  • created_on
  • updated_on
  • deleted_on

# Response

{
  "data": [
    {
      "id": "8d10c353",
      "name": "Service Charge",
      "name_localized": null,
      "type": 2,
      "order_types": [
        1,
        3
      ],
      "is_auto_applied": true,
      "is_open_charge": true,
      "value": 10,
      "created_at": "2019-02-24 18:02:40",
      "updated_at": "2019-02-24 18:02:40",
      "deleted_at": null,
      "tax_group": {
        "id": "8d84bdcf"
      },
      "branches": [
        {
          "id": "8d84b5d2"
        }
      ]
    }
  ]
}

# Get Charge

GET /charges/{chargeId}

# Scope

general.read

# Response

{
  "data": {
    "id": "8d10c353",
    "name": "Service Charge",
    "name_localized": null,
    "type": 2,
    "order_types": [
      1,
      3
    ],
    "is_auto_applied": true,
    "is_open_charge": true,
    "value": 10,
    "created_at": "2019-02-24 18:02:40",
    "updated_at": "2019-02-24 18:02:40",
    "deleted_at": null,
    "tax_group": {
      "id": "8d84bdcf"
    },
    "branches": [
      {
        "id": "8d84b5d2"
      }
    ]
  }
}

# Create Charge

POST /charges

# Scope

admin.write

# Request

{
  "name": "Service Charge",
  "name_localized": null,
  "type": 2,
  "tax_group_id": "8d10c353",
  "order_types": [
    1,
    3
  ],
  "is_auto_applied": true,
  "is_open_charge": true,
  "value": 10,
  "branches": [
    {
      "id": "8f7ab00a"
    }
  ]
}

# Response

{
  "data": {
    "id": "8d10c353",
    "name": "Service Charge",
    "name_localized": null,
    "type": 2,
    "order_types": [
      1,
      3
    ],
    "is_auto_applied": true,
    "is_open_charge": true,
    "value": 10,
    "created_at": "2019-02-24 18:02:40",
    "updated_at": "2019-02-24 18:02:40",
    "deleted_at": null,
    "tax_group": {
      "id": "8d84bdcf"
    },
    "branches": [
      {
        "id": "8d84b5d2"
      }
    ]
  }
}

# Update Charge

POST /charges/{chargeId}`

# Scope

admin.write

# Request

{
  "name": "Service Charge",
  "name_localized": null,
  "type": 2,
  "tax_group_id": "8d10c353",
  "order_types": [
    1,
    3
  ],
  "is_auto_applied": true,
  "is_open_charge": true,
  "value": 10,
  "branches": [
    {
      "id": "8f7ab00a"
    }
  ]
}

# Response

{
  "data": {
    "id": "8d10c353",
    "name": "Service Charge",
    "name_localized": null,
    "type": 2,
    "order_types": [
      1,
      3
    ],
    "is_auto_applied": true,
    "is_open_charge": true,
    "value": 10,
    "created_at": "2019-02-24 18:02:40",
    "updated_at": "2019-02-24 18:02:40",
    "deleted_at": null,
    "tax_group": {
      "id": "8d84bdcf"
    },
    "branches": [
      {
        "id": "8d84b5d2"
      }
    ]
  }
}

# Delete Charge

DELETE /charges/{chargeId}

# Scope

admin.write

The API will respond with 200 indicating that the charge has been deleted.

# Restore Charge

PUT /charges/{chargeId}/restore

# Scope

admin.restore

The API will respond with 200 indicating that the charge has been restored.

Last Updated: 2/9/2023, 2:19:30 PM