For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update a payment authorization

How to update an existing payment authorization via API

To update an existing payment authorization, send a PATCH request to the /api/2026-05/payment_authorizations/:id endpoint, where id is the ID of the resource that you want to update.

Here below the list of all the possible arguments that you can pass with the request body.

Request

PATCH https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/:id

Arguments

Body Parameter
Type
Required

type

string

Required

id

string

Required

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

attributes._payment_details

object

Optional

Example

The following request updates the payment authorization identified by the ID "XAyRWNUzyN":

curl -g -X PATCH \
  'https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "payment_authorizations",
    "id": "xYZkjABcde",
    "attributes": {
      "reference": "ANY-EXTERNAL-REFEFERNCE"
    }
  }
}'

On success, the API responds with a 200 OK status code, returning the updated resource object:

{
  "data": {
    "id": "XAyRWNUzyN",
    "type": "payment_authorizations",
    "links": {
      "self": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN"
    },
    "attributes": {
      "type": "payment_authorization",
      "status": "draft",
      "payment_type": "MANUAL",
      "token": "xxxx-yyyy-zzzz",
      "currency_code": "EUR",
      "amount_cents": 1000,
      "amount_float": 10.0,
      "formatted_amount": "€10,00",
      "request_data": {},
      "response_data": {},
      "options": {
        "cancellation_reason": "fraudulent"
      },
      "requires_action_at": "2018-01-01T12:00:00.000Z",
      "processing_at": "2018-01-01T12:00:00.000Z",
      "succeeded_at": "2018-01-01T12:00:00.000Z",
      "declined_at": "2018-01-01T12:00:00.000Z",
      "failed_at": "2018-01-01T12:00:00.000Z",
      "canceled_at": "2018-01-01T12:00:00.000Z",
      "expired_at": "2018-01-01T12:00:00.000Z",
      "created_at": "2018-01-01T12:00:00.000Z",
      "updated_at": "2018-01-01T12:00:00.000Z",
      "reference": "ANY-EXTERNAL-REFEFERNCE",
      "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
      "metadata": {
        "foo": "bar"
      },
      "capture_balance_cents": 1000,
      "capture_balance_float": 10.0,
      "formatted_capture_balance": "€10,00",
      "void_balance_cents": 1500,
      "void_balance_float": 15.0,
      "formatted_void_balance": "€15,00",
      "next_action_type": "challenge",
      "next_action_data": {}
    },
    "relationships": {
      "payment_session": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/relationships/payment_session",
          "related": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/payment_session"
        }
      },
      "order": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/relationships/order",
          "related": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/order"
        }
      },
      "payment_setting": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/relationships/payment_setting",
          "related": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/payment_setting"
        }
      },
      "attachments": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/relationships/attachments",
          "related": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/attachments"
        }
      },
      "events": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/relationships/events",
          "related": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/events"
        }
      },
      "event_stores": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/relationships/event_stores",
          "related": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/event_stores"
        }
      },
      "payment_void": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/relationships/payment_void",
          "related": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/payment_void"
        }
      },
      "payment_captures": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/relationships/payment_captures",
          "related": "https://yourdomain.commercelayer.io/api/2026-05/payment_authorizations/XAyRWNUzyN/payment_captures"
        }
      }
    },
    "meta": {
      "created_with_version": "2026-05"
    }
  },
  "meta": {
    "trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74",
    "api_versions": [
      "2026-05"
    ]
  }
}

Last updated