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

# Settlement report Cybersource mapping

<Warning>This integration is currently in beta and the exact mapping of fields might still change.</Warning>

Below is the mapping of Cybersource's report to the settlement report. This data is pulled from the Cybersource's [Payment Batch Detail report](https://developer.cybersource.com/docs/cybs/en-us/reporting/user/all/ebc/reporting-ug/c_Reports_Available_in_the_Business_Center/c_Payment_Batch_Detail.html).

<Note>
  Cybersource's reconciliation is done via Payment Batch Detail reports which
  lack fee information and chargeback reporting. It's therefore not possible
  to use the settlement report for full end to end reconciliation between
  Cybersource and a bank statement. It does allow for insights in which
  transactions have been sent for settlement or refunded.
</Note>

| Settlement report                               | Cybersource field? | Cybersource report                                                                                  |
| :---------------------------------------------- | :----------------- | :-------------------------------------------------------------------------------------------------- |
| `payment_service_transaction_reconciliation_id` | Yes                | `Request.MerchantReferenceNumber` (only when `ics_bill` in `Application.Name`)                      |
| `transaction_id`                                | No                 | -                                                                                                   |
| `payment_service_transaction_id`                | Yes                | `Request.LinkToRequest`                                                                             |
| `payment_service_id`                            | No                 | -                                                                                                   |
| `payment_service_definition_id`                 | No                 | -                                                                                                   |
| `payment_service_display_name`                  | No                 | -                                                                                                   |
| `journal_type`                                  | Yes                | Check journal type mapping table below                                                              |
| `raw_journal_type`                              | Yes                | `Application.Name`                                                                                  |
| `payment_service_transaction_created_at`        | Yes                | Always `null`                                                                                       |
| `posted_at`                                     | Yes                | `Batch.BatchDate`                                                                                   |
| `processing_amount_plain`                       | Yes                | `PaymentData.RequestedAmount`                                                                       |
| `processing_currency`                           | Yes                | `PaymentData.RequestedAmountCurrencyCode`                                                           |
| `exchange_rate`                                 | Yes                | Always `null`                                                                                       |
| `currency`                                      | Yes                | `PaymentData.CurrencyCode`                                                                          |
| `gross_credit_plain`                            | Yes                | `PaymentData.Amount` (only when `ics_bill` in `Application.Name`)                                   |
| `net_credit_plain`                              | Yes                | `PaymentData.Amount` (only when `ics_bill` in `Application.Name`)                                   |
| `gross_debit_plain`                             | Yes                | `(-1) * PaymentData.Amount` (only when `ics_credit` in `Application.Name`)                          |
| `net_debit_plain`                               | Yes                | `(-1) * PaymentData.Amount` (only when `ics_credit` in `Application.Name`)                          |
| `fee_markup_plain`                              | Yes                | Always `null`                                                                                       |
| `fee_interchange_plain`                         | Yes                | Always `null`                                                                                       |
| `fee_scheme_plain`                              | Yes                | Always `null`                                                                                       |
| `fee_total_plain`                               | Yes                | Always `0`                                                                                          |
| `method`                                        | Yes                | Standardized value of `raw_method`                                                                  |
| `raw_method`                                    | Yes                | `PaymentMethod.Type` or `PaymentMethod.WalletType` depending on what was used to calculate `method` |
| `scheme`                                        | Yes                | Standardized value of `raw_scheme`                                                                  |
| `raw_scheme`                                    | Yes                | `PaymentMethod.CardType`                                                                            |
| `batch`                                         | Yes                | `Batch.BatchID`                                                                                     |
| `report_id`                                     | No                 | -                                                                                                   |
| `raw_report_ids`                                | No                 | -                                                                                                   |
| `ingested_at`                                   | No                 | -                                                                                                   |
| `description`                                   | Yes                | Always `null`                                                                                       |
| `transaction_external_identifier`               | No                 | -                                                                                                   |
| `transaction_metadata`                          | No                 | -                                                                                                   |
| `report_payment_service_id`                     | No                 | -                                                                                                   |
| `report_payment_service_definition_id`          | No                 | -                                                                                                   |
| `report_payment_service_display_name`           | No                 | -                                                                                                   |
| `payment_service_modification_reference`        | Yes                | `Request.RequestID`                                                                                 |
| `payment_service_refund_reconciliation_id`      | Yes                | Always `null`                                                                                       |

### Notes

* The `posted_at` value provided is only an approximation, as the `Payment Batch Detail` report does not report this value.
* The `method` value is calculated from `PaymentMethod.WalletType` if it is not null. Otherwise, `PaymentMethod.Type` is used.

### Journal type mapping

| Cybersource raw journal type | Journal type |
| :--------------------------- | :----------- |
| `ics_bill`                   | `settlement` |
| `ics_credit`                 | `refund`     |

<Note>
  Fields marked as not a **Cybersource field** are populated from internal data and not
  from the imported payment service report.
</Note>
