{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://spec.openapis.org/oas/3.1/dialect/base",
  "info": {
    "title": "DiscountCodes REST API",
    "description": "API for managing DiscountCodes (ObjectsGrid's own type): the codes shoppers enter at checkout, counted when used.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://apis.objectsgrid.com"
    }
  ],
  "paths": {
    "/discountcodes": {
      "post": {
        "summary": "Create object",
        "operationId": "create",
        "security": [
          {
            "accessTokenAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-ObjectsGrid-AccessPoint",
            "description": "EU or US depending on where your Organization Account is located",
            "schema": {
              "type": "string",
              "enum": [
                "EU",
                "US"
              ]
            },
            "required": true
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-RestApiVersion",
            "description": "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-SessionID",
            "description": "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "https://objectsgrid.com/.well-known/objects-catalog/DiscountCode/v1/schema.json"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully created the object",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The object version. Send it in the If-Match header to update, patch or delete this exact version",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/DiscountCode/v1/schema.json"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, object already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "List objects",
        "operationId": "list",
        "description": "A page of the type's objects, filtered, ordered and paged with where, orderBy, first and after, or of their\ngroups with groupBy.\n",
        "security": [
          {
            "accessTokenAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-ObjectsGrid-AccessPoint",
            "description": "EU or US depending on where your Organization Account is located",
            "schema": {
              "type": "string",
              "enum": [
                "EU",
                "US"
              ]
            },
            "required": true
          },
          {
            "in": "query",
            "name": "lang",
            "schema": {
              "type": "string"
            },
            "description": "BCP 47 language code\n",
            "example": "fr, de, de-AT, cy-GB"
          },
          {
            "in": "query",
            "name": "where",
            "schema": {
              "type": "string"
            },
            "description": "The objects to list, as JSON (Prisma style): conditions on fields (equals, in, notIn, lt, lte, gt, gte,\ncontains, startsWith, endsWith, not, mode insensitive), on lists of values (has, hasSome, hasEvery,\nisEmpty) and on lists of objects (some, every, none), combined with AND, OR and NOT. Every field of the\ntype can be filtered on. A field the caller may not read can't be used. See\nhttps://objectsgrid.com/docs/guides/lists/\n",
            "example": "{\"name\": {\"some\": {\"at_value\": {\"contains\": \"clean\", \"mode\": \"insensitive\"}}}}"
          },
          {
            "in": "query",
            "name": "orderBy",
            "schema": {
              "type": "string"
            },
            "description": "The order, as JSON: {\"<field>\": \"asc\" or \"desc\"}, or {\"<field>\": {\"sort\": \"asc\", \"nulls\": \"last\"}}, or a\nlist of up to 3 of them; an embedded object's fields nest ({\"meta\": {\"createdAt\": \"desc\"}}). Lists can't be\nsorted on. The id always ends the order, so pages are stable.\n",
            "example": "{\"meta\": {\"createdAt\": \"desc\"}}"
          },
          {
            "in": "query",
            "name": "first",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": "The number of objects in the page."
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string"
            },
            "description": "The page after this cursor, a previous page's pageInfo.endCursor, with the same where and orderBy."
          },
          {
            "in": "query",
            "name": "count",
            "schema": {
              "type": "boolean"
            },
            "description": "true adds totalCount, the number of objects the where matches. It needs access to every object of the\ntype, since it counts those the caller may not see.\n"
          },
          {
            "in": "query",
            "name": "groupBy",
            "schema": {
              "type": "string"
            },
            "description": "Groups instead of objects, as JSON (Prisma style): by (1 to 3 fields), where, _count, _sum, _avg, _min,\n_max, having, orderBy, take (1 to 100) and cursor. Not with where, orderBy, first, after or count, which\nit holds itself. It needs access to every object of the type.\n",
            "example": "{\"by\": [\"providerMobility\"], \"_count\": true}"
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-RestApiVersion",
            "description": "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-SessionID",
            "description": "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully listed the objects",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "description": "A page of objects",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "https://objectsgrid.com/.well-known/objects-catalog/DiscountCode/v1/schema.json"
                          }
                        },
                        "pageInfo": {
                          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/PageInfo/v1/schema.json"
                        },
                        "totalCount": {
                          "type": "integer",
                          "description": "The number of objects the where matches, with count=true"
                        }
                      },
                      "required": [
                        "items",
                        "pageInfo"
                      ]
                    },
                    {
                      "$ref": "https://objectsgrid.com/.well-known/objects-catalog/GroupPage/v1/schema.json"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        }
      }
    },
    "/discountcodes/batch": {
      "post": {
        "summary": "Create objects",
        "operationId": "batchCreate",
        "description": "Creates up to 100 DiscountCodes in one request, all or none: if any of them is not valid, or you may not create\nit, nothing is created, and the error's reasons name the object by its index, as in `/items/3/name`.\nEach object gets its own id, version and event, as with Create object, and is returned as you may read it.\nEach object created counts as one request against the monthly spending cap; a batch that would pass the\ncap is refused (429). Rarely, some objects cannot be stored once the batch was accepted: the response is\nthen 207, each item has its own status, and the others stay created.\n",
        "security": [
          {
            "accessTokenAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-ObjectsGrid-AccessPoint",
            "description": "EU or US depending on where your Organization Account is located",
            "schema": {
              "type": "string",
              "enum": [
                "EU",
                "US"
              ]
            },
            "required": true
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-RestApiVersion",
            "description": "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-SessionID",
            "description": "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "items"
                ],
                "additionalProperties": false,
                "properties": {
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "$ref": "https://objectsgrid.com/.well-known/objects-catalog/DiscountCode/v1/schema.json"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Every object was created; the items are in the order of the request",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchCreateResponse"
                }
              }
            }
          },
          "207": {
            "description": "Some objects could not be stored; each item has its own status, and the others were created",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request; an object is not valid, or the batch has no objects or more than 100. Nothing was created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized; you may not create one of the objects. Nothing was created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large; the body exceeds 10 MB, or one of its objects exceeds 1 MB. Nothing was created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - rate limited, or the batch would pass the monthly spending cap. Nothing was created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        }
      }
    },
    "/discountcodes/{id}": {
      "get": {
        "summary": "Retrieve Object",
        "operationId": "retrieve",
        "security": [
          {
            "accessTokenAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the object to retrieve"
          },
          {
            "in": "query",
            "name": "lang",
            "schema": {
              "type": "string"
            },
            "description": "BCP 47 language code\n",
            "example": "fr, de, de-AT, cy-GB"
          },
          {
            "in": "query",
            "name": "version",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "An object version, its meta.objectVersion: returns that version instead of the current one. Earlier versions stay readable after the object is deleted; an earlier version carries the object's current tags.\n",
            "example": 1731312000123456
          },
          {
            "in": "header",
            "name": "If-None-Match",
            "description": "The ETag of the version you hold: answered 304 Not Modified, with no body and not billed, when the object is still at it. Poll a configuration or flags this way.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-AccessPoint",
            "description": "EU or US depending on where your Organization Account is located",
            "schema": {
              "type": "string",
              "enum": [
                "EU",
                "US"
              ]
            },
            "required": true
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-RestApiVersion",
            "description": "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-SessionID",
            "description": "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved the object",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The object version. Send it in the If-Match header to update, patch or delete this exact version",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/DiscountCode/v1/schema.json"
                }
              },
              "application/ld+json": {
                "schema": {
                  "type": "object",
                  "description": "With Accept: application/ld+json, the object as a Schema.org JSON-LD document for your web pages: at_ becomes @, the objects it references are embedded one level deep, its computed lists (such as a Product's offers and review) are embedded too, and every address is your own, from the organization account's jsonLdAddresses. lang gives one language as plain text. No personal data, no id, meta or tags. See https://objectsgrid.com/docs/guides/json-ld/"
                }
              }
            }
          },
          "304": {
            "description": "Not Modified, the object is still at the version If-None-Match named; no body, not billed"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update Object",
        "operationId": "update",
        "security": [
          {
            "accessTokenAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the object to update"
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-AccessPoint",
            "description": "EU or US depending on where your Organization Account is located",
            "schema": {
              "type": "string",
              "enum": [
                "EU",
                "US"
              ]
            },
            "required": true
          },
          {
            "in": "header",
            "name": "If-Match",
            "description": "The ETag of the object version being modified, as returned by the Retrieve, Create, Update or Patch operations.\nIf the object has been modified since that version, the request fails with 412 Precondition Failed.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-RestApiVersion",
            "description": "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-SessionID",
            "description": "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "https://objectsgrid.com/.well-known/objects-catalog/DiscountCode/v1/schema.json"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated the object",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The object version. Send it in the If-Match header to update, patch or delete this exact version",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/DiscountCode/v1/schema.json"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed - the object was modified since the version in the If-Match header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Patch Object",
        "operationId": "patch",
        "security": [
          {
            "accessTokenAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the object to update"
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-AccessPoint",
            "description": "EU or US depending on where your Organization Account is located",
            "schema": {
              "type": "string",
              "enum": [
                "EU",
                "US"
              ]
            },
            "required": true
          },
          {
            "in": "header",
            "name": "If-Match",
            "description": "The ETag of the object version being modified, as returned by the Retrieve, Create, Update or Patch operations.\nIf the object has been modified since that version, the request fails with 412 Precondition Failed.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-RestApiVersion",
            "description": "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-SessionID",
            "description": "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "https://objectsgrid.com/.well-known/objects-catalog/DiscountCode/v1/schema.json"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully patched the object",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The object version. Send it in the If-Match header to update, patch or delete this exact version",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/DiscountCode/v1/schema.json"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed - the object was modified since the version in the If-Match header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete Object",
        "operationId": "delete",
        "security": [
          {
            "accessTokenAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the object to delete"
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-AccessPoint",
            "description": "EU or US depending on where your Organization Account is located",
            "schema": {
              "type": "string",
              "enum": [
                "EU",
                "US"
              ]
            },
            "required": true
          },
          {
            "in": "header",
            "name": "If-Match",
            "description": "The ETag of the object version being modified, as returned by the Retrieve, Create, Update or Patch operations.\nIf the object has been modified since that version, the request fails with 412 Precondition Failed.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-RestApiVersion",
            "description": "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-SessionID",
            "description": "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted the object",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed - the object was modified since the version in the If-Match header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "accessTokenAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Bearer JWT",
        "description": "An ObjectsGrid access token (a JWT), sent as 'Authorization: Bearer <token>': from POST /oauth2/token, valid 1 hour, or an API key: a service account's from the bootstrap of an Organization Account created without signing in, valid 90 days; a public service account's (POST /serviceaccounts/{id}/apikey, or the bootstrap's anonymous one), without expiry, until its account is disabled or deleted."
      }
    },
    "schemas": {
      "BatchCreateResponse": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "description": "One item per object of the request, in its order",
            "items": {
              "$ref": "#/components/schemas/BatchCreateItem"
            }
          }
        }
      },
      "BatchCreateItem": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "integer",
            "description": "201 when the object was created, otherwise the HTTP status of its error"
          },
          "etag": {
            "type": "string",
            "description": "The created object's version, as the ETag header of Create object"
          },
          "object": {
            "$ref": "https://objectsgrid.com/.well-known/objects-catalog/DiscountCode/v1/schema.json"
          },
          "error": {
            "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
          }
        }
      }
    }
  }
}
