Spending API
- Global Parameters
- Spending Parameters
- Possible Response Columns
- Predefined Entities in XML
- Sample XML Requests and Responses
- Sample Request: Spending Transactions
- Sample Response: Spending Transactions
- Sample Request: Spending Transactions (OTHER GOVERNMENT ENTITIES - NYCEDC)
- Sample Response: Spending Transactions (OTHER GOVERNMENT ENTITIES - NYCEDC)
- Sample Request: Spending Transactions (OTHER GOVERNMENT ENTITIES - NYCHA)
- Sample Response: Spending Transactions (OTHER GOVERNMENT ENTITIES - NYCHA)
- Status Codes and Messages
Global Parameters
Name | Required (Y/N) | Format/Value | Description | Example |
---|---|---|---|---|
type_of_data | Y | String –Maximum 15 Characters | Allows user to select different types of data. Value must be one of the following:Contracts, Budget, Revenue, Payroll, Spending, Spending_OGE, Contracts_OGE, Spending_NYCHA, Contracts_NYCHA, Payroll_NYCHA | Spending |
max_records | N | String – Max 4 characters | Allows you to set the maximum number of records retrieved to fewer than 1000 | 500 |
record_from | N | String – Max 15 characters | Allows you to set the starting position of the records to be retrieved | 12500 |
type_of_data: Spending
Spending Parameters – All the parameters are optional, meaning that you can send only 1 or all of them. If you choose to not send any, you will receive random transactions in return, as these parameters are the filter.
Name | Required (Y/N/C) | Type of Criteria (Value/Range) | Format/Value | Applicable Filters | Description | Spending Category | Reference Codes | Example |
---|---|---|---|---|---|---|---|---|
fiscal_year | C | value | String - YYYY - Maximum 4 characters | Citywide Agencies and Other Government Entities (NYCEDC, NYCHA) | Fiscal Year. Must be exactly 4 characters. Either fiscal year or Issue Date can be specified. |
|
2005 | |
payee_name | N | value | String - Maximum 100 characters | Other Government Entities (NYCEDC) | Vendor name. The user shall be able to search using vendor name. The search will return all results that match the first three letters of the vendor name. |
|
apple inc | |
payee_code | N | value | String - Maximum 10 characters | Citywide Agencies | The unique identifier assigned to the vendor/customer. |
|
Citywide: Payee Codes List | 0000636940 |
vendor_code | N | value | String - Maximum 10 characters | Other Government Entities(NYCHA) | The unique identifier assigned to the vendor/customer. |
|
NYCHA: Vendor Codes list | ANA SANCHEZ-75002294 |
document_id | N | value | String - Maximum 36 characters | Citywide Agencies and Other Government Entities(NYCEDC, NYCHA) | The unique identifier assigned to the vendor/customer. |
|
20110480413 | |
agency_code | N | value | String - Maximum 3 characters | Citywide Agencies | The unique identifier assigned to the agency. |
|
Citywide: Agency Codes List | 002 |
issue_date | C | range | String - YYYY-MM-DD | Citywide Agencies | The Check/EFT Issue Date field is the day that represents when the check or electronic funds transfer was issued for disbursement. Either fiscal year or Issue Date can be specified. |
|
2011-06-13 | |
department_code | N | value | String – Maximum 9 characters | Citywide Agencies and Other Government Entities (NYCEDC) | An identification code associated with a department on the accounting line. |
|
Citywide: Department Codes List | 561 |
check_amount | N | range | String - Maximum 22 characters | Citywide Agencies and Other Government Entities(NYCEDC, NYCHA) | This is the net check amount. It reflects the line amount net any of the deductions (i.e., discount, retainage, withholding, intercepts, interest). Up to "99999999999999.99" (99 trillion); includes decimal and leading negative; no commas or dollar sign. |
|
10000.00 | |
expense_category | N | value | String – Maximum 22 characters | Citywide Agencies and Other Government Entities(NYCEDC, NYCHA) | The unique identifier assigned to Expense Category |
|
Citywide: Expense Category Codes List NYCHA: Expense Category Codes List |
6620 |
contract_id | N | value | String - Maximum 32 characters | Citywide Agencies and Other Government Entities(NYCEDC, NYCHA) | Identification code associated with contract. |
|
CT100220060028251 | |
capital_project_code | N | value | String - Maximum 15 characters | Citywide Agencies and Other Government Entities (NYCEDC) | Identification of Capital Project for which Disbursement is being made. |
|
Citywide: Capital Project codes List | 040A000 |
spending_category | N | value | String - Maximum 10 characters | Citywide Agencies and Other Government Entities(NYCEDC, NYCHA) | For total spending, the user shall not include the script for spending category in the request xml (search criteria).By default, that data for total spending is displayed. |
|
Citywide: Spending Category codes list NYCHA: Spending Category codes list |
c |
budget_name | N | value | String- Maximum 75 characters | Other Government Entities(NYCEDC) | Budget name. The user shall be able to search using budget name. The search will return all results that match the first three letters of the budget name. |
|
FA - EDUCATIONAL ALLIANCE RENOVATIONS | |
commodity_line | N | value | String- Maximum 3 characters | Other Government Entities(NYCEDC) |
|
1 | ||
entity_contract_number | N | value | String- Maximum 15 characters | Other Government Entities(NYCEDC) | Identification code associated with OGE contract. The user would need to enter the contract number manually. |
|
48440001 | |
other_government _entities_code |
N | value | String- Maximum 3 characters | Other Government Entities(NYCEDC) | Identifies which government entities the user would want to search. Currently Includes EDC and NYCHA. Code for EDC is z81 and NYCHA is 996. |
|
z81 | |
mwbe_category | N | value | String- Maximum 20 characters | Citywide Agencies | User shall be able to extract data for specific mwbe categories, by specifying the mwbe category code in the request XML. For all m/wbe categories results, user need not give any m/wbe category codes in the request. By default, it shall display results for all categories.For Total M/WBE, include all the m/wbe category codes in the request XML, which is 1~2~3~4~5~10~6~9~99. |
|
Citywide: mwbe categories list | 3 |
industry | N | value | String- Maximum 4 characters | Citywide Agencies and Other Government Entities(NYCHA) |
User shall be able to extract data for specific industry types, by specifying the industry type codes in the request XML. By default, it shall display results for all industries. |
|
Citywide: Industry Codes list NYCHA: Industry Codes list |
2 |
funding_source | N | value | String- Maximum 9 characters | Other Government Entities(NYCHA) | User shall be able to extract data for specific funding sources, by specifying the funding source codes in the request XML.By default, it shall display results for all funding sources. Spending Categories- Total,Contract, and Other spending are applicable for NYCHA. |
|
NYCHA: Funding Source Codes list | GF01 |
responsibility_center | N | value | String- Maximum 10 characters | Other Government Entities(NYCHA) | User shall be able to extract data for specific responsibility center, by specifying the responsibility center codes in the request XML.By default, it shall display results for all responsibility center. |
|
NYCHA:Responsibility Center Codes list | B0361600 |
purchase_order_type | N | value | String- Maximum 2 characters | Other Government Entities(NYCHA) | User shall be able to narrow down the results by providing by pruchase order type |
|
NYCHA: Purchase Order codes | PA |
amount_spent | N | value | String- Maximum 22 characters | Other Government Entities(NYCHA) | This is the net amount spent by NYCHA. It reflects the line amount net including the deductions (i.e., invoice discount, retainage, withholding). Up to "99999999999999.99" (99 trillion); includes decimal and leading negative; no commas or dollar sign. S |
|
200 | |
conditional_category | N | value | String- Maximum 2 characters | Citywide Agencies | Identification id associated with conditional category. |
|
Citywide: Conditional Category Ids | 1 |
Possible response columns:
User would be able to select which columns he would like to view in his output. Below mentioned are the possible column names for contracts domain (including OGE column names). The user should include the required column names in the request xml in an element called <response_columns>
|
|
|
Predefined Entities in XML
The user has to encode the names using the predefined entities list embedded below, while searching using names (payee_name, budget_name, vendor_name, and contract_purpose). The table below lists the five XML predefined entities. The "Name" column mentions the entity's name. The "Character" column shows the character. To render the character, the format &name; is used; for example, & renders as &.
Name | Character | Description | Representation | Example Text | Example Request/Response |
---|---|---|---|---|---|
quot | " | double quotation mark | " | “Gilbane” | "Gilbane" |
amp | & | ampersand | & | Mckissack & Mckissack | Mckissack & Mckissack |
apos | ' | apostrophe (apostrophe-quote) | ' | ‘turner’ | ' turner ' |
lt | < | less-than sign | < | <gilbane building | <gilbane building |
gt | > | greater-than sign | > | gilbane building> | gilbane building> |
Sample XML Requests and Responses
The following xml file will specify API method calls and the details for each call.
The request xml would include global parameters which specify the selected domain, records from and maximum records to return in response. It also includes search parameters along with requested response column.
In the response xml, the actual search parameters that were sent will be returned in an element called <search_criteria> along with the actual result for a given search criteria will be displayed in an element called <result_records>.
The total number of resulting records for a given search criteria will be displayed within an element called <record_count>, which helps user to view the total number of records found for a given search criteria.
The response xml also includes status messages for the result. If there is an error, corresponding error code along with description will be included in an element called <messages> for user reference.
Sample Request: Spending Transactions (Citywide)
<request> <type_of_data>Spending</type_of_data> <records_from>1</records_from> <max_records>1000</max_records> <search_criteria> <criteria> <name>agency_code</name> <type>value</type> <value>039</value> </criteria> <criteria> <name>department_code</name> <type>value</type> <value>D22</value> </criteria> <criteria> <name>expense_category</name> <type>value</type> <value>2200</value> </criteria> <criteria> <name>document_id</name> <type>value</type> <value>20180011164</value> </criteria> <criteria> <name>spending_category</name> <type>value</type> <value>cc</value> </criteria> <criteria> <name>mwbe_category</name> <type>value</type> <value>7</value> </criteria> <criteria> <name>industry</name> <type>value</type> <value>2</value> </criteria> </search_criteria> <response_columns> <column>agency</column> <column>fiscal_year</column> <column>document_id</column> <column>payee_name</column> <column>department</column> <column>check_amount</column> <column>expense_category</column> <column>contract_id</column> <column>capital_project</column> <column>industry</column> <column>issue_date</column> <column>spending_category</column> <column>mwbe_category</column> <column>sub_vendor</column> <column>associated_prime_vendor</column> <column>sub_contract_reference_id</column> <column>woman_owned_business</column> <column>emerging_business</column> <column>budget_code</column> </response_columns> </request>
Sample Response: Spending Transactions (Citywide)
<response> <status> <result>success</result> </status> <request_criteria> <request> <type_of_data>Spending</type_of_data> <records_from>1</records_from> <max_records>1000</max_records> <search_criteria> <criteria> <name>agency_code</name> <type>value</type> <value>039</value> </criteria> <criteria> <name>department_code</name> <type>value</type> <value>D22</value> </criteria> <criteria> <name>expense_category</name> <type>value</type> <value>2200</value> </criteria> <criteria> <name>document_id</name> <type>value</type> <value>20180011164</value> </criteria> <criteria> <name>spending_category</name> <type>value</type> <value>cc</value> </criteria> <criteria> <name>mwbe_category</name> <type>value</type> <value>7</value> </criteria> <criteria> <name>industry</name> <type>value</type> <value>2</value> </criteria> </search_criteria> <response_columns> <column>agency</column> <column>fiscal_year</column> <column>document_id</column> <column>payee_name</column> <column>department</column> <column>check_amount</column> <column>expense_category</column> <column>contract_id</column> <column>capital_project</column> <column>industry</column> <column>issue_date</column> <column>spending_category</column> <column>mwbe_category</column> <column>sub_vendor</column> <column>associated_prime_vendor</column> <column>sub_contract_reference_id</column> <column>woman_owned_business</column> <column>emerging_business</column> <column>budget_code</column> </response_columns> </request> </request_criteria> <result_records> <record_count>1</record_count> <spending_transactions> <transaction> <agency>Queens Borough Public Library</agency> <associated_prime_vendor>N/A</associated_prime_vendor> <budget_code>LQTS (QUEENS LIBRARY SYSTEM: REPLACEMENT OF TE)</budget_code> <capital_project>039LQD122TEL001</capital_project> <contract_id>CT103920171428053</contract_id> <check_amount>35775.00</check_amount> <department>400-039-D22</department> <document_id>20180011164-1-DSB-AD</document_id> <expense_category>CAPITAL PURCHASED EQUIPMENT</expense_category> <fiscal_year>2018</fiscal_year> <industry>Goods</industry> <issue_date>2017-07-17</issue_date> <mwbe_category>Non-M/WBE</mwbe_category> <woman_owned_business>No</woman_owned_business> <emerging_business>No</emerging_business> <payee_name>NEW CASTLE COMMUNICATIONS INC</payee_name> <spending_category>Capital Contracts</spending_category> <sub_contract_reference_id/> <sub_vendor>No</sub_vendor> </transaction> </spending_transactions> </result_records> </response>
Sample Request: Spending Transactions (Other Government Entities - NYCEDC)
<request> <type_of_data>Spending_OGE</type_of_data> <records_from>1</records_from> <max_records>10</max_records> <search_criteria> <criteria> <name>other_government_entities_code</name> <type>value</type> <value>z81</value> </criteria> <criteria> <name>entity_contract_number</name> <type>value</type> <value>27360016</value> </criteria> <criteria> <name>fiscal_year</name> <type>value</type> <value>2018</value> </criteria> <criteria> <name>department_code</name> <type>value</type> <value>110</value> </criteria> <criteria> <name>expense_category</name> <type>value</type> <value>2320</value> </criteria> <criteria> <name>contract_id</name> <type>value</type> <value>CTA180120167206331</value> </criteria> <criteria> <name>spending_category</name> <type>value</type> <value>cc</value> </criteria> <criteria> <name>commodity_line</name> <type>value</type> <value>1</value> </criteria> </search_criteria> <response_columns> <column>other_government_entities</column> <column>spending_category</column> <column>fiscal_year</column> <column>payee_name</column> <column>department</column> <column>check_amount</column> <column>contract_id</column> <column>contract_purpose</column> <column>expense_category</column> <column>capital_project</column> <column>spending_category</column> <column>entity_contract_number</column> <column>budget_name</column> <column>commodity_line</column> </response_columns> </request>
Sample Response: Spending Transactions (Other Government Entities - NYCEDC)
<response> <status> <result>success</result> </status> <request_criteria> <request> <type_of_data>Spending_OGE</type_of_data> <records_from>1</records_from> <max_records>10</max_records> <search_criteria> <criteria> <name>other_government_entities_code</name> <type>value</type> <value>z81</value> </criteria> <criteria> <name>entity_contract_number</name> <type>value</type> <value>27360016</value> </criteria> <criteria> <name>fiscal_year</name> <type>value</type> <value>2018</value> </criteria> <criteria> <name>department_code</name> <type>value</type> <value>110</value> </criteria> <criteria> <name>expense_category</name> <type>value</type> <value>2320</value> </criteria> <criteria> <name>contract_id</name> <type>value</type> <value>CTA180120167206331</value> </criteria> <criteria> <name>spending_category</name> <type>value</type> <value>cc</value> </criteria> <criteria> <name>commodity_line</name> <type>value</type> <value>1</value> </criteria> </search_criteria> <response_columns> <column>other_government_entities</column> <column>spending_category</column> <column>fiscal_year</column> <column>payee_name</column> <column>department</column> <column>check_amount</column> <column>contract_id</column> <column>contract_purpose</column> <column>expense_category</column> <column>capital_project</column> <column>spending_category</column> <column>entity_contract_number</column> <column>budget_name</column> <column>commodity_line</column> </response_columns> </request> </request_criteria> <result_records> <record_count>4</record_count> <spending_transactions> <transaction> <other_government_entities>NEW YORK CITY ECONOMIC DEVELOPMENT CORPORATION</other_government_entities> <fiscal_year>2018</fiscal_year> <payee_name>LIRO PROGRAM & CONSTRUCTION MGT,PC</payee_name> <department>NYCEDC</department> <check_amount>5968306.78</check_amount> <expense_category>IOTB CONSTRUCTION</expense_category> <contract_id>CTA180120167206331</contract_id> <contract_purpose>Queens West/Hunter's Point South 23960003</contract_purpose> <capital_project>801QWESTC 002</capital_project> <spending_category>Capital Contracts</spending_category> <entity_contract_number>27360016</entity_contract_number> <budget_name>HUNTERS POINT SOUTH (QUEENS WEST), PHASE</budget_name> <commodity_line>1</commodity_line> </transaction> <transaction> <other_government_entities>NEW YORK CITY ECONOMIC DEVELOPMENT CORPORATION</other_government_entities> <fiscal_year>2018</fiscal_year> <payee_name>LIRO PROGRAM & CONSTRUCTION MGT,PC</payee_name> <department>NYCEDC</department> <check_amount>4256277.36</check_amount> <expense_category>IOTB CONSTRUCTION</expense_category> <contract_id>CTA180120167206331</contract_id> <contract_purpose>Queens West/Hunter's Point South 27360016</contract_purpose> <capital_project>801QWESTC 002</capital_project> <spending_category>Capital Contracts</spending_category> <entity_contract_number>27360016</entity_contract_number> <budget_name>HUNTERS POINT SOUTH (QUEENS WEST), PHASE</budget_name> <commodity_line>1</commodity_line> </transaction> <transaction> <other_government_entities>NEW YORK CITY ECONOMIC DEVELOPMENT CORPORATION</other_government_entities> <fiscal_year>2018</fiscal_year> <payee_name>LIRO PROGRAM & CONSTRUCTION MGT,PC</payee_name> <department>NYCEDC</department> <check_amount>4221135.69</check_amount> <expense_category>IOTB CONSTRUCTION</expense_category> <contract_id>CTA180120167206331</contract_id> <contract_purpose>Queens West/Hunter's Point South 23960003</contract_purpose> <capital_project>801QWESTC 002</capital_project> <spending_category>Capital Contracts</spending_category> <entity_contract_number>27360016</entity_contract_number> <budget_name>HUNTERS POINT SOUTH (QUEENS WEST), PHASE</budget_name> <commodity_line>1</commodity_line> </transaction> <transaction> <other_government_entities>NEW YORK CITY ECONOMIC DEVELOPMENT CORPORATION</other_government_entities> <fiscal_year>2018</fiscal_year> <payee_name>LIRO PROGRAM & CONSTRUCTION MGT,PC</payee_name> <department>NYCEDC</department> <check_amount>2199337</check_amount> <expense_category>IOTB CONSTRUCTION</expense_category> <contract_id>CTA180120167206331</contract_id> <contract_purpose>Queens West/Hunter's Point South 27360016</contract_purpose> <capital_project>801QWESTC 002</capital_project> <spending_category>Capital Contracts</spending_category> <entity_contract_number>27360016</entity_contract_number> <budget_name>HUNTERS POINT SOUTH (QUEENS WEST), PHASE</budget_name> <commodity_line>1</commodity_line> </transaction> </spending_transactions> </result_records> </response>
Sample Request: Spending Transactions (Other Government Entities - NYCHA)
<request> <type_of_data>Spending_NYCHA</type_of_data> <records_from>1</records_from> <max_records>10</max_records> <search_criteria> <criteria> <name>other_government_entities_code</name> <type>value</type> <value>996</value> </criteria> <criteria> <name>contract_id</name> <type>value</type> <value>BA1601045</value> </criteria> <criteria> <name>fiscal_year</name> <type>value</type> <value>2019</value> </criteria> <criteria> <name>expense_category</name> <type>value</type> <value>77934</value> </criteria> <criteria> <name>spending_category</name> <type>value</type> <value>CONTRACT</value> </criteria> </search_criteria> <response_columns> <column>amount_spent</column> <column>check_amount</column> <column>document_id</column> <column>contract_id</column> <column>expense_category</column> <column>funding_source</column> <column>industry</column> <column>invoice_number</column> <column>release_number</column> <column>line_number</column> <column>distribution_line_number</column> <column>issue_date</column> <column>program</column> <column>project</column> <column>purchase_order_type</column> <column>purpose</column> <column>section_8</column> <column>check_status</column> <column>responsibility_center</column> <column>spending_category</column> <column>vendor</column> <column>year</column> </response_columns> </request>
Sample Response: Spending Transactions (Other Government Entities - NYCHA)
<response> <status> <result>success</result> </status> <request_criteria> <request> <type_of_data>Spending_NYCHA</type_of_data> <records_from>1</records_from> <max_records>1</max_records> <search_criteria> <criteria> <name>other_government_entities_code</name> <type>value</type> <value>996</value> </criteria> <criteria> <name>contract_id</name> <type>value</type> <value>BA1601045</value> </criteria> <criteria> <name>fiscal_year</name> <type>value</type> <value>2019</value> </criteria> <criteria> <name>expense_category</name> <type>value</type> <value>77934</value> </criteria> <criteria> <name>spending_category</name> <type>value</type> <value>3</value> </criteria> </search_criteria> <response_columns> <column>amount_spent</column> <column>check_amount</column> <column>document_id</column> <column>contract_id</column> <column>document_id</column> <column>expense_category</column> <column>funding_source</column> <column>industry</column> <column>invoice_number</column> <column>release_number</column> <column>line_number</column> <column>distribution_line_number</column> <column>issue_date</column> <column>program</column> <column>project</column> <column>purchase_order_type</column> <column>purpose</column> <column>section_8</column> <column>check_status</column> <column>responsibility_center</column> <column>spending_category</column> <column>vendor</column> <column>year</column> </response_columns> </request> </request_criteria> <result_records> <record_count>24</record_count> <spending_transactions> <transaction> <issue_date>2019-11-21</issue_date> <document_id>199666-48758-20191121-996-EFT</document_id> <contract_id>BA1601045</contract_id> <release_number>7349</release_number> <line_number>1</release_number> <distirbution_line_number>1</release_number> <invoice_number>526</invoice_number> <check_status>NEGOTIABLE</check_status> <check_amount>55115.89</check_amount> </transaction> </spending_transactions> </result_records> </response>
Status Codes and Messages
Status messages are categorized and displayed as status codes with short description for the user to understand the cause of the error. In case of an error no result records will be displayed and the error message will be displayed inside the <message> XML element as shown below. See here for list of Status codes and Messages.
Example:
• Result is Success
<status> <result>success</result> <messages> <message> <code>1</code> <description> The status is still a success but there are no results found for given search criteria</description> </message> </messages> </status>
• Result is Failure
<status> <result>failure</result> <messages> <message> <code>1000</code > <description>Required parameter 'type_of_data' is missing</description> </message> </messages> </status>
Status Code | Description |
---|---|
1 | The status is still a success but there are no results found for given search criteria. |
1000 | Required parameter 'type_of_data' is missing. |
1001 | Invalid value 'BudgetRequest' is provided for 'type_of_data'. Valid values are Budget, Spending, and Revenue. |
1002 | Provided value '2.1' for 'records_from' is not an integer. Valid value is a number values without decimal places |
1003 | Total number of requested records '1001' exceeds allowed limit of '1000' records |
1101 | Provided request parameter 'date' is not valid for 'Budget' domain. Valid values are 'fiscal_year, agency_code, department_code, budget_code, expense_category, adopted_budget, current_modified_budget, pre_encumbered, encumbered, cash_expense, post_adjustment, accrued_expense |
1102 | No value is provided for request parameter 'fiscal_year'. |
1103 | Provided value '20000' for request parameter 'fiscal_year' is not valid year. |
1104 | Provided 'start' value '200s' for request parameter 'adopted_budget' is not valid amount. |
1105 | Provided start value '1000' is greater than end value '500' for request parameter 'adopted_budget'. |
1106 | Provided response column 'agencyname' value is not allowed for 'Budget' domain. Valid values are 'agency_name, department_name, expense_category, budget_code, budget_code_name, current_modified_budget, adopted_budget, pre_encumbered, encumbered, cash_expense, post_adjustment, accrued_expense'. |
1108 | Provided value 'abcd' for request parameter 'agency_code' exceeds maximum allowed '3' characters. |
1109 | Provided 'start' value '1234567890' for request parameter 'adopted_budget' exceeds maximum allowed '5' characters. |
1110 | Request parameter 'agency_code' do not support range values. |