{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":554,"path":"api-reference/rest-apis/spendint-api.md","title":"Spendint API","bundle":null,"doc_type":null,"release":"australia","body":"\n# Spendint API\n\nThe Spendint API provides endpoints that push the catalog, price, availability, order, shipment, and invoice information from a third party to the ServiceNow instance. This API is part of the Source-to-Pay Integration Framework application.\n\nThis API requires the Procurement Integration Framework \\(com.glide.sn\\_spend\\_intg\\) store application and is provided within the `sn_spend_intg` namespace. For information, see [Procurement File Transfer Framework](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/source-to-pay-operations/procurement-file-transfer-framework.md).\n\nTo access this API, you must have the sn\\_spend\\_intg.procurement\\_integrator role.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## Spendint API - POST /sn\\_spend\\_intg/spendint/catalog\n\nAllows suppliers to post multiple catalogs for creating supplier products, model products, contracts, and pricing records.\n\nIn the catalog API integration, when you receive data from a third-party catalog, you can:\n\n1.  Create any new third-party categories and map these categories to model categories.\n    -   If available, use the United Nations Standard Products and Services Code \\(UNSPSC\\) and then the category name.\n    -   If UNSPSC is not available, use just the category name.\n2.  After you map a third-party category to a model category, use the Manufacturer Part Number \\(MPN\\) to find an existing product model, if one is available.\n    1.  If a product model is found for the MPN, update the product model with any changes, and then create or update any supplier products that are related to the product model.\n    2.  If a product model does not exist for the MPN, do the following:\n        1.  A product model class is usually available on the model category that is referenced by the third-party category for the product. Use this product model class to get the product model table in which the product model should be created, for example, hardware, software, consumable, and so on. If no product model class is available, create the product model in the base product model table.\n        2.  After the correct product model class is identified, create a new product model in the correct class as follows:\n            -   Manufacturer, publisher, or provider should map to the manufacturer on the product model.\n            -   Product name from the API should map to the name on the product model.\n            -   MPN from the API should update the model number.\n            -   Product description from the API should update the description on the product model.\n            -   Model category should be updated with the product category referenced on the third-party category record.\n            -   Product category should be updated with the product category referenced on the third-party category record.\n            -   If there are values in the substitute products in the API, create the substitute product records between the current product model and the other product models.\n            -   If there are values in the compatible products in the API, create the compatible product records between the current product model and the other product models.\n            -   Product attributes from the API should be created or updated in the product attribute related list for the product model.\n3.  If a product model is available, use the supplier part number to create or update the supplier products that are related to the product model.\n\n### Third-party mapping\n\nUse the following tables to perform the third-party category, model, and unit mappings:\n\n-   Third-Party Categories: Stores all the third-party category records for the ShoppingHub administrator to map with internal existing model categories.\n-   Third-Party Model Mappings: Stores all the mapping information between product models and third-party model categories.\n-   Third-Party Units: Stores all the third-party unit records for the ShoppingHub administrator to map with supplier product units.\n-   Third-Party Unit Mappings: Stores all the mapping information between product models and third-party units.\n\n**Note:** A third-party integration product is auto-published when both the third-party category and third-party unit are mapped appropriately.\n\n### Supplier product sales dates\n\nA supplier product is discontinued and no longer published in the catalog when it has reached its sales end date. The **Sales start date** and **Sales end date** fields on the Supplier product form are populated through third-party integration from theCatalog API.\n\n### Status tables\n\nTo know the status of the bulk product import request, make a REST call into the ServiceNow database using the Table REST API. The response from the API lists the records where the bulk import request failed. For bulk product import response, query the Catalog Error table with the following parameter:\n\n`sysparm_query=outbound_error.supplier_id=<supplier_id>^outbound_error.state=20`\n\nDetails on the customer id, supplier id, error type, unique import set id, and state can be found in the Outbound Status table, which is the parent error table.\n\n### URL format\n\n`/api/sn_spend_intg/spendint/catalog`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmode\n\n</td><td>\n\nSupport for asynchronous and synchronous modes for third-party integration.Data type: String\n\n Valid values:\n\n-   async: Asynchronous mode.\n-   sync: Synchronous mode.\n\n Default: async\n\n</td></tr></tbody>\n</table><table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncustomer\\_id\n\n</td><td>\n\nIdentifier for the customer.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\ncatalog\\_id\n\n</td><td>\n\nIdentifier for the catalog content that can be purchased by a customer.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nproducts\n\n</td><td>\n\nList of objects that define products to create or update. Each transaction has a limit of 1000 products.Data type: Array\n\n ```\n\"products\": [\n  {\n    \"available_units\": \"String\",\n    \"available_for_country\": [Array],\n    \"bundled_components\": [Array],\n    \"contract_agreement\": {Object},\n    \"delivery_time\": \"String\",\n    \"images\": [Array],\n    \"manufacturer\": \"String\",\n    \"mpn\": \"String\",\n    \"parent_bundle\": \"String\",\n    \"product_attributes\": {Object},\n    \"product_category_name\": \"String\",\n    \"product_description\": \"String\",\n    \"product_name\": \"String\",\n    \"sku\": \"String\",\n    \"unit\": \"String\",\n    \"unspsc\": \"String\",\n  }\n]\n```\n\n</td></tr><tr><td>\n\nproducts.available\\_units\n\n</td><td>\n\nRequired for products that are kept in stock. This value indicates the quantity of units that are available for this product.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nproducts.available\\_for\\_country\n\n</td><td>\n\nList of country codes where the supplier product can be purchased. If no country is provided, a user from any country can purchase the product.Data type: Array\n\n ```\n\"available_for_country\": [\"US\",\"IN\",\"GB\"]\n```\n\n</td></tr><tr><td>\n\nproducts.bundled\\_components\n\n</td><td>\n\nValid only for scenarios when sending a product bundle as part of the catalog payload, and applicable only for the parent bundle payloads. This value contains the reference to the child bundle components. The list of the MPN and quantities for the child bundle components are maintained here.**Note:** Since the same child bundle component can be added more than once within a bundle, the entered quantity is the differentiator between the same children bundle components.\n\nThe child bundle components and their details \\(MPN and quantities\\) should be mapped to the same supplier.Data type: Array\n\n ```\n\"bundled_components\": [\n  {\n    \"mpn\": \"String\",\n    \"quantity\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement\n\n</td><td>\n\nDetails of the contract for a product.**Note:** This is not required for child bundle components.\n\n Data type: Object\n\n ```\n\"contract_agreement\": {\n  \"contract_end_date\": \"String\",\n  \"contract_number\": \"String\",\n  \"contract_start_date\": \"String\",\n  \"negotiated_currency \": \"String\",\n  \"negotiated_price\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement.contract\\_end\\_date\n\n</td><td>\n\nDate on which the contract term ends.Data type: String\n\n Maximum length: 40\n\n Format: YYYY-MM-DD\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement.contract\\_number\n\n</td><td>\n\nRequired. Number of the active contract that is associated with the product.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement.contract\\_start\\_date\n\n</td><td>\n\nDate on which the contract term starts.Data type: String\n\n Maximum length: 40\n\n Format: YYYY-MM-DD\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement.negotiated\\_currency\n\n</td><td>\n\nRequired. Currency of the negotiated price.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement.negotiated\\_price\n\n</td><td>\n\nRequired. Unit price of a product as negotiated through a contract with the supplier or reseller.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nproducts.delivery\\_time\n\n</td><td>\n\nEstimated number of days it takes to ship a product to the customer. This value must represent the number of days and be a whole integer.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nproducts.images\n\n</td><td>\n\nList of strings that specify the image URLs for the supplier product.Data type: Array\n\n</td></tr><tr><td>\n\nproducts.manufacturer\n\n</td><td>\n\nRequired. Company that manufactures, publishes, or provides the product. This is not the supplier or reseller of the product.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nproducts.mpn\n\n</td><td>\n\nRequired. Identifier for a product that is provided by the manufacturer, publisher, or provider.**Note:** This is not required for reseller parent bundles if the SKU value is available.\n\n Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nproducts.parent\\_bundle\n\n</td><td>\n\nValid only for scenarios when sending a product bundle as part of the catalog payload, and applicable only for the child bundle component payloads. In the case of a child bundle component, the reference to the parent is maintained here. The parent MPN and SKU values are also set here.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nproducts.product\\_attributes\n\n</td><td>\n\nList of key-value pairs that define product attributes, for example, `\"Color\": \"Space Grey\"`. Multiple attributes for a product are allowed. However, only those attributes that impact pricing or stock availability should be provided through the API.Data type: Object\n\n</td></tr><tr><td>\n\nproducts.product\\_category\\_name\n\n</td><td>\n\nRequired. Name that you enter if you are not setting the **unspsc** property. This name is the category to which a product belongs. This category name can be used in a commerce scenario to shop for the product. For example, a power strip product could belong to an Office Equipment category.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nproducts.product\\_description\n\n</td><td>\n\nFull description of the product that appears to a shopper within a commerce experience.**Note:** It is recommended that the supplier be as descriptive as possible here, especially for product bundle catalog items where there are child bundle components.\n\n Data type: String\n\n Maximum length: 65000\n\n</td></tr><tr><td>\n\nproducts.product\\_name\n\n</td><td>\n\nRequired. Name of the product.Data type: String\n\n Maximum length: 1000\n\n</td></tr><tr><td>\n\nproducts.sku\n\n</td><td>\n\nRequired. Number that is generated by a supplier that uniquely identifies a product that is sold by that supplier.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nproducts.unit\n\n</td><td>\n\nRequired. Unit or rate at which the product is sold by the supplier. For example, pieces, hours, and so on.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nproducts.unspsc\n\n</td><td>\n\nRequired. Identifier that you enter if you are not setting the **product\\_category\\_name** property. This identifier is the UNSPSC for the category to which a product belongs. For example, UNSPSC code 43210000 is the identifier for the product category Computers.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nsupplier\\_id\n\n</td><td>\n\nRequired. Identifier for the reseller or supplier with whom the customer can place orders.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nthird\\_party\\_import\\_id\n\n</td><td>\n\nIdentifier that enables a third party to pass a string value to uniquely identify a set of imported data.Data type: String\n\n Maximum length: 100\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only or apply to this action in a distinct way.\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>**Note:** Only the **application/json** data format is supported for Procurement Integration Framework.\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action.\n\n|Status code|Description|\n|-----------|-----------|\n|success|Successful. The request was successfully processed.|\n|failure|Unsuccessful. The request was processed with errors.|\n\n### Response body parameters \\(JSON\\)\n\nThese response body parameters are received when queried in synchronous mode.\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\\_response\\_body\n\n</td><td>\n\nDescription of the errors, listed by sku, mpn, and the error message.Data type: Array\n\n</td></tr><tr><td>\n\nerror\\_response\\_body.error\\_message\n\n</td><td>\n\nDetailed error message.Data type: String\n\n</td></tr><tr><td>\n\nstatus\\_code\n\n</td><td>\n\nResponse status such as \"success\" or \"failure.\"Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\n```\ncurl \"https://instance.service-now.com/api/sn_spend_intg/spendint/catalog\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n{\"root\": [{\n  \"customer_id\": \"AB-1234323\",\n  \"catalog_id\": \"ACME CORP-12347898\",\n  \"supplier_id\": \"SUP-123456\",\n  \"third_party_import_id\": \"DELL1234567\",\n  \"products\": [\n    {\n      \"product_name\": \"Apple MacBook Pro 13 Core i7\",\n      \"mpn\": \"Z0WQ-20004301931\",\n      \"sku\": \"55788741\",\n      \"manufacturer\": \"Apple\",\n      \"product_category_name\": \"Computer\",\n      \"parent_bundle\": \"920-0045362002\",\n      \"bundled_components\": {\n        \"mpn\": \"Z0WQ-20004301931\",\n        \"quantity\": \"4\",\n       },\n      \"unspsc\": \"43211500\",\n      \"product_description\": \"Apple MacBook Pro 13 Core i7 2.8GHz 16GB 512GB - Touch Bar - Space Gray\",\n      \"product_attributes\": {\n        \"Color\": \"Space Grey\",\n        \"RAM\": \"16GB\",\n        \"Screen Size\": \"13inch\"\n      },\n      \"images\": [\"http://test123.image1.png\", \"http://test123.image2.jpeg\"],\n      \"unit\": \"Each\",\n      \"available_units\": \"4\",\n      \"available_for_country\": [\"US\",\"IN\",\"GB\"],\n      \"delivery_time\": \"4\",\n      \"contract_agreement\": {\n        \"contract_number\": \"34567892\",\n        \"contract_start_date\": \"YYYY-MM-DD\",\n        \"contract_end_date\": \"YYYY-MM-DD\",\n        \"negotiated_price\": \"456\",\n        \"negotiated_currency \": \"USD\"\n      }\n    }\n  ]\n}\n]}\n\n```\n\nPossible responses:\n\n```\n// Success response:\n{\n    \"result\": {\n        \"response\": \"success\"\n    }\n}\n\n// Error response:\n{\n    \"result\": {\n        \"response\": [\n            {\n                \"customer_id\": \"AB-1234323\",\n                \"supplier_id\": \"SUP-123456\",\n                \"third_party_import_id\": \"DELL1234567\",\n                \"status_code\": \"failure\",\n                \"error_response_body\": [\n                    {\n                        \"sku\": \"55788741\",\n                        \"mpn\": \"Z0WQ-20004301931\",\n                        \"error_message\": \"Field Value empty/Formatting issue Negotiated currency \\n\"\n                    }\n                ]\n            }\n        ]\n    }\n}\n```\n\n## Spendint API - POST /sn\\_spend\\_intg/spendint/price\n\nUpdates any pricing for supplier product records.\n\nWhen pricing is available for supplier product records, the API uses the product SKU to find an existing supplier product. If a matching supplier product exists, the corresponding contract price is updated. If no matching supplier product is found, an error message is generated, stating that the product for which you are trying to update pricing for does not exist.\n\n### Status tables\n\nTo know the status of the price import request, make a REST call into the ServiceNow database using the Table REST API. The response from the API lists the records where the price import request failed. For a price import response, query the Price Error table with the following parameter:\n\n`sysparm_query=outbound_error.supplier_id=<supplier_id>^outbound_error.state=20`\n\nYou can find the details on the customer ID, supplier ID, error type, unique import set ID, and state can in the Outbound Status table, which is the parent error table.\n\n### URL format\n\n`/api/sn_spend_intg/spendint/price`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table id=\"table_bdb_dck_ymb\" class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmode\n\n</td><td>\n\nSupport for asynchronous and synchronous modes for third-party integration.Data type: String\n\n Valid values:\n\n-   async: Asynchronous mode.\n-   sync: Synchronous mode.\n\n Default: async\n\n</td></tr></tbody>\n</table><table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncatalog\\_id\n\n</td><td>\n\nRequired. Identifier for the catalog content that can be purchased by a customer.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\ncustomer\\_id\n\n</td><td>\n\nRequired. Identifier for the customer.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nproducts\n\n</td><td>\n\nList of objects that define products to create or update. Each transaction has a limit of 1000 products.Data type: Array\n\n ```\n\"products\": [\n  {\n    \"contract_agreement\": {Array},\n    \"sku\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement\n\n</td><td>\n\nDetails of the contract for a product.Data type: Object\n\n ```\n\"contract_agreement\": {\n  \"contract_end_date\": \"String\",\n  \"contract_number\": \"String\",\n  \"contract_start_date\": \"String\",\n  \"negotiated_currency \": \"String\",\n  \"negotiated_price\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement.contract\\_end\\_date\n\n</td><td>\n\nDate on which the contract term ends.Data type: String\n\n Maximum length: 40\n\n Format: YYYY-MM-DD\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement.contract\\_number\n\n</td><td>\n\nRequired. Number of the active contract that is associated with the product.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement.contract\\_start\\_date\n\n</td><td>\n\nDate on which the contract term starts.Data type: String\n\n Maximum length: 40\n\n Format: YYYY-MM-DD\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement.negotiated\\_currency\n\n</td><td>\n\nRequired. Currency of the negotiated price.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nproducts.contract\\_agreement.negotiated\\_price\n\n</td><td>\n\nRequired. Unit price of a product as negotiated through a contract with the supplier or reseller.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nproducts.sku\n\n</td><td>\n\nRequired. Number that is generated by a supplier that uniquely identifies a product that is sold by that supplier.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nsupplier\\_id\n\n</td><td>\n\nRequired. Identifier for the reseller or supplier that the customer can place orders with.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nthird\\_party\\_import\\_id\n\n</td><td>\n\nIdentifier that enables a third party to pass a string value to uniquely identify a set of imported data.Data type: String\n\n Maximum length: 100\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only or apply to this action in a distinct way.\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>**Note:** Only the **application/json** data format is supported for Procurement Integration Framework.\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action.\n\n|Status code|Description|\n|-----------|-----------|\n|success|Successful. The request was successfully processed.|\n|failure|Unsuccessful. The request was processed with errors.|\n\n### Response body parameters \\(JSON\\)\n\nThese response body parameters are received when queried in synchronous mode.\n\n<table id=\"table_jy2_1hk_ymb\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\\_response\\_body\n\n</td><td>\n\nDescription of the errors, listed by sku and the error message.Data type: Array\n\n</td></tr><tr><td>\n\nerror\\_response\\_body.error\\_message\n\n</td><td>\n\nDetailed error message.Data type: String\n\n</td></tr><tr><td>\n\nstatus\\_code\n\n</td><td>\n\nResponse status such as \"success\" or \"failure.\"Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\n```\ncurl \"https://instance.service-now.com/api/sn_spend_intg/spendint/price\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n{\"root\": [{\n  \"customer_id\": \"ACME CORP\",\n  \"catalog_id\": \"AB-1234323\",\n  \"supplier_id\": \"SUP-123456\",\n  “third_party_import_id”: “DEL789876\",\n  \"products\": [\n    {\n      \"sku\": \"5578874\",\n      \"contract_agreement\": {\n        \"contract_number\": \"34567892\",\n        \"contract_start_date\": \"YYYY-MM-DD\",\n        \"contract_end_date\": \"YYYY-MM-DD\",\n        \"negotiated_price\": \"456\",\n        \"negotiated_currency \": \"USD\"\n      }\n    }\n  ]\n}\n]}\n\n```\n\nPossible responses:\n\n```\n// Success response:\n{\n    “result”: {\n        “response”: “success”\n    }\n}\n\n// Error response:\n{\n    “result”: {\n        “response”: [\n            {\n                “customer_id”: “ACME CORP”,\n                “supplier_id”: “SUP-123456”,\n                “third_party_import_id”: “DEL789876\",\n                “status_code”: “failure”,\n                “error_response_body”: [\n                    {\n                        “sku”: “5578874”,\n                        “error_message”: “The product for which you are trying to update pricing does not exist\\nField Value empty/Formatting issue Negotiated currency\\nField Value empty/Formatting issue Contract start date\\nField Value empty/Formatting issue Contract end date\\n”\n                    }\n                ]\n            }\n        ]\n    }\n}\n```\n\n## Spendint API - POST /sn\\_spend\\_intg/spendint/availability\n\nUpdates the availability for supplier product records.\n\nWhen supplier product records are available, the API uses the product SKU to find an existing supplier product. If a matching supplier product exists, the corresponding **available\\_units** field is updated. If no matching supplier product is found, an error message generates stating that the product for which you are trying to update availability for does not exist.\n\n### Status tables\n\nTo know the status of the update availability request, make a REST call into the ServiceNow database using the Table REST API. The response from the API lists the records where the update availability request failed. For update availability response, query the Availability Error table with the following parameter:\n\n`sysparm_query=outbound_error.supplier_id=<supplier_id>^outbound_error.state=20`\n\nThe details on the customer ID, supplier ID, error type, unique import set ID, and state can be found in the Outbound Status table, which is the parent error table.\n\n### URL format\n\n`/api/sn_spend_intg/spendint/availability`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table id=\"table_rdf_2ck_ymb\" class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmode\n\n</td><td>\n\nSupport for asynchronous and synchronous modes for third-party integration.Data type: String\n\n Valid values:\n\n-   async: Asynchronous mode.\n-   sync: Synchronous mode.\n\n Default: async\n\n</td></tr></tbody>\n</table><table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncatalog\\_id\n\n</td><td>\n\nRequired. Identifier for the catalog content that can be purchased by a customer.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\ncustomer\\_id\n\n</td><td>\n\nRequired. Identifier for the customer.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nproducts\n\n</td><td>\n\nList of objects that define the products to update. Each transaction has a limit of 1000 products.Data type: Array\n\n ```\n\"products\": [\n  {\n    \"available_units\": \"String\",\n    \"sku\": \"String\",\n    \"unit\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nproducts.available\\_units\n\n</td><td>\n\nRequired for products that are kept in stock. Number of units available for this product.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nproducts.sku\n\n</td><td>\n\nRequired. Number that is generated by a supplier that uniquely identifies a product sold by that supplier.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nproducts.unit\n\n</td><td>\n\nRequired. Unit or rate at which the product is sold by the supplier. For example, pieces, hours, and so on.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nsupplier\\_id\n\n</td><td>\n\nIdentifier for the reseller or supplier that the customer can place orders with.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nthird\\_party\\_import\\_id\n\n</td><td>\n\nAllows a third-party to pass a string value to uniquely identify a set of imported data.Data type: String\n\n Maximum length: 100\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only or apply to this action in a distinct way.\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>**Note:** Only the **application/json** data format is supported for Procurement Integration Framework.\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action.\n\n|Status code|Description|\n|-----------|-----------|\n|success|Successful. The request was successfully processed.|\n|failure|Unsuccessful. The request was processed with errors.|\n\n### Response body parameters \\(JSON\\)\n\nThese response body parameters are received when queried in synchronous mode.\n\n<table id=\"table_vsm_1hk_ymb\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\\_response\\_body\n\n</td><td>\n\nDescription of the errors, listed by sku and the error message.Data type: Array\n\n</td></tr><tr><td>\n\nerror\\_response\\_body.error\\_message\n\n</td><td>\n\nDetailed error message.Data type: String\n\n</td></tr><tr><td>\n\nstatus\\_code\n\n</td><td>\n\nResponse status such as \"success\" or \"failure.\"Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\n```\ncurl \"https://instance.servicenow.com/api/sn_spend_intg/spendint/availability\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n{\"root\": [{\n  \"customer_id\": \"AB-1234323\",\n  \"catalog_id\": \"ACME CORP\",\n  \"supplier_id\": \"SUP-123456\",\n  \"third_party_import_id\": \"DEL6789876\",\n  \"products\": [\n    {\n      \"sku\": \"5578874\",\n      \"unit\": \"Each\",\n      \"available_units\": \"20\"\n    }\n  ]\n}\n]}\n\n```\n\nPossible responses:\n\n```\n// Success response:\n{\n    \"result\": {\n        \"response\": \"success\"\n    }\n}\n\nError response: \n{\n    \"result\": {\n        \"response\": [\n            {\n                \"customer_id\": \"AB-1234323\",\n                \"supplier_id\": \"SUP-123456\",\n                \"third_party_import_id\": \"DEL6789876\",\n                \"status_code\": \"failure\",\n                \"error_response_body\": [\n                    {\n                        \"sku\": \"5578874\",\n                        \"error_message\": \"The product for which you are trying to update availability does not exist\\nField Value empty/Formatting issue Unit\\n\"\n                    }\n                ]\n            }\n        ]\n    }\n}\n```\n\n## Spendint API - POST /sn\\_spend\\_intg/spendint/orderack\n\nUpdates order information for when a user shops for a product from a third-party catalog. When the user checks out, a purchase line is created so that approvals or other tasks for the purchase can be completed.\n\nWhen a purchase order is generated in the ServiceNow database, the order is pushed into the following tables:\n\n-   Outbound Order: Contains the order header.\n-   Outbound Order Line: Contains the order lines.\n\nSuppliers need to query these tables and fetch the orders that are pending against them. Suppliers should create a scoped app for Workflow Studio actions for integrating with the ServiceNow database.\n\nQuery the tables with the following parameters:\n\n-   `sysparm_query=supplier_id=<supplier_id>^purchase_order.status=20 for header`\n-   `sysparm_query=purchase_order.supplier_id=<supplier_id>^purchase_order.status=20 for header`\n\nWhen a purchase line is converted to a purchase order line, the following processes are run:\n\n1.  The purchase order and purchase order line are submitted to the Enterprise Resource Planning \\(ERP\\), if applicable.\n2.  The purchase order and purchase order line are transferred through integration to the third party with the customer ID, supplier ID, purchase order number, order date, purchase order amount, purchase order amount currency, and purchase order lines.\n3.  The purchase order and purchase order line remain in the Pending Submission state until confirmation messages are received by both the third-party catalog integration and the ERP. After confirmation is received, the state is updated to Ordered. If there is no ERP integration involved, a confirmation message is required only from the third-party integration.\n\n### Status tables\n\nTo know the status of the order acknowledgment request, make a REST call into the ServiceNow database using the Table REST API. The response from the API lists the records where the order acknowledgment request failed. For an order acknowledgment response, query the Order Acknowledgment Error table with the following parameter:\n\n`sysparm_query=outbound_error.supplier_id=<supplier_id>^outbound_error.state=20`\n\nThe details on the customer ID, supplier ID, error type, unique import set ID, and state can be found in the Outbound Status table, which is the parent error table.\n\n### URL format\n\n`/api/sn_spend_intg/spendint/orderack`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table id=\"table_sd3_lck_ymb\" class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmode\n\n</td><td>\n\nSupport for asynchronous and synchronous modes for third-party integration.Data type: String\n\n Valid values:\n\n-   async: Asynchronous mode.\n-   sync: Synchronous mode.\n\n Default: async\n\n</td></tr></tbody>\n</table><table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncustomer\\_id\n\n</td><td>\n\nRequired. Identifier for the customer.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\norder\\_number\n\n</td><td>\n\nRequired. Purchase order number provided by the customer for this order.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nsales\\_order\\_lines\n\n</td><td>\n\nList of objects that define the sales order lines with unique updates for the purchases in this order.Data type: Array\n\n ```\n\"sales_order_lines\":[\n  {\n    \"estimated_arrival_date\": \"String\",\n    \"line_number\": \"String\",\n    \"sales_order_line_number\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nsales\\_order\\_lines.estimated\\_arrival\\_date\n\n</td><td>\n\nEstimated arrival date of the order.Data type: String\n\n Maximum length: 40\n\n Format: YYYY-MM-DD\n\n</td></tr><tr><td>\n\nsales\\_order\\_lines.line\\_number\n\n</td><td>\n\nRequired. Purchase order line number that was generated by the customer for a particular purchase.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nsales\\_order\\_lines.sales\\_order\\_line\\_number\n\n</td><td>\n\nSales order line number that was generated by the supplier. This number is required only for revisions to this purchase.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nsales\\_order\\_number\n\n</td><td>\n\nNumber or value that is generated by the supplier for this order.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nstatus\\_code\n\n</td><td>\n\nRequired. Status of the submitted order that confirms if the order was successfully placed.Data type: String\n\n Valid values:\n\n-   confirmed: Order placed successfully.\n-   rejected: Order not placed.\n\n</td></tr><tr><td>\n\nstatus\\_message\n\n</td><td>\n\nMessage that is attached to a status code. For example, the message could be that the order was successfully placed and is on back order.Data type: String\n\n Maximum length: 1000\n\n</td></tr><tr><td>\n\nsupplier\\_id\n\n</td><td>\n\nRequired. Identifier for the reseller or supplier that the customer can place orders with.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nthird\\_party\\_import\\_id\n\n</td><td>\n\nIdentifier that enables a third party to pass a string value to uniquely identify a set of imported data.Data type: String\n\n Maximum length: 100\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only or apply to this action in a distinct way.\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>**Note:** Only the **application/json** data format is supported for Procurement Integration Framework.\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action.\n\n|Status code|Description|\n|-----------|-----------|\n|success|Successful. The request was successfully processed.|\n|failure|Unsuccessful. The request was processed with errors.|\n\n### Response body parameters \\(JSON\\)\n\nThese response body parameters are received when queried in synchronous mode.\n\n<table id=\"table_dq5_1hk_ymb\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\\_response\\_body\n\n</td><td>\n\nDescription of the errors, listed by the sales order number, sales order line number, and the error message.Data type: Array\n\n</td></tr><tr><td>\n\nerror\\_response\\_body.error\\_message\n\n</td><td>\n\nDetailed error message.Data type: String\n\n</td></tr><tr><td>\n\nstatus\\_code\n\n</td><td>\n\nResponse status such as \"success\" or \"failure.\"Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\n```\ncurl \"https://instance.service-now.com/api/sn_spend_intg/spendint/orderack\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n{\"root\":[{\n  \"customer_id\": \"ACME CORP\",\n  \"supplier_id\": \"SUP-123456\",\n  \"third_party_import_id\": \"undefined\",\n  \"order_number\": \"PO08903323\",\n  \"sales_order_number\": \"SO03323212\",\n  \"status_code\": \"CONFIRMED\",\n  \"status_message\": \"BACKORDERED\",\n  \"sales_order_lines\":[\n    {\n      \"line_number\": \"POL6789876\",\n      \"sales_order_line_number\": \"SOL5678909\",\n      \"estimated_arrival_date\": \"YYYY-MM-DD\"\n    }\n  ]\n}\n]}\n\n```\n\nPossible responses:\n\n```\n// Success response:\n{\n    \"result\": {\n        \"response\": \"success\"\n    }\n}\n\n// Error response:\n{\n    \"result\": {\n        \"response\": [\n            {\n                \"customer_id\": \"ACME CORP\",\n                \"supplier_id\": \"SUP-123456\",\n                \"third_party_import_id\": \"undefined\",\n                \"status_code\": \"failure\",\n                \"error_response_body\": [\n                    {\n                        \"sales_order_number\": \"SO03323212\",\n                        \"sales_order_line_number\": \"SOL5678909\",\n                        \"error_message\": \"Field Value empty/Formatting issue Purchase order number\\nField Value empty/Formatting issue Purchase order line number\\n\"\n                    }\n                ]\n            }\n        ]\n    }\n}\n```\n\n## Spendint API - POST /sn\\_spend\\_intg/spendint/shipment\n\nUse this endpoint to accept updates on purchases from third parties.\n\nWhen you receive data, you must match the shipment data to a purchase order line by using the sales order line number. You can use the tracking number to find an existing shipment detail record that is related to the purchase order line. If no such record is found, create a new shipment detail record. If no purchase order or purchase order line exists for the shipment data, you see an error message that states that the purchase order for this shipment does not exist.\n\n**Note:** If the purchase order and purchase order lines are in the Pending Submission status, and the sales order and sales order lines are not populated, then the shipment and invoice posting from the third-party reseller is not allowed. It is only allowed when the status of the purchase order and purchase order lines are Ordered. Also, there is no sequential restriction on shipment and invoice posting.\n\n### Status tables\n\nTo know the status of the shipping request, make a REST call into the ServiceNow database using the Table REST API. The response from the API lists the records where the shipping update failed. To get a shipping response, query the Shipment Error table with the following parameter:\n\n`sysparm_query=outbound_error.supplier_id=<supplier_id>^outbound_error.state=20`\n\nThe details on the customer ID, supplier ID, error type, unique import set ID, and state can be found in the Outbound Status table, which is the parent error table.\n\n### URL format\n\n`/api/sn_spend_intg/spendint/shipment`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table id=\"table_igy_fck_ymb\" class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmode\n\n</td><td>\n\nSupport for asynchronous and synchronous modes for third-party integration.Data type: String\n\n Valid values:\n\n-   async: Asynchronous mode.\n-   sync: Synchronous mode.\n\n Default: async\n\n</td></tr></tbody>\n</table><table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncustomer\\_id\n\n</td><td>\n\nIdentifier for the customer.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\norder\\_number\n\n</td><td>\n\nRequired. Purchase order number that is provided by the customer for this order.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nsales\\_order\\_number\n\n</td><td>\n\nRequired. Number or value that is generated by the supplier for this order.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nshipment\\_lines\n\n</td><td>\n\nList of shipment lines that can contain the serial number, IMEI number, and asset tag details of the assets.Data type: Array\n\n ```\n\"shipment_lines\": [\n  {\n    \"actual_shipment_date\": \"String\",\n    \"estimated_arrival_date\": \"String\",\n    \"line_number\": \"String\",\n    \"planned_shipment_date\": \"String\",\n    \"product_details\": [Array],\n    \"sales_order_line_number\": \"String\",\n    \"shipping_address\": {Object},\n    \"shipping_carrier\": \"String\",\n    \"shipment_quantity\": \"String\",\n    \"ship_to\": \"String\",\n    \"tracking_number\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nshipment\\_lines.actual\\_shipment\\_date\n\n</td><td>\n\nDate on which the shipment leaves the supplier’s location.Data type: String\n\n Maximum length: 40\n\n Format: YYYY-MM-DD\n\n</td></tr><tr><td>\n\nshipment\\_lines.estimated\\_arrival\\_date\n\n</td><td>\n\nDate on which the shipment is expected to arrive at the specified location.Data type: String\n\n Maximum length: 40\n\n Format: YYYY-MM-DD\n\n</td></tr><tr><td>\n\nshipment\\_lines.line\\_number\n\n</td><td>\n\nRequired. Purchase order line number that is generated by the customer for a particular purchase.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nshipment\\_lines.planned\\_shipment\\_date\n\n</td><td>\n\nDate on which the shipment is planned to leave the supplier’s location.Data type: String\n\n Maximum length: 40\n\n Format: YYYY-MM-DD\n\n</td></tr><tr><td>\n\nshipment\\_lines.product\\_details\n\n</td><td>\n\nList of objects that define the details about the products being shipped. Options include the serial number, IMEI number, and asset tag details.Data type: Array\n\n ```\n\"product_details\": [\n  {\n    \"asset_tag\": \"String\",\n    \"imei\": \"String\",\n    \"serial_number\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nshipment\\_lines.product\\_details.asset\\_tag\n\n</td><td>\n\nAsset tag of the shipped product.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nshipment\\_lines.product\\_details.imei\n\n</td><td>\n\nIMEI number of the shipped product.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nshipment\\_lines.product\\_details.serial\\_number\n\n</td><td>\n\nRequired. Serial number of the shipped product.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nshipment\\_lines.sales\\_order\\_line\\_number\n\n</td><td>\n\nSales order line number that is generated by the supplier. This number is required only for revisions to this purchase.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nshipment\\_lines.shipping\\_address\n\n</td><td>\n\nAddress where the products are being shipped to.Data type: Object\n\n ```\n\"shipping_address\":\n  {\n    \"city\": \"String\",\n    \"country\": \"String\",\n    \"name\": \"String\",\n    \"state\": \"String\",\n    \"street\": \"String\",\n    \"zip_code\": \"String\"\n  }\n```\n\n</td></tr><tr><td>\n\nshipment\\_lines.shipping\\_address.city\n\n</td><td>\n\nName of the city where the products are shipped to.Data type: String\n\n Maximum length: 1000\n\n</td></tr><tr><td>\n\nshipment\\_lines.shipping\\_address.country\n\n</td><td>\n\nCountry where the products are shipped to.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nshipment\\_lines.shipping\\_address.name\n\n</td><td>\n\nName of the customer that the products are being shipped to.Data type: String\n\n Maximum length: 1000\n\n</td></tr><tr><td>\n\nshipment\\_lines.shipping\\_address.state\n\n</td><td>\n\nState where the products are shipped to.Data type: String\n\n Maximum length: 1000\n\n</td></tr><tr><td>\n\nshipment\\_lines.shipping\\_address.street\n\n</td><td>\n\nName of the street where the products are shipped to.Data type: String\n\n Maximum length: 1000\n\n</td></tr><tr><td>\n\nshipment\\_lines.shipping\\_address.zip\\_code\n\n</td><td>\n\nZip code or pin code where the products are shipped to.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nshipment\\_lines.shipment\\_quantity\n\n</td><td>\n\nRequired. Number of the products being shipped as physical goods. The number should contain the quantity of the products that are in the shipment.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nshipment\\_lines.shipping\\_carrier\n\n</td><td>\n\nShipping carrier that is delivering the product to the specified location such as FedEx, UPS, USPS, and so on.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nshipment\\_lines.ship\\_to\n\n</td><td>\n\nName of the recipient that the products are shipped to.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nshipment\\_lines.tracking\\_number\n\n</td><td>\n\nTracking number that is provided by the shipping carrier for the whole or a portion of the purchase.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nsupplier\\_id\n\n</td><td>\n\nRequired. Identifier for the reseller or supplier that the customer can place orders with.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nsupplier\\_shipment\\_number\n\n</td><td>\n\nRequired. Identification number that is generated for this shipment. Typically, this number is generated by an Enterprise Resource Planning \\(ERP\\) or order tracking system.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nthird\\_party\\_import\\_id\n\n</td><td>\n\nIdentifier that enables a third party to pass a string value to uniquely identify a set of imported data.Data type: String\n\n Maximum length: 100\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only or apply to this action in a distinct way.\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>**Note:** Only the **application/json** data format is supported for Procurement Integration Framework.\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action.\n\n|Status code|Description|\n|-----------|-----------|\n|success|Successful. The request was successfully processed.|\n|failure|Unsuccessful. The request was processed with errors.|\n\n### Response body parameters \\(JSON\\)\n\nThese response body parameters are received when queried in synchronous mode.\n\n<table id=\"table_igg_bhk_ymb\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\\_response\\_body\n\n</td><td>\n\nDescription of the errors, listed by the sales order line number, sales order number, supplier shipment number, and the error message.Data type: Array\n\n</td></tr><tr><td>\n\nerror\\_response\\_body.error\\_message\n\n</td><td>\n\nDetailed error message.Data type: String\n\n</td></tr><tr><td>\n\nstatus\\_code\n\n</td><td>\n\nResponse status such as \"success\" or \"failure.\"Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\n```\ncurl \"https://instance.service-now.com/api/sn_spend_intg/spendint/shipment\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n{\"root\":[{\n  \"customer_id\" : \"ACME CORP\",\n  \"supplier_id\" : \"SUP-123456\",\n  \"third_party_import_id\": \"DEL2134324\",\n  \"supplier_shipment_number\" : \"TN-YU67898723\",\n  \"order_number\": \"PO0001002\",\n  \"sales_order_number\": \"SO00223002\",\n  \"shipment_lines\": [\n    {\n      \"line_number\": \"POL0001005\",\n      \"sales_order_line_number\": \"SOL0231325\",\n      \"shipment_quantity\": \"4\",\n      \"shipping_carrier\": \"FedEx\",\n      \"tracking_number\": \"E-901290092\",\n      \"shipping_address\":\n        {\n          \"name\" : \"1640 Camino Del Rio North #202, San Diego,CA\",\n          \"street\" : \"1640 Camino Del Rio North\",\n          \"city\" : \"San Diego\",\n          \"state\" : \"CA\",\n          \"zip_code\" : \"92108-1512\",\n          \"country\" : \"US\"\n        },\n      \"ship_to\": \"John doe\",\n      \"planned_shipment_date\": \"YYYY-MM-DD\",\n      \"actual_shipment_date\": \"YYYY-MM-DD\",\n      \"estimated_arrival_date\": \"YYYY-MM-DD\",\n      \"product_details\": [\n        {\n          \"serial_number\": \"FL1234-23242319001\",\n          \"imei\": \"2134890294\",\n          \"asset_tag\": \"\"\n        },{\n          \"serial_number\": \"FL1234-23242319110\",\n          \"imei\": \"245499003\",\n          \"asset_tag\": \"\"\n        }\n      ]\n    }\n  ]\n}\n]}\n```\n\nPossible responses:\n\n```\n// Success response:\n{\n    \"result\": {\n        \"response\": \"success\"\n    }\n}\n\n// Error response:\n{\n    \"result\": {\n        \"response\": [\n            {\n                \"customer_id\": \"ACME CORP\",\n                \"supplier_id\": \"SUP-123456\",\n                \"third_party_import_id\": \"DEL2134324\",\n                \"status_code\": \"failure\",\n                \"error_response_body\": [\n                    {\n                        \"sales_order_line_number\": \"SOL0231325\",\n                        \"sales_order_number\": \"SO00223002\",\n                        \"supplier_shipment_number\": \"TN-YU67898723\",\n                        \"error_message\": \"The purchase order for this shipment does not exist\\nThe purchase order line for this shipment does not exist\\n\"\n                    }\n                ]\n            }\n        ]\n    }\n}\n```\n\n## Spendint API - POST /sn\\_spend\\_intg/spendint/invoice\n\nAccepts invoices from third-party providers.\n\nIf the purchase order and purchase order lines are in the Pending Submission status, and the sales order and sales order lines are not populated, then the shipment and invoice posting from the third-party reseller is not allowed. It is only allowed when the status of the purchase order and purchase order lines are Ordered. Also, there is no sequential restriction on shipment and invoice posting.\n\nAfter an invoice is submitted, the invoice and invoice lines are mapped to a purchase order. On a successful mapping, the state of the invoice is set as follows:\n\n-   Awaiting Delivery: When no receipts exist, the order is partially delivered, or the invoice requires approval.\n-   Invoice Confirmed: When the purchase order is delivered and the amount invoiced matches the purchase order total amount.\n-   Requires Review: When the purchase order is delivered and the amount invoiced does not match the purchase order total amount.\n\nWhen a valid invoice is posted for a line item, the same invoice cannot be updated.\n\nIf the provided invoice does not have a purchase order number, the invoice is rejected and you see an error message that states that one or more of the provided invoices does not have a purchase order number. If the provided invoice has a purchase order number, but it doesn't match the purchase order or no purchase order exists, you see an error message. The message states that one or more invoices do not have a corresponding purchase order that matches the purchase order number of the invoice. Also, if the amount invoiced sent from the third-party reseller does not match with the invoiced amount, the invoice is rejected.\n\n### Status tables\n\nTo know the status of the invoice request, make a REST call into the ServiceNow database using the Table REST API. The response from the API lists the records where the invoice creation failed. For invoice response, query the Invoice Error table with the following parameter:\n\n`sysparm_query=outbound_error.supplier_id=<supplier_id>^outbound_error.state=20`\n\nThe details on the customer ID, supplier ID, error type, unique import set ID, and state can be found in the Outbound Status table, which is the parent error table.\n\n### URL format\n\n`/api/sn_spend_intg/spendint/invoice`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table id=\"table_jhz_gck_ymb\" class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmode\n\n</td><td>\n\nSupport for asynchronous and synchronous modes for third-party integration.Data type: String\n\n Valid values:\n\n-   async: Asynchronous mode.\n-   sync: Synchronous mode.\n\n Default: async\n\n</td></tr></tbody>\n</table><table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncurrency\n\n</td><td>\n\nRequired. Currency for subtotal, tax, and shipping. The subtotal, tax, and shipping should be in the same currency.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\ncustomer\\_id\n\n</td><td>\n\nIdentifier for the customer.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\ndiscounts\n\n</td><td>\n\nDiscounts that are applied toward the invoice. This is an editable field.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\ninvoice\\_date\n\n</td><td>\n\nRequired. Date on which the customer was invoiced.Data type: String\n\n Maximum length: 40\n\n Format: YYYY-MM-DD\n\n</td></tr><tr><td>\n\ninvoice\\_lines\n\n</td><td>\n\nList of objects that define the lines that are being invoiced for purchases within this order.Data type: Array\n\n ```\n\"invoice_lines\": [\n  {\n    \"invoiced_line_amount\": \"String\",\n    \"invoiced_quantity\": \"String\",\n    \"line_number\": \"String\",\n    \"supplier_invoice_line_number\": \"String\",\n    \"sales_order_line_number\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\ninvoice\\_lines.invoiced\\_line\\_amount\n\n</td><td>\n\nRequired. Total cost, excluding taxes and shipping, that a customer is being invoiced for a given purchase order line.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\ninvoice\\_lines.invoiced\\_quantity\n\n</td><td>\n\nRequired. Quantity of goods or services that a customer is being invoiced for.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\ninvoice\\_lines.line\\_number\n\n</td><td>\n\nRequired. Purchase order line number that is generated by the customer for a particular purchase.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\ninvoice\\_lines.sales\\_order\\_line\\_number\n\n</td><td>\n\nRequired. Sales order line number that is generated by the supplier.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\ninvoice\\_lines.supplier\\_invoice\\_line\\_number\n\n</td><td>\n\nRequired. Identification number that is generated by a supplier for this invoice line.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nother\\_charges\n\n</td><td>\n\nOther additional charges associated to the invoice. This is an editable field.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\norder\\_number\n\n</td><td>\n\nRequired. Purchase order number that is provided by the customer for this order.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nremit\\_to\\_address\n\n</td><td>\n\nRequired. Location to which a payment is made.Data type: String\n\n Maximum length: 1000\n\n</td></tr><tr><td>\n\nsales\\_order\\_number\n\n</td><td>\n\nRequired. Number or value that is generated by the supplier for this order.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nshipping\n\n</td><td>\n\nRequired. Total shipping cost for the entire purchase.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nsubtotal\n\n</td><td>\n\nRequired. Total amount of money to be paid to the supplier excluding tax and shipping charges.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\nsupplier\\_id\n\n</td><td>\n\nRequired. Identifier for the reseller or supplier that the customer can place orders with.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nsupplier\\_invoice\\_number\n\n</td><td>\n\nRequired. Identification number that is generated by a supplier for this invoice.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nsupplier\\_tax\\_id\n\n</td><td>\n\nTax identifier that is associated to the third party reseller. This is an editable field.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\ntax\n\n</td><td>\n\nRequired. Total amount of taxes that are billed for the purchase.Data type: String\n\n Maximum length: 40\n\n</td></tr><tr><td>\n\ntax\\_rate\n\n</td><td>\n\nTax rate percentage that is applied for the order. This is an editable field.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\nthird\\_party\\_import\\_id\n\n</td><td>\n\nIdentifier that enables a third party to pass a string value to uniquely identify a set of imported data.Data type: String\n\n Maximum length: 100\n\n</td></tr><tr><td>\n\ntotal\\_amount\\_invoiced\n\n</td><td>\n\nRequired. Total amount of money to be paid to the supplier including tax and shipping charges.Data type: String\n\n Maximum length: 40\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only or apply to this action in a distinct way.\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>**Note:** Only the **application/json** data format is supported for Procurement Integration Framework.\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action.\n\n|Status code|Description|\n|-----------|-----------|\n|success|Successful. The request was successfully processed.|\n|failure|Unsuccessful. The request was processed with errors.|\n\n### Response body parameters \\(JSON\\)\n\nThese response body parameters are received when queried in synchronous mode.\n\n<table id=\"table_jh4_bhk_ymb\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\\_response\\_body\n\n</td><td>\n\nDescription of the errors, listed by the sales order line number, sales order number, supplier invoice number, supplier invoice line number, and the error message.Data type: Array\n\n</td></tr><tr><td>\n\nerror\\_response\\_body.error\\_message\n\n</td><td>\n\nDetailed error message.Data type: String\n\n</td></tr><tr><td>\n\nstatus\\_code\n\n</td><td>\n\nResponse status such as \"success\" or \"failure.\"Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\n```\ncurl \"https://instance.service-now.com/api/sn_spend_intg/spendint/invoice\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n{\"root\":[{\n  \"customer_id\": \"Customer - A\",\n  \"supplier_id\": \"SUP-123456\",\n  \"third_party_import_id\": \"undefined\",\n  \"supplier_invoice_number\": \"QAAP89873220071\",\n  \"supplier_tax_id\": \"TIN000000\",\n  \"order_number\": \"POL7987633\",\n  \"sales_order_number\": \"SO0000000081\",\n  \"invoice_date\": \"YYYY-MM-DD\",\n  \"subtotal\": \"6000\",\n  \"tax_rate\": \"10%\",\n  \"tax\": \"600\",\n  \"shipping\": \"120\",\n  \"other_charges\": \"100\",\n  \"discounts\": \"200\",\n  \"total_amount_invoiced\": \"6620\",\n  \"remit_to_address\": \"1640 Camino Del Rio North #202, San Diego,CA\",\n  \"currency\": \"USD\",\n  \"invoice_lines\": [\n    {\n      \"supplier_invoice_line_number\": \"QA789A867877ABN32251\",\n      \"line_number\": \"POL587667\",\n      \"sales_order_line_number\": \"SOL00000081\",\n      \"invoiced_quantity\": \"45\",\n      \"invoiced_line_amount\": \"4000\"\n    },\n    {\n      \"line_number\": \"POL587668\",\n      \"supplier_invoice_line_number\": \"78987323\",\n      \"sales_order_line_number\": \"SOL98769\",\n      \"invoiced_quantity\": \"12\",\n      \"invoiced_line_amount\": \"2000\"\n    }\n  ]\n}\n]}\n```\n\nPossible responses:\n\n```\n// Success response:\n{\n    \"result\": {\n        \"response\": \"success\"\n    }\n}\n\n// Error response:\n{\n    \"result\": {\n        \"response\": [\n            {\n                \"customer_id\": \"Customer - A\",\n                \"supplier_id\": \"SUP-123456\",\n                \"third_party_import_id\": \"undefined\",\n                \"status_code\": \"failure\",\n                \"error_response_body\": [\n                    {\n                        \"sales_order_line_number\": \"SOL00000081\",\n                        \"sales_order_number\": \"SO0000000081\",\n                        \"supplier_invoice_number\": \"QAAP89873220071\",\n                        \"supplier_invoice_line_number\": \"QA789A867877ABN32251\",\n                        \"error_message\": \"The invoice do not have a corresponding purchase order which matches the purchase order number of the invoice provided\\n\"\n                    }\n                ]\n            }\n        ]\n    }\n}\n```\n\n"}}