Adyen · Arazzo Workflow

Adyen Classic Authorise and Refund

Version 1.0.0

Authorise a payment with the classic Payment API then refund it.

1 workflow 1 source API 1 provider
View Spec View on GitHub PaymentsFinancial ServicesFintechArazzoWorkflows

Provider

adyen

Workflows

authorise-and-refund
Authorise a classic payment and refund it by original reference.
Authorises a payment and, when the result code is Authorised, refunds the supplied amount using the PSP reference from the authorisation as the original reference.
2 steps inputs: amount, card, merchantAccount, modificationAmount, reference outputs: authPspReference, refundPspReference, response
1
authorise
post-authorise
Authorise the payment with the supplied card and amount to obtain a PSP reference and result code.
2
refund
post-refund
Refund the supplied amount using the PSP reference from the authorisation as the original reference.

Source API Descriptions

Arazzo Workflow Specification

adyen-classic-authorise-and-refund-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Adyen Classic Authorise and Refund
  summary: Authorise a payment with the classic Payment API then refund it.
  description: >-
    This workflow authorises a payment with the classic PAL Payment API,
    confirms the result is Authorised, and then refunds the supplied amount
    using the authorisation PSP reference as the original reference. Refund
    applies once the payment has been captured. Every step spells out its
    request inline so the flow can be read and executed without opening the
    underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: paymentsApi
  url: ../openapi/payments-openapi-original.yml
  type: openapi
workflows:
- workflowId: authorise-and-refund
  summary: Authorise a classic payment and refund it by original reference.
  description: >-
    Authorises a payment and, when the result code is Authorised, refunds the
    supplied amount using the PSP reference from the authorisation as the
    original reference.
  inputs:
    type: object
    required:
    - merchantAccount
    - amount
    - reference
    - card
    - modificationAmount
    properties:
      merchantAccount:
        type: string
        description: The merchant account identifier that processes the payment.
      amount:
        type: object
        description: The authorisation amount object with currency and value.
      reference:
        type: string
        description: Your unique reference for the payment.
      card:
        type: object
        description: The card details object (number, expiryMonth, expiryYear, cvc, holderName).
      modificationAmount:
        type: object
        description: The amount object to refund (currency and value in minor units).
  steps:
  - stepId: authorise
    description: >-
      Authorise the payment with the supplied card and amount to obtain a PSP
      reference and result code.
    operationId: post-authorise
    requestBody:
      contentType: application/json
      payload:
        merchantAccount: $inputs.merchantAccount
        amount: $inputs.amount
        reference: $inputs.reference
        card: $inputs.card
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      pspReference: $response.body#/pspReference
      resultCode: $response.body#/resultCode
    onSuccess:
    - name: authorised
      type: goto
      stepId: refund
      criteria:
      - context: $response.body
        condition: $.resultCode == "Authorised"
        type: jsonpath
  - stepId: refund
    description: >-
      Refund the supplied amount using the PSP reference from the authorisation
      as the original reference.
    operationId: post-refund
    requestBody:
      contentType: application/json
      payload:
        merchantAccount: $inputs.merchantAccount
        modificationAmount: $inputs.modificationAmount
        originalReference: $steps.authorise.outputs.pspReference
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      refundPspReference: $response.body#/pspReference
      response: $response.body#/response
  outputs:
    authPspReference: $steps.authorise.outputs.pspReference
    refundPspReference: $steps.refund.outputs.refundPspReference
    response: $steps.refund.outputs.response