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

# Create a payment

<Note> At least one of `customerId` or `email` is required. </Note>

### About `providerId` and `iban`

* To pre-select a bank for your customer, include `providerId`.
* To skip the payment form entirely and navigate the customer straight to their bank's payment form, include the `iban` parameter.
* If you include both parameters but the `iban` does not match the `providerId` bank, your customer will still be prompted for their IBAN on the payment form (with the bank pre-selected).


## OpenAPI

````yaml POST /api/payments
openapi: 3.0.1
info:
  title: Rocka Payments
  version: 1.0.0
  description: ''
  contact:
    email: support@rocka.live
servers:
  - url: https://api.stage.rocka.live
    description: Sandbox
  - url: https://api.rocka.live
    description: Live
security: []
paths:
  /api/payments:
    post:
      tags:
        - Open banking payments
      summary: Create a payment
      operationId: Payment_PaymentUrl
      requestBody:
        required: true
        content:
          application/*+json:
            schema:
              $ref: '#/components/schemas/Request_Payment'
            examples:
              EUR payment:
                value:
                  amount: 1.24
                  currency: EUR
                  customerId: CID-012456789-1
                  description: Order 1234-DS-1234
                  shopId: d0c3ccd9-162c-497e-808b-e769aea89c58
                  paymentId: 119318-123-test-1423
                  returnUrl: https://example.com/returnUrl
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  id:
                    type: string
                    description: The payment's ID.
                  url:
                    type: string
                    description: The link to the payment.
                type: object
                x-internal: false
              examples:
                EUR payment:
                  value:
                    id: 31739456-be7a-4ed5-bb47-1076247235c7
                    url: >-
                      https://checkout.rocka.live/?id=31739456-be7a-4ed5-bb47-1076247235c7&token=v4.local.8f-oWexxulzmRG4lriUJ1IZuKJsV_kBd9WDufvxBlYMiJZ1-losr11ZY0mDsO_sUFOfY8KLTsFd4Xig9vSxGXfU-Su0o05pcJTJs3f0V4sWjB8nCST3VrBnLUcoIxh8v9XuZnF6tylaK7qJCEr6f2dqMzphJxPaUBNEu1EcxgyEexbU3foC3j6IfJs4vZEvTgaCeqxOu1NYKjptr1ACDQB_fBymZyINyNKfWdEDMUdT-3YJpAkuiDW7y0eeaD-bH6_Q7VHw7KyiTIET3JBUf94uZSNXqcpOkuHJ_dkZGFnExF8FzWoHNev8GHVPXMeygyANlfbrBfcQG8iF3nolXSp_VaFkhmeStRS0kQ05XSofVS6OOO6WGvpdGELXF9FVgMka_m3S4TyQVMYpJK42U4tzsXpMwOjg70eW_TQ&country=EU&info_isNew=true
                    qrCode: null
                    token: >-
                      v4.local.8f-oWexxulzmRG4lriUJ1IZuKJsV_kBd9WDufvxBlYMiJZ1-losr11ZY0mDsO_sUFOfY8KLTsFd4Xig9vSxGXfU-Su0o05pcJTJs3f0V4sWjB8nCST3VrBnLUcoIxh8v9XuZnF6tylaK7qJCEr6f2dqMzphJxPaUBNEu1EcxgyEexbU3foC3j6IfJs4vZEvTgaCeqxOu1NYKjptr1ACDQB_fBymZyINyNKfWdEDMUdT-3YJpAkuiDW7y0eeaD-bH6_Q7VHw7KyiTIET3JBUf94uZSNXqcpOkuHJ_dkZGFnExF8FzWoHNev8GHVPXMeygyANlfbrBfcQG8iF3nolXSp_VaFkhmeStRS0kQ05XSofVS6OOO6WGvpdGELXF9FVgMka_m3S4TyQVMYpJK42U4tzsXpMwOjg70eW_TQ
                    threeDsData: null
                    status: New
          description: ''
        '400':
          description: One of the required parameters is missing or has an incorrect value.
      security:
        - APIkey: []
components:
  schemas:
    Request_Payment:
      title: Request_Payment
      description: Either `customerId` or `email` must be provided. Both may be included.
      anyOf:
        - $ref: '#/components/schemas/Request_Payment_WithCustomerId'
        - $ref: '#/components/schemas/Request_Payment_WithEmail'
      x-examples:
        EUR payment:
          value:
            amount: 1
            currency: EUR
            returnUrl: https://soundflare.com/order/20039471/complete
            webhookUrl: https://api.soundflare.com/order/20039471/complete
            shopId: d0c3ccd9-162c-497e-808b-e769aea89c58
            description: Membership on SoundFlare
            paymentId: '20039471'
            customerId: 2145-a1223
    Request_Payment_WithCustomerId:
      title: With customerId
      allOf:
        - $ref: '#/components/schemas/Request_Payment_Base'
        - type: object
          required:
            - customerId
    Request_Payment_WithEmail:
      title: With email
      allOf:
        - $ref: '#/components/schemas/Request_Payment_Base'
        - type: object
          required:
            - email
    Request_Payment_Base:
      type: object
      title: Request Payment
      description: Information for the new payment creation.
      properties:
        amount:
          format: decimal
          type: number
          description: Payment amount in decimal format (e.g. 999.99).
        currency:
          type: string
          description: 'Payment currency. Currently accepted: EUR.'
          enum:
            - EUR
        returnUrl:
          type: string
          description: The URL the customer is redirected to once the payment is completed.
        paymentId:
          type: string
          description: Order identifier in your records.
        webhookUrl:
          type: string
          description: Rocka will send payment status updates to this URL.
        shopId:
          type: string
          description: >-
            Your website's identifier in Rocka's records. This parameter is
            useful if you have more than one website.
        description:
          type: string
          description: Short payment description for the customer.
        customerId:
          type: string
          description: Customer's unique identifier in your records.
        email:
          type: string
          description: Customer's email address.
        iin:
          type: string
          description: >-
            The first 6 digits of the customer's bank card number. If you
            include this parameter, the customer's bank and country will be
            pre-selected for them on the payment form.
        providerId:
          type: string
          description: >-
            If you include this parameter, the bank will be pre-selected for
            your customer on the payment form. With most banks, your customer
            will be prompted for their IBAN. To skip the payment form entirely,
            add the `iban` parameter.
        ipAddress:
          type: string
          description: Customer's IP Address.
        iban:
          type: string
          description: >-
            Customer's IBAN. If you include this parameter, the payment will be
            initiated directly through the customer’s bank, skipping Rocka’s
            payment form entirely.
        merchantBankReference:
          type: string
          example: 864abc4d12648 IN
          description: Bank reference for this payment, with a space.
      required:
        - amount
        - currency
        - description
        - returnUrl
        - paymentId
  securitySchemes:
    APIkey:
      description: >-
        To get your own API keys, go to the **Integration** tab in your [Rocka
        Hub](https://hub.rocka.live).
      in: header
      name: x-api-key
      type: apiKey

````