There was a problem loading the comments.

Advanced Response Injector

Support Portal  »  Knowledgebase  »  Viewing Article

  Print
  • 24/02/2022 1:14 PM

Advanced header is a custom header, a part of Billia, whose purpose is to amplify the response body of a requested resource, with all its related resources.

KeyValue
Accepr-ResponseAdvanced

Example

The billing/product resource will be used in the example

GET /billing/product

Json output example without the advanced response header:

{
  "_embedded": {
    "catalog_product": [
      {
        "product_id": 1,
        "name": "test1",
        "status": "active",
        "module": "Cpanel",
        "description": "descr",
        "min_quantity": 1,
        "max_quantity": 10,
        "quantity_type": "monthly",
        "suspend_days": 5,
        "redemption_days": 0,
        "terminate_days": 10,
        "category_id": 25
      },
      ...
    ]
  }
}

The same resource, requested with the advanced header:

GET /billing/product

{
    "_embedded": {
        "catalog_product": [
            {
                "product_id": 1,
                "name": "example",
                "status": "active",
                "module": "Cpanel",
                "description": "descr",
                "min_quantity": 1,
                "max_quantity": 10,
                "quantity_type": "monthly",
                "suspend_days": 5,
                "redemption_days": 0,
                "terminate_days": 10,
                "category_id": 25,
                "category": {
                    "id": 25,
                    "parent_category_id": 0,
                    "name": "Domains",
                    "description": "Domains description",
                    "layout": "domain",
                },
                "options": [
                    {
                        "option_id": 1,
                        "name": "Option name",
                        "namespace": "",
                        "option_key": "optoin_key",
                        "instruction": "",
                        "required": 0,
                        "provider": "system",
                        "visibility": "everywhere",
                        "option_type": "text",
                        "option_type_value": "text",
                        "relation_identifier": 440,
                    },
                    ...
                ],
                "price": {
                    "tax": {
                        "amount": 1.11,
                        "country": "Finland",
                        "percent": "24%"
                    },
                    "quantity": 1,
                    "currency": "EUR",
                    "tax_included": true,
                    "unit_price": 6.66,
                    "total_product": 8.21,
                    "choices_total": 0,
                    "total": 8.21,
                    "discount": {
                        "_discount": {
                            "discount_promocode_message": "Discounted by code: ",
                            "discount_quantity_message": "Can't be discounted by quantity criteria"
                        }
                    }
                }
            },
		...
        ]
    }
}

Share via

Related Articles

© ApiHawk