# Settle an APM payment

Perform a settlement on authorized funds. Not all APMs support this, please check the links returned from querying a payment.

Endpoint: POST /apmPayments/{paymentId}/settlements
Version: 2024-07-01
Security: BasicAuth

## Security:

  - `BasicAuth` (unknown)
    http basic

## Path parameters:

  - `paymentId` (string, required)
    The identifier of the payment resource.

## Header parameters:

  - `Content-Type` (string, required)
    The content type of the request body.

  - `WP-Api-Version` (string, required)
    The API version.

## Request fields (application/json):

  - `value` (object, required)
    The value of the payment.

  - `value.currency` (string, required)
    The supported [ISO 4217 currency codes](/products/reference/supported-countries-currencies#iso-currency-codes).
    Enum: "AED", "AFN", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNH", "CNY", "COP", "CRC", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHP", "SLE", "SLL", "SOS", "SRD", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VES", "VND", "VUV", "WST", "XAF", "XCD", "XOF", "XPF", "YER", "ZAR", "ZMW"

  - `value.amount` (integer, required)
    The amount in the lowest denomination of the currency, e.g. pennies for GBP, cents for USD.
    Example: 1234

  - `reference` (string)

  - `shipping` (object)
    Shipping information for settlement requests.

  - `shipping.courier` (array, required)

  - `shipping.courier.trackingId` (string, required)
    If you are providing multiple entries, a 255 character total limit exists for the combined trackingId length.

  - `order` (object)
    Object that contains the complete list of lines relating to the transaction.

  - `order.items` (array, required)

  - `order.items.productCode` (string)
    Your customer facing product code, e.g. SKU (stock keeping unit) or similar.

  - `order.items.name` (string, required)
    Description or name of item, e.g. “mobile phone”.

  - `order.items.quantity` (number, required)
    Number of items being purchased.

  - `order.items.unitCost` (number, required)
    Cost for each unit of the item with tax included.

  - `order.items.totalTaxAmount` (number, required)
    How much of totalAmount is tax. If you need to work it out backwards the formula is: totalTaxAmount = totalAmount - (totalAmount / (1+(taxRate/10000))).

  - `order.items.totalAmount` (number, required)
    Sum of all chargeable elements on the line added together. Formula is: totalAmount = (unitCost x quantity) - totalDiscountAmount.

  - `order.items.productUrl` (string)
    Link to the product page that can later be embedded in communications between Klarna and your customer.

  - `order.items.imageUrl` (string)
    Link to the product image that can later be embedded in communications between Klarna and your customer.

Note: we recommend you submit this to improve the post-purchase customer experience.

  - `industryData` (object)
    An object containing industry-specific order data.

  - `industryData.type` (string, required)
    Industry type.
    Enum: "airline"

  - `industryData.agentCode` (string, required)
    The IATA travel agency code.

  - `industryData.agentName` (string, required)
    The name of the travel agent.

  - `industryData.airlineCode` (string, required)
    The two character IATA airline code.

  - `industryData.airlineName` (string, required)
    The name of the airline (displayed as it would be on a bill).

  - `industryData.passenger` (object, required)
    An object containing passenger details.

  - `industryData.passenger.code` (string, required)
    The passenger code.

  - `industryData.passenger.firstName` (string, required)
    The passenger’s first name.

  - `industryData.passenger.lastName` (string, required)
    The passenger’s last name.

  - `industryData.ticket` (object, required)
    An object containing ticket details.

  - `industryData.ticket.number` (string, required)
    The ticket number.

  - `industryData.ticket.restricted` (boolean, required)
    Ticket restriction flag.

  - `industryData.ticket.issueDate` (string, required)
    An object containing the ticket's issue date.

  - `industryData.ticket.issuerAddress` (object, required)
    An object containing the ticket issuer's address.

  - `industryData.ticket.issuerAddress.address1` (string, required)
    The first line of the issuer's address.

  - `industryData.ticket.issuerAddress.city` (string, required)
    The city of the issuer's address.

  - `industryData.ticket.issuerAddress.countryCode` (string, required)
    The country code of the issuer, must be a supported ISO 3166-1 alpha-2 country code.
    Enum: "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"

  - `industryData.ticket.issuerAddress.postalCode` (string, required)
    The postal code of the issuer's address.

  - `industryData.ticket.flightDetails` (array, required)
    Array of flight legs (up to four).

  - `industryData.ticket.flightDetails.carrierCode` (string, required)
    Airline code for specific leg.

  - `industryData.ticket.flightDetails.flightCode` (string, required)
    The flight code.

  - `industryData.ticket.flightDetails.stopOver` (boolean)
    Set to true if this flight leg is a stopover.

  - `industryData.ticket.flightDetails.departureAirport` (string, required)
    The three letter IATA Airport Code for the departure airport.

  - `industryData.ticket.flightDetails.arrivalAirport` (string, required)
    The three letter IATA Airport Code for the destination airport.

  - `industryData.ticket.flightDetails.departureDate` (string, required)
    Date of departure.

  - `industryData.ticket.flightDetails.fareClassCode` (string, required)
    The code used by airlines to identify a fare type.

  - `industryData.ticket.flightDetails.fareBasisCode` (string, required)
    An extension to the fareClassCode for custom codes.

  - `industryData.ticket.flightDetails.taxAmount` (integer, required)
    The tax amount for this specific flight leg.

  - `passthroughData` (string)
    Passthrough field representing [additional payment information](/products/apms/klarna#supplementary-purchase-data). We do not validate this field beyond checking length. Must contain escaped JSON ready for transmission.

## Request examples:

  - `Settlement` (unknown)

  - `Klarna settlement - retail` (unknown)

  - `Klarna settlement - passthrough data` (unknown)

  - `PayPal Airline Data settlement` (unknown)

## Response 202:

  - `202` (unknown)
    OK

## Response 202 fields (application/json):

  - `paymentId` (string)
    The identifier of the payment resource.

  - `commandId` (string)
    An action ID generated by us, identifying a single merchant interaction.
    Example: cmdYNdIHBPJwbkjLiykzTx0

  - `outcome` (string)
    The payment outcome.
    Enum: "authorized", "cancelFailed", "cancelled", "cancelRequested", "sentForSettlement", "sentForAuthorization", "settlementFailed", "chargebackReversed", "chargedBack", "disputeExpired", "disputeFundsHeld", "disputeFundsReleased", "disputeReserveReleased", "error", "expired", "disputeInformationRequested", "disputeInformationSupplied", "miscellaneous", "pending", "refunded", "refundExpired", "refundFailed", "refundReversed", "refused", "refusedByIssuer", "requestExpired", "sentForRefund", "settled", "settlementReversed", "cancelledByCustomer", "signedFormReceived", "unknown", "manuallyAmended"

  - `lastEvent` (string)
    Deprecated in favor of `outcome`.
    Enum: "authorized", "cancelFailed", "cancelled", "cancelRequested", "sentForSettlement", "sentForAuthorization", "settlementFailed", "chargebackReversed", "chargedBack", "disputeExpired", "disputeFundsHeld", "disputeFundsReleased", "disputeReserveReleased", "error", "expired", "disputeInformationRequested", "disputeInformationSupplied", "miscellaneous", "pending", "refunded", "refundExpired", "refundFailed", "refundReversed", "refused", "refusedByIssuer", "requestExpired", "sentForRefund", "settled", "settlementReversed", "cancelledByCustomer", "signedFormReceived", "unknown", "manuallyAmended"

  - `_links` (object)
    Links to resources related to the request.

  - `_links.self` (object)
    The URL you can invoke to fetch the last event for the payment.

  - `_links.self.href` (string)

  - `_actions` (object)

## Response 400:

  - `400` (unknown)
    Bad request.

## Response 400 fields (application/json):

  - `errorName` (string)

  - `message` (string)

  - `validationErrors` (array)

## Response 401:

  - `401` (unknown)
    Client is not authorized due to missing or invalid Authorization header.

## Response 401 fields (application/json):

  - `errorName` (string)

  - `message` (string)

## Response 404:

  - `404` (unknown)
    Payment resource not found.

## Response 404 fields (application/json):

  - `errorName` (string)

  - `message` (string)

  - `validationErrors` (array)

## Response 500:

  - `500` (unknown)
    A problem occurred processing the request on our side.

## Response 500 fields (application/json):

  - `errorName` (string)

  - `message` (string)

## Response 202 examples:

  - `Example` (unknown)

## Response 400 examples:

  - `Example` (unknown)

## Response 401 examples:

  - `Example` (unknown)

## Response 404 examples:

  - `Example` (unknown)

## Response 500 examples:

  - `Example` (unknown)

