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

ParameterTypeDescriptionExample
pageNumberPage number within the paginated result set to return.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 New Vendor Requests per page
statusNumberFilter by registration status:

0 – Pending
1 – Approved
2 – Processed
3 – Connected
4 – Rejected
5 – Returned

status=1 will return only approved New Vendor Requests.
typeNumberFilter by registration type:

0 – Full
1 – Partial
2 – Edit

type=2 will return only Edit Registrations
resubmitted_onlyBooleanWhen 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_sinceDateFilter 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.
sinceDateFilter 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_daysNumberFilter to only return registrations submitted in the last N dayslast_n_days=30 will only return the registrations submitted within the last 30 days.
supplier_nameStringCase 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_nameStringCase 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_numStringFilter 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_codeStringFilter 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_onlyBooleanIf 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.
idNumberFilter by the PaymentWorks registration ID.id=123 will only return registration 123.
tinStringFilter 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

KeyTypeSample ValueDescription
countNumber17How many New Vendor Requests were retrieved.
nextURLhttps://paymentworks.com/api/new-vendor-requests/?page=2The URL to the next page or null if there are no further pages to return.
previousURLhttps://paymentworks.com/api/new-vendor-requests/?page=1The URL to the previous page or null if this is the first page.
resultsArray 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 CodeDescription
200 OKSuccess
400 Bad RequestThe 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 ForbiddenPermission Denied – User does not have permission to perform this request
404 Not FoundThe resource you requested on the server does not exist
500The request has failed due to a temporary failure of the server. You can try this request at a later time.
503The request has failed due to a temporary failure of the server. You can try this request at a later time.

Calling the API