The Charge object

To create credit card or other payment method, you create a Charge object.

If your API key is in test mode, the supplied payment source (for example, card) won’t actually be charged, although everything else will occur as if in live mode. (Digital River assumes that the charge would have completed successfully).

Attributes

Description

id string

Unique identifier of the charge.

createdTime datetime

The time when the charge was created.

currency string

Three-letter ISO currency code.

amount number

The amount that represents how much to charge. The minimum amount is $0.50 US or equivalent in charge currency.

state string

The status of the charge, one of pending, succeeded or failed.

customerId string

The ID of the customer for this charge if one exists.

orderId string

The ID of the order this charge is for if one exists.

sourceId string

The ID of the source used to create this charge.

failureCode string

Errors code explaining the reason for charge failure.

failureMessage string

The reason for the charge failure.

cancels [object]

Contains cancel information.

cancels[].id string

Unique identifier of the cancel.

cancels[].createdTime datetime

The time when the cancel was created.

cancels[].updatedTime datetime

The time when the cancel was last updated.

cancels[].amount Number

The amount representing how much was canceled.

cancels[].state string

The status of the cancel, one of pending, succeeded or failed.

cancels[].failureCode string

Errors code explaining the reason for cancel failure.

cancels[].failureMessage string

The reason for the cancel failure.

captures [object]

Contains capture information.

captures[].id string

Unique identifier of the capture.

captures[].createdTime datetime

The time when the charge was created.

captures[].updatedTime datetime

The time when the capture was last updated.

captures[].amount number

The amount representing how much was captured.

captures[].state string

The status of the capture, one of pending, succeeded or failed.

captures[].failureCode string

Errors code explaining the reason for capture failure.

captures[].failureMessage string

The reason for the capture failure.

refunds [object]

Contains refund information.

refunds[].id string

Unique identifier of the refund.

refunds[].createdTime datetime

The time when the refund was created.

refunds[].updatedTime datetime

The time when the refund was last updated.

refunds[].amount string

The amount representing how much was refunded.

refunds[].state string

The status of the refund, one of pending, succeeded or failed.

refunds[].failureCode string

Errors code explaining the reason for refund failure.

refunds[].failureMessage string

The reason for the refund failure.

type string

The type of charge (for example, customer-initiated).

liveMode boolean

Has the value is true if the object exists in live mode or the value false if the object exists in test mode.

The Charge object
The Charge object
{
"id": "a6809a63-e6a9-4016-abbc-f33d19fccb5b",
"createdTime": "2018-04-25T20:36:00Z",
"currency": "USD",
"amount": 1180.26,
"state": "pending",
"customerId": 8760945562,
"orderId": 9986340012,
"sourceId": 9986340012,
"failureCode": "string",
"failureMessage": "string",
"cancels": [
{
"id": "a6809a63-e6a9-4016-abbc-f33d19fccb5b",
"createdTime": "2018-04-25T20:36:00Z",
"updatedTime": "2018-04-25T20:36:00Z",
"amount": 1180.26,
"state": "pending",
"failureCode": "string",
"failureMessage": "string"
}
],
"captures": [
{
"id": "a6809a63-e6a9-4016-abbc-f33d19fccb5b",
"createdTime": "2018-04-25T20:36:00Z",
"updatedTime": "2018-04-25T20:36:00Z",
"amount": 1180.26,
"state": "pending",
"failureCode": "string",
"failureMessage": "string"
}
],
"refunds": [
{
"id": "a6809a63-e6a9-4016-abbc-f33d19fccb5b",
"createdTime": "2018-04-25T20:36:00Z",
"updatedTime": "2018-04-25T20:36:00Z",
"amount": 1180.26,
"state": "pending",
"failureCode": "string",
"failureMessage": "string"
}
],
"type": "customer_initiated",
"liveMode": true