iLab API - Cost Allocation response not always consistent.

I am using iLab API in .Net Core application to get a list of service requests. I am able to parse JSON response with Serializer.Deserialize in most cases, on some of the service requests the deserialization fails dues to inconsistence format of the "payment number" in the "cost allocation" node. the payment number return null, a string or and object. Can someone help with iLab APIs ? 

Here are examples of cost allocations I get:

example 1

"cost_allocations": [
                {
                    "allocatable_percentage": "100.0",
                    "payment_method": "",
                    "amount": "0.0",
                    "payment_options": null,
                    "payment_number": null
                }
            ],
example 2
            "cost_allocations": [
                {
                    "allocatable_percentage": "100.0",
                    "payment_method": "",
                    "amount": "0.0",
                    "payment_options": "custom",
                    "payment_number": "RES233312"
                }
            ],
example 3
"cost_allocations": [
                {
                    "allocatable_percentage": "100.0",
                    "payment_method": "",
                    "amount": "0.0",
                    "payment_options": null,
                    "payment_number": {
                        "id": 6311111,
                        "n1": "SP004661",
                        "n2": "50352",
                        "n3": "1",
                        "description": "Analysis Project",
                        "available_funds": null,
                        "expires_at": "2027-12-10T23:59:59.000-05:00",
                        "manually_added": false,
                        "erp_id": 1130,
                        "created_at": "2022-03-10T05:37:50.000-05:00",
                        "updated_at": "2022-03-10T05:37:50.000-05:00",
                        "status": "active",
                        "fund_owner_id": 1149222,
                        "n4": "10921",
                        "n5": "193209",
                        "n6": "SPONSORED PROGRAMS",
                        "n7": null,
                        "n8": null,
                        "n9": null,
                        "n10": null,
                        "voucherable": null,
                        "alias": null,
                        "n11": null,
                        "starts_at": null,
                        "center_id": null,
                        "manager_id": null,
                        "fund_transfer_id": null,
                        "imported": true,
                        "source": "sponsored",
                        "version": null
                    }
                }
            ],
Was this helpful?