Get a charge
United States
Canada
The Get a charge endpoint retrieves details of an existing charge previously created using the Create a charge endpoint. To return a charge, use the charge identifier (chargeId
) that was returned from the create a charge request. a ChargeId
is also returned when a charge is first created or if it is refunded.
Request example
The following is a sample request when issuing the Get a charge endpoint:
curl --request GET \
--url 'https://scl-sandbox.dev.clover.com/v1/charges/6CK2MJSF87X2M' \
--header 'Accept: application/json'\
Path parameter
The following table describes the path parameter to use with the Get a charge endpoint:
Object | Type | Description |
---|---|---|
chargeId | string | Required. Universally unique identifier (UUID) of the charge you want to retrieve. |
Query parameter
The following table describes the query parameter to use when using the Get a charge endpoint:
Object | Type | Description |
---|---|---|
expand | array of strings | Indicates the fields to display in response to expanding the fields. |
Response example
The following is a sample response when running Get a charge endpoint:
{
"object": "list",
"url": "/v1/charges",
"data": [
{
"id": "1AB2CDEF34G5H",
"amount": 214,
"currency": "usd",
"created": 123456789123,
"captured": false,
"ref_num": 987654321,
"auth_code": "123456",
"order": A1BCDD3EF4JKL,
"outcome": {
"network_status": "approved_by_network",
"type": "authorized"
},
"paid": true,
"status": "succeeded",
"source": {
"id": "clv_1AAAAAAbCdefJK2l3MnoPQ4r",
"brand": "DISCOVER",
"first6": “123456,
"last4": “4321”
},
"amount_captured": 214
}
Responses
The following table describes the possible responses when running the Get a charge endpoint:
Message | Description | Variable | Description |
---|---|---|---|
200 | string | Returns the charge object with any captured value set to true . | |
400 Bad Request | string | charge | Returns when a card-related error occurs. Indicates the unique ID of the failed charge. |
400 Bad Request | string | code | Returns additional information about the error that you can use to provide user-friendly handling of the issue. |
400 Bad Request | string | decline_code | Returns when a card issuer declined the transaction. Includes the reason for the decline if specified by the card issuer. |
400 Bad Request | string | doc_url | Returns a link for more information about the reported error code. |
400 Bad Request | string | message | Provides detailed information about the error code. For card-related errors, use this information to inform users. |
400 Bad Request | string | param | If the error is related to a specific parameter, this value lists the parameter. You can inform users of a particular issue in the entered card information. |
400 Bad Request | string | type | Returned error type: - api_connection_error - api_error - authentication_error - card_error - idempotency_error - invalid_request_error - rate_limit_error |
Updated 12 months ago
Related topics