Square: Create Vendor
Square vendors.createVendor: arguments, response, policy and SDK examples.
← Vendors operations · Get started
Operation square.createvendor
Provider route: POST /v2/vendors/create. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/square with npm, or alter-sdk-square with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { SquareIntegration } from "@alter-ai/square";
async function execute(input: Parameters<SquareIntegration["vendors"]["createVendor"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new SquareIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.vendors.createVendor(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_square import SquareIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = SquareIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.vendors.create_vendor(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | Model | Required within parent | Expand Create Vendor — request body — body |
Referenced models: Create Vendor — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Create Vendor — response body |
Referenced models: Create Vendor — response body
Schemas
Section titled “Schemas”6 more schemas are linked from the tables above, on the schema pages.
Create Vendor — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an input to a call to [CreateVendor](api-endpoint:Vendors-CreateVendor). |
idempotency_key | string | Required within parent | A client-supplied, universally unique identifier (UUID) to make this [CreateVendor](api-endpoint:Vendors-CreateVendor) call idempotent. See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the [API Development 101](https://developer.squareup.com/docs/buildbasics) section for more information. Maximum length: 128 Minimum length: 1 |
vendor | Model | Optional | Expand Create Vendor — request body — body vendor The requested [Vendor](entity:Vendor) to be created. |
Referenced models: Create Vendor — request body — body vendor
Create Vendor — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an output from a call to [CreateVendor](api-endpoint:Vendors-CreateVendor). |
errors | array | Optional | Errors encountered when the request fails. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
vendor | Model | Optional | Expand Create Vendor — response body — vendor The successfully created [Vendor](entity:Vendor) object. |
Referenced models: Get Shift — response body — errors item, Create Vendor — response body — vendor
Create Vendor — request body — body vendor
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a supplier to a seller. |
account_number | JSON | Optional | |
account_number (anyOf 1) | string | Alternative | The account number of the [Vendor](entity:Vendor). Maximum length: 100 |
account_number (anyOf 2) | null | Alternative | |
address | JSON | Optional | |
address (anyOf 1) | Model | Alternative | Expand Create Customer — request body — body address The address of the [Vendor](entity:Vendor). |
address (anyOf 2) | null | Alternative | |
contacts | JSON | Optional | |
contacts (anyOf 1) | array | Alternative | The contacts of the [Vendor](entity:Vendor). |
contacts (anyOf 1)[] | Model | Each item | Expand Create Vendor — request body — body vendor contacts The contacts of the Vendor (entity:Vendor) item |
contacts (anyOf 2) | null | Alternative | |
created_at | string | Optional | An RFC 3339-formatted timestamp that indicates when the [Vendor](entity:Vendor) was created. Maximum length: 34 Read only: true |
id | string | Optional | A unique Square-generated ID for the [Vendor](entity:Vendor). This field is required when attempting to update a [Vendor](entity:Vendor). Maximum length: 100 |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The name of the [Vendor](entity:Vendor). This field is required when attempting to create or update a [Vendor](entity:Vendor). Maximum length: 100 |
name (anyOf 2) | null | Alternative | |
note | JSON | Optional | |
note (anyOf 1) | string | Alternative | A note detailing information about the [Vendor](entity:Vendor). Maximum length: 4096 |
note (anyOf 2) | null | Alternative | |
status | JSON | Optional | |
status (anyOf 1) | string | Alternative | The status of the [Vendor](entity:Vendor), whether a [Vendor](entity:Vendor) is active or inactive. The status of the [Vendor](entity:Vendor). See [Status](#type-status) for possible values One of: ACTIVE, INACTIVE |
status (anyOf 2) | null | Alternative | |
updated_at | string | Optional | An RFC 3339-formatted timestamp that indicates when the [Vendor](entity:Vendor) was last updated. Maximum length: 34 Read only: true |
version | integer | Optional | The version of the [Vendor](entity:Vendor). |
Referenced models: Create Customer — request body — body address, Create Vendor — request body — body vendor contacts The contacts of the Vendor (entity:Vendor) item
Get Shift — response body — errors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an error encountered during a request to the Connect API. See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information. |
category | string | Required within parent | Indicates which high-level category of error has occurred during a request to the Connect API. The high-level category for the error. See [ErrorCategory](#type-errorcategory) for possible values Known values: API_ERROR, AUTHENTICATION_ERROR, INVALID_REQUEST_ERROR, RATE_LIMIT_ERROR, PAYMENT_METHOD_ERROR, REFUND_ERROR, MERCHANT_SUBSCRIPTION_ERROR, EXTERNAL_VENDOR_ERROR |
code | Model | Required within parent | Expand Get Shift — response body — errors item code The specific code of the error. See [ErrorCode](#type-errorcode) for possible values |
detail | string | Optional | A human-readable description of the error for debugging purposes. |
field | string | Optional | The name of the field provided in the original request (if any) that the error pertains to. |
Referenced models: Get Shift — response body — errors item code
Create Vendor — response body — vendor
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a supplier to a seller. |
account_number | JSON | Optional | |
account_number (anyOf 1) | string | Alternative | The account number of the [Vendor](entity:Vendor). Maximum length: 100 |
account_number (anyOf 2) | null | Alternative | |
address | JSON | Optional | |
address (anyOf 1) | Model | Alternative | Expand Get Payment — response body — payment billing address The address of the [Vendor](entity:Vendor). |
address (anyOf 2) | null | Alternative | |
contacts | JSON | Optional | |
contacts (anyOf 1) | array | Alternative | The contacts of the [Vendor](entity:Vendor). |
contacts (anyOf 1)[] | Model | Each item | Expand Create Vendor — response body — vendor contacts The contacts of the Vendor (entity:Vendor) item |
contacts (anyOf 2) | null | Alternative | |
created_at | string | Optional | An RFC 3339-formatted timestamp that indicates when the [Vendor](entity:Vendor) was created. Maximum length: 34 Read only: true |
id | string | Optional | A unique Square-generated ID for the [Vendor](entity:Vendor). This field is required when attempting to update a [Vendor](entity:Vendor). Maximum length: 100 |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The name of the [Vendor](entity:Vendor). This field is required when attempting to create or update a [Vendor](entity:Vendor). Maximum length: 100 |
name (anyOf 2) | null | Alternative | |
note | JSON | Optional | |
note (anyOf 1) | string | Alternative | A note detailing information about the [Vendor](entity:Vendor). Maximum length: 4096 |
note (anyOf 2) | null | Alternative | |
status | JSON | Optional | |
status (anyOf 1) | string | Alternative | The status of the [Vendor](entity:Vendor), whether a [Vendor](entity:Vendor) is active or inactive. The status of the [Vendor](entity:Vendor). See [Status](#type-status) for possible values Known values: ACTIVE, INACTIVE |
status (anyOf 2) | null | Alternative | |
updated_at | string | Optional | An RFC 3339-formatted timestamp that indicates when the [Vendor](entity:Vendor) was last updated. Maximum length: 34 Read only: true |
version | JSON | Optional | |
version (anyOf 1) | integer | Alternative | The version of the [Vendor](entity:Vendor). |
version (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Referenced models: Get Payment — response body — payment billing address, Create Vendor — response body — vendor contacts The contacts of the Vendor (entity:Vendor) item
Create Location — request body — body location country
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | Indicates the country associated with another entity, such as a business. Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). One of: 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 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.createvendor. Catalog operation: CreateVendor. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["VENDOR_WRITE"]
Pinned headers: {"Square-Version": "2026-11-18"}