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

# Update a checkout

> Updates a checkout. Omitted fields are left unchanged, and checkout sessions already created keep the settings they were created with. Returns 400 if `settlementAccountId` or `shippingOptions` is sent for a TOP_UP checkout, or the settlement account is not APPROVED or is in another currency, and 404 if the checkout or settlement account is not on the account.



## OpenAPI

````yaml /autogenerated/openapi/roqqett.openapi.json patch /roqqett/checkouts/{checkoutId}
openapi: 3.1.0
info:
  title: Roqqett API
  version: 2.0.0
  description: Version 2
  license:
    name: UNLICENSED
    url: https://docs.equalsmoney.com
servers:
  - url: https://api.equalsmoney.com/v2
    description: Production
security: []
paths:
  /roqqett/checkouts/{checkoutId}:
    patch:
      tags:
        - Checkouts
      summary: Update a checkout
      description: >-
        Updates a checkout. Omitted fields are left unchanged, and checkout
        sessions already created keep the settings they were created with.
        Returns 400 if `settlementAccountId` or `shippingOptions` is sent for a
        TOP_UP checkout, or the settlement account is not APPROVED or is in
        another currency, and 404 if the checkout or settlement account is not
        on the account.
      operationId: updateCheckout
      parameters:
        - name: checkoutId
          in: path
          required: true
          schema:
            description: >-
              The ID of a checkout: the configured payment page a checkout
              session is taken on.
            type:
              - string
            format: uuid
            maxLength: 36
            example: 6f1c2d0e-7a4b-4e2f-9c1d-3b5a7e9f0a12
        - name: accountId
          in: query
          schema:
            description: The ID of the account to work with.
            type:
              - string
            example: F50091
          required: true
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type:
                - object
              properties:
                name:
                  type:
                    - string
                  minLength: 1
                  maxLength: 64
                  description: The merchant's name for the checkout. Never shown to payers.
                  example: Online shop
                status:
                  description: >-
                    Only an ACTIVE checkout can take new checkout sessions;
                    sessions already created can still complete. The merchant
                    switches between them.
                  type:
                    - string
                  enum:
                    - ACTIVE
                    - DEACTIVATED
                  example: ACTIVE
                returnUrl:
                  type:
                    - string
                  format: uri
                  maxLength: 2048
                  pattern: ^https:\/\/
                  description: >-
                    Where the payer is sent once a checkout session ends, unless
                    the session sets its own.
                  example: https://shop.example.com/checkout/complete
                locale:
                  type:
                    - string
                    - 'null'
                  pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|\d{3}))?$
                  description: Default locale for payer-facing screens. `null` clears it.
                  example: en-GB
                settlementAccountId:
                  type:
                    - string
                    - 'null'
                  format: uuid
                  maxLength: 36
                  description: >-
                    SHOPPING only. The APPROVED settlement account, in the
                    checkout's currency, that sessions pay into. `null` switches
                    to the default settlement account.
                  example: 5c8e2a1f-9d4b-4f7a-8e3c-1b6d0f2a9e64
                shippingOptions:
                  type:
                    - object
                  properties:
                    collectAddress:
                      type:
                        - boolean
                      description: >-
                        Whether the payer must give a shipping address during
                        checkout.
                    dynamicRatesUrl:
                      type:
                        - string
                      format: uri
                      maxLength: 2048
                      pattern: ^https:\/\/
                      description: >-
                        Set to fetch shipping rates from the merchant once the
                        payer gives an address. Requires `collectAddress`.
                      example: https://shop.example.com/shipping/rates
                  required:
                    - collectAddress
                  description: SHOPPING only. Replaces the shipping options as a whole.
              example:
                name: Online shop
                status: ACTIVE
                returnUrl: https://shop.example.com/checkout/complete
                locale: en-GB
                settlementAccountId: 5c8e2a1f-9d4b-4f7a-8e3c-1b6d0f2a9e64
                shippingOptions:
                  collectAddress: true
                  dynamicRatesUrl: https://shop.example.com/shipping/rates
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type:
                  - object
                properties:
                  id:
                    description: >-
                      The ID of a checkout: the configured payment page a
                      checkout session is taken on.
                    type:
                      - string
                    format: uuid
                    maxLength: 36
                    example: 6f1c2d0e-7a4b-4e2f-9c1d-3b5a7e9f0a12
                  type:
                    type:
                      - string
                    enum:
                      - SHOPPING
                      - TOP_UP
                    description: >-
                      The type of checkout session the checkout takes. Fixed at
                      creation.
                    example: SHOPPING
                  name:
                    type:
                      - string
                      - 'null'
                    minLength: 1
                    description: >-
                      The merchant's name for the checkout. Never shown to
                      payers. `null` when none was stored.
                    example: Online shop
                  status:
                    description: >-
                      Only an ACTIVE checkout can take new checkout sessions;
                      sessions already created can still complete. The merchant
                      switches between them.
                    type:
                      - string
                    enum:
                      - ACTIVE
                      - DEACTIVATED
                    example: ACTIVE
                  currencyCode:
                    type:
                      - string
                    enum:
                      - GBP
                      - EUR
                    description: >-
                      The currency the checkout takes payments in. Fixed at
                      creation.
                    example: GBP
                  settlementAccountId:
                    type:
                      - string
                      - 'null'
                    format: uuid
                    maxLength: 36
                    description: >-
                      The settlement account SHOPPING sessions pay into. `null`
                      uses the default settlement account; always `null` for
                      TOP_UP, whose sessions pay into a payee.
                    example: 5c8e2a1f-9d4b-4f7a-8e3c-1b6d0f2a9e64
                  shippingOptions:
                    type:
                      - object
                      - 'null'
                    properties:
                      collectAddress:
                        type:
                          - boolean
                        description: >-
                          Whether the payer must give a shipping address during
                          checkout.
                      dynamicRatesUrl:
                        type:
                          - string
                          - 'null'
                        format: uri
                        maxLength: 2048
                        pattern: ^https:\/\/
                        description: >-
                          Where Roqqett fetches shipping rates once the payer
                          gives an address. `null` when rates are not dynamic.
                        example: https://shop.example.com/shipping/rates
                    required:
                      - collectAddress
                      - dynamicRatesUrl
                    description: >-
                      Shipping collection for SHOPPING checkouts. Always `null`
                      for TOP_UP.
                  returnUrl:
                    type:
                      - string
                    format: uri
                    maxLength: 2048
                    pattern: ^https:\/\/
                    description: >-
                      Where the payer is sent once a checkout session ends,
                      unless the session sets its own.
                    example: https://shop.example.com/checkout/complete
                  locale:
                    type:
                      - string
                      - 'null'
                    pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|\d{3}))?$
                    description: >-
                      Default locale for payer-facing screens. A session's own
                      locale overrides it. `null` lets the payer's browser
                      decide, with en-GB as the final fallback.
                    example: en-GB
                  createdAt:
                    type:
                      - string
                    format: date-time
                    description: >-
                      The date the Resource was initially created. ISO 8601
                      format without milliseconds.
                  updatedAt:
                    type:
                      - string
                    format: date-time
                    description: >-
                      The date the Resource was last modified. ISO 8601 format
                      without milliseconds.
                required:
                  - id
                  - type
                  - name
                  - status
                  - currencyCode
                  - settlementAccountId
                  - shippingOptions
                  - returnUrl
                  - locale
                  - createdAt
                  - updatedAt
                example:
                  id: 6f1c2d0e-7a4b-4e2f-9c1d-3b5a7e9f0a12
                  type: SHOPPING
                  name: Online shop
                  status: ACTIVE
                  currencyCode: GBP
                  settlementAccountId: 5c8e2a1f-9d4b-4f7a-8e3c-1b6d0f2a9e64
                  shippingOptions:
                    collectAddress: true
                    dynamicRatesUrl: https://shop.example.com/shipping/rates
                  returnUrl: https://shop.example.com/checkout/complete
                  locale: en-GB
                  createdAt: '2019-08-24T14:15:22Z'
                  updatedAt: '2019-08-24T14:15:22Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type:
                  - object
                properties:
                  message:
                    type:
                      - string
                    maxLength: 1024
                    description: Human-readable error description.
                    example: Checkout session not found.
                  errors:
                    type:
                      - array
                    items:
                      type:
                        - object
                      properties:
                        path:
                          type:
                            - string
                          description: The location of the bad parameter.
                        message:
                          type:
                            - string
                          description: Description of why the validation failed.
                        errorCode:
                          type:
                            - string
                          description: Where the error occurred.
                      required:
                        - path
                        - message
                      description: An object containing details about one particular error.
                required:
                  - message
                  - errors
                example:
                  message: Checkout session not found.
                  errors:
                    - path: string
                      message: string
                      errorCode: string
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type:
                  - object
                properties:
                  message:
                    type:
                      - string
                    maxLength: 1024
                    description: Human-readable error description.
                    example: Checkout session not found.
                  errors:
                    type:
                      - array
                    items:
                      type:
                        - object
                      properties:
                        path:
                          type:
                            - string
                          description: The location of the bad parameter.
                        message:
                          type:
                            - string
                          description: Description of why the validation failed.
                        errorCode:
                          type:
                            - string
                          description: Where the error occurred.
                      required:
                        - path
                        - message
                      description: An object containing details about one particular error.
                required:
                  - message
                  - errors
                example:
                  message: Checkout session not found.
                  errors:
                    - path: string
                      message: string
                      errorCode: string
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type:
                  - object
                properties:
                  message:
                    type:
                      - string
                    maxLength: 1024
                    description: Human-readable error description.
                    example: Checkout session not found.
                  errors:
                    type:
                      - array
                    items:
                      type:
                        - object
                      properties:
                        path:
                          type:
                            - string
                          description: The location of the bad parameter.
                        message:
                          type:
                            - string
                          description: Description of why the validation failed.
                        errorCode:
                          type:
                            - string
                          description: Where the error occurred.
                      required:
                        - path
                        - message
                      description: An object containing details about one particular error.
                required:
                  - message
                  - errors
                example:
                  message: Checkout session not found.
                  errors:
                    - path: string
                      message: string
                      errorCode: string
      security:
        - CommonAuth:
            - roqqett:checkouts:update:any
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |-
            curl --request PATCH \
              --url 'https://api.equalsmoney.com/v2/roqqett/checkouts/{checkoutId}?accountId={{accountId}}' \
              --header 'Authorization: <api-key>' \
              --header 'Content-Type: application/json' \
              --data '
            {
              "name": "Online shop",
              "status": "ACTIVE",
              "returnUrl": "https://shop.example.com/checkout/complete",
              "locale": "en-GB",
              "settlementAccountId": "5c8e2a1f-9d4b-4f7a-8e3c-1b6d0f2a9e64",
              "shippingOptions": {
                "collectAddress": true,
                "dynamicRatesUrl": "https://shop.example.com/shipping/rates"
              }
            }
            '
components:
  securitySchemes:
    CommonAuth:
      type: apiKey
      in: header
      name: Authorization

````