# Estornar Cobrança

## Realizar estorno parcial

> Realiza estorno parcial de uma cobrança

```json
{"openapi":"3.0.0","info":{"title":"Barte Payment Service API - Charges","version":"2.0.0"},"servers":[{"url":"https://api.barte.com","description":"Servidor de Produção"},{"url":"https://sandbox-api.barte.com","description":"Servidor de Sandbox"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Token-Api","description":"Token de autenticação para acesso à API"}},"schemas":{"PartialRefundRequest":{"type":"object","required":["value"],"properties":{"value":{"type":"number","format":"double","description":"Valor a ser estornado"}}},"PartialRefundResponse":{"type":"object","properties":{"uuid":{"type":"string","format":"uuid","description":"UUID da charge"},"originalValue":{"type":"number","format":"double","description":"Valor original da cobrança"},"value":{"type":"number","format":"double","description":"Valor restante após o estorno parcial"},"refundValue":{"type":"number","format":"double","description":"Valor da solicitação de estorno"},"refundStatus":{"type":"string7","description":"Status da requisição de estorno"}}},"Error":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetail"}},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"ErrorDetail":{"type":"object","properties":{"status":{"type":"string"},"code":{"type":"string","enum":["PAYMENT-0000","PAYMENT-0500","PAYMENT-9999","BAR-0300","BAR-0502","BAD_REQUEST","FORBIDDEN","METHOD_NOT_ALLOWED","NOT_ACCEPTABLE","UNSUPPORTED_MEDIA_TYPE","BAR-7001"]},"title":{"type":"string","enum":["BUSINESS_SELLER","BUSINESS_CHECKOUT","BUSINESS_COMMON","BUSINESS_SECURITY","BUSINESS_SUBSCRIPTION","INVALID_REQUEST_PARAM","BUSINESS_METRIC","BUSINESS_ACCOUNTANCY","BUSINESS_NOTIFICATION","BUSINESS_BARTE","BUSINESS_COMPANY","BUSINESS_INVOICE","BUSINESS_TRANSFER","BUSINESS_CARD","BUSINESS_ORDER","card_not_supported"]},"description":{"type":"string"},"action":{"type":"string"},"additionalInfo":{"type":"object","additionalProperties":{"type":"object"}}}},"Metadata":{"type":"object","properties":{"totalRecords":{"type":"integer"},"totalPages":{"type":"integer"},"requestDatetime":{"type":"string","format":"date-time"}}}}},"paths":{"/v2/charges/partial-refund/{uuid}":{"patch":{"summary":"Realizar estorno parcial","description":"Realiza estorno parcial de uma cobrança","tags":["Cobranças"],"parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"UUID da cobrança a ser estornada parcialmente"},{"name":"X-Token-Api","in":"header","required":true,"schema":{"type":"string"},"description":"Token de autenticação para acesso à API"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialRefundRequest"}}}},"responses":{"200":{"description":"Estorno parcial processado com sucesso","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PartialRefundResponse"}}}}},"400":{"description":"Erro de validação","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Token inativo ou inexistente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Acesso negado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Cobrança não encontrada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Método não permitido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflito","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Entidade não processável","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Erro interno do servidor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.barte.com/api-reference/estorno/estorno-cobranca-parcial.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
