Menu

Manage your payments

APMs v1
Last updated May 2022

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": {
    "paypal:refund": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/refunds/full/eyJrIjoiazNhYjYzMiJ9"
    },
    "paypal:partialRefund": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/refunds/partials/I5s6cjh6XLbzuHiw5xRULjPPVKjYX-41ztBmQNIa9-k"
    },
    "paypal:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/I5s6zFXLbzCw5xRULjPPVKjYX-41ztBmQNj4Ia9-k"
    },
    "curies": [
      {
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "name": "paypal",
        "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": {
    "paypal:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/eyJrIjoiazNhYjYzMiJ9"
    },
    "curies": [
      {
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "name": "paypal",
        "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": {
    "paypal:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/eyJrIjoiazNhYjYzMiJ9"
    },
    "curies": [
      {
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "name": "paypal",
        "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": {
    "paypal:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/I5s6c2zFXLbq70IhCw5xRULjPPVKjYX-NTj4Ia9-k"
    },
    "curies": [
      {
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "name": "paypal",
        "templated": true
      }
    ]
  }
}