{
  "components": {
    "responses": {
      "Error": {
        "content": {
          "application/json": {
            "example": {
              "code": "INVALID_SETTING_TYPE",
              "message": "unknown setting type",
              "trace_id": "0f8c1d2e3a4b5c6d"
            },
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "The shared failure envelope."
      }
    },
    "schemas": {
      "AvailabilityDate": {
        "properties": {
          "date": {
            "format": "date",
            "type": "string"
          },
          "inventories": {
            "items": {
              "$ref": "#/components/schemas/AvailabilityInventory"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "AvailabilityInventory": {
        "properties": {
          "available": {
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "price": {
            "description": "Smallest currency unit (centavos).",
            "type": "integer"
          },
          "variants": {
            "items": {
              "$ref": "#/components/schemas/AvailabilityVariant"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "AvailabilityResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/AvailabilityDate"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "AvailabilityVariant": {
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Error": {
        "properties": {
          "code": {
            "description": "Stable machine-readable failure code.",
            "type": "string"
          },
          "message": {
            "description": "Human-readable explanation.",
            "type": "string"
          },
          "trace_id": {
            "description": "Correlation id for this request.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "EventAttribute": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "EventDetail": {
        "properties": {
          "attributes": {
            "items": {
              "$ref": "#/components/schemas/EventAttribute"
            },
            "type": "array"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "images": {
            "items": {
              "$ref": "#/components/schemas/EventImage"
            },
            "type": "array"
          },
          "integration_id": {
            "nullable": true,
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EventImage": {
        "properties": {
          "credits": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EventPrice": {
        "properties": {
          "amount": {
            "description": "Smallest currency unit (centavos).",
            "type": "integer"
          },
          "label": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PaginationMeta": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "RegisterTicketDownloadRequest": {
        "properties": {
          "identifiers": {
            "description": "Ticket identifiers being retrieved.",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "type": "array"
          },
          "order_id": {
            "format": "uuid",
            "type": "string"
          },
          "source": {
            "description": "Channel the storefront served it through, for example site, app or email.",
            "maxLength": 64,
            "type": "string"
          },
          "user_id": {
            "description": "Signed-in buyer, when the storefront has one. A link opened from an email carries no session.",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "order_id",
          "identifiers"
        ],
        "type": "object"
      },
      "RegisterTicketDownloadResponse": {
        "properties": {
          "first_access": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "registered": {
            "type": "integer"
          },
          "unknown": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SellerEvent": {
        "properties": {
          "description": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "image": {
            "$ref": "#/components/schemas/EventImage"
          },
          "integration_id": {
            "nullable": true,
            "type": "string"
          },
          "price": {
            "$ref": "#/components/schemas/EventPrice"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SellerEventList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SellerEvent"
            },
            "type": "array"
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "TokenBasic": {
        "description": "HTTP Basic with the seller id as the username and the seller's API key as the password.",
        "scheme": "basic",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "The storefront API a partner integrates against to sell tickets under their own brand.\n\nEvery call authenticates with HTTP Basic, using the seller id as the username and the seller's API key as the password. The seller is resolved from those credentials, so no endpoint takes a seller id in the path or the body.\n\nSend `X-Affiliate-Code` alongside the credentials to attribute a session to an affiliate. Listings, basket ownership and order attribution then follow the affiliate instead of the owning seller; the owner is unchanged.\n\nFailures share one envelope — a stable `code`, a human-readable `message`, and a `trace_id` to quote in a support request.",
    "title": "Storefront API",
    "version": "v1.0.5"
  },
  "openapi": "3.0.3",
  "paths": {
    "/stf/v1/auth/forgot-password": {
      "post": {
        "description": "Sends a reset link to the address when an account exists for it. The response does not reveal whether it did, so the endpoint cannot be used to enumerate customers.",
        "operationId": "storefrontForgotPassword",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "email": "buyer@example.com"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Request a password reset",
        "tags": [
          "Authentication"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/auth/forgot-password\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\":\"buyer@example.com\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"email\": \"buyer@example.com\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/auth/forgot-password\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/auth/forgot-password\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"email\": \"buyer@example.com\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/auth/forgot-password\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"email\": \"buyer@example.com\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/auth/login": {
      "post": {
        "description": "Exchanges a customer's email and password for an access token and a refresh token. The customer belongs to the seller the Basic credentials identify.",
        "operationId": "storefrontLogin",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "email": "buyer@example.com",
                "password": "s3cret"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Log a customer in",
        "tags": [
          "Authentication"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/auth/login\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\":\"buyer@example.com\",\"password\":\"s3cret\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"email\": \"buyer@example.com\",\n\t  \"password\": \"s3cret\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/auth/login\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/auth/login\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"email\": \"buyer@example.com\",\n  \"password\": \"s3cret\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/auth/login\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"email\": \"buyer@example.com\",\n    \"password\": \"s3cret\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/auth/logout": {
      "delete": {
        "description": "Revokes the customer's refresh tokens. The access token remains valid until it expires.",
        "operationId": "storefrontLogout",
        "parameters": [
          {
            "description": "Customer whose session is ending.",
            "in": "query",
            "name": "user_id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Logged out."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Log a customer out",
        "tags": [
          "Authentication"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X DELETE \"https://api.sdx.ingressos.com.br/stf/v1/auth/logout?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.sdx.ingressos.com.br/stf/v1/auth/logout?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/auth/logout?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/auth/logout?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/auth/magic-link": {
      "post": {
        "description": "Emails a single-use sign-in link to the customer. Same non-disclosure as the password reset: the response is identical whether or not the account exists.",
        "operationId": "storefrontRequestMagicLink",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "email": "buyer@example.com"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Request a passwordless sign-in link",
        "tags": [
          "Authentication"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/auth/magic-link\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\":\"buyer@example.com\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"email\": \"buyer@example.com\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/auth/magic-link\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/auth/magic-link\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"email\": \"buyer@example.com\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/auth/magic-link\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"email\": \"buyer@example.com\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/auth/magic-link/verify": {
      "post": {
        "description": "Consumes the token from a magic link and issues the token pair a password login would have returned.",
        "operationId": "storefrontVerifyMagicLink",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "token": "5f8d1c2b9a"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Redeem a passwordless sign-in link",
        "tags": [
          "Authentication"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/auth/magic-link/verify\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"token\":\"5f8d1c2b9a\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"token\": \"5f8d1c2b9a\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/auth/magic-link/verify\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/auth/magic-link/verify\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"token\": \"5f8d1c2b9a\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/auth/magic-link/verify\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"token\": \"5f8d1c2b9a\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/auth/refresh": {
      "post": {
        "description": "Exchanges a valid refresh token for a new access token. The refresh token is single use.",
        "operationId": "storefrontRefresh",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "refresh_token": "eyJhbGciOiJIUzI1NiIs..."
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Refresh an access token",
        "tags": [
          "Authentication"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/auth/refresh\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"refresh_token\":\"eyJhbGciOiJIUzI1NiIs...\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"refresh_token\": \"eyJhbGciOiJIUzI1NiIs...\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/auth/refresh\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/auth/refresh\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"refresh_token\": \"eyJhbGciOiJIUzI1NiIs...\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/auth/refresh\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"refresh_token\": \"eyJhbGciOiJIUzI1NiIs...\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/auth/register": {
      "post": {
        "description": "Creates a customer account under the authenticated seller and sends the address verification email.",
        "operationId": "storefrontRegister",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "email": "buyer@example.com",
                "first_name": "Ana",
                "last_name": "Souza",
                "password": "s3cret"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Register a customer",
        "tags": [
          "Authentication"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/auth/register\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\":\"buyer@example.com\",\"password\":\"s3cret\",\"first_name\":\"Ana\",\"last_name\":\"Souza\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"email\": \"buyer@example.com\",\n\t  \"password\": \"s3cret\",\n\t  \"first_name\": \"Ana\",\n\t  \"last_name\": \"Souza\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/auth/register\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/auth/register\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"email\": \"buyer@example.com\",\n  \"password\": \"s3cret\",\n  \"first_name\": \"Ana\",\n  \"last_name\": \"Souza\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/auth/register\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"email\": \"buyer@example.com\",\n    \"password\": \"s3cret\",\n    \"first_name\": \"Ana\",\n    \"last_name\": \"Souza\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/auth/reset-password": {
      "post": {
        "description": "Consumes a reset token and sets the new password. The token is single use.",
        "operationId": "storefrontResetPassword",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "password": "n3wS3cret",
                "token": "5f8d1c2b9a"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Reset a password",
        "tags": [
          "Authentication"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/auth/reset-password\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"token\":\"5f8d1c2b9a\",\"password\":\"n3wS3cret\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"token\": \"5f8d1c2b9a\",\n\t  \"password\": \"n3wS3cret\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/auth/reset-password\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/auth/reset-password\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"token\": \"5f8d1c2b9a\",\n  \"password\": \"n3wS3cret\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/auth/reset-password\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"token\": \"5f8d1c2b9a\",\n    \"password\": \"n3wS3cret\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/auth/verify-email": {
      "post": {
        "description": "Consumes the token from the verification email and marks the address confirmed.",
        "operationId": "storefrontVerifyEmail",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "token": "5f8d1c2b9a"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Verify an email address",
        "tags": [
          "Authentication"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/auth/verify-email\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"token\":\"5f8d1c2b9a\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"token\": \"5f8d1c2b9a\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/auth/verify-email\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/auth/verify-email\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"token\": \"5f8d1c2b9a\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/auth/verify-email\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"token\": \"5f8d1c2b9a\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/baskets": {
      "post": {
        "description": "Opens a basket for the seller the Basic credentials identify and returns its identifier. Every later basket call addresses that identifier.",
        "operationId": "createBasket",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "items": [
                  {
                    "inventory_id": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
                    "quantity": 2
                  }
                ]
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Create a basket",
        "tags": [
          "Baskets"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/baskets\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"items\":[{\"inventory_id\":\"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\"quantity\":2}]}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"items\": [\n\t    {\n\t      \"inventory_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n\t      \"quantity\": 2\n\t    }\n\t  ]\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/baskets\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/baskets\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"items\": [\n    {\n      \"inventory_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n      \"quantity\": 2\n    }\n  ]\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/baskets\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"items\": [\n      {\n        \"inventory_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n        \"quantity\": 2\n      }\n    ]\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/baskets/{id}": {
      "get": {
        "description": "Returns the basket with its items, the totals and any coupon applied.",
        "operationId": "getBasket",
        "parameters": [
          {
            "description": "Basket identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Read a basket",
        "tags": [
          "Baskets"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/baskets/{id}/coupon": {
      "post": {
        "description": "Applies a discount coupon to the whole basket and returns the recalculated totals.",
        "operationId": "applyBasketCoupon",
        "parameters": [
          {
            "description": "Basket identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "code": "PRIMEIRACOMPRA"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Apply a coupon",
        "tags": [
          "Baskets"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/coupon\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"code\":\"PRIMEIRACOMPRA\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"code\": \"PRIMEIRACOMPRA\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/coupon\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/coupon\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"code\": \"PRIMEIRACOMPRA\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/coupon\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"code\": \"PRIMEIRACOMPRA\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/baskets/{id}/coupon/{item_id}": {
      "post": {
        "description": "Applies a discount coupon to a single basket item rather than the whole basket.",
        "operationId": "applyBasketItemCoupon",
        "parameters": [
          {
            "description": "Basket identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Basket item identifier.",
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "code": "MEIAENTRADA"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Apply a coupon to one item",
        "tags": [
          "Baskets"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/coupon/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"code\":\"MEIAENTRADA\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"code\": \"MEIAENTRADA\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/coupon/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/coupon/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"code\": \"MEIAENTRADA\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/coupon/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"code\": \"MEIAENTRADA\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/baskets/{id}/installments": {
      "post": {
        "description": "Returns the installment plans available for the basket total, with the amount and any interest per plan. What the payment step renders before the buyer chooses.",
        "operationId": "calculateBasketInstallments",
        "parameters": [
          {
            "description": "Basket identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "payment_method": "credit_card"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Calculate installments",
        "tags": [
          "Baskets"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/installments\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"payment_method\":\"credit_card\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"payment_method\": \"credit_card\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/installments\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/installments\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"payment_method\": \"credit_card\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/installments\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"payment_method\": \"credit_card\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/baskets/{id}/items": {
      "patch": {
        "description": "Replaces the quantities in the basket. Sending a quantity of zero removes that item.",
        "operationId": "updateBasketItems",
        "parameters": [
          {
            "description": "Basket identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "items": [
                  {
                    "inventory_id": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
                    "quantity": 3
                  }
                ]
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Set basket items",
        "tags": [
          "Baskets"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X PATCH \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/items\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"items\":[{\"inventory_id\":\"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\"quantity\":3}]}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"items\": [\n\t    {\n\t      \"inventory_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n\t      \"quantity\": 3\n\t    }\n\t  ]\n\t}`\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/items\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/items\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PATCH\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"items\": [\n    {\n      \"inventory_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n      \"quantity\": 3\n    }\n  ]\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/items\", {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"items\": [\n      {\n        \"inventory_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n        \"quantity\": 3\n      }\n    ]\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/baskets/{id}/items/{inventory_id}": {
      "delete": {
        "description": "Removes one inventory line from the basket and recalculates the totals.",
        "operationId": "removeBasketItem",
        "parameters": [
          {
            "description": "Basket identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Inventory identifier.",
            "in": "path",
            "name": "inventory_id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Remove a basket item",
        "tags": [
          "Baskets"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X DELETE \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/items/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/items/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/items/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/baskets/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/items/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/checkout": {
      "post": {
        "description": "Turns a basket into an order and takes payment. The customer is resolved from the email: an existing account is reused, an unknown one is created, and the primary address and document are filled in from the payload when the account has none. Tickets are issued asynchronously once the payment is approved.",
        "operationId": "processCheckout",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "basket_id": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
                "document": "12345678901",
                "email": "buyer@example.com",
                "first_name": "Ana",
                "last_name": "Souza",
                "payment": {
                  "installments": 3,
                  "method": "credit_card"
                }
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Order created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Complete a checkout",
        "tags": [
          "Checkout"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/checkout\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"basket_id\":\"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\"email\":\"buyer@example.com\",\"first_name\":\"Ana\",\"last_name\":\"Souza\",\"document\":\"12345678901\",\"payment\":{\"method\":\"credit_card\",\"installments\":3}}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"basket_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n\t  \"email\": \"buyer@example.com\",\n\t  \"first_name\": \"Ana\",\n\t  \"last_name\": \"Souza\",\n\t  \"document\": \"12345678901\",\n\t  \"payment\": {\n\t    \"method\": \"credit_card\",\n\t    \"installments\": 3\n\t  }\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/checkout\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/checkout\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"basket_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n  \"email\": \"buyer@example.com\",\n  \"first_name\": \"Ana\",\n  \"last_name\": \"Souza\",\n  \"document\": \"12345678901\",\n  \"payment\": {\n    \"method\": \"credit_card\",\n    \"installments\": 3\n  }\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/checkout\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"basket_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n    \"email\": \"buyer@example.com\",\n    \"first_name\": \"Ana\",\n    \"last_name\": \"Souza\",\n    \"document\": \"12345678901\",\n    \"payment\": {\n      \"method\": \"credit_card\",\n      \"installments\": 3\n    }\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/events": {
      "get": {
        "description": "Returns every published event belonging to the seller the Basic credentials identify, with its cover image and starting price.",
        "operationId": "listSellerEvents",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellerEventList"
                }
              }
            },
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "List the seller's events",
        "tags": [
          "Events"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/events\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/events\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/events\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/events\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/events/category/{slug}": {
      "get": {
        "description": "Returns the seller's published events in one category, addressed by the category slug.",
        "operationId": "listEventsByCategory",
        "parameters": [
          {
            "description": "Category slug.",
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "example": "shows",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellerEventList"
                }
              }
            },
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "List events in a category",
        "tags": [
          "Events"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/events/category/shows\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/events/category/shows\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/events/category/shows\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/events/category/shows\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/events/{eventId}": {
      "get": {
        "description": "Returns one event in full: every image, every attribute and its content source. Accepts either the event UUID or its slug.",
        "operationId": "getEvent",
        "parameters": [
          {
            "description": "Event UUID or slug.",
            "in": "path",
            "name": "eventId",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventDetail"
                }
              }
            },
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Read an event",
        "tags": [
          "Events"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/events/{eventId}/availability": {
      "get": {
        "description": "Returns availability by date: the inventories on sale for each date, how many remain and at what price. Accepts either the event UUID or its slug.",
        "operationId": "checkEventAvailability",
        "parameters": [
          {
            "description": "Event UUID or slug.",
            "in": "path",
            "name": "eventId",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailabilityResponse"
                }
              }
            },
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Check availability for an event",
        "tags": [
          "Events"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/availability\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/availability\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/availability\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/availability\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/events/{id}/variants": {
      "get": {
        "description": "Returns the ticket variants configured for the event — the half-price, full-price and named categories a buyer chooses between. Accepts either the UUID or the slug.",
        "operationId": "lookupEventVariants",
        "parameters": [
          {
            "description": "Event UUID or slug.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "type": "string"
            }
          },
          {
            "description": "Restrict the result to one variant type.",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "example": "half",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "List an event's variants",
        "tags": [
          "Events"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/variants\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/variants\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/variants\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/events/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/variants\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/inventory/search": {
      "post": {
        "description": "Resolves a set of inventory selections into the sellable units behind them, with current price and remaining quantity. This is what a seat map or date picker calls as the buyer chooses.",
        "operationId": "searchInventory",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "date": "2026-11-20",
                "event_id": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Search inventory",
        "tags": [
          "Inventory"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/inventory/search\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"event_id\":\"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\"date\":\"2026-11-20\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"event_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n\t  \"date\": \"2026-11-20\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/inventory/search\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/inventory/search\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"event_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n  \"date\": \"2026-11-20\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/inventory/search\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"event_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n    \"date\": \"2026-11-20\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/order-groups/by-order/{orderID}": {
      "delete": {
        "description": "The same withdrawal as above, addressed by the order rather than the attachment — what a storefront calls when it holds the order id and not the group id.",
        "operationId": "withdrawOrderGroupByOrder",
        "parameters": [
          {
            "description": "Order identifier.",
            "in": "path",
            "name": "orderID",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Customer detaching the order.",
            "in": "query",
            "name": "user_id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Detached."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Detach a grouped order by order id",
        "tags": [
          "Order groups"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X DELETE \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/by-order/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/by-order/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/by-order/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/by-order/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/order-groups/confirm": {
      "get": {
        "description": "Consumes the token from an invitation email and attaches the order to the invited customer. The token is single use.",
        "operationId": "confirmOrderGroup",
        "parameters": [
          {
            "description": "Token from the invitation email.",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "example": "5f8d1c2b9a",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Confirm an invitation",
        "tags": [
          "Order groups"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/confirm?token=5f8d1c2b9a\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/confirm?token=5f8d1c2b9a\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/confirm?token=5f8d1c2b9a\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/confirm?token=5f8d1c2b9a\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/order-groups/lookup": {
      "post": {
        "description": "Resolves an order code into a masked preview — enough for the customer to recognise the order before claiming it. Creates nothing.",
        "operationId": "lookupOrderGroup",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "code": "HGW-4821-9930"
              },
              "schema": {
                "properties": {
                  "code": {
                    "description": "Order code as printed on the confirmation.",
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Look up an order by code",
        "tags": [
          "Order groups"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/lookup\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"code\":\"HGW-4821-9930\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"code\": \"HGW-4821-9930\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/lookup\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/lookup\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"code\": \"HGW-4821-9930\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/lookup\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"code\": \"HGW-4821-9930\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/order-groups/user/{userID}": {
      "get": {
        "description": "Returns the orders the customer has attached to their account, including orders originally bought by someone else and shared with them.",
        "operationId": "listOrderGroups",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "userID",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "List a customer's grouped orders",
        "tags": [
          "Order groups"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      },
      "post": {
        "description": "Attaches an order to the customer. Their own order is attached immediately; an order bought by someone else sends an invitation email instead, and the row appears once the recipient confirms.",
        "operationId": "createOrderGroup",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "userID",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "code": "HGW-4821-9930",
                "notes": "Aniversário da Ana"
              },
              "schema": {
                "properties": {
                  "code": {
                    "description": "Order code to attach.",
                    "type": "string"
                  },
                  "expires_at": {
                    "description": "When the invitation stops being redeemable.",
                    "format": "date-time",
                    "nullable": true,
                    "type": "string"
                  },
                  "notes": {
                    "description": "Free-text note the customer sees on the order.",
                    "nullable": true,
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Attached or invited."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Attach an order to a customer",
        "tags": [
          "Order groups"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"code\":\"HGW-4821-9930\",\"notes\":\"Aniversário da Ana\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"code\": \"HGW-4821-9930\",\n\t  \"notes\": \"Aniversário da Ana\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"code\": \"HGW-4821-9930\",\n  \"notes\": \"Aniversário da Ana\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"code\": \"HGW-4821-9930\",\n    \"notes\": \"Aniversário da Ana\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/order-groups/{id}": {
      "delete": {
        "description": "Removes the attachment between the customer and the order. The order itself is untouched.",
        "operationId": "deleteOrderGroup",
        "parameters": [
          {
            "description": "Order group identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Customer detaching the order.",
            "in": "query",
            "name": "user_id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Detached."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Detach a grouped order",
        "tags": [
          "Order groups"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X DELETE \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11?user_id=3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      },
      "patch": {
        "description": "Changes the free-text note the customer has attached to the order.",
        "operationId": "updateOrderGroupNotes",
        "parameters": [
          {
            "description": "Order group identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "notes": "Presente",
                "user_id": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11"
              },
              "schema": {
                "properties": {
                  "notes": {
                    "description": "New note.",
                    "nullable": true,
                    "type": "string"
                  },
                  "user_id": {
                    "description": "Customer the note belongs to.",
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "user_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Update the note on a grouped order",
        "tags": [
          "Order groups"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X PATCH \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"user_id\":\"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\"notes\":\"Presente\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"user_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n\t  \"notes\": \"Presente\"\n\t}`\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.sdx.ingressos.com.br/stf/v1/order-groups/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PATCH\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"user_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n  \"notes\": \"Presente\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/order-groups/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"user_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n    \"notes\": \"Presente\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/orders/user/{userId}": {
      "get": {
        "description": "Returns the orders belonging to one customer, most recent first.",
        "operationId": "listOrdersByUser",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "List a customer's orders",
        "tags": [
          "Orders"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/orders/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/orders/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/orders/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/orders/user/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/orders/{id}": {
      "get": {
        "description": "Returns one order with its items, its payment state and the tickets issued for it.",
        "operationId": "lookupOrder",
        "parameters": [
          {
            "description": "Order identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Read an order",
        "tags": [
          "Orders"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/orders/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/orders/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/orders/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/orders/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/settings": {
      "get": {
        "description": "Returns one seller setting by name. The readable names are an allowlist — `basket` for the basket rules, `inventory_source` for the catalogue origin. Any other name is rejected, because the seller settings map also holds payment and mail credentials that must never reach a browser.",
        "operationId": "getStorefrontSetting",
        "parameters": [
          {
            "description": "Setting to read: `basket` or `inventory_source`.",
            "in": "query",
            "name": "type",
            "required": true,
            "schema": {
              "example": "basket",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Read a storefront setting",
        "tags": [
          "Settings"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/settings?type=basket\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/settings?type=basket\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/settings?type=basket\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/settings?type=basket\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/tickets/downloads": {
      "post": {
        "description": "Records that the buyer retrieved one or more tickets. The storefront serves the PDF from the CDN link, so this call is the only point at which a retrieval becomes visible: it stamps the first access and journals every one after it.",
        "operationId": "registerTicketDownload",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "identifiers": [
                  "HGW-0001",
                  "HGW-0002"
                ],
                "order_id": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
                "source": "site",
                "user_id": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11"
              },
              "schema": {
                "$ref": "#/components/schemas/RegisterTicketDownloadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterTicketDownloadResponse"
                }
              }
            },
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Register a ticket download",
        "tags": [
          "Tickets"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/tickets/downloads\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"order_id\":\"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\"identifiers\":[\"HGW-0001\",\"HGW-0002\"],\"user_id\":\"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\"source\":\"site\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"order_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n\t  \"identifiers\": [\n\t    \"HGW-0001\",\n\t    \"HGW-0002\"\n\t  ],\n\t  \"user_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n\t  \"source\": \"site\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/tickets/downloads\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/tickets/downloads\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"order_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n  \"identifiers\": [\n    \"HGW-0001\",\n    \"HGW-0002\"\n  ],\n  \"user_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n  \"source\": \"site\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/tickets/downloads\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"order_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n    \"identifiers\": [\n      \"HGW-0001\",\n      \"HGW-0002\"\n    ],\n    \"user_id\": \"3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\",\n    \"source\": \"site\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/users/{id}": {
      "patch": {
        "description": "Updates the customer's own core fields: first name, last name and username.",
        "operationId": "updateStorefrontUser",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "first_name": "Ana",
                "last_name": "Souza"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Update a customer",
        "tags": [
          "Users"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X PATCH \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"first_name\":\"Ana\",\"last_name\":\"Souza\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"first_name\": \"Ana\",\n\t  \"last_name\": \"Souza\"\n\t}`\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PATCH\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"first_name\": \"Ana\",\n  \"last_name\": \"Souza\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"first_name\": \"Ana\",\n    \"last_name\": \"Souza\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/users/{id}/addresses": {
      "get": {
        "description": "Returns the customer's saved addresses, most recent first.",
        "operationId": "listStorefrontAddresses",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "1-based page number. Defaults to the first page.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "example": 1,
              "type": "integer"
            }
          },
          {
            "description": "Addresses per page.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "example": 20,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "List a customer's addresses",
        "tags": [
          "Addresses"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      },
      "post": {
        "description": "Saves a new address for the customer. The first address saved becomes the primary one.",
        "operationId": "createStorefrontAddress",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "city": "São Paulo",
                "complement": "Conjunto 12",
                "country": "BR",
                "district": "Bela Vista",
                "number": "1578",
                "state": "SP",
                "street": "Avenida Paulista",
                "zip_code": "01310-100"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Add an address",
        "tags": [
          "Addresses"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"zip_code\":\"01310-100\",\"street\":\"Avenida Paulista\",\"number\":\"1578\",\"district\":\"Bela Vista\",\"city\":\"São Paulo\",\"state\":\"SP\",\"country\":\"BR\",\"complement\":\"Conjunto 12\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"zip_code\": \"01310-100\",\n\t  \"street\": \"Avenida Paulista\",\n\t  \"number\": \"1578\",\n\t  \"district\": \"Bela Vista\",\n\t  \"city\": \"São Paulo\",\n\t  \"state\": \"SP\",\n\t  \"country\": \"BR\",\n\t  \"complement\": \"Conjunto 12\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"zip_code\": \"01310-100\",\n  \"street\": \"Avenida Paulista\",\n  \"number\": \"1578\",\n  \"district\": \"Bela Vista\",\n  \"city\": \"São Paulo\",\n  \"state\": \"SP\",\n  \"country\": \"BR\",\n  \"complement\": \"Conjunto 12\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"zip_code\": \"01310-100\",\n    \"street\": \"Avenida Paulista\",\n    \"number\": \"1578\",\n    \"district\": \"Bela Vista\",\n    \"city\": \"São Paulo\",\n    \"state\": \"SP\",\n    \"country\": \"BR\",\n    \"complement\": \"Conjunto 12\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/users/{id}/addresses/{addressId}": {
      "delete": {
        "description": "Removes a saved address. An address referenced by a completed order is retained on that order and only detached from the customer.",
        "operationId": "deleteStorefrontAddress",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Address identifier.",
            "in": "path",
            "name": "addressId",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Delete an address",
        "tags": [
          "Addresses"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X DELETE \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      },
      "patch": {
        "description": "Updates a saved address. Only the fields present in the body are changed.",
        "operationId": "updateStorefrontAddress",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Address identifier.",
            "in": "path",
            "name": "addressId",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "complement": "Conjunto 14",
                "number": "1600"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Update an address",
        "tags": [
          "Addresses"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X PATCH \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"number\":\"1600\",\"complement\":\"Conjunto 14\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"number\": \"1600\",\n\t  \"complement\": \"Conjunto 14\"\n\t}`\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PATCH\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"number\": \"1600\",\n  \"complement\": \"Conjunto 14\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/addresses/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"number\": \"1600\",\n    \"complement\": \"Conjunto 14\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/users/{id}/change-password": {
      "post": {
        "description": "Changes the password of a signed-in customer. Requires the current password; the reset flow is the path for a customer who cannot supply it.",
        "operationId": "changeStorefrontPassword",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "current_password": "s3cret",
                "new_password": "n3wS3cret"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Change a password",
        "tags": [
          "Users"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/change-password\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"current_password\":\"s3cret\",\"new_password\":\"n3wS3cret\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"current_password\": \"s3cret\",\n\t  \"new_password\": \"n3wS3cret\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/change-password\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/change-password\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"current_password\": \"s3cret\",\n  \"new_password\": \"n3wS3cret\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/change-password\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"current_password\": \"s3cret\",\n    \"new_password\": \"n3wS3cret\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/users/{id}/documents": {
      "get": {
        "description": "Returns the identity documents saved for the customer — the CPF or CNPJ checkout and ticket issuance require.",
        "operationId": "listStorefrontDocuments",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "List a customer's documents",
        "tags": [
          "Documents"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      },
      "post": {
        "description": "Saves an identity document for the customer. The first one saved becomes primary.",
        "operationId": "createStorefrontDocument",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "number": "12345678901",
                "type": "cpf"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Add a document",
        "tags": [
          "Documents"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"type\":\"cpf\",\"number\":\"12345678901\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"type\": \"cpf\",\n\t  \"number\": \"12345678901\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"type\": \"cpf\",\n  \"number\": \"12345678901\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"type\": \"cpf\",\n    \"number\": \"12345678901\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/users/{id}/documents/{documentId}": {
      "delete": {
        "description": "Removes a saved identity document from the customer.",
        "operationId": "deleteStorefrontDocument",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Document identifier.",
            "in": "path",
            "name": "documentId",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Delete a document",
        "tags": [
          "Documents"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X DELETE \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/documents/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    },
    "/stf/v1/users/{id}/profile": {
      "get": {
        "description": "Returns the profile record attached to the customer: document, birth date, phone and the other fields checkout needs.",
        "operationId": "getStorefrontProfile",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Read a customer profile",
        "tags": [
          "Users"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X GET \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\"\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\", {\n  method: \"GET\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n  },\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      },
      "patch": {
        "description": "Updates the profile record. Only the fields present in the body are changed.",
        "operationId": "updateStorefrontProfile",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "phone": "+5511988888888"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Update a customer profile",
        "tags": [
          "Users"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X PATCH \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"phone\":\"+5511988888888\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"phone\": \"+5511988888888\"\n\t}`\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PATCH\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"phone\": \"+5511988888888\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\", {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"phone\": \"+5511988888888\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      },
      "post": {
        "description": "Creates the profile record for a customer that has none. Checkout creates one implicitly, so this is for storefronts that collect the data up front.",
        "operationId": "createStorefrontProfile",
        "parameters": [
          {
            "description": "Customer identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "birth_date": "1990-05-21",
                "phone": "+5511999999999"
              },
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "TokenBasic": []
          }
        ],
        "summary": "Create a customer profile",
        "tags": [
          "Users"
        ],
        "x-codeSamples": [
          {
            "label": "cURL",
            "lang": "Shell",
            "source": "curl -sS -X POST \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"phone\":\"+5511999999999\",\"birth_date\":\"1990-05-21\"}'\n"
          },
          {
            "label": "Go",
            "lang": "Go",
            "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `{\n\t  \"phone\": \"+5511999999999\",\n\t  \"birth_date\": \"1990-05-21\"\n\t}`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.SetBasicAuth(clientID, clientSecret)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tpayload, _ := io.ReadAll(res.Body)\n\tfmt.Println(res.StatusCode, string(payload))\n}\n"
          },
          {
            "label": "PHP",
            "lang": "PHP",
            "source": "\u003c?php\n\n$ch = curl_init(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId . \":\" . $clientSecret);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\"Content-Type: application/json\"]);\n\n$payload = \u003c\u003c\u003c'JSON'\n{\n  \"phone\": \"+5511999999999\",\n  \"birth_date\": \"1990-05-21\"\n}\nJSON;\n\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n$response = curl_exec($ch);\necho curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL, $response, PHP_EOL;\ncurl_close($ch);\n"
          },
          {
            "label": "Node.js",
            "lang": "JavaScript",
            "source": "const auth = Buffer.from(`${clientId}:${clientSecret}`).toString(\"base64\");\n\nconst response = await fetch(\"https://api.sdx.ingressos.com.br/stf/v1/users/3f1c2e5a-9b4d-4c77-8a1e-2d6f0b9c4e11/profile\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Basic ${auth}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"phone\": \"+5511999999999\",\n    \"birth_date\": \"1990-05-21\"\n  }),\n});\n\nconsole.log(response.status, await response.json());\n"
          }
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Sandbox. Every sample on this page targets it.",
      "url": "https://api.sdx.ingressos.com.br"
    },
    {
      "description": "Production.",
      "url": "https://api.ingressos.com.br"
    }
  ],
  "tags": [
    {
      "description": "Customer sign-in, registration and password recovery.",
      "name": "Authentication"
    },
    {
      "description": "The customer record and its profile.",
      "name": "Users"
    },
    {
      "description": "Customer addresses.",
      "name": "Addresses"
    },
    {
      "description": "Customer identity documents.",
      "name": "Documents"
    },
    {
      "description": "The seller's catalogue.",
      "name": "Events"
    },
    {
      "description": "What is on sale, and how much of it is left.",
      "name": "Inventory"
    },
    {
      "description": "The basket a buyer fills before checkout.",
      "name": "Baskets"
    },
    {
      "description": "Turning a basket into a paid order.",
      "name": "Checkout"
    },
    {
      "description": "Orders and their tickets.",
      "name": "Orders"
    },
    {
      "description": "Orders a customer has claimed or been given.",
      "name": "Order groups"
    },
    {
      "description": "Ticket retrieval reporting.",
      "name": "Tickets"
    },
    {
      "description": "Per-seller storefront configuration.",
      "name": "Settings"
    }
  ]
}