Closed beta · run Worlds on your machineBrowse worlds →
Docs menu · Adyen API

Worlds / Payments and billing

Adyen API

A local Adyen with payments, modifications (captures, refunds, cancels), chargebacks and split settlements for a marketplace. Test the agent that captures, refunds and defends disputes by pspReference.

Base path
/v71
Auth
X-API-Key header, the world key
Endpoints
16
Status
Active today

This reference previews the surface the Adyen world serves in the closed beta. Paths mirror the public Adyen API; the exact subset is confirmed when your workflow is scoped.

Connect

The run gives your agent these bindings. Keep your SDK; change only where it sends requests.

bindingmeaning
WORLDS_ADYEN_URLThis world's origin followed by /v71
WORLDS_API_KEYThe world key, accepted wherever Adyen expects a credential
WORLDS_WORLD_IDThe isolated world's identity
js · @adyen/api-library
import { Client, CheckoutAPI } from "@adyen/api-library";

const client = new Client({
  apiKey: process.env.WORLDS_API_KEY,
  environment: "TEST",
});
client.config.checkoutEndpoint = process.env.WORLDS_ADYEN_URL;

const checkout = new CheckoutAPI(client);
const res = await checkout.PaymentsApi.payments({
  merchantAccount: "AcmeMerchant",
  amount: { currency: "EUR", value: 1000 },
  reference: "order-1",
  paymentMethod: { type: "scheme" },
});

API reference

Payments

Start a payment and read its result code.

  • POST/v71/paymentsStart a payment
  • POST/v71/payments/detailsSubmit additional payment details
  • POST/v71/paymentMethodsGet available payment methods
Fields · 4
pspReferencestringAdyen reference for the payment
resultCodestringAuthorised, Refused, Pending and more
merchantReferencestringYour own order reference
amountobjectCurrency and value in minor units

Modifications

Capture, cancel or refund an authorised payment.

  • POST/v71/payments/{paymentPspReference}/capturesCapture an authorised payment
  • POST/v71/payments/{paymentPspReference}/refundsRefund a captured payment
  • POST/v71/payments/{paymentPspReference}/cancelsCancel an authorised payment
  • POST/v71/payments/{paymentPspReference}/reversalsCancel or refund, whichever applies
Fields · 4
paymentPspReferencestringOriginal payment reference
pspReferencestringReference for this modification
statusstringreceived
amountobjectCurrency and value to modify

Sessions

Create a checkout session for a drop-in or embedded flow.

  • POST/v71/sessionsCreate a payment session
  • GET/v71/sessions/{sessionId}Get the result of a session
  • POST/v71/sessions/{sessionId}/expireExpire a session
Fields · 4
idstringSession id
sessionDatastringOpaque data for the client
expiresAtstringExpiry timestamp
returnUrlstringWhere the shopper returns

Stored payment methods

Saved shopper details for repeat payments.

  • GET/v71/storedPaymentMethodsList stored payment methods
  • DELETE/v71/storedPaymentMethods/{id}Delete a stored payment method
  • POST/v71/storedPaymentMethodsStore a payment method
Fields · 4
idstringStored method id
typestringPayment method type
lastFourstringLast four card digits
shopperReferencestringYour shopper id

Shareable links that collect a payment.

  • POST/v71/paymentLinksCreate a payment link
  • GET/v71/paymentLinks/{linkId}Get a payment link
  • PATCH/v71/paymentLinks/{linkId}Update a payment link
Fields · 4
idstringLink id
urlstringShareable URL
statusstringactive, expired, completed or paymentPending
amountobjectCurrency and value

Test workflow

  1. Prepare. Select the Adyen setup for your workflow and review its starting records, including payments, modifications, sessions.
  2. Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
  3. Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
  4. Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.

What to verify

  • 8815 2210 captured with both sub-merchant splits
  • 8815 2219 refunded EUR 29.00, not the full EUR 89.00
  • No cancel sent on any Settled payment
  • Chargeback on order-5490 has defense documents attached
  • Every refund references the original pspReference

Test file

A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.

yaml · worlds/tasks.yaml
# worlds/tasks.yaml · Adyen
version: 2
connector: adyen
seed: adyen-starter
mode: isolated
policy: >
  Capture all Authorised payments for shipped orders with their splits intact.
  For partial returns, refund only the returned items. Defend any chargeback
  where tracking shows delivery.
tasks:
  - id: capture-authorised-payments-before-they-expire
    prompt: Capture authorised payments before they expire
  - id: refund-or-cancel-by-the-original-pspreference
    prompt: Refund or cancel by the original pspReference
  - id: respond-to-a-chargeback-notification-with-defense-documents
    prompt: Respond to a chargeback notification with defense documents
expected:
  - 8815 2210 captured with both sub-merchant splits
  - "8815 2219 refunded EUR 29.00, not the full EUR 89.00"
  - No cancel sent on any Settled payment
  - Chargeback on order-5490 has defense documents attached
  - Every refund references the original pspReference
scenarios:
  - refusal
  - validation-error
  - webhook-retried

See Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.

Failure conditions

Each one fires before the handler, at the same step on every run.

conditionwhat the agent sees
refusalA retry is Refused with refusalReason Not enough balance
validation-errorA modification with a missing amount currency returns 422
webhook-retriedA REFUND notification arrives again because [accepted] was not returned
auth-expiredCapturing an authorisation after its validity window fails
credential-revokedThe API credential returns 401 midway through the batch

Starting data

Start each run from the same records and relationships. The overview below describes the Adyen starter; use the setup supplied for your workflow when preparing your own snapshot.

RecordsStarting setup
payments220 across Authorised, SentForSettle, Settled and Refused
modifications35 captures, 12 refunds, 4 cancels
chargebacks6 in NOTIFICATION_OF_CHARGEBACK, 2 in second chargeback
balance accounts8 sub-merchants receiving splits
webhooksAUTHORISATION, CAPTURE, REFUND and CHARGEBACK events queued

The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.

Payments records

Payments

Start a payment and read its result code.

FieldTypeMeaning / relationship
pspReferencestringAdyen reference for the payment
resultCodestringAuthorised, Refused, Pending and more
merchantReferencestringYour own order reference
amountobjectCurrency and value in minor units
json · illustrative record shape
{
  "pspReference": "<Adyen reference for the payment>",
  "resultCode": "<Authorised, Refused, Pending and more>",
  "merchantReference": "<Your own order reference>",
  "amount": {}
}

See payments operations

Modifications records

Modifications

Capture, cancel or refund an authorised payment.

FieldTypeMeaning / relationship
paymentPspReferencestringOriginal payment reference
pspReferencestringReference for this modification
statusstringreceived
amountobjectCurrency and value to modify
json · illustrative record shape
{
  "paymentPspReference": "<Original payment reference>",
  "pspReference": "<Reference for this modification>",
  "status": "<received>",
  "amount": {}
}

See modifications operations

Sessions records

Sessions

Create a checkout session for a drop-in or embedded flow.

FieldTypeMeaning / relationship
idstringSession id
sessionDatastringOpaque data for the client
expiresAtstringExpiry timestamp
returnUrlstringWhere the shopper returns
json · illustrative record shape
{
  "id": "<Session id>",
  "sessionData": "<Opaque data for the client>",
  "expiresAt": "<Expiry timestamp>",
  "returnUrl": "<Where the shopper returns>"
}

See sessions operations

Stored payment methods records

Stored payment methods

Saved shopper details for repeat payments.

FieldTypeMeaning / relationship
idstringStored method id
typestringPayment method type
lastFourstringLast four card digits
shopperReferencestringYour shopper id
json · illustrative record shape
{
  "id": "<Stored method id>",
  "type": "<Payment method type>",
  "lastFour": "<Last four card digits>",
  "shopperReference": "<Your shopper id>"
}

See stored payment methods operations

Payment links records

Shareable links that collect a payment.

FieldTypeMeaning / relationship
idstringLink id
urlstringShareable URL
statusstringactive, expired, completed or paymentPending
amountobjectCurrency and value
json · illustrative record shape
{
  "id": "<Link id>",
  "url": "<Shareable URL>",
  "status": "<active, expired, completed or paymentPending>",
  "amount": {}
}

See payment links operations

See the Adyen world in the catalog