arazzo: 1.0.1 info: title: Adyen Checkout Payment and Cancel summary: Authorise a card payment then cancel the authorisation. description: >- When an order can no longer be fulfilled before capture, the authorisation is cancelled to release the hold on the shopper's funds. This workflow makes a Checkout payment, confirms the authorisation, and cancels it against the returned PSP reference. 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: checkoutApi url: ../openapi/adyen-checkout-api-openapi.yml type: openapi workflows: - workflowId: payment-and-cancel summary: Authorise a Checkout payment and cancel it by PSP reference. description: >- Submits a payment and, once it is authorised, cancels the authorisation against the payment PSP reference before it is captured. inputs: type: object required: - merchantAccount - amount - reference - paymentMethod - returnUrl properties: merchantAccount: type: string description: The merchant account identifier that processes the payment. amount: type: object description: The payment amount object with currency and value. reference: type: string description: Your unique reference for the payment. paymentMethod: type: object description: The payment method details (e.g. type scheme with card data). returnUrl: type: string description: The URL the shopper is returned to after the payment. cancelReference: type: string description: Your unique reference for the cancellation request. steps: - stepId: makePayment description: >- Submit the payment to obtain an authorisation and a payment PSP reference that can later be cancelled. operationId: post-payments requestBody: contentType: application/json payload: merchantAccount: $inputs.merchantAccount amount: $inputs.amount reference: $inputs.reference paymentMethod: $inputs.paymentMethod returnUrl: $inputs.returnUrl successCriteria: - condition: $statusCode == 200 outputs: pspReference: $response.body#/pspReference resultCode: $response.body#/resultCode onSuccess: - name: authorised type: goto stepId: cancelPayment criteria: - context: $response.body condition: $.resultCode == "Authorised" type: jsonpath - stepId: cancelPayment description: >- Cancel the authorisation against the payment PSP reference, releasing the hold on the shopper's funds before capture. operationId: post-payments-paymentPspReference-cancels parameters: - name: paymentPspReference in: path value: $steps.makePayment.outputs.pspReference requestBody: contentType: application/json payload: merchantAccount: $inputs.merchantAccount reference: $inputs.cancelReference successCriteria: - condition: $statusCode == 201 outputs: cancelPspReference: $response.body#/pspReference status: $response.body#/status outputs: paymentPspReference: $steps.makePayment.outputs.pspReference cancelPspReference: $steps.cancelPayment.outputs.cancelPspReference status: $steps.cancelPayment.outputs.status