Update a contractor

PUT /api/v1/contractors/{contractor_id}

Updates the specified contractor by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

This request accepts mostly the same arguments as the contractor creation call.

Path parameters

  • contractor string Required

    The ID of the desired contractor (e.g., cn_Ehb3bYa).

application/json

Body

  • address object

    The contractor's home address.

    Hide address attributes Show address attributes object
    • country string | null

      2-letter country code.

    • line1 string

      Address line 1 (Street address/PO Box).

    • line2 string | null

      Address line 2 (Apartment/Suite/Unit/Building).

    • locality string

      City/District/Suburb/Town/Village.

    • ZIP or postal code.

    • region string

      2-letter state code.

  • The contractor's business name.

  • Set of key-value pairs that you can attach to an object. Used to store additional information about the contractor in a structured format. Individual keys can be unset by posting an empty value to them. Pass an empty value, e.g. {}, to custom_metadata to unset all keys.

  • email string

    The contractor's email address.

  • The contractor's first name.

  • The contractor's last name.

  • The contractor's middle name.

  • phone string

    The contractor's phone number.

  • This indicates whether the contractor is paying premium directly with their credit card (i.e., false) or if the contractor has given the platform that's integrating with 1099Policy permission to withhold the premium payment from their wages and pay the premium on the contractor's behalf (i.e., true). Defaults to false.

Responses

  • 200 application/json

    Returns the contractor object if the update succeeded. Returns an error if update parameters are invalid.

    Hide response attributes Show response attributes object
    • address object
      Hide address attributes Show address attributes object
      • country string | null

        2-letter country code.

      • line1 string

        Address line 1 (Street address/PO Box).

      • line2 string | null

        Address line 2 (Apartment/Suite/Unit/Building).

      • locality string

        City/District/Suburb/Town/Village.

      • ZIP or postal code.

      • region string

        2-letter state code.

    • company_name string | null

      The contractor's business name.

    • created integer(int64)

      Time at which the object was created. Measured in seconds since the Unix epoch.

    • Set of key-value pairs that you can attach to the contractor object. Used for storing additional information in a structured format. Individual keys can be unset by posting an empty value to them. Pass an empty value, e.g. {}, to custom_metadata to unset all keys.

    • email string

      The contractor's email address.

    • The contractor's first name.

    • id string
    • The contractor's last name.

    • middle_name string | null

      The contractor's middle name.

    • phone string

      The contractor's phone number.

    • This indicates whether the contractor is paying premium directly with their credit card (i.e., false) or if the contractor has given the platform that's integrating with 1099Policy permission to withhold the premium payment from their wages and pay the premium on the contractor's behalf (i.e., true). Defaults to false.

      Default value is false.

PUT /api/v1/contractors/{contractor_id}
curl \
 -X PUT https://api.1099policy.com/api/v1/contractors/{contractor_id} \
 -H "Content-Type: application/json" \
 -d '{"email":"[email protected]","phone":"415-474-9088","address":{"line1":"123 Main St.","region":"CA","locality":"San Francisco","postalcode":"94105"},"last_name":"Parker","first_name":"Joe","middle_name":"Doe","company_name":"Acme Co.","custom_metadata":{"campaign":"Red Bull"}}'
Request example
{
  "email": "[email protected]",
  "phone": "415-474-9088",
  "address": {
    "line1": "123 Main St.",
    "region": "CA",
    "locality": "San Francisco",
    "postalcode": "94105"
  },
  "last_name": "Parker",
  "first_name": "Joe",
  "middle_name": "Doe",
  "company_name": "Acme Co.",
  "custom_metadata": {
    "campaign": "Red Bull"
  }
}
Response examples (200)
{
  "address": {
    "country": "null",
    "line1": "92 Geary St",
    "line2": "null",
    "locality": "San Francisco",
    "postalcode": 94114,
    "region": "CA"
  },
  "company_name": "Acme Co.",
  "created": 1646818364,
  "custom_metadata": {
    "campaign": "Red Bull"
  },
  "email": "[email protected]",
  "first_name": "Joe",
  "id": "cn_Ehb3bYa",
  "last_name": "Parker",
  "middle_name": "null",
  "phone": "415-474-9088",
  "withhold_premium": false
}