Adyen · Arazzo Workflow

Adyen Create Payment Link and Expire It

Version 1.0.0

Create a Pay by Link payment link then expire it when no longer needed.

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

Provider

adyen

Workflows

payment-link-create-and-expire
Create a payment link and then expire it by id.
Creates a Pay by Link payment link and, when it is active, updates its status to expired so it can no longer be used by a shopper.
2 steps inputs: amount, countryCode, merchantAccount, reference outputs: linkId, status
1
createLink
post-paymentLinks
Create a Pay by Link payment link for the supplied amount and reference, returning a link id and an active status.
2
expireLink
patch-paymentLinks-linkId
Update the payment link status to expired using its id so it can no longer be used to complete a payment.

Source API Descriptions

Arazzo Workflow Specification

adyen-payment-link-create-and-expire-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Adyen Create Payment Link and Expire It
  summary: Create a Pay by Link payment link then expire it when no longer needed.
  description: >-
    A payment link can be invalidated before a shopper uses it by setting its
    status to expired. This workflow creates a payment link, confirms it is
    active, and then patches its status to expired using the returned link id.
    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-link-create-and-expire
  summary: Create a payment link and then expire it by id.
  description: >-
    Creates a Pay by Link payment link and, when it is active, updates its
    status to expired so it can no longer be used by a shopper.
  inputs:
    type: object
    required:
    - merchantAccount
    - amount
    - reference
    - countryCode
    properties:
      merchantAccount:
        type: string
        description: The merchant account identifier that processes the link.
      amount:
        type: object
        description: The amount object with currency and value (minor units).
      reference:
        type: string
        description: Your unique reference for the payment link.
      countryCode:
        type: string
        description: The shopper country code (e.g. NL).
  steps:
  - stepId: createLink
    description: >-
      Create a Pay by Link payment link for the supplied amount and reference,
      returning a link id and an active status.
    operationId: post-paymentLinks
    requestBody:
      contentType: application/json
      payload:
        merchantAccount: $inputs.merchantAccount
        amount: $inputs.amount
        reference: $inputs.reference
        countryCode: $inputs.countryCode
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      linkId: $response.body#/id
      status: $response.body#/status
    onSuccess:
    - name: linkActive
      type: goto
      stepId: expireLink
      criteria:
      - context: $response.body
        condition: $.status == "active"
        type: jsonpath
  - stepId: expireLink
    description: >-
      Update the payment link status to expired using its id so it can no longer
      be used to complete a payment.
    operationId: patch-paymentLinks-linkId
    parameters:
    - name: linkId
      in: path
      value: $steps.createLink.outputs.linkId
    requestBody:
      contentType: application/json
      payload:
        status: expired
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      status: $response.body#/status
  outputs:
    linkId: $steps.createLink.outputs.linkId
    status: $steps.expireLink.outputs.status