latestOpenAPI 3.0.12026-08-101292701.1 MB

f21981db32be

Charges

Gets a charge by ID

Retrieves the details of a Charge by supplying its unique identifier.

get/charges/{id}

Path parameters

idstring required

Charge ID

Response

OK.

idstring

The unique identifier of the charge.

createdTimestring date-time

The time when the charge was created.

currencystring

A three-letter ISO 4217 currency code.

amountnumber double

An amount representing how much is to be to charged.

state'pending' | 'capturable' | 'processing' | 'complete' | 'cancelled' | 'failed'

The state of the charge.

orderIdstring

The identifier of the associated order.

sourceIdstring

The identifier of the source.

failureCodestring

Error code identifying reason for charge failure.

failureMessagestring

Error message describing reason for charge failure.

paymentSessionIdstring

Tracks the process of collecting a payment.

capturedboolean

Indicates if the charge has been captured.

refundedboolean

Indicates if the charge has been refunded.

type'customer_initiated' | 'merchant_initiated' | 'moto'

The type of charge.

liveModeboolean

Has the value <code>true</code> if the object exists in live mode and the value <code>false</code> if the object exists in test mode.

Example response

{
  "id": "a6809a63-e6a9-4016-abbc-f33d19fccb5b",
  "createdTime": "2018-04-25T20:36:00Z",
  "currency": "USD",
  "amount": 1180.26,
  "state": "pending",
  "orderId": "9986340012",
  "sourceId": "9986340012",
  "failureCode": "a failure code",
  "failureMessage": "a failure message",
  "paymentSessionId": "8cecaa32-f692-44cc-b103-4cf24dc93913",
  "cancels": [
    {
      "id": "a6809a63-e6a9-4016-abbc-f33d19fccb5b",
      "createdTime": "2018-04-25T20:36:00Z",
      "updatedTime": "2018-04-25T20:36:00Z",
      "amount": 1180.26,
      "state": "pending"
    }
  ],
  "captures": [
    {
      "id": "a6809a63-e6a9-4016-abbc-f33d19fccb5b",
      "createdTime": "2018-04-25T20:36:00Z",
      "updatedTime": "2018-04-25T20:36:00Z",
      "amount": 1180.26,
      "state": "pending"
    }
  ],
  "refunds": [
    {
      "id": "a6809a63-e6a9-4016-abbc-f33d19fccb5b",
      "createdTime": "2018-04-25T20:36:00Z",
      "updatedTime": "2018-04-25T20:36:00Z",
      "amount": 1180.26,
      "state": "pending"
    }
  ],
  "liveMode": true
}