Menu

Manage your payments

APMs v1
Last updated January 2023

Query

Make a GET request on the paypal:events action link.

Note: No request body is needed for this request.

Query example request

GET https://try.access.worldpay.com/payments/alternative/action/paypal/events/eyJrIjoiazNhYjYzMiJ9

Query response for event sentForSettlement

You receive:

  • an HTTP code 200
  • the lastEvent for your query request
  • links torefundyour payment
  • links topartial refundyour payment

Example response:

Copied!
{
  "lastEvent": "sentForSettlement",
  "_links": {
    "action:refund": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/refunds/full/eyJrIjoiazNhYjYzMiJ9"
    },
    "action:partialRefund": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/refunds/partials/I5s6cjh6XLbzuHiw5xRULjPPVKjYX-41ztBmQNIa9-k"
    },
    "action:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/I5s6zFXLbzCw5xRULjPPVKjYX-41ztBmQNj4Ia9-k"
    },
    "curies": [
      {
        "name": "action",
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "templated": true
      }
    ]
  }
}

Query response for events other than sentForSettlement

You receive:

  • an HTTP code 200
  • the lastEvent for your query request
  • links toqueryyour payment

Example response:

Copied!
{
  "lastEvent": "|authorized|sentForRefund|refundFailed|refused|error|captureFailed",
  "_links": {
    "action:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/eyJrIjoiazNhYjYzMiJ9"
    },
    "curies": [
      {
        "name": "action",
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "templated": true
      }
    ]
  }
}

Refund

To refund a payment the latest status must be sentForSettlement.

POST your request to the paypal:refund action link.

Note: No request body is needed for this request.

Refund example request

POST https://try.access.worldpay.com/payments/alternative/action/paypal/refunds/full/eyJrIjoiazNhYjYzMiJ9

Refund responses

You receive:

  • an HTTP code 202
  • links toqueryyour payment

Example response:

Copied!
{
  "_links": {
    "action:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/eyJrIjoiazNhYjYzMiJ9"
    },
    "curies": [
      {
        "name": "action",
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "templated": true
      }
    ]
  }
}

Possible outcomes

  • sentForRefund - The refund has been accepted.
  • refundFailed - The refund was not successful.
  • sentForSettlement - Query the payment again later. The refund might already be in process.

Partial refund

Partial refund request

Send the amount to partial refund and the authorization currency in the body.

Partial refund example request

POST https://try.access.worldpay.com/payments/alternative/action/paypal/refunds/partials/I5s6cjh6XLbzuHiw5xRULjPPVKjYX-41ztBmQNIa9-k

Partial refund request body:

Copied!
{
  "value": {
    "amount": 100,
    "currency": "GBP"
  },
  "reference": "partial-refund-reference"
}

Description of your partial refund request parameters

ParameterRequiredDescription
value.amountAn identifier for the amount being used.
value.currencyAn identifier for the currency being used.
referenceA unique reference generated by you to identify the partial refund.

Partial refund response

You receive:

  • an HTTP code 202
  • links toqueryyour payment

Example response:

Copied!
{
  "_links": {
    "action:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/I5s6c2zFXLbq70IhCw5xRULjPPVKjYX-NTj4Ia9-k"
    },
    "curies": [
      {
        "name": "action",
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "templated": true
      }
    ]
  }
}