Vendors
Create, update, and query the available Vendors in Square.
Table Specific Information
Select
The driver uses the Square API to process the following search criteria:
List all vendors. This will list both active and inactive vendors.
SELECT * from Vendors;
Retrieve a vendor through its 'Id':
SELECT * from Vendors WHERE Id = 'F5MMNGPNW2IZVRB2';
Retrieve a vendor through its 'Name':
SELECT * from Vendors WHERE Name = 'new-vendor';
List only active vendors:
SELECT * FROM Vendors WHERE Status = 'ACTIVE';
List only inactive vendors:
SELECT * FROM Vendors WHERE Status = 'INACTIVE';
Insert
To create a Vendor, the field 'Name' is required.
INSERT INTO Vendors (Name, AddressAddressLine1, AddressAddressLine2, AddressAddressLine3, AddressLocality, AddressSublocality, AddressSublocality2, AddressSublocality3, AddressAdministrativeDistrictLevel1, AddressAdministrativeDistrictLevel2, AddressAdministrativeDistrictLevel3, AddressPostalCode, AddressCountry, AddressFirstName, AddressLastName, AccountNumber, Note, Status) VALUES ('insert_4', 'a', 'b', 'c', 'locality', 'sub', 'sub2', 'sub3', 'AddressAdministrativeDistrictLevel1', 'AddressAdministrativeDistrictLevel2', 'AddressAdministrativeDistrictLevel3', '134003', 'IN', 'AddressFirstName', 'AddressLastName', '1234567890', 'this is a note.', 'ACTIVE');
INSERT INTO Vendors (Name, AccountNumber, Note, Status, Contacts) VALUES ('insert_8', '1234567890', 'this is a note.', 'ACTIVE', '[{"ordinal": 0, "name": "first_contact", "phone_number": "1234567890", "removed": false}, {"ordinal": 1, "name": "first_contact2", "phone_number": "1234567891", "removed": false}]');
Update
To update a Vendor record, the field 'Version' is required. The value which should be supplied to this field must be the same one the record currently has.
UPDATE Vendors SET Name = 'updated', AddressAddressLine1 = 'updated', AddressAddressLine2 = 'updated', AddressAddressLine3 = 'updated', AddressLocality = 'updated', AddressSublocality = 'updated', AddressSublocality2 = 'updated', AddressSublocality3 = 'updated', AddressAdministrativeDistrictLevel1 = 'updated', AddressAdministrativeDistrictLevel2 = 'updated', AddressAdministrativeDistrictLevel3 = 'updated', AddressPostalCode = 'updated', AddressCountry = 'AU', AddressFirstName = 'updated', AddressLastName = 'updated', Contacts = '[{"ordinal": 2,"email_address": "[email protected]","name": "updated1","phone_number": "5645645645","removed": false}, {"ordinal": 3,"email_address": "[email protected]","name": "updated2","phone_number": "1233211233","removed": false}]', AccountNumber = '9346', Note = 'updated', Version = 3, Status = 'INACTIVE' WHERE Id = 'YEA4LD6WXX6BJUZT';
Bulk Insert
Maximum BatchSize supported by Vendors is 100.
You can create Vendors in bulk using TEMP tables.
INSERT INTO Vendors#TEMP (Name, AddressCountry) VALUES ('s1', 'IN');
INSERT INTO Vendors#TEMP (Name, AddressCountry) VALUES ('s2', 'IN');
INSERT INTO Vendors (Name, AddressCountry) SELECT Name, Contacts FROM Vendors#TEMP;
Bulk Update
Maximum BatchSize supported by Vendors is 100.
Vendors van be updated in bulk using their Ids.
INSERT INTO Vendors#TEMP (Id, Version, AddressCountry) VALUES ('SUKM5RFPH6T4CWTW',5,'IN');
INSERT INTO Vendors#TEMP (Id, Version, AddressCountry) VALUES ('RCWAADSCRNBVER3W',9,'IN');
UPDATE Vendors (Id, Version, AddressCountry) SELECT Id, Version, AddressCountry FROM Vendors#TEMP;
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
A unique Square-generated ID for the Vendor. |
| CreatedAt | Datetime | True |
An RFC 3339-formatted timestamp that indicates when the Vendor was created. |
| UpdatedAt | Datetime | True |
An RFC 3339-formatted timestamp that indicates when the Vendor was last updated. |
| Name | String | False |
The name of the Vendor. |
| AddressAddressLine1 | String | False |
The first line of the address. |
| AddressAddressLine2 | String | False |
The second line of the address, if any. |
| AddressAddressLine3 | String | False |
The third line of the address, if any. |
| AddressLocality | String | False |
The city or town of the address. |
| AddressSublocality | String | False |
A civil region within the address's locality, if any. |
| AddressSublocality2 | String | False |
A civil region within the address's sublocality, if any. |
| AddressSublocality3 | String | False |
A civil region within the address's Sublocality2, if any. |
| AddressAdministrativeDistrictLevel1 | String | False |
A civil entity within the address's country. In the US, this is the state. |
| AddressAdministrativeDistrictLevel2 | String | False |
A civil entity within the address's AdministrativeDistrictLevel1. In the US, this is the county. |
| AddressAdministrativeDistrictLevel3 | String | False |
A civil entity within the address's AdministrativeDistrictLevel2, if any. |
| AddressPostalCode | String | False |
The address's postal code. |
| AddressCountry | String | False |
The address's country, in the two-letter format of ISO 3166. For example, US or FR. The allowed values are ZZ, AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, YE, YT, ZA, ZM, ZW. |
| AddressFirstName | String | False |
Optional first name when it's representing recipient. |
| AddressLastName | String | False |
Optional last name when it's representing recipient. |
| Contacts | String | False |
The contacts of the Vendor. |
| AccountNumber | String | False |
The account number of the Vendor. |
| Note | String | False |
A note detailing information about the Vendor. |
| Version | Integer | False |
The version of the Vendor. This column must not be set when executing INSERT operations. |
| Status | String | False |
The status of the Vendor. |