v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.1 MB
BookingCustomAttributes

BulkUpsertBookingCustomAttributes

Bulk upserts bookings custom attributes.

To call this endpoint with buyer-level permissions, set APPOINTMENTS_WRITE for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE and APPOINTMENTS_WRITE for the OAuth scope.

For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.

post/v2/bookings/custom-attributes/bulk-upsert

Request body

valuesobject required

A map containing 1 to 25 individual upsert requests. For each request, provide an arbitrary ID that is unique for this BulkUpsertBookingCustomAttributes request and the information needed to create or update a custom attribute.

Response

Success

valuesobject

A map of responses that correspond to individual upsert requests. Each response has the same ID as the corresponding request and contains either a booking_id and custom_attribute or an errors field.

Example response

{
  "errors": [],
  "values": {
    "id1": {
      "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8",
      "custom_attribute": {
        "created_at": "2022-11-16T23:14:47Z",
        "key": "favoriteShampoo",
        "updated_at": "2022-11-16T00:16:23Z",
        "value": "Spring Fresh",
        "version": 1,
        "visibility": "VISIBILITY_READ_WRITE_VALUES"
      },
      "errors": []
    },
    "id2": {
      "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM",
      "custom_attribute": {
        "created_at": "2022-11-16T00:16:20Z",
        "key": "hasShoes",
        "updated_at": "2022-11-16T00:16:23Z",
        "value": false,
        "version": 2,
        "visibility": "VISIBILITY_READ_WRITE_VALUES"
      },
      "errors": []
    },
    "id3": {
      "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM",
      "custom_attribute": {
        "created_at": "2022-11-16T00:16:20Z",
        "key": "favoriteShampoo",
        "updated_at": "2022-11-16T00:16:23Z",
        "value": "Hydro-Cool",
        "version": 2,
        "visibility": "VISIBILITY_READ_WRITE_VALUES"
      },
      "errors": []
    },
    "id4": {
      "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8",
      "custom_attribute": {
        "created_at": "2022-11-16T23:14:47Z",
        "key": "partySize",
        "updated_at": "2022-11-16T00:16:23Z",
        "value": 4,
        "version": 1,
        "visibility": "VISIBILITY_READ_WRITE_VALUES"
      },
      "errors": []
    },
    "id5": {
      "booking_id": "70548QG1HN43B05G0KCZ4MMC1G",
      "custom_attribute": {
        "created_at": "2022-11-16T00:16:20Z",
        "key": "celebrating",
        "updated_at": "2022-11-16T00:16:23Z",
        "value": "birthday",
        "version": 2,
        "visibility": "VISIBILITY_READ_WRITE_VALUES"
      },
      "errors": []
    }
  }
}