Syntax

GET /api/updates/

Returns a set of vendor updates that satisfy all selected request parameters. The user performing this request has to be authorized to View Vendor Company Updates. In addition to this, depending on the nature of the update the following permissions are required: View Vendor Sanction List Reports, View Tax ID Unmasked, View Vendor Payment Details and View Vendor Profiles.

Example:

GET /api/updates/?status=1&per_page=20

This sample call will return all vendor updates that are Approved ( the status is equal to 1 ). It will return twenty results per page. Note, you only want to fetch the approved updates.

Request Parameters

ParameterTypeDescriptionExample
pageNumberA page number within the paginated result set.page=2 will return the second page.
per_pageNumberNumber of results to return per page. Default value is 10. The maximum per_page value is 1000.per_page=20 will return twenty comments per page.
StatiusNumber0 – Pending
1 – Approved
2 – Rejected
3 – Processed
4 – Promoted (handled as a registration)
status=1 will return approved updates only.
status_change_sinceNumberDate when the vendor update has last changed its status in yyyy-mm-dd format.status_change_since=2022-12-31 will return all updates that have changed status on or after Dec 31st 2022.
value_change_sinceDateTimeDate when the vendor update has last changed a value in yyyy-mm-dd format.value_change_since=2022-12-31 will return all updates that have changed values on or after Dec 31st 2022.
sinceDateTimeDate when the New Vendor Request was last submitted in yyyy-mm-dd format.since=2022-12-31 will return all updates that are submitted on or after Dec 31st 2022.
last_n_daysNumberNumber of dayslast_n_days=30 will return only updates that were added during the last 30 days.
supplier_nameStringThe name of the supplier or a prefix of it. The name is not case sensitive.supplier_name=Home%20dep will return suppliers “Home Depot”, and “Home Depot of Wolcott”. Notice the space is represented as %20. Matching is not case sensitive.
group nameStringbank_address
bank_account
company
corporate_address
remittance_address
order_address
sanction_list_alert
custom_form_fields
group_name=corporate_address will return all updates that have changes in the Corporate Address group of fields.
vendor_numNumberVendor number that this update is connected to in the ERP. vendor_num=12345 will return only updates that are connected with supplier that has vendor number = 12345 in the ERP.
site_codeNumberSite code that this update is connected to in the ERP.site_code=2 will return only update that are connected with supplier that has site code = 2 in the ERP.

Success Codes

HTTP Status CodeExceptionDescription
200SuccessIt will return a set of vendor updates that satisfy all selected request parameters. The set may be empty if no update satisfies all selected parameters.

Sample Response

Returns a JSON object with one page of results. Example:

{
  "count": 17,
  "next": https://paymentworks.com/api/updates/?page=2,
  "previous": null,
  "results": [ ... 
  ]
}

where:

KeyTypeSample ValueDescription
countString17How many vendor updates were retrieved.
nextStringhttps://paymentworks.com/api/updates/?page=2The URL to the next page or null if the number of result is less than per_page (default is 10).
previousStringhttps://paymentworks.com/api/updates/?page=1The URL to the previous page or null if this is the first page.
resultsArray of JSON objects[ { Update 1 },
{ Update 2 },
{ Update 3} … ]
An array of JSON objects where each object is one Update. This array is always at most one page long.

Each comment is a JSON object. Example:

{
      "id": 22584,
      "ts": "2022-04-12T10:44:25.474805-04:00",
      "status_ts": "2022-04-12T10:48:43.055888-04:00",
      "vendor_nums": [
        {
          "site_codes": [
            "2"
          ],
          "vendor_num": "12345"
        }
      ],
      "vendor_name": "Home depot of Wolcott",
      "group_name": "Company",
      "from_value_display": "Telephone: +12023334444",
      "to_value_display": "Telephone: +12023334445",
      "status": "Approved",
      "field_changes": [
        {
          "field_name": "Telephone",
          "from_value": "+12023334444",
          "to_value": "+12023334445"
        }
      ],
      "user_can_approve": false,
      "pending_approvers": [],
      "user_can_skip": false,
      "user_can_bypass": false,
      "addr_validated": null,
      "bank_validation_status_display": "",
      "bank_verification_reason_context": null,
      "bank_verification_note": null,
      "metadata": {}
}

where some more important key values pairs are:

KeyTypeSample ValueDescription
idNumber22584Each update is identified with a numeric id.
vendur_numString12345If vendor that is being updated is connected, this is the id for this vendor in the ERP.
site_codeArray of Strings[“1”, “2”, “3”]This is a list of all sites for this vendor that will be affected by this update.
group_nameString“Company”What group this update belongs to: bank_address, bank_account, company…
field_nameString“Telephone”
The field that was changed.
from_valueString“+12023334444”The value prior to the change.
to_valueString“+12023334445”The new value.

Error Codes

HTTP Status CodeExceptionDescription
400Bad RequestThe request could not be understood by the server due to incorrect syntax.
401UnauthenticatedThe request requires user authentication information. Your API token is missing or invalid.
403ForbiddenUnauthorized request. The client does not have access rights to the content. Unlike 401, the client’s identity is known to the server.
404Not FoundThe API that you requested does not exist on this server.
500

503

Service UnavailableThe request has failed due to a temporary failure of the server. You can try this request at a later time.

Calling the API