---
title: "Finishes a transaction."
url: "https://developer-qual.migros.ch/apis/central-pricing-facade-1/versions/bff861d9-5d8f-4383-8066-4b36e581bb7f/operations/finishtransaction"
---

> Full API specification: https://developer-qual.migros.ch/apis/central-pricing-facade-1/versions/bff861d9-5d8f-4383-8066-4b36e581bb7f.md

# Finishes a transaction.

`POST` `/migros/sales/central-pricing/v1/{store}/transactions/{transaction}/finish`

Operation ID: `finishtransaction`

Business errors are documented at <a href="https://wiki.migros.net/x/Gb6cGw">https://wiki.migros.net/x/Gb6cGw</a>.

## Path parameters

- `store` (string, required) - Store which the calculation is based on
- `transaction` (string, required) - Transaction ID to finish

## Request body (required)

Content types: `application/json`

## Responses

- `200` - Successful calculation result
- `400` - Invalid data given

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Central Pricing Facade
  version: 1.3.3.7
servers:
  - description: URL of upstream
    url: https://api-qual.migros.ch
paths:
  /migros/sales/central-pricing/v1/{store}/transactions/{transaction}/finish:
    post:
      description: Business errors are documented at <a
        href="https://wiki.migros.net/x/Gb6cGw">https://wiki.migros.net/x/Gb6cGw</a>.
      operationId: finishtransaction
      parameters:
        - description: Store which the calculation is based on
          example: "0023200"
          in: path
          name: store
          required: true
          schema:
            type: string
        - description: Transaction ID to finish
          example: 5oj548c9afa59304c0eb0b7f18b77c9c
          in: path
          name: transaction
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Finish"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Transaction"
          description: Successful calculation result
        "400":
          $ref: "#/components/responses/400"
      summary: Finishes a transaction.
      tags:
        - central-pricing-facade
security:
  - Kong-Api-Key: []
components:
  schemas:
    Finish:
      additionalProperties: false
      description: Request body for finsihing a transaction.
      properties:
        amount:
          description: Total amount of the payment.
          example: 100.8
          format: float
          type: number
        ep2:
          description: Details of EP2 payment.
          nullable: true
          oneOf:
            - $ref: "#/components/schemas/EP2"
        gift_cards:
          description: List of used gift cards.
          items:
            $ref: "#/components/schemas/GiftCard"
          type: array
        gkk:
          description: Details of Gkk payment (Grosskundenkarte).
          nullable: true
          oneOf:
            - $ref: "#/components/schemas/Gkk"
        loyalty_system_actions:
          description: List of loyalty system actions.
          items:
            $ref: "#/components/schemas/LoyaltySystemAction"
          type: array
      required:
        - amount
      type: object
    Transaction:
      additionalProperties: false
      description: Response for finished transaction.
      properties:
        status_code:
          description: Status code if there was an error.
          nullable: true
          type: string
        transaction_id:
          description: ID of the transaction used for finishing it.
          example: 5oj548c9afa59304c0eb0b7f18b77c9c
          type: string
      required:
        - transaction_id
      type: object
    EP2:
      additionalProperties: false
      description: Information about EP2 payment.
      properties:
        activation_sequence_id:
          description: Activation sequence counter (ep2Actseqcnt).
          example: "584"
          type: string
        amount:
          description: Amount payed with cad.
          example: 50.2
          format: float
          type: number
        application_id:
          description: Application ID (ep2Aid).
          example: A0000000041010
          type: string
        authorization_code:
          description: Authorization code (ep2Authc).
          example: "046333"
          type: string
        brand:
          description: Tender name, e.g. MasterCard.
          example: MasterCard
          type: string
        encrypted_primary_account_number:
          description: Encrypted credit card number (ep2Apppanenc).
          example: E9876C899FFBF4CC22602FFAE60D20B5
          minLength: 8
          nullable: true
          type: string
        encrypted_primary_account_number_index:
          description: Index for encrypted credit card number (ap2Apppanencind).
          example: ep2Apppanencind
          nullable: true
          type: string
        issuer_code:
          example: "2"
          nullable: true
          pattern: ^[0-9]+$
          type: string
        masked_primary_account_number:
          description: Masked credit card number (ep2Pan).
          example: xxxxxxx1234
          maxLength: 19
          minLength: 8
          type: string
        terminal_id:
          description: Terminal ID.
          example: "31392368"
          nullable: true
          type: string
        transaction:
          $ref: "#/components/schemas/EP2TransactionDetails"
      required:
        - amount
        - transaction
        - brand
        - masked_primary_account_number
        - activation_sequence_id
        - application_id
        - authorization_code
      type: object
    GiftCard:
      additionalProperties: false
      description: Details of a payment with a gift card.
      properties:
        amount:
          description: Amount used for payment with this card.
          example: 30.35
          exclusiveMinimum: true
          format: float
          minimum: 0
          type: number
        number:
          example: "778300001911860030"
          type: string
        transaction:
          $ref: "#/components/schemas/GiftCardTransaction"
      required:
        - number
        - amount
        - transaction
      type: object
    Gkk:
      additionalProperties: false
      description: Information about Gkk payment.
      properties:
        amount:
          description: Amount payed with Gkk card.
          example: 50.2
          format: float
          type: number
      required:
        - amount
      type: object
    LoyaltySystemAction:
      additionalProperties: false
      description: Details of an action of the Loyalty System.
      properties:
        action:
          example: none
          type: string
        barcode:
          example: "778400001234567813"
          type: string
        coupon_id:
          example: "123123123"
          type: string
        coupon_type:
          example: UCB
          type: string
        cumulus_number:
          example: "2099123123123"
          maxLength: 40
          minLength: 10
          type: string
        loyalty_product:
          $ref: "#/components/schemas/LoyaltyProductDetails"
        loyalty_system:
          $ref: "#/components/schemas/LoyaltySystemDetails"
      required:
        - cumulus_number
        - coupon_id
        - coupon_type
        - barcode
        - action
        - loyalty_system
        - loyalty_product
      type: object
    problem:
      description: Problem Details for HTTP APIs defined by RFC 7807
      properties:
        detail:
          example: More details
          type: string
        status:
          example: 400
          type: integer
        title:
          example: Test error
          type: string
        validation-errors:
          items:
            properties:
              constraint:
                example: minLength
                type: string
              message:
                example: Example error
                type: string
              pointer:
                example: /prop1/0
                type: string
              property:
                example: prop1[0]
                type: string
            required:
              - property
              - pointer
              - message
              - constraint
            type: object
          minItems: 1
          type: array
      required:
        - status
        - title
      title: Problem Details
      type: object
    EP2TransactionDetails:
      additionalProperties: false
      description: Details of an EP2 transaction.
      properties:
        amount:
          description: Transaction amount (ep2Trxamount).
          example: 50.2
          format: float
          type: number
        date:
          description: Transaction date time (ep2Trxdatetime).
          format: date-time
          type: string
        reference_number:
          description: Transaction reference number (ep2Trxrefnum).
          example: "00007987"
          nullable: true
          type: string
        sequence_number:
          description: Transaction sequence number (ep2Trxseqcnt).
          example: "7987"
          nullable: true
          type: string
        type_extension:
          description: Transaction type extension (ep2Trxtypeextn).
          example: Buchung
          nullable: true
          type: string
      required:
        - amount
        - date
      type: object
    GiftCardTransaction:
      additionalProperties: false
      description: Details of a transaction for a gift card.
      properties:
        id:
          example: "1044426921"
          type: string
        product_id:
          example: "939100100000"
          type: string
        uuid:
          example: "95640107100102403603679079134482"
          type: string
      required:
        - uuid
        - id
        - product_id
      type: object
    LoyaltyProductDetails:
      additionalProperties: false
      description: Details about the product of the Loyalty System.
      properties:
        expiration_date:
          format: date-time
          nullable: true
          type: string
        status:
          enum:
            - charged
            - redeemed
          example: charged
          type: string
      required:
        - status
      type: object
    LoyaltySystemDetails:
      additionalProperties: false
      description: Details about the Loyalty System communication.
      properties:
        date:
          format: date-time
          type: string
        online:
          example: true
          type: boolean
        status:
          enum:
            - OK
            - NOK
          example: OK
          type: string
        uuid:
          example: "68471892100106106113111269117711"
          type: string
      required:
        - status
        - online
        - date
        - uuid
      type: object
  responses:
    "400":
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/problem"
      description: Invalid data given
  securitySchemes:
    Kong-Api-Key:
      description: Kong key-auth authentication
      in: header
      name: X-Api-Key
      type: apiKey
```
