• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
Bulk create vendors BETA

POST /v2/vendors/bulk-create

Creates one or more Vendor objects to represent suppliers to a seller.


Permissions
VENDOR_WRITE
Guide
Create vendors
Try in API Explorer
Name Description
vendors
Map<string, Vendor>

Required

Specifies a set of new Vendor objects as represented by a collection of idempotency-key/Vendor-object pairs.

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

responses
Map<string, CreateVendorResponse>

A set of CreateVendorResponse objects encapsulating successfully created Vendor objects or error responses for failed attempts. The set is represented by a collection of idempotency-key/Vendor-object or idempotency-key/error-object pairs. The idempotency keys correspond to those specified in the input.

Examples

You are viewing an old version of the API
POST /v2/vendors/bulk-create
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/vendors/bulk-create \
  -X POST \
  -H 'Square-Version: 2022-05-12' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "vendors": {
      "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe": {
        "name": "Joe'\''s Fresh Seafood",
        "address": {
          "address_line_1": "505 Electric Ave",
          "address_line_2": "Suite 600",
          "locality": "New York",
          "administrative_district_level_1": "NY",
          "postal_code": "10003",
          "country": "US"
        },
        "contacts": [
          {
            "name": "Joe Burrow",
            "email_address": "joe@joesfreshseafood.com",
            "phone_number": "1-212-555-4250"
          }
        ],
        "account_number": "4025391",
        "note": "a vendor"
      }
    },
    "47bb76a8-c9fb-4f33-9df8-25ce02ca4505": {
      "name": "Annie’s Hot Sauce",
      "contacts": [
        {
          "name": "Annie Thomas",
          "email_address": "annie@annieshotsauce.com",
          "phone_number": "1-212-555-4250"
        }
      ]
    }
  }'
Response JSON
{
  "errors": [],
  "vendors": {
    "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe": {
      "vendor": {
        "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4",
        "created_at": "2022-03-16T10:21:54.859Z",
        "updated_at": "2022-03-16T10:21:54.859Z",
        "name": "Joe's Fresh Seafood",
        "address": {
          "address_line_1": "505 Electric Ave",
          "address_line_2": "Suite 600",
          "locality": "New York",
          "administrative_district_level_1": "NY",
          "postal_code": "10003",
          "country": "US"
        },
        "contacts": [
          {
            "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A",
            "name": "Joe Burrow",
            "email_address": "joe@joesfreshseafood.com",
            "phone_number": "1-212-555-4250"
          }
        ],
        "account_number": "4025391",
        "note": "a vendor",
        "version": 0,
        "status": "ACTIVE"
      }
    }
  },
  "47bb76a8-c9fb-4f33-9df8-25ce02ca4505": {
    "vendor": {
      "id": "INV_V_FMCYHBWT1TPL8MFH52PBMEN92A",
      "created_at": "2022-03-16T10:21:54.859Z",
      "updated_at": "2022-03-16T10:21:54.859Z",
      "name": "Annie’s Hot Sauce",
      "contacts": [
        {
          "id": "INV_VC_ABYYHBWT1TPL8MFH52PBMENPJ4",
          "name": "Annie Thomas",
          "email_address": "annie@annieshotsauce.com",
          "phone_number": "1-212-555-4250"
        }
      ],
      "version": 1,
      "status": "ACTIVE"
    }
  }
}