Include for Custom Discounts
GET Include Custom Discounts
You can use include=custom_discounts to retrieve detailed information about the custom discounts associated with an order.
https://useast.api.elasticpath.com/v2/orders/:id?include=custom_discounts
Parameters
Path parameters
| Name | Required | Type | Description | 
|---|---|---|---|
| id | Required | string | The ID of the order. | 
Query parameters
| Name | Required | Type | Description | 
|---|---|---|---|
| include | Required | string | The custom discounts for the order. | 
Request Example - Curl
curl -X GET https://useast.api.elasticpath.com/v2/orders/:id?include=custom_discounts \
     -H "Authorization: Bearer XXXX"
Response Example
200 OK
{
    "data": {
        "id": "a51a680e-9570-4f8d-9bbc-bd3c9fcd9ea3",
        "type": "order",
        "status": "incomplete",
        "payment": "unpaid",
        "shipping": "unfulfilled",
        "anonymized": false,
        "customer": {
            "name": "John Doe",
            "email": "andy@example.com"
        },
        "shipping_address": {
            "first_name": "Andy",
            "last_name": "Dwyer",
            "phone_number": "123-456-1111",
            "company_name": "Elasticpath",
            "line_1": "1 Sunny Street",
            "line_2": "",
            "city": "Sunny Town",
            "postcode": "v1v 1v1",
            "county": "BC",
            "country": "CA",
            "instructions": ""
        },
        "billing_address": {
            "first_name": "Andy",
            "last_name": "Dwyer",
            "company_name": "Elasticpath",
            "line_1": "1 Sunny Street",
            "line_2": "",
            "city": "Sunny Town",
            "postcode": "v1v 1v1",
            "county": "BC",
            "country": "CA"
        },
        "links": {},
        "meta": {
            "display_price": {
                "with_tax": {
                    "amount": 8500,
                    "currency": "USD",
                    "formatted": "$85.00"
                },
                "without_tax": {
                    "amount": 8500,
                    "currency": "USD",
                    "formatted": "$85.00"
                },
                "tax": {
                    "amount": 0,
                    "currency": "USD",
                    "formatted": "$0.00"
                },
                "discount": {
                    "amount": -1500,
                    "currency": "USD",
                    "formatted": "-$15.00"
                },
                "balance_owing": {
                    "amount": 8500,
                    "currency": "USD",
                    "formatted": "$85.00"
                },
                "paid": {
                    "amount": 0,
                    "currency": "USD",
                    "formatted": "$0.00"
                },
                "authorized": {
                    "amount": 0,
                    "currency": "USD",
                    "formatted": "$0.00"
                },
                "without_discount": {
                    "amount": 10000,
                    "currency": "USD",
                    "formatted": "$100.00"
                }
            },
            "timestamps": {
                "created_at": "2023-04-19T23:08:57Z",
                "updated_at": "2023-04-19T23:08:57Z"
            }
        },
        "relationships": {
            "items": {
                "data": [
                    {
                        "type": "item",
                        "id": "8addeb0a-3117-4583-bb92-efd7a7aa91b5"
                    }
                ]
            },
            "custom_discounts": {
                "data": [
                    {
                        "type": "custom_discount",
                        "id": "4b3ec5f2-941f-4125-89d7-5885b3e9782b"
                    }
                ]
            }
        }
    },
    "included": {
        "custom_discounts": [
            {
                "amount": {
                    "amount": -500,
                    "currency": "USD"
                },
                "type": "custom_discount",
                "id": "3e36ad8e-cf3e-463d-8332-ef569ffc819c",
                "external_id": "item custom discount",
                "discount_engine": "Custom Discount Engine",
                "description": "custom discount description",
                "discount_code": "item custom-code"
            },
            {
                "amount": {
                    "amount": -1000,
                    "currency": "USD"
                },
                "type": "custom_discount",
                "id": "4b3ec5f2-941f-4125-89d7-5885b3e9782b",
                "external_id": "cart custom discount",
                "discount_engine": "Custom Discount Engine",
                "description": "custom discount description",
                "discount_code": "cart custom-code"
            }
        ]
    }
}