> For the complete documentation index, see [llms.txt](https://aplazo.gitbook.io/aplazo-integrations/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aplazo.gitbook.io/aplazo-integrations/api-reference/settlement-api.md).

# Settlement API

\
The Aplazo Settlement API lets you, as a merchant, reconcile the payouts\
Aplazo deposits into your bank account against the orders your customers\
paid with Aplazo.

With this API you can:

* **Get monthly or date-range totals** of your sales, fees, adjustments and the final amount deposited.
* **List individual settlement payments** (one per deposit) with their invoice and receipt URLs for your accounting.
* **Drill into a single payment** to see every loan (transaction) and every adjustment (refund, debit, credit) that made it up.

Every endpoint is read-only (`GET`) and returns JSON.

### Required headers

All endpoints require two custom headers issued to your merchant account.\
Both must be sent on every request:

* `merchant_id` — your numeric merchant identifier
* `api_token` — the UUID token assigned to your account

If you don't have them yet, contact your Aplazo account manager.

## Monthly Settlement Summary

> Returns aggregated settlement totals for a merchant in a given month.

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"tags":[{"name":"Summary","description":"Aggregated settlement totals"}],"servers":[{"url":"https://merchant.aplazo.mx","description":"Production"},{"url":"https://merchant.aplazo.net","description":"Development / Staging"}],"paths":{"/merchant/report/summary":{"get":{"tags":["Summary"],"summary":"Monthly Settlement Summary","description":"Returns aggregated settlement totals for a merchant in a given month.","parameters":[{"$ref":"#/components/parameters/Status"},{"name":"monthYear","in":"query","required":true,"description":"Month and year in `MM/YYYY` format.","schema":{"type":"string"}}],"responses":{"200":{"description":"Aggregated totals for the month. When no settlements match the filter\n(e.g. `status=PROCESS` in production), the body is empty.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementSummary"}}}}}}}},"components":{"parameters":{"Status":{"name":"status","in":"query","required":false,"description":"Settlement status to filter by:\n  - `PROGRESS` — payment is in progress / in transit to be paid.\n  - `PAID` — payment has already been deposited to the merchant.\n","schema":{"type":"string","enum":["PROGRESS","PAID"]}}},"schemas":{"SettlementSummary":{"type":"object","properties":{"totalSales":{"type":"number","format":"double","description":"Sum of the amount of all orders paid in the selected period for that merchant."},"totalAdjustment":{"type":"number","format":"double","description":"Sum of all negative or positive adjustments done for this merchant in the selected period.\nA positive value is deducted from `totalPay`.\n"},"totalPay":{"type":"number","format":"double","description":"Final amount paid to the merchant in the selected period after all adjustments."},"totalFee":{"type":"number","format":"double","description":"Sum of all fees (including taxes) charged to the merchant."}}}}}}
```

## Date Range Settlement Summary

> Returns aggregated settlement totals for a merchant in a date range.

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"tags":[{"name":"Summary","description":"Aggregated settlement totals"}],"servers":[{"url":"https://merchant.aplazo.mx","description":"Production"},{"url":"https://merchant.aplazo.net","description":"Development / Staging"}],"paths":{"/merchant/report/summary/range":{"get":{"tags":["Summary"],"summary":"Date Range Settlement Summary","description":"Returns aggregated settlement totals for a merchant in a date range.","parameters":[{"$ref":"#/components/parameters/Status"},{"$ref":"#/components/parameters/FromDate"},{"$ref":"#/components/parameters/ToDate"}],"responses":{"200":{"description":"Aggregated totals for the range. Empty body if no records match.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementSummary"}}}}}}}},"components":{"parameters":{"Status":{"name":"status","in":"query","required":false,"description":"Settlement status to filter by:\n  - `PROGRESS` — payment is in progress / in transit to be paid.\n  - `PAID` — payment has already been deposited to the merchant.\n","schema":{"type":"string","enum":["PROGRESS","PAID"]}},"FromDate":{"name":"fromDate","in":"query","required":true,"description":"Start date in `DD/MM/YYYY` format.","schema":{"type":"string"}},"ToDate":{"name":"toDate","in":"query","required":true,"description":"End date in `DD/MM/YYYY` format.","schema":{"type":"string"}}},"schemas":{"SettlementSummary":{"type":"object","properties":{"totalSales":{"type":"number","format":"double","description":"Sum of the amount of all orders paid in the selected period for that merchant."},"totalAdjustment":{"type":"number","format":"double","description":"Sum of all negative or positive adjustments done for this merchant in the selected period.\nA positive value is deducted from `totalPay`.\n"},"totalPay":{"type":"number","format":"double","description":"Final amount paid to the merchant in the selected period after all adjustments."},"totalFee":{"type":"number","format":"double","description":"Sum of all fees (including taxes) charged to the merchant."}}}}}}
```

## Monthly Settlement Payment Detail (paged)

> Returns a paginated list of merchant payments for the given month.

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"tags":[{"name":"Payments","description":"Per-payment settlement detail"}],"servers":[{"url":"https://merchant.aplazo.mx","description":"Production"},{"url":"https://merchant.aplazo.net","description":"Development / Staging"}],"paths":{"/merchant/report/page":{"get":{"tags":["Payments"],"summary":"Monthly Settlement Payment Detail (paged)","description":"Returns a paginated list of merchant payments for the given month.","parameters":[{"$ref":"#/components/parameters/Status"},{"name":"monthYear","in":"query","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PageNum"},{"$ref":"#/components/parameters/PageSize"},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Page of merchant payments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantPaymentPage"}}}}}}}},"components":{"parameters":{"Status":{"name":"status","in":"query","required":false,"description":"Settlement status to filter by:\n  - `PROGRESS` — payment is in progress / in transit to be paid.\n  - `PAID` — payment has already been deposited to the merchant.\n","schema":{"type":"string","enum":["PROGRESS","PAID"]}},"PageNum":{"name":"pageNum","in":"query","required":false,"schema":{"type":"integer","default":0}},"PageSize":{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","default":10}}},"schemas":{"MerchantPaymentPage":{"allOf":[{"$ref":"#/components/schemas/PageMeta"},{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/MerchantPayment"}}}}]},"PageMeta":{"type":"object","properties":{"last":{"type":"boolean"},"first":{"type":"boolean"},"empty":{"type":"boolean"},"size":{"type":"integer"},"number":{"type":"integer"},"numberOfElements":{"type":"integer"},"totalPages":{"type":"integer"},"totalElements":{"type":"integer"},"pageable":{"$ref":"#/components/schemas/Pageable"},"sort":{"type":"array","items":{"type":"object"}}}},"Pageable":{"type":"object","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"sort":{"type":"array","items":{"type":"object"}},"offset":{"type":"integer"},"paged":{"type":"boolean"},"unpaged":{"type":"boolean"}}},"MerchantPayment":{"type":"object","properties":{"id":{"type":"integer","description":"Merchant payment identifier."},"paymentDate":{"type":"string","format":"date","description":"Date when this payment was settled (`YYYY-MM-DD`)."},"saleAmount":{"type":"number","format":"double","description":"Sum of all orders paid in this payment."},"adjustment":{"type":"number","format":"double","description":"Sum of all adjustments applied to this payment."},"feeAmount":{"type":"number","format":"double","description":"Sum of fees including tax (`feeNoTax + tax`)."},"payAmount":{"type":"number","format":"double","description":"Amount paid before adjustments (`saleAmount - feeAmount`)."},"finalAmount":{"type":"number","format":"double","description":"Final amount paid after adjustments (`payAmount - adjustment`)."},"status":{"type":"string","description":"Status of the merchant payment.","enum":["PROGRESS","PAID"]},"loans":{"type":"integer","description":"Number of loans included in this payment."},"adjustments":{"type":"integer","description":"Number of adjustments applied to this payment."},"current":{"type":"string","description":"Currency code (e.g. `MXN`). Note the field name is `current`, not `currency`."},"statusInvoice":{"type":"string","description":"Invoice status.","enum":["PENDING","INVOICED","INVOICED_EXCLUDED","ERROR"]},"statusReceipt":{"type":"string","description":"Receipt status."},"invoicePdfUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the fee invoice PDF."},"invoiceXmlUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the fee invoice XML (CFDI)."},"receiptPdfUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the payment receipt PDF."}}}}}}
```

## Date Range Settlement Payment Detail (paged)

> Returns a paginated list of merchant payments in a date range.

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"tags":[{"name":"Payments","description":"Per-payment settlement detail"}],"servers":[{"url":"https://merchant.aplazo.mx","description":"Production"},{"url":"https://merchant.aplazo.net","description":"Development / Staging"}],"paths":{"/merchant/report/page/range":{"get":{"tags":["Payments"],"summary":"Date Range Settlement Payment Detail (paged)","description":"Returns a paginated list of merchant payments in a date range.","parameters":[{"$ref":"#/components/parameters/Status"},{"$ref":"#/components/parameters/FromDate"},{"$ref":"#/components/parameters/ToDate"},{"$ref":"#/components/parameters/PageNum"},{"$ref":"#/components/parameters/PageSize"}],"responses":{"200":{"description":"Page of merchant payments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantPaymentPage"}}}}}}}},"components":{"parameters":{"Status":{"name":"status","in":"query","required":false,"description":"Settlement status to filter by:\n  - `PROGRESS` — payment is in progress / in transit to be paid.\n  - `PAID` — payment has already been deposited to the merchant.\n","schema":{"type":"string","enum":["PROGRESS","PAID"]}},"FromDate":{"name":"fromDate","in":"query","required":true,"description":"Start date in `DD/MM/YYYY` format.","schema":{"type":"string"}},"ToDate":{"name":"toDate","in":"query","required":true,"description":"End date in `DD/MM/YYYY` format.","schema":{"type":"string"}},"PageNum":{"name":"pageNum","in":"query","required":false,"schema":{"type":"integer","default":0}},"PageSize":{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","default":10}}},"schemas":{"MerchantPaymentPage":{"allOf":[{"$ref":"#/components/schemas/PageMeta"},{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/MerchantPayment"}}}}]},"PageMeta":{"type":"object","properties":{"last":{"type":"boolean"},"first":{"type":"boolean"},"empty":{"type":"boolean"},"size":{"type":"integer"},"number":{"type":"integer"},"numberOfElements":{"type":"integer"},"totalPages":{"type":"integer"},"totalElements":{"type":"integer"},"pageable":{"$ref":"#/components/schemas/Pageable"},"sort":{"type":"array","items":{"type":"object"}}}},"Pageable":{"type":"object","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"sort":{"type":"array","items":{"type":"object"}},"offset":{"type":"integer"},"paged":{"type":"boolean"},"unpaged":{"type":"boolean"}}},"MerchantPayment":{"type":"object","properties":{"id":{"type":"integer","description":"Merchant payment identifier."},"paymentDate":{"type":"string","format":"date","description":"Date when this payment was settled (`YYYY-MM-DD`)."},"saleAmount":{"type":"number","format":"double","description":"Sum of all orders paid in this payment."},"adjustment":{"type":"number","format":"double","description":"Sum of all adjustments applied to this payment."},"feeAmount":{"type":"number","format":"double","description":"Sum of fees including tax (`feeNoTax + tax`)."},"payAmount":{"type":"number","format":"double","description":"Amount paid before adjustments (`saleAmount - feeAmount`)."},"finalAmount":{"type":"number","format":"double","description":"Final amount paid after adjustments (`payAmount - adjustment`)."},"status":{"type":"string","description":"Status of the merchant payment.","enum":["PROGRESS","PAID"]},"loans":{"type":"integer","description":"Number of loans included in this payment."},"adjustments":{"type":"integer","description":"Number of adjustments applied to this payment."},"current":{"type":"string","description":"Currency code (e.g. `MXN`). Note the field name is `current`, not `currency`."},"statusInvoice":{"type":"string","description":"Invoice status.","enum":["PENDING","INVOICED","INVOICED_EXCLUDED","ERROR"]},"statusReceipt":{"type":"string","description":"Receipt status."},"invoicePdfUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the fee invoice PDF."},"invoiceXmlUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the fee invoice XML (CFDI)."},"receiptPdfUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the payment receipt PDF."}}}}}}
```

## Payment Settlement Summary

> Returns the settlement summary for a specific merchant payment.

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"tags":[{"name":"Payments","description":"Per-payment settlement detail"}],"servers":[{"url":"https://merchant.aplazo.mx","description":"Production"},{"url":"https://merchant.aplazo.net","description":"Development / Staging"}],"paths":{"/merchant/report/payment/{paymentId}":{"get":{"tags":["Payments"],"summary":"Payment Settlement Summary","description":"Returns the settlement summary for a specific merchant payment.","parameters":[{"$ref":"#/components/parameters/PaymentId"}],"responses":{"200":{"description":"Single merchant payment summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantPayment"}}}}}}}},"components":{"parameters":{"PaymentId":{"name":"paymentId","in":"path","required":true,"description":"Merchant payment identifier.","schema":{"type":"integer"}}},"schemas":{"MerchantPayment":{"type":"object","properties":{"id":{"type":"integer","description":"Merchant payment identifier."},"paymentDate":{"type":"string","format":"date","description":"Date when this payment was settled (`YYYY-MM-DD`)."},"saleAmount":{"type":"number","format":"double","description":"Sum of all orders paid in this payment."},"adjustment":{"type":"number","format":"double","description":"Sum of all adjustments applied to this payment."},"feeAmount":{"type":"number","format":"double","description":"Sum of fees including tax (`feeNoTax + tax`)."},"payAmount":{"type":"number","format":"double","description":"Amount paid before adjustments (`saleAmount - feeAmount`)."},"finalAmount":{"type":"number","format":"double","description":"Final amount paid after adjustments (`payAmount - adjustment`)."},"status":{"type":"string","description":"Status of the merchant payment.","enum":["PROGRESS","PAID"]},"loans":{"type":"integer","description":"Number of loans included in this payment."},"adjustments":{"type":"integer","description":"Number of adjustments applied to this payment."},"current":{"type":"string","description":"Currency code (e.g. `MXN`). Note the field name is `current`, not `currency`."},"statusInvoice":{"type":"string","description":"Invoice status.","enum":["PENDING","INVOICED","INVOICED_EXCLUDED","ERROR"]},"statusReceipt":{"type":"string","description":"Receipt status."},"invoicePdfUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the fee invoice PDF."},"invoiceXmlUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the fee invoice XML (CFDI)."},"receiptPdfUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the payment receipt PDF."}}}}}}
```

## Payment Settlement Loan Detail

> Returns the loans (transactions) included in a specific merchant payment.\
> Note: items are returned under the \`loans\` array (not \`content\`).<br>

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"tags":[{"name":"Loans","description":"Loans included in a settlement payment"}],"servers":[{"url":"https://merchant.aplazo.mx","description":"Production"},{"url":"https://merchant.aplazo.net","description":"Development / Staging"}],"paths":{"/merchant/report/payment/{paymentId}/loans":{"get":{"tags":["Loans"],"summary":"Payment Settlement Loan Detail","description":"Returns the loans (transactions) included in a specific merchant payment.\nNote: items are returned under the `loans` array (not `content`).\n","parameters":[{"$ref":"#/components/parameters/PaymentId"},{"$ref":"#/components/parameters/Status"},{"$ref":"#/components/parameters/PageNum"},{"$ref":"#/components/parameters/PageSize"}],"responses":{"200":{"description":"Page of loans for the payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanPage"}}}}}}}},"components":{"parameters":{"PaymentId":{"name":"paymentId","in":"path","required":true,"description":"Merchant payment identifier.","schema":{"type":"integer"}},"Status":{"name":"status","in":"query","required":false,"description":"Settlement status to filter by:\n  - `PROGRESS` — payment is in progress / in transit to be paid.\n  - `PAID` — payment has already been deposited to the merchant.\n","schema":{"type":"string","enum":["PROGRESS","PAID"]}},"PageNum":{"name":"pageNum","in":"query","required":false,"schema":{"type":"integer","default":0}},"PageSize":{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","default":10}}},"schemas":{"LoanPage":{"allOf":[{"$ref":"#/components/schemas/PageMeta"},{"type":"object","properties":{"loans":{"type":"array","description":"Loans for this payment. Note this collection is named `loans`\ninstead of the usual Spring `content`.\n","items":{"$ref":"#/components/schemas/Loan"}}}}]},"PageMeta":{"type":"object","properties":{"last":{"type":"boolean"},"first":{"type":"boolean"},"empty":{"type":"boolean"},"size":{"type":"integer"},"number":{"type":"integer"},"numberOfElements":{"type":"integer"},"totalPages":{"type":"integer"},"totalElements":{"type":"integer"},"pageable":{"$ref":"#/components/schemas/Pageable"},"sort":{"type":"array","items":{"type":"object"}}}},"Pageable":{"type":"object","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"sort":{"type":"array","items":{"type":"object"}},"offset":{"type":"integer"},"paged":{"type":"boolean"},"unpaged":{"type":"boolean"}}},"Loan":{"type":"object","properties":{"id":{"type":"integer","description":"Aplazo loan/transaction ID."},"creationDate":{"type":"string","format":"date-time","description":"ISO-8601 timestamp when the loan was created."},"salesAmount":{"type":"number","format":"double","description":"Amount the user paid for this order."},"feePct":{"type":"number","format":"double","description":"Fee percentage charged on this loan."},"feeMerchantPct":{"type":"number","format":"double","description":"Fee amount before fixed ops fee (`salesAmount * feePct`)."},"feeOps":{"type":"number","format":"double","description":"Fixed operations fee charged per transaction."},"feeMerchant":{"type":"number","format":"double","description":"Total merchant fee before tax (`feeMerchantPct + feeOps`)."},"feeTaxMerchantPct":{"type":"number","format":"double","description":"Tax percentage applied to the merchant fee."},"feeTaxMerchant":{"type":"number","format":"double","description":"Tax amount on the merchant fee (`feeMerchant * feeTaxMerchantPct`)."},"feeRevenue":{"type":"number","format":"double","description":"Total fee charged to the merchant including tax (`feeMerchant + feeTaxMerchant`)."},"payMerchantAmount":{"type":"number","format":"double","description":"Amount paid to the merchant for this loan (`salesAmount - feeRevenue`)."},"status":{"type":"string","description":"Loan approval status."},"statusPayment":{"type":"string","description":"Settlement status of the underlying payment.","enum":["PROGRESS","PAID"]},"cartId":{"type":"string","description":"Merchant-side cart/order identifier."},"branch":{"type":"string","nullable":true,"description":"Merchant branch identifier (when provided by the merchant)."},"totalProducts":{"type":"integer","description":"Number of products in the loan."}}}}}}
```

## Payment Settlement Adjustment Detail

> Returns the adjustments applied to a specific merchant payment.\
> Note: items are returned under the \`adjustments\` array (not \`content\`).<br>

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"tags":[{"name":"Adjustments","description":"Adjustments applied on a settlement payment"}],"servers":[{"url":"https://merchant.aplazo.mx","description":"Production"},{"url":"https://merchant.aplazo.net","description":"Development / Staging"}],"paths":{"/merchant/report/payment/{paymentId}/adjustments":{"get":{"tags":["Adjustments"],"summary":"Payment Settlement Adjustment Detail","description":"Returns the adjustments applied to a specific merchant payment.\nNote: items are returned under the `adjustments` array (not `content`).\n","parameters":[{"$ref":"#/components/parameters/PaymentId"},{"$ref":"#/components/parameters/Status"},{"$ref":"#/components/parameters/PageNum"},{"$ref":"#/components/parameters/PageSize"}],"responses":{"200":{"description":"Page of adjustments for the payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustmentPage"}}}}}}}},"components":{"parameters":{"PaymentId":{"name":"paymentId","in":"path","required":true,"description":"Merchant payment identifier.","schema":{"type":"integer"}},"Status":{"name":"status","in":"query","required":false,"description":"Settlement status to filter by:\n  - `PROGRESS` — payment is in progress / in transit to be paid.\n  - `PAID` — payment has already been deposited to the merchant.\n","schema":{"type":"string","enum":["PROGRESS","PAID"]}},"PageNum":{"name":"pageNum","in":"query","required":false,"schema":{"type":"integer","default":0}},"PageSize":{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","default":10}}},"schemas":{"AdjustmentPage":{"allOf":[{"$ref":"#/components/schemas/PageMeta"},{"type":"object","properties":{"adjustments":{"type":"array","description":"Adjustments for this payment. Note this collection is named\n`adjustments` instead of the usual Spring `content`.\n","items":{"$ref":"#/components/schemas/Adjustment"}}}}]},"PageMeta":{"type":"object","properties":{"last":{"type":"boolean"},"first":{"type":"boolean"},"empty":{"type":"boolean"},"size":{"type":"integer"},"number":{"type":"integer"},"numberOfElements":{"type":"integer"},"totalPages":{"type":"integer"},"totalElements":{"type":"integer"},"pageable":{"$ref":"#/components/schemas/Pageable"},"sort":{"type":"array","items":{"type":"object"}}}},"Pageable":{"type":"object","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"sort":{"type":"array","items":{"type":"object"}},"offset":{"type":"integer"},"paged":{"type":"boolean"},"unpaged":{"type":"boolean"}}},"Adjustment":{"type":"object","properties":{"id":{"type":"integer"},"merchantId":{"type":"integer"},"merchantPaymentId":{"type":"integer","description":"Merchant payment to which this adjustment was applied."},"loanId":{"type":"integer","nullable":true,"description":"Loan associated with the adjustment, when applicable."},"status":{"type":"string","enum":["PROGRESS","PAID"]},"type":{"type":"string","enum":["RETURN","MERCHANT_POSITIVE","MERCHANT_NEGATIVE"]},"comment":{"type":"string","nullable":true},"created":{"type":"string","format":"date-time"},"refundId":{"type":"integer","nullable":true,"description":"Refund identifier when `type=RETURN`."},"amount":{"type":"number","format":"double"}}}}}}
```

## The SettlementSummary object

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"components":{"schemas":{"SettlementSummary":{"type":"object","properties":{"totalSales":{"type":"number","format":"double","description":"Sum of the amount of all orders paid in the selected period for that merchant."},"totalAdjustment":{"type":"number","format":"double","description":"Sum of all negative or positive adjustments done for this merchant in the selected period.\nA positive value is deducted from `totalPay`.\n"},"totalPay":{"type":"number","format":"double","description":"Final amount paid to the merchant in the selected period after all adjustments."},"totalFee":{"type":"number","format":"double","description":"Sum of all fees (including taxes) charged to the merchant."}}}}}}
```

## The MerchantPayment object

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"components":{"schemas":{"MerchantPayment":{"type":"object","properties":{"id":{"type":"integer","description":"Merchant payment identifier."},"paymentDate":{"type":"string","format":"date","description":"Date when this payment was settled (`YYYY-MM-DD`)."},"saleAmount":{"type":"number","format":"double","description":"Sum of all orders paid in this payment."},"adjustment":{"type":"number","format":"double","description":"Sum of all adjustments applied to this payment."},"feeAmount":{"type":"number","format":"double","description":"Sum of fees including tax (`feeNoTax + tax`)."},"payAmount":{"type":"number","format":"double","description":"Amount paid before adjustments (`saleAmount - feeAmount`)."},"finalAmount":{"type":"number","format":"double","description":"Final amount paid after adjustments (`payAmount - adjustment`)."},"status":{"type":"string","description":"Status of the merchant payment.","enum":["PROGRESS","PAID"]},"loans":{"type":"integer","description":"Number of loans included in this payment."},"adjustments":{"type":"integer","description":"Number of adjustments applied to this payment."},"current":{"type":"string","description":"Currency code (e.g. `MXN`). Note the field name is `current`, not `currency`."},"statusInvoice":{"type":"string","description":"Invoice status.","enum":["PENDING","INVOICED","INVOICED_EXCLUDED","ERROR"]},"statusReceipt":{"type":"string","description":"Receipt status."},"invoicePdfUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the fee invoice PDF."},"invoiceXmlUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the fee invoice XML (CFDI)."},"receiptPdfUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the payment receipt PDF."}}}}}}
```

## The Loan object

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"components":{"schemas":{"Loan":{"type":"object","properties":{"id":{"type":"integer","description":"Aplazo loan/transaction ID."},"creationDate":{"type":"string","format":"date-time","description":"ISO-8601 timestamp when the loan was created."},"salesAmount":{"type":"number","format":"double","description":"Amount the user paid for this order."},"feePct":{"type":"number","format":"double","description":"Fee percentage charged on this loan."},"feeMerchantPct":{"type":"number","format":"double","description":"Fee amount before fixed ops fee (`salesAmount * feePct`)."},"feeOps":{"type":"number","format":"double","description":"Fixed operations fee charged per transaction."},"feeMerchant":{"type":"number","format":"double","description":"Total merchant fee before tax (`feeMerchantPct + feeOps`)."},"feeTaxMerchantPct":{"type":"number","format":"double","description":"Tax percentage applied to the merchant fee."},"feeTaxMerchant":{"type":"number","format":"double","description":"Tax amount on the merchant fee (`feeMerchant * feeTaxMerchantPct`)."},"feeRevenue":{"type":"number","format":"double","description":"Total fee charged to the merchant including tax (`feeMerchant + feeTaxMerchant`)."},"payMerchantAmount":{"type":"number","format":"double","description":"Amount paid to the merchant for this loan (`salesAmount - feeRevenue`)."},"status":{"type":"string","description":"Loan approval status."},"statusPayment":{"type":"string","description":"Settlement status of the underlying payment.","enum":["PROGRESS","PAID"]},"cartId":{"type":"string","description":"Merchant-side cart/order identifier."},"branch":{"type":"string","nullable":true,"description":"Merchant branch identifier (when provided by the merchant)."},"totalProducts":{"type":"integer","description":"Number of products in the loan."}}}}}}
```

## The Adjustment object

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"components":{"schemas":{"Adjustment":{"type":"object","properties":{"id":{"type":"integer"},"merchantId":{"type":"integer"},"merchantPaymentId":{"type":"integer","description":"Merchant payment to which this adjustment was applied."},"loanId":{"type":"integer","nullable":true,"description":"Loan associated with the adjustment, when applicable."},"status":{"type":"string","enum":["PROGRESS","PAID"]},"type":{"type":"string","enum":["RETURN","MERCHANT_POSITIVE","MERCHANT_NEGATIVE"]},"comment":{"type":"string","nullable":true},"created":{"type":"string","format":"date-time"},"refundId":{"type":"integer","nullable":true,"description":"Refund identifier when `type=RETURN`."},"amount":{"type":"number","format":"double"}}}}}}
```

## The Pageable object

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"components":{"schemas":{"Pageable":{"type":"object","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"sort":{"type":"array","items":{"type":"object"}},"offset":{"type":"integer"},"paged":{"type":"boolean"},"unpaged":{"type":"boolean"}}}}}}
```

## The PageMeta object

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"components":{"schemas":{"PageMeta":{"type":"object","properties":{"last":{"type":"boolean"},"first":{"type":"boolean"},"empty":{"type":"boolean"},"size":{"type":"integer"},"number":{"type":"integer"},"numberOfElements":{"type":"integer"},"totalPages":{"type":"integer"},"totalElements":{"type":"integer"},"pageable":{"$ref":"#/components/schemas/Pageable"},"sort":{"type":"array","items":{"type":"object"}}}},"Pageable":{"type":"object","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"sort":{"type":"array","items":{"type":"object"}},"offset":{"type":"integer"},"paged":{"type":"boolean"},"unpaged":{"type":"boolean"}}}}}}
```

## The MerchantPaymentPage object

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"components":{"schemas":{"MerchantPaymentPage":{"allOf":[{"$ref":"#/components/schemas/PageMeta"},{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/MerchantPayment"}}}}]},"PageMeta":{"type":"object","properties":{"last":{"type":"boolean"},"first":{"type":"boolean"},"empty":{"type":"boolean"},"size":{"type":"integer"},"number":{"type":"integer"},"numberOfElements":{"type":"integer"},"totalPages":{"type":"integer"},"totalElements":{"type":"integer"},"pageable":{"$ref":"#/components/schemas/Pageable"},"sort":{"type":"array","items":{"type":"object"}}}},"Pageable":{"type":"object","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"sort":{"type":"array","items":{"type":"object"}},"offset":{"type":"integer"},"paged":{"type":"boolean"},"unpaged":{"type":"boolean"}}},"MerchantPayment":{"type":"object","properties":{"id":{"type":"integer","description":"Merchant payment identifier."},"paymentDate":{"type":"string","format":"date","description":"Date when this payment was settled (`YYYY-MM-DD`)."},"saleAmount":{"type":"number","format":"double","description":"Sum of all orders paid in this payment."},"adjustment":{"type":"number","format":"double","description":"Sum of all adjustments applied to this payment."},"feeAmount":{"type":"number","format":"double","description":"Sum of fees including tax (`feeNoTax + tax`)."},"payAmount":{"type":"number","format":"double","description":"Amount paid before adjustments (`saleAmount - feeAmount`)."},"finalAmount":{"type":"number","format":"double","description":"Final amount paid after adjustments (`payAmount - adjustment`)."},"status":{"type":"string","description":"Status of the merchant payment.","enum":["PROGRESS","PAID"]},"loans":{"type":"integer","description":"Number of loans included in this payment."},"adjustments":{"type":"integer","description":"Number of adjustments applied to this payment."},"current":{"type":"string","description":"Currency code (e.g. `MXN`). Note the field name is `current`, not `currency`."},"statusInvoice":{"type":"string","description":"Invoice status.","enum":["PENDING","INVOICED","INVOICED_EXCLUDED","ERROR"]},"statusReceipt":{"type":"string","description":"Receipt status."},"invoicePdfUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the fee invoice PDF."},"invoiceXmlUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the fee invoice XML (CFDI)."},"receiptPdfUrl":{"type":"string","format":"uri","nullable":true,"description":"Pre-signed S3 URL to download the payment receipt PDF."}}}}}}
```

## The LoanPage object

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"components":{"schemas":{"LoanPage":{"allOf":[{"$ref":"#/components/schemas/PageMeta"},{"type":"object","properties":{"loans":{"type":"array","description":"Loans for this payment. Note this collection is named `loans`\ninstead of the usual Spring `content`.\n","items":{"$ref":"#/components/schemas/Loan"}}}}]},"PageMeta":{"type":"object","properties":{"last":{"type":"boolean"},"first":{"type":"boolean"},"empty":{"type":"boolean"},"size":{"type":"integer"},"number":{"type":"integer"},"numberOfElements":{"type":"integer"},"totalPages":{"type":"integer"},"totalElements":{"type":"integer"},"pageable":{"$ref":"#/components/schemas/Pageable"},"sort":{"type":"array","items":{"type":"object"}}}},"Pageable":{"type":"object","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"sort":{"type":"array","items":{"type":"object"}},"offset":{"type":"integer"},"paged":{"type":"boolean"},"unpaged":{"type":"boolean"}}},"Loan":{"type":"object","properties":{"id":{"type":"integer","description":"Aplazo loan/transaction ID."},"creationDate":{"type":"string","format":"date-time","description":"ISO-8601 timestamp when the loan was created."},"salesAmount":{"type":"number","format":"double","description":"Amount the user paid for this order."},"feePct":{"type":"number","format":"double","description":"Fee percentage charged on this loan."},"feeMerchantPct":{"type":"number","format":"double","description":"Fee amount before fixed ops fee (`salesAmount * feePct`)."},"feeOps":{"type":"number","format":"double","description":"Fixed operations fee charged per transaction."},"feeMerchant":{"type":"number","format":"double","description":"Total merchant fee before tax (`feeMerchantPct + feeOps`)."},"feeTaxMerchantPct":{"type":"number","format":"double","description":"Tax percentage applied to the merchant fee."},"feeTaxMerchant":{"type":"number","format":"double","description":"Tax amount on the merchant fee (`feeMerchant * feeTaxMerchantPct`)."},"feeRevenue":{"type":"number","format":"double","description":"Total fee charged to the merchant including tax (`feeMerchant + feeTaxMerchant`)."},"payMerchantAmount":{"type":"number","format":"double","description":"Amount paid to the merchant for this loan (`salesAmount - feeRevenue`)."},"status":{"type":"string","description":"Loan approval status."},"statusPayment":{"type":"string","description":"Settlement status of the underlying payment.","enum":["PROGRESS","PAID"]},"cartId":{"type":"string","description":"Merchant-side cart/order identifier."},"branch":{"type":"string","nullable":true,"description":"Merchant branch identifier (when provided by the merchant)."},"totalProducts":{"type":"integer","description":"Number of products in the loan."}}}}}}
```

## The AdjustmentPage object

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Settlement API","version":"1.0.0"},"components":{"schemas":{"AdjustmentPage":{"allOf":[{"$ref":"#/components/schemas/PageMeta"},{"type":"object","properties":{"adjustments":{"type":"array","description":"Adjustments for this payment. Note this collection is named\n`adjustments` instead of the usual Spring `content`.\n","items":{"$ref":"#/components/schemas/Adjustment"}}}}]},"PageMeta":{"type":"object","properties":{"last":{"type":"boolean"},"first":{"type":"boolean"},"empty":{"type":"boolean"},"size":{"type":"integer"},"number":{"type":"integer"},"numberOfElements":{"type":"integer"},"totalPages":{"type":"integer"},"totalElements":{"type":"integer"},"pageable":{"$ref":"#/components/schemas/Pageable"},"sort":{"type":"array","items":{"type":"object"}}}},"Pageable":{"type":"object","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"sort":{"type":"array","items":{"type":"object"}},"offset":{"type":"integer"},"paged":{"type":"boolean"},"unpaged":{"type":"boolean"}}},"Adjustment":{"type":"object","properties":{"id":{"type":"integer"},"merchantId":{"type":"integer"},"merchantPaymentId":{"type":"integer","description":"Merchant payment to which this adjustment was applied."},"loanId":{"type":"integer","nullable":true,"description":"Loan associated with the adjustment, when applicable."},"status":{"type":"string","enum":["PROGRESS","PAID"]},"type":{"type":"string","enum":["RETURN","MERCHANT_POSITIVE","MERCHANT_NEGATIVE"]},"comment":{"type":"string","nullable":true},"created":{"type":"string","format":"date-time"},"refundId":{"type":"integer","nullable":true,"description":"Refund identifier when `type=RETURN`."},"amount":{"type":"number","format":"double"}}}}}}
```
