> For the complete documentation index, see [llms.txt](https://docs.commercelayer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.commercelayer.io/how-tos/placing-orders/payments/checkout.com/getting-the-payment-details.md).

# Getting the payment details

## Problem

Your customer has submitted credit card information to Checkout.com and has already authenticated through 3DS upon the authorization process. You now need to collect the details of the authorization which are used to update the payment.

## Solution

To fetch the details of the payment, send a `PATCH` request to the `/api/checkout_com_payments/:id` endpoint, setting the `_details` attribute to `true` and passing the `session_id` parameter you've got from the [3DS page](broken://pages/-MZCk3tJjDzHdF_XD7jN#3d-secure-authentication). You can check the output of the authorization in the `payment_response` attribute of the response.

### Example

{% tabs %}
{% tab title="Request" %}
The following request updates the Checkout.com payment source identified by the "emdEKhoOMA" ID to get the authorization details from Checkout.com:

```javascript
curl -g -X PATCH \
  'http://yourdomain.commercelayer.io/api/checkout_com_payments/emdEKhoOMA' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "checkout_payments",
    "id": "emdEKhoOMA",
    "attributes": {
      "_details": true,
      "session_id": "sid_y3oqhf46pyzuxjbcn2giaqnb44"
    }
  }
}'
```

{% endtab %}

{% tab title="Response" %}
On success, the API responds with a `200 OK` status code, returning the updated Adyen payment object:

```javascript
{
  "data": {
    "id": "emdEKhoOMA",
    "type": "checkout_com_payments",
    "links": {
      "self": "https://yourdomain.commercelayer.io/api/checkout_com_payments/emdEKhoOMA"
    },
    "attributes": {
      "payment_type": "token",
      "token": "tok_ubfj2q76miwundwlk72vxt2i7q",
      "session_id": "sid_y3oqhf46pyzuxjbcn2giaqnb44",
      "source_id": "src_n5uaa7fr6mwe5nkwmbn244gmhy",
      "customer_token": "cus_pb4u3cqvs36e7p4snxukfhxfrq",
      "redirect_uri": "https://3ds2-sandbox.ckotech.co/interceptor/3ds_plbzo3odshuevkh3bh4tjocl74",
      "payment_response": {
        "3ds": {...},
        "_links": {...},
        "actions": [
          {...}
        ],
        "amount": 17,
        "approved": true,
        "billing_descriptor": {...},
        "currency": "GBP",
        "customer": {
          "id": "cus_6ylx5ay76wou3d4yocniv5qogy"
        },
        "eci": "05",
        "id": "pay_y3oqhf46pyzuxjbcn2giaqnb44",
        "payment_type": "Regular",
        "reference": "ORD-090857",
        "requested_on": "2021-02-15T14:52:39Z",
        "risk": {
          "flagged": false
        },
        "scheme_id": "440925750609151",
        "source": {...},
        "status": "Authorized"
      },
      "payment_instrument":{...},
      "created_at": "2018-01-01T12:00:00.000Z",
      "updated_at": "2018-01-01T12:00:00.000Z",
      "reference": null,
      "reference_origin": null,
      "metadata": {}
    },
    "relationships": {
      "order": {
        "links": {...}
      }
    },
    "meta": {
      "mode": "test",
      "organization_id": "Hi8jJkKlLm",
      "trace_id": "0d3e6f9a2b5c8d1e4f7a0b3c6d9e2f5a8b1c4d7e0f3a6b9c2d5e8f1a4b7c0d3e6"
    }
  },
  "meta": {
    "mode": "test",
    "organization_id": "Hi8jJkKlLm",
    "trace_id": "0d3e6f9a2b5c8d1e4f7a0b3c6d9e2f5a8b1c4d7e0f3a6b9c2d5e8f1a4b7c0d3e6"
  }
}
```

{% endtab %}
{% endtabs %}

## More to read

See our documentation if you need more information on how to [update a Checkout.com payment](https://docs.commercelayer.io/developers/v/api-reference/checkout_com_payments/update). See our Checkout guide for more details on how to place an order.

{% content-ref url="/pages/-LyDmx1SH-gJp8DstXnO" %}
[Placing the order](/how-tos/placing-orders/checkout/placing-the-order.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.commercelayer.io/how-tos/placing-orders/payments/checkout.com/getting-the-payment-details.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
