---
title: "Fechar um pedido"
url: "https://devcenter.stone.com.br/apis/v5-docs-legacy/versions/b9aaff36-6dcc-4353-8398-836d6c13dfa5/operations/fechar-um-pedido"
---

> Full API specification: https://devcenter.stone.com.br/apis/v5-docs-legacy/versions/b9aaff36-6dcc-4353-8398-836d6c13dfa5.md

# Fechar um pedido

`PATCH` `/orders/{order_id}/closed`

Operation ID: `fechar-um-pedido`

Utilizado para fechar um pedido para que não seja mais possível adicionar cobranças.

## Path parameters

- `order_id` (string, required) - Código do pedido.

## Request body

Content types: `application/json`

## Responses

- `200` - 200
- `400` - 400

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Pagar.me v5 API (Legado)
  version: 5.0.0
servers:
  - url: https://api.stone.com.br/core/v5
paths:
  /orders/{order_id}/closed:
    patch:
      summary: Fechar um pedido
      description: Utilizado para fechar um pedido para que não seja mais possível
        adicionar cobranças.
      operationId: fechar-um-pedido
      parameters:
        - name: order_id
          in: path
          description: Código do pedido.
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - status
              properties:
                status:
                  type: string
                  description: "Status final do pedido. Valores possíveis: **paid**, **canceled**
                    ou **failed**. Caso não enviado, valor default será
                    **paid**."
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                      "id": "or_koMvlQOTMCb9dpPO",
                      "code": "O8YDFPZUM3",
                      "amount": 2990,
                      "currency": "BRL",
                      "closed": true,
                      "items": [
                        {
                          "id": "oi_jkW1MBc9MtKdzK20",
                          "description": "Bolinho de feijoada",
                          "amount": 2990,
                          "quantity": 1,
                          "status": "active",
                          "created_at": "2017-06-06T16:03:41Z",
                          "updated_at": "2017-06-06T16:03:41Z"
                        }
                      ],
                      "customer": {
                        "id": "cus_mBloKMLnswtD4O3a",
                        "name": "Tony Stark",
                        "email": "avengerstark@ligadajustica.com.br",
                        "delinquent": false,
                        "created_at": "2016-10-07T19:50:39Z",
                        "updated_at": "2017-06-06T16:03:40Z",
                        "phones": {},
                        "metadata": {
                          "company": "Pagar.me",
                          "nome_da_mae": "Maria"
                        }
                      },
                      "status": "paid",
                      "created_at": "2017-06-06T16:03:40Z",
                      "updated_at": "2017-06-06T16:03:40Z",
                      "closed_at": "2017-06-06T16:03:47Z"
                    }
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: or_koMvlQOTMCb9dpPO
                  code:
                    type: string
                    example: O8YDFPZUM3
                  amount:
                    type: integer
                    example: 2990
                    default: 0
                  currency:
                    type: string
                    example: BRL
                  closed:
                    type: boolean
                    example: true
                    default: true
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: oi_jkW1MBc9MtKdzK20
                        description:
                          type: string
                          example: Bolinho de feijoada
                        amount:
                          type: integer
                          example: 2990
                          default: 0
                        quantity:
                          type: integer
                          example: 1
                          default: 0
                        status:
                          type: string
                          example: active
                        created_at:
                          type: string
                          example: 2017-06-06T16:03:41Z
                        updated_at:
                          type: string
                          example: 2017-06-06T16:03:41Z
                  customer:
                    type: object
                    properties:
                      id:
                        type: string
                        example: cus_mBloKMLnswtD4O3a
                      name:
                        type: string
                        example: Tony Stark
                      email:
                        type: string
                        example: avengerstark@ligadajustica.com.br
                      delinquent:
                        type: boolean
                        example: false
                        default: true
                      created_at:
                        type: string
                        example: 2016-10-07T19:50:39Z
                      updated_at:
                        type: string
                        example: 2017-06-06T16:03:40Z
                      phones:
                        type: object
                        properties: {}
                      metadata:
                        type: object
                        properties:
                          company:
                            type: string
                            example: Pagar.me
                          nome_da_mae:
                            type: string
                            example: Maria
                  status:
                    type: string
                    example: paid
                  created_at:
                    type: string
                    example: 2017-06-06T16:03:40Z
                  updated_at:
                    type: string
                    example: 2017-06-06T16:03:40Z
                  closed_at:
                    type: string
                    example: 2017-06-06T16:03:47Z
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
security:
  - sec0: []
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic
```
