# Settles transactions

POST {{baseURL}}/pay-api/v1/transactions/settle
This endpoint settles, or completes, a transaction.
A settlement transaction is the step in the payment process when an authorized transaction is finalized.
The funds are transferred to the merchant's acquiring bank.
See Also:
To capture a transaction, see POST /pay-api/v1/transactions/capture.
To create a transaction, see POST /pay-api/v1/transactions/sale.
To list transactions, see GET /pay-api/v1/transactions.

Endpoint: POST /pay-api/v1/transactions/settle
Version: V1
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `paymentProcessorId` (string, required)
    Specifies the payment processor identifier.
A list of available payment processers can be found with GET {{baseURL}}/pay-api/v1/configurations/payments.
See response `availablePaymentProcessors.id`.
Example: 8f5a4c27-71c4-4b5d-944e-8bb457594d86
    Example: 8f5a4c27-71c4-4b5d-944e-8bb457594d86

## Request examples:

  - `Settle the open batch` (unknown)
    Submits the open batch for a card processor.

All captured transactions in the batch are sent for settlement.

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `code` (integer)
    A vendor independent response code.
Valid values are:
| Value | Name | Description |
|  --- | --- | --- |
| 0 | Approve | Operation fully or partially approved. |
| 1 | Decline | Operation declined. |
| 2 | Error | Something prevents to complete the operation. Request format is wrong, or system error, or any other reason that prevented normal processing. |

Example: 0
    Example: 0

  - `message` (string)
    Free-form result description.

  - `processorResponseCode` (string)
    Processor-specific response code that precisely describes the operation result.

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `details` (string)
    Indicates details about the error.

Example: Validation failed: -- Email: 'Email' is not a valid email address. Severity: Error
    Example: Validation failed: -- Email: 'Email' is not a valid email address. Severity: Error

  - `statusCode` (integer)
    Specifies the HTTP response status code.
This is the HTTP status code returned by the attempted delivery.
The following is a list of HTTP response status codes that include but are not limited to:
| HTTP Status | Meaning |
|  --- | --- |
| 200 | Delivery succeeded |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Endpoint not found |
| 429 | Rate limited |

Example: 401
    Example: 401

  - `source` (string)
    Indicates the source of the error.

Example: FluteOpsDeveloper.MSG322
    Example: FluteOpsDeveloper.MSG322

  - `exceptionType` (string)
    Indicates the error's exception type.

Example: FluentValidation.ValidationException
    Example: FluentValidation.ValidationException

  - `correlationId` (string)
    Indicates the correlation identifier.

Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef
    Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef

  - `entityId` (string)
    Indicates the entity identifier.
Example:
null

  - `errorCode` (string)
    Indicates the error code.
Example:
null

  - `errors` (object)
    Indicates the collection of validation errors, keyed by field name.
Example:
{ "Email": ["'Email' is not a valid email address."] }

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `details` (string)
    Indicates details about the error.

Example: Validation failed: -- Email: 'Email' is not a valid email address. Severity: Error
    Example: Validation failed: -- Email: 'Email' is not a valid email address. Severity: Error

  - `statusCode` (integer)
    Specifies the HTTP response status code.
This is the HTTP status code returned by the attempted delivery.
The following is a list of HTTP response status codes that include but are not limited to:
| HTTP Status | Meaning |
|  --- | --- |
| 200 | Delivery succeeded |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Endpoint not found |
| 429 | Rate limited |

Example: 401
    Example: 401

  - `source` (string)
    Indicates the source of the error.
Example: <Service>
    Example: FluteOpsDeveloper.MSG322

  - `exceptionType` (string)
    Indicates the error's exception type.

Example: FluentValidation.ValidationException
    Example: FluentValidation.ValidationException

  - `correlationId` (string)
    Indicates the correlation identifier.

Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef
    Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef

  - `entityId` (string)
    Indicates the entity identifier.
Example:
null

  - `errorCode` (string)
    Indicates the error code.
Example:
null

  - `title` (string)
    Indicates a short summary of the error.

Example: Validation failed
    Example: Validation failed

  - `cause` (string)
    Indicates the cause of the error.

Example: One or more fields failed validation rules.
    Example: One or more fields failed validation rules.

  - `resolution` (string)
    Indicates how to resolve the error.

Example: Review the errors and correct the invalid fields.
    Example: Review the errors and correct the invalid fields.

  - `documentationUrl` (string)
    Indicates a URL to relevant documentation about the error.

Example: https://developer.risewithaurora.com/
    Example: https://developer.risewithaurora.com/

## Response 404:

  - `404` (unknown)
    Resource not found

## Response 404 fields (application/json):

  - `details` (string)
    Indicates details about the error.

Example: Entity with ID 'aa6cfcd0-0295-4a4c-b074-8c901f114fef' was not found.
    Example: Entity with ID 'aa6cfcd0-0295-4a4c-b074-8c901f114fef' was not found.

  - `statusCode` (integer)
    Specifies the HTTP response status code.
This is the HTTP status code returned by the attempted delivery.
The following is a list of HTTP response status codes that include but are not limited to:
| HTTP Status | Meaning |
|  --- | --- |
| 200 | Delivery succeeded |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Endpoint not found |
| 429 | Rate limited |

Example: 401
    Example: 401

  - `source` (string)
    Indicates the source of the error.

Example: FluteOpsDeveloper.MSG322
    Example: FluteOpsDeveloper.MSG322

  - `exceptionType` (string)
    Indicates the error's exception type.

Example: System.Collections.Generic.KeyNotFoundException
    Example: System.Collections.Generic.KeyNotFoundException

  - `correlationId` (string)
    Indicates the correlation identifier.

Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef
    Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef

  - `entityId` (string)
    Indicates the entity identifier.
Example:
null

  - `errorCode` (string)
    Indicates the error code.
Example:
null

## Response 500:

  - `500` (unknown)
    Internal Error

## Response 500 fields (application/json):

  - `details` (string)
    Indicates details about the error.

Example: An unexpected error occurred while processing the request.
    Example: An unexpected error occurred while processing the request.

  - `statusCode` (integer)
    Specifies the HTTP response status code.
This is the HTTP status code returned by the attempted delivery.
The following is a list of HTTP response status codes that include but are not limited to:
| HTTP Status | Meaning |
|  --- | --- |
| 200 | Delivery succeeded |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Endpoint not found |
| 429 | Rate limited |

Example: 401
    Example: 401

  - `source` (string)
    Indicates the source of the error.
Example: <Service>
    Example: (Service)

  - `exceptionType` (string)
    Indicates the error's exception type.

Example: System.Exception
    Example: System.Exception

  - `correlationId` (string)
    Indicates the correlation identifier.

Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef
    Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef

  - `entityId` (string)
    Indicates the entity identifier.
Example:
null

  - `errorCode` (string)
    Indicates the error code.
Example:
null

## Response 200 examples:

  - `Batch submitted` (unknown)
    The processor accepts the batch.

code is 0 (Approve).

  - `Batch not submitted` (unknown)
    The batch could not be submitted.

code is 2 (Error).

