> For the complete documentation index, see [llms.txt](https://docs.coda.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coda.co/codapay/direct-api-integration/direct-api-integration-for-cards/get-charge-data.md).

# Get charge data

### Pre-requisite

When integrating with Codapay's API, ensure you adhere to the following standards:

1. Use HTTPS protocol.
2. TLS 1.2 or higher

### Reference

<table><thead><tr><th width="180">Environment</th><th>Endpoint Base URL</th></tr></thead><tbody><tr><td>Sandbox</td><td><a href="https://tc-api-card-sandbox.codapayments.com/v1/direct/charges">https://tc-api-card-sandbox.codapayments.com/v1/</a></td></tr><tr><td>Production</td><td><a href="https://api-tc.codapayments.com/v1/direct/charges">https://api-tc.codapayments.com/v1/</a></td></tr></tbody></table>

#### Endpoint

<mark style="color:green;">**GET**</mark>**&#x20;{Base URL}/direct/charges/{charge\_id}**&#x20;

#### Current Environment Availability

<table><thead><tr><th width="227">Environment</th><th>Is Available?</th></tr></thead><tbody><tr><td>Sandbox</td><td>Yes</td></tr><tr><td>Production</td><td>Yes</td></tr></tbody></table>

{% hint style="info" %}
Codapay's APIs support REST web services. By default, the endpoints displayed are RESTful.&#x20;
{% endhint %}

### Request Parameters

| Parameter Name | Data Type | Description                      | Constraint                | Is Required? |
| -------------- | --------- | -------------------------------- | ------------------------- | ------------ |
| charge\_id     | String    | Unique identifier for the charge | Must be a valid charge ID | Yes          |

### Response Parameters

The response contains the charge object.

| Parameter Name     | Data Type   | Description                                                                                                                                                                                                   |
| ------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                 | String      | Coda’s unique identifier for the charge                                                                                                                                                                       |
| created\_at        | String      | Timestamp of when the charge was created                                                                                                                                                                      |
| status\_code       | String      | Status of the charge. See the full list of possible statuses [here](https://docs.google.com/document/d/1XA9FRZ0ndMm8HHiTmweSKgM_wahoA8wTURBjPEup0yQ/edit#heading=h.qjs24a3vpkce).                             |
| error\_code        | String      | The error code for which the charge has failed. See the full list of possibilities [here](https://docs.google.com/document/d/1XA9FRZ0ndMm8HHiTmweSKgM_wahoA8wTURBjPEup0yQ/edit#heading=h.g4tfgjuz7a4q).       |
| error\_description | String      | The error description for which the charge has failed. See the full list of possibilities [here](https://docs.google.com/document/d/1XA9FRZ0ndMm8HHiTmweSKgM_wahoA8wTURBjPEup0yQ/edit#heading=h.g4tfgjuz7a4q) |
| finalized\_at      | String      | Timestamp of when the charge was finalized                                                                                                                                                                    |
| item\_code         | String      | item code                                                                                                                                                                                                     |
| item\_name         | String      | Item name                                                                                                                                                                                                     |
| amount\_value      | String      | Amount of total price                                                                                                                                                                                         |
| amount\_currency   | String      | Amount Currency                                                                                                                                                                                               |
| partner\_reference | String      | Unique identifier for the partner's charge                                                                                                                                                                    |
| shopper\_agent     | JSON Object | A JSON object that contains the shopper’s browser details                                                                                                                                                     |
| setting            | JSON Object | A JSON object that contains setting details ( ie partner\_webhook\_url)                                                                                                                                       |
| payment\_method    | JSON Object | A JSON Object that contains payment method details                                                                                                                                                            |
| shopper\_action    | JSON Object | A JSON object that contains next action for shopper                                                                                                                                                           |

**shopper\_agent**

| Parameter Name | Data Type | Description                   |
| -------------- | --------- | ----------------------------- |
| ip\_address    | String    | The IP address of the shopper |
| user\_agent    | String    | User-agent of the shopper     |
| timezone       | String    | Timezone of shopper           |
| screen\_height | String    | Height of screen shopper      |
| screen\_width  | String    | Width of screen shopper       |
| colour\_depth  | String    | Color depth of screen shopper |
| accept\_header | String    | Accept header of shopper      |

**setting**

| Parameter Name        | Data Type   | Description                                                            |
| --------------------- | ----------- | ---------------------------------------------------------------------- |
| default\_language     | String      | Preferred language                                                     |
| partner\_webhook\_url | String      | URL for charge notifications (authorization and capture)               |
| card                  | JSON Object | A JSON object that contains card setting details (ie 3DS, capture ack) |

**setting -> card**

| Parameter Name               | Data Type | Description                                                                                  |
| ---------------------------- | --------- | -------------------------------------------------------------------------------------------- |
| pre\_capture\_ack\_url       | String    | URL to send the charge capture request                                                       |
| capture\_grace\_period       | Integer   | The time period for sending the capture request is in seconds. By default, this is to set 0. |
| 3ds\_challenge\_window\_size | String    | Size of the 3D Secure challenge window                                                       |

**payment\_method**

| Parameter Name | Data Type   | Description                                      |
| -------------- | ----------- | ------------------------------------------------ |
| id             | String      | Id of payment method                             |
| created\_at    | String      | Timestamp of when the payment method was created |
| type           | String      | Type of payment method                           |
| card           | JSON Object | The information on card detail                   |
| shopper        | JSON Object | Shopper objects that contain shopper details     |

**payment\_method -> shopper**

| Parameter Name | Data Type   | Description                               |
| -------------- | ----------- | ----------------------------------------- |
| id             | String      | A unique id of shopper                    |
| created\_at    | String      | Timestamp of when the shopper was created |
| status\_code   | JSON Object | A status of shopper                       |
| email          | String      | email of shopper                          |
| zip\_code      | String      | zip code of the shopper                   |

**payment\_method -> card**

| Parameter Name    | Data Type | Description                                     |
| ----------------- | --------- | ----------------------------------------------- |
| id                | String    | A unique ID of card                             |
| created\_at       | String    | Timestamp of when the card was created          |
| country\_code     | String    | Must be a valid ISO 3166-1 alpha-2 country code |
| holder\_name      | String    | The card holder name                            |
| last\_four        | String    | The last 4 digits of card number                |
| expiration\_month | String    | Expire month of card                            |
| expiration\_year  | String    | Expire year of card                             |

**shopper\_action**

| Parameter Name | Data Type   | Description                          |
| -------------- | ----------- | ------------------------------------ |
| id             | String      | A unique id of shopper action        |
| type           | String      | A type that shoppers was action with |
| form           | JSON Object | An object that contains form details |

**shopper\_action -> form**

| Parameter Name | Data Type     | Description                             |
| -------------- | ------------- | --------------------------------------- |
| id             | String        | A unique id of form                     |
| method         | String        | A method that requires to submit        |
| action         | String        | A URL that the partner has to submit to |
| inputs         | List of Input | Details that are required to submit     |

**shopper\_action -> form -> inputs -> item**

| Parameter Name | Data Type | Description                 |
| -------------- | --------- | --------------------------- |
| name           | String    | The name of the input value |
| value          | String    | The value of the field      |
| type           | String    | The type of the value       |


---

# 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.coda.co/codapay/direct-api-integration/direct-api-integration-for-cards/get-charge-data.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.
