Get New Vendor Requests
Syntax
GET /api/new-vendor-requests/
Returns a set of new vendors that satisfy all selected request parameters. The user performing this request has to be authorized to View New Vendor Requests.
Example:
GET /api/new-vendor-requests/?status=1&per_page=20
This sample call will return the first page of New Vendor Requests that are Approved (status=1). Each page of results will have at most 20 results per page in this case.
Request Parameters
Parameter | Type | Description | Example |
---|---|---|---|
page | Number | Page number within the paginated result set to return. | page=2 will return the second page |
per_page | Number | Number of results to return per page. Default value is 10. The maximum per_page value is 1000. | per_page=20 will return twenty New Vendor Requests per page |
status | Number | Filter by registration status:
0 – Pending | status=1 will return only approved New Vendor Requests. |
type | Number | Filter by registration type:
0 – Full | type=2 will return only Edit Registrations |
resubmitted_only | Boolean | When true, return only registrations that have been returned to the payee, and then resubmitted by the payee.
Default is false. | resubmitted_only=true will return only registrations that have been returned to the vendor, and then resubmitted by the vendor. |
status_change_since | Date | Filter to only return registrations where the status has changed since the specified date.
Format: YYYY-MM-DD | status_change_since=2022-12-31 will return all registrations where the status has changed on or after Dec 31st, 2022. |
since | Date | Filter to only return registrations submitted by the payee since the specified date.
Format: YYYY-MM-DD | since=2022-12-31 will return all registrations that are submitted on or after Dec 31st 2022. |
last_n_days | Number | Filter to only return registrations submitted in the last N days | last_n_days=30 will only return the registrations submitted within the last 30 days. |
supplier_name | String | Case insensitive filter on the name of the supplier/payee. supplier_name can be a prefix or the exact name of the payee that submitted the registration. | supplier_name=Home%20dep will return registrations submitted by “Home Depot”, and “Home Depot of Wolcott”. Notice the space is represented as %20. Matching is not case sensitive. |
tag_name | String | Case insensitive filter on registrations with the specified tag name or a prefix of the tag. | tag_name=test will return all registrations that have tags that look like: Test, Test 1, test 2, etc. |
vendor_num | String | Filter by vendor number that this registration is connected to in the ERP. | vendor_num=12345 will return only registrations that are connected with supplier that has vendor number = 12345 in the ERP. |
site_code | String | Filter by the site code that this registration is connected to in the ERP. | site_code=2 will return only registrations that are connected with supplier that has site code = 2 in the ERP. |
my_pending_only | Boolean | If true, only return pending registrations that can be approved by the requesting user. | my_pending_only=True will only return pending registrations that the requesting user can approve. |
id | Number | Filter by the PaymentWorks registration ID. | id=123 will only return registration 123. |
tin | String | Filter by tax id (SSN, EIN, ITIN, foreign tax ID) of the payee that submitted the registration. | tin=123456789 will return the registrations submitted by payees with tax ID “123456789” |
Sample Response
An example JSON response can be seen here:
{ "count": 6, "next": null, "previous": null, "results": [ { "id": 19657, "request_status": "Approved", "requesting_company": { "id": 12593, "name": "Home Depot" }, "ts": "2023-01-11T15:06:45.288495-05:00", "user_can_approve": false, "user_can_bypass": false, "pending_approvers": [], "latest_sent_msg_id": null, "is_resubmitted": false, "last_submitted_ts": "2023-01-11T15:06:45.285381-05:00", "request_type": "Partial", "registration_routing": { "op_code": "new_address", "annotation": "", "related_site_code": "2", "related_vendor_number": "12345" }, "tags": [] }, { "id": 19654, "request_status": "Approved", "requesting_company": { "id": 12593, "name": "Home Depot" }, "ts": "2023-01-11T14:55:00.788375-05:00", "user_can_approve": false, "user_can_bypass": false, "pending_approvers": [], "latest_sent_msg_id": null, "is_resubmitted": false, "last_submitted_ts": "2023-01-11T14:55:00.777605-05:00", "request_type": "Partial", "registration_routing": { "op_code": "new_address", "annotation": "", "related_site_code": "2", "related_vendor_number": "12345" }, "tags": [] } ]
Response Key/Value Explanations
Key | Type | Sample Value | Description |
---|---|---|---|
count | Number | 17 | How many New Vendor Requests were retrieved. |
next | URL | https://paymentworks.com/api/new-vendor-requests/?page=2 | The URL to the next page or null if there are no further pages to return. |
previous | URL | https://paymentworks.com/api/new-vendor-requests/?page=1 | The URL to the previous page or null if this is the first page. |
results | Array of JSON objects | [ { New Vendor Request 1 },
{ New Vendor Request 2 }, { New Vendor Request 3} … ] | An array of JSON objects where each object is one New Vendor Requests. This array is always at most one page long. |
HTTP Response Codes
Status Code | Description |
---|---|
200 OK | Success |
400 Bad Request | The request could not be understood by the server due to incorrect syntax. |
401 Unauthenticated | The request requires user authentication information. Your API token is missing or invalid. |
403 Forbidden | Permission Denied – User does not have permission to perform this request |
404 Not Found | The resource you requested on the server does not exist |
500 | The request has failed due to a temporary failure of the server. You can try this request at a later time. |
503 | The request has failed due to a temporary failure of the server. You can try this request at a later time. |