> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prava.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Report a Mandate Charge

> Settle a mandate charge outcome (APPROVED / DECLINED) with the card network.

Reconcile a mandate charge outcome and settle it with the card network. Call this after checking out with the credentials from [Charge a Mandate](https://docs.prava.space/api-reference/mandate-charge.md).

`POST /v1/mandates/{id}/charges/{txnId}/report` · Authenticated with your secret key (merchants) or Ed25519 signature (agents).

Need to **create** a mandate? Mandate creation is part of the Session APIs — [create a mandate](https://docs.prava.space/api-reference/create-session.md#mandate-setup) with a `mandate_setup` block on Create Session.

## Path parameters

**id** `string` *required*

The mandate id.

**txnId** `string` *required*

The `transactionId` returned from [Charge a Mandate](https://docs.prava.space/api-reference/mandate-charge.md).

## Body

**txn\_status** `string` *required*

`APPROVED` or `DECLINED`.

**txn\_type** `string` *required*

`PURCHASE`.

**authorization\_code** `string`

Authorization code from your processor, max 128. Optional; recorded when supplied.

**response\_code** `string`

Processor response code, max 2. Optional.

**amount\_paid** `string`

Amount paid, decimal string. Optional.

## Response

**mandateId** `string`

**transactionId** `string`

**orderId** `string`

**status** `string`

`completed` or `failed`.

**mandateStatus** `string`

The mandate's status after settlement.

**visaConfirmation** `string`

`SUCCESS` or `FAILURE`.

## Notes

* Reporting a one-time mandate charge as `APPROVED` moves the mandate to `consumed`; recurring mandates stay `active`.
* `authorization_code`, `response_code`, and `amount_paid` are optional and recorded when supplied.

## Error responses

| Status | Code | Cause |
| - | - | - |
| 401 | `AUTH_REQUIRED` | Missing or invalid credentials |
| 403 | `MANDATE_FORBIDDEN` | Caller does not own this mandate |
| 404 | `MANDATE_NOT_FOUND` / `CHARGE_NOT_FOUND` | Mandate or charge not found |
| 409 | `CHARGE_NOT_REPORTABLE` / `CHARGE_NO_TLI` / `NO_INSTRUCTION` | Charge is not in a reportable state |
| 502 | `VISA_CONFIRMATION_FAILED` | Visa confirmation failed |
| 500 | `MANDATE_CHARGE_REPORT_DB_FAILED` | Persistence failed |

```bash cURL theme={null}
curl -X POST https://sandbox.api.prava.space/v1/mandates/mdt_123/charges/txn_9/report \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{ "txn_status": "APPROVED", "txn_type": "PURCHASE", "authorization_code": "OK123", "response_code": "00", "amount_paid": "40.00" }'
```

```python Python theme={null}
import requests

resp = requests.post(
    "https://sandbox.api.prava.space/v1/mandates/mdt_123/charges/txn_9/report",
    headers={"Authorization": "Bearer sk_test_..."},
    json={
        "txn_status": "APPROVED",
        "txn_type": "PURCHASE",
        "authorization_code": "OK123",
        "response_code": "00",
        "amount_paid": "40.00",
    },
)
```

```javascript JavaScript theme={null}
const resp = await fetch(
  "https://sandbox.api.prava.space/v1/mandates/mdt_123/charges/txn_9/report",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer sk_test_...",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      txn_status: "APPROVED",
      txn_type: "PURCHASE",
      authorization_code: "OK123",
      response_code: "00",
      amount_paid: "40.00",
    }),
  }
);
```

```json 200 Success theme={null}
{
  "mandateId": "mdt_123",
  "transactionId": "txn_9",
  "orderId": "ord_9",
  "status": "completed",
  "mandateStatus": "active",
  "visaConfirmation": "SUCCESS"
}
```

```json 404 Not Found theme={null}
{
  "error": { "code": "CHARGE_NOT_FOUND", "message": "Charge not found" }
}
```

```json 409 Not Reportable theme={null}
{
  "error": { "code": "CHARGE_NOT_REPORTABLE", "message": "Charge is not in a reportable state" }
}
```


## OpenAPI

````yaml api-reference/openapi.json POST /v1/mandates/{id}/charges/{txnId}/report
openapi: 3.1.0
info:
  title: Prava Payments API
  description: >-
    Server-side REST API for Prava Payments. All requests are authenticated with
    your secret key (sk_test_* in sandbox, sk_live_* in production).
  version: 1.0.0
servers:
  - url: https://sandbox.api.prava.space
    description: Sandbox
  - url: https://api.prava.space
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/mandates/{id}/charges/{txnId}/report:
    post:
      summary: Report a Mandate Charge
      description: >-
        Reconcile a mandate charge outcome (APPROVED / DECLINED) and settle it
        with the card network.
      operationId: reportMandateCharge
      parameters:
        - name: id
          in: path
          required: true
          description: The mandate id.
          schema:
            type: string
        - name: txnId
          in: path
          required: true
          description: The transactionId returned from Charge a Mandate.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MandateReportRequest'
      responses:
        '200':
          description: Charge outcome recorded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  mandateId:
                    type: string
                  transactionId:
                    type: string
                  orderId:
                    type: string
                  status:
                    type: string
                    enum:
                      - completed
                      - failed
                  mandateStatus:
                    type: string
                  visaConfirmation:
                    type: string
                    enum:
                      - SUCCESS
                      - FAILURE
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '500':
          $ref: '#/components/responses/Error'
components:
  schemas:
    MandateReportRequest:
      type: object
      required:
        - txn_status
      properties:
        txn_status:
          type: string
          enum:
            - APPROVED
            - DECLINED
        txn_type:
          type: string
          enum:
            - PURCHASE
          default: PURCHASE
        authorization_code:
          type: string
          maxLength: 128
        response_code:
          type: string
          maxLength: 2
        amount_paid:
          type: string
          pattern: ^\d+(\.\d{1,2})?$
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code (e.g. VAL_2001, AUTH_1001)
            message:
              type: string
              description: Human-readable error message
            details:
              type: object
              description: >-
                Optional — included for validation errors to specify which
                fields failed
  responses:
    Error:
      description: Error response
      headers:
        X-Response-ID:
          $ref: '#/components/headers/XResponseId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  headers:
    XResponseId:
      description: >-
        UUID correlation identifier for this response. Include it when
        contacting Prava support.
      schema:
        type: string
        format: uuid
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your secret key: sk_test_* (sandbox) or sk_live_* (production).'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.