Skip to content
Get started

Get a charge by id.

client.Charges.Unmask(ctx, id, query) (*ChargeUnmaskResponse, error)
GET/v1/charges/{id}/unmask

Get a charge by id.

ParametersExpand Collapse
id string
query ChargeUnmaskParams
CorrelationID param.Field[string]optional

Optional client generated identifier to trace and debug a series of requests.

RequestID param.Field[string]optional

Optional client generated identifier to trace and debug a request.

StraddleAccountID param.Field[string]optional

For use by platforms to specify an account id and set scope of a request.

formatuuid
ReturnsExpand Collapse
type ChargeUnmaskResponse struct{…}
Data ChargeUnmaskResponseData
ID string

Id.

formatuuid
Amount int64

Amount.

formatint32
Config ChargeUnmaskResponseDataConfig
BalanceCheck string

Defines whether to check the customer's balance before processing the charge.

One of the following:
const ChargeUnmaskResponseDataConfigBalanceCheckRequired ChargeUnmaskResponseDataConfigBalanceCheck = "required"
const ChargeUnmaskResponseDataConfigBalanceCheckEnabled ChargeUnmaskResponseDataConfigBalanceCheck = "enabled"
const ChargeUnmaskResponseDataConfigBalanceCheckDisabled ChargeUnmaskResponseDataConfigBalanceCheck = "disabled"
AutoHold booloptional

Defines whether to automatically place this charge on hold after being created.

AutoHoldMessage stringoptional

The reason the charge is being automatically held on creation.

SandboxOutcome stringoptional

Payment will simulate processing if not Standard.

One of the following:
const ChargeUnmaskResponseDataConfigSandboxOutcomeStandard ChargeUnmaskResponseDataConfigSandboxOutcome = "standard"
const ChargeUnmaskResponseDataConfigSandboxOutcomePaid ChargeUnmaskResponseDataConfigSandboxOutcome = "paid"
const ChargeUnmaskResponseDataConfigSandboxOutcomeOnHoldDailyLimit ChargeUnmaskResponseDataConfigSandboxOutcome = "on_hold_daily_limit"
const ChargeUnmaskResponseDataConfigSandboxOutcomeCancelledForFraudRisk ChargeUnmaskResponseDataConfigSandboxOutcome = "cancelled_for_fraud_risk"
const ChargeUnmaskResponseDataConfigSandboxOutcomeCancelledForBalanceCheck ChargeUnmaskResponseDataConfigSandboxOutcome = "cancelled_for_balance_check"
const ChargeUnmaskResponseDataConfigSandboxOutcomeFailedInsufficientFunds ChargeUnmaskResponseDataConfigSandboxOutcome = "failed_insufficient_funds"
const ChargeUnmaskResponseDataConfigSandboxOutcomeReversedInsufficientFunds ChargeUnmaskResponseDataConfigSandboxOutcome = "reversed_insufficient_funds"
const ChargeUnmaskResponseDataConfigSandboxOutcomeFailedCustomerDispute ChargeUnmaskResponseDataConfigSandboxOutcome = "failed_customer_dispute"
const ChargeUnmaskResponseDataConfigSandboxOutcomeReversedCustomerDispute ChargeUnmaskResponseDataConfigSandboxOutcome = "reversed_customer_dispute"
const ChargeUnmaskResponseDataConfigSandboxOutcomeFailedClosedBankAccount ChargeUnmaskResponseDataConfigSandboxOutcome = "failed_closed_bank_account"
const ChargeUnmaskResponseDataConfigSandboxOutcomeReversedClosedBankAccount ChargeUnmaskResponseDataConfigSandboxOutcome = "reversed_closed_bank_account"

The channel or mechanism through which the payment was authorized. Use internet for payments made online or through a mobile app and signed for signed agreements where there is a consent form or contract. Use signed for PDF signatures.

One of the following:
CreatedAt Time

Created at.

formatdate-time
Currency string

Currency.

Description string

Description.

Device ChargeUnmaskResponseDataDevice
IPAddress string

Ip address.

format**.**.**.**
ExternalID string

External id.

FundingIDs []string

Funding Ids

Paykey string

Paykey.

PaymentDate Time

Payment date.

formatdate
Status string

The current status of the charge or payout.

One of the following:
const ChargeUnmaskResponseDataStatusCreated ChargeUnmaskResponseDataStatus = "created"
const ChargeUnmaskResponseDataStatusScheduled ChargeUnmaskResponseDataStatus = "scheduled"
const ChargeUnmaskResponseDataStatusFailed ChargeUnmaskResponseDataStatus = "failed"
const ChargeUnmaskResponseDataStatusCancelled ChargeUnmaskResponseDataStatus = "cancelled"
const ChargeUnmaskResponseDataStatusOnHold ChargeUnmaskResponseDataStatus = "on_hold"
const ChargeUnmaskResponseDataStatusPending ChargeUnmaskResponseDataStatus = "pending"
const ChargeUnmaskResponseDataStatusPaid ChargeUnmaskResponseDataStatus = "paid"
const ChargeUnmaskResponseDataStatusReversed ChargeUnmaskResponseDataStatus = "reversed"
const ChargeUnmaskResponseDataStatusValidating ChargeUnmaskResponseDataStatus = "validating"
StatusDetails StatusDetailsV1
ChangedAt Time

The time the status change occurred.

formatdate-time
Message string

A human-readable description of the current status.

Reason StatusDetailsV1Reason

A machine-readable identifier for the specific status, useful for programmatic handling.

One of the following:
const StatusDetailsV1ReasonInsufficientFunds StatusDetailsV1Reason = "insufficient_funds"
const StatusDetailsV1ReasonClosedBankAccount StatusDetailsV1Reason = "closed_bank_account"
const StatusDetailsV1ReasonInvalidBankAccount StatusDetailsV1Reason = "invalid_bank_account"
const StatusDetailsV1ReasonInvalidRouting StatusDetailsV1Reason = "invalid_routing"
const StatusDetailsV1ReasonDisputed StatusDetailsV1Reason = "disputed"
const StatusDetailsV1ReasonPaymentStopped StatusDetailsV1Reason = "payment_stopped"
const StatusDetailsV1ReasonOwnerDeceased StatusDetailsV1Reason = "owner_deceased"
const StatusDetailsV1ReasonFrozenBankAccount StatusDetailsV1Reason = "frozen_bank_account"
const StatusDetailsV1ReasonRiskReview StatusDetailsV1Reason = "risk_review"
const StatusDetailsV1ReasonFraudulent StatusDetailsV1Reason = "fraudulent"
const StatusDetailsV1ReasonDuplicateEntry StatusDetailsV1Reason = "duplicate_entry"
const StatusDetailsV1ReasonInvalidPaykey StatusDetailsV1Reason = "invalid_paykey"
const StatusDetailsV1ReasonPaymentBlocked StatusDetailsV1Reason = "payment_blocked"
const StatusDetailsV1ReasonAmountTooLarge StatusDetailsV1Reason = "amount_too_large"
const StatusDetailsV1ReasonTooManyAttempts StatusDetailsV1Reason = "too_many_attempts"
const StatusDetailsV1ReasonInternalSystemError StatusDetailsV1Reason = "internal_system_error"
const StatusDetailsV1ReasonUserRequest StatusDetailsV1Reason = "user_request"
const StatusDetailsV1ReasonOk StatusDetailsV1Reason = "ok"
const StatusDetailsV1ReasonOtherNetworkReturn StatusDetailsV1Reason = "other_network_return"
const StatusDetailsV1ReasonPayoutRefused StatusDetailsV1Reason = "payout_refused"
const StatusDetailsV1ReasonCancelRequest StatusDetailsV1Reason = "cancel_request"
const StatusDetailsV1ReasonFailedVerification StatusDetailsV1Reason = "failed_verification"
const StatusDetailsV1ReasonRequireReview StatusDetailsV1Reason = "require_review"
const StatusDetailsV1ReasonBlockedBySystem StatusDetailsV1Reason = "blocked_by_system"
const StatusDetailsV1ReasonWatchtowerReview StatusDetailsV1Reason = "watchtower_review"
const StatusDetailsV1ReasonValidating StatusDetailsV1Reason = "validating"
const StatusDetailsV1ReasonAutoHold StatusDetailsV1Reason = "auto_hold"
Source StatusDetailsV1Source

Identifies the origin of the status change (e.g., bank_decline, watchtower). This helps in tracking the cause of status updates.

One of the following:
const StatusDetailsV1SourceWatchtower StatusDetailsV1Source = "watchtower"
const StatusDetailsV1SourceBankDecline StatusDetailsV1Source = "bank_decline"
const StatusDetailsV1SourceCustomerDispute StatusDetailsV1Source = "customer_dispute"
const StatusDetailsV1SourceUserAction StatusDetailsV1Source = "user_action"
const StatusDetailsV1SourceSystem StatusDetailsV1Source = "system"
Code stringoptional

The status code if applicable.

StatusHistory []ChargeUnmaskResponseDataStatusHistory

Status history.

ChangedAt Time

The time the status change occurred.

formatdate-time
Message string

A human-readable description of the status.

Reason string

A machine-readable identifier for the specific status, useful for programmatic handling.

One of the following:
const ChargeUnmaskResponseDataStatusHistoryReasonInsufficientFunds ChargeUnmaskResponseDataStatusHistoryReason = "insufficient_funds"
const ChargeUnmaskResponseDataStatusHistoryReasonClosedBankAccount ChargeUnmaskResponseDataStatusHistoryReason = "closed_bank_account"
const ChargeUnmaskResponseDataStatusHistoryReasonInvalidBankAccount ChargeUnmaskResponseDataStatusHistoryReason = "invalid_bank_account"
const ChargeUnmaskResponseDataStatusHistoryReasonInvalidRouting ChargeUnmaskResponseDataStatusHistoryReason = "invalid_routing"
const ChargeUnmaskResponseDataStatusHistoryReasonDisputed ChargeUnmaskResponseDataStatusHistoryReason = "disputed"
const ChargeUnmaskResponseDataStatusHistoryReasonPaymentStopped ChargeUnmaskResponseDataStatusHistoryReason = "payment_stopped"
const ChargeUnmaskResponseDataStatusHistoryReasonOwnerDeceased ChargeUnmaskResponseDataStatusHistoryReason = "owner_deceased"
const ChargeUnmaskResponseDataStatusHistoryReasonFrozenBankAccount ChargeUnmaskResponseDataStatusHistoryReason = "frozen_bank_account"
const ChargeUnmaskResponseDataStatusHistoryReasonRiskReview ChargeUnmaskResponseDataStatusHistoryReason = "risk_review"
const ChargeUnmaskResponseDataStatusHistoryReasonFraudulent ChargeUnmaskResponseDataStatusHistoryReason = "fraudulent"
const ChargeUnmaskResponseDataStatusHistoryReasonDuplicateEntry ChargeUnmaskResponseDataStatusHistoryReason = "duplicate_entry"
const ChargeUnmaskResponseDataStatusHistoryReasonInvalidPaykey ChargeUnmaskResponseDataStatusHistoryReason = "invalid_paykey"
const ChargeUnmaskResponseDataStatusHistoryReasonPaymentBlocked ChargeUnmaskResponseDataStatusHistoryReason = "payment_blocked"
const ChargeUnmaskResponseDataStatusHistoryReasonAmountTooLarge ChargeUnmaskResponseDataStatusHistoryReason = "amount_too_large"
const ChargeUnmaskResponseDataStatusHistoryReasonTooManyAttempts ChargeUnmaskResponseDataStatusHistoryReason = "too_many_attempts"
const ChargeUnmaskResponseDataStatusHistoryReasonInternalSystemError ChargeUnmaskResponseDataStatusHistoryReason = "internal_system_error"
const ChargeUnmaskResponseDataStatusHistoryReasonUserRequest ChargeUnmaskResponseDataStatusHistoryReason = "user_request"
const ChargeUnmaskResponseDataStatusHistoryReasonOk ChargeUnmaskResponseDataStatusHistoryReason = "ok"
const ChargeUnmaskResponseDataStatusHistoryReasonOtherNetworkReturn ChargeUnmaskResponseDataStatusHistoryReason = "other_network_return"
const ChargeUnmaskResponseDataStatusHistoryReasonPayoutRefused ChargeUnmaskResponseDataStatusHistoryReason = "payout_refused"
const ChargeUnmaskResponseDataStatusHistoryReasonCancelRequest ChargeUnmaskResponseDataStatusHistoryReason = "cancel_request"
const ChargeUnmaskResponseDataStatusHistoryReasonFailedVerification ChargeUnmaskResponseDataStatusHistoryReason = "failed_verification"
const ChargeUnmaskResponseDataStatusHistoryReasonRequireReview ChargeUnmaskResponseDataStatusHistoryReason = "require_review"
const ChargeUnmaskResponseDataStatusHistoryReasonBlockedBySystem ChargeUnmaskResponseDataStatusHistoryReason = "blocked_by_system"
const ChargeUnmaskResponseDataStatusHistoryReasonWatchtowerReview ChargeUnmaskResponseDataStatusHistoryReason = "watchtower_review"
const ChargeUnmaskResponseDataStatusHistoryReasonValidating ChargeUnmaskResponseDataStatusHistoryReason = "validating"
const ChargeUnmaskResponseDataStatusHistoryReasonAutoHold ChargeUnmaskResponseDataStatusHistoryReason = "auto_hold"
Source string

Identifies the origin of the status change (e.g., bank_decline, watchtower). This helps in tracking the cause of status updates.

One of the following:
const ChargeUnmaskResponseDataStatusHistorySourceWatchtower ChargeUnmaskResponseDataStatusHistorySource = "watchtower"
const ChargeUnmaskResponseDataStatusHistorySourceBankDecline ChargeUnmaskResponseDataStatusHistorySource = "bank_decline"
const ChargeUnmaskResponseDataStatusHistorySourceCustomerDispute ChargeUnmaskResponseDataStatusHistorySource = "customer_dispute"
const ChargeUnmaskResponseDataStatusHistorySourceUserAction ChargeUnmaskResponseDataStatusHistorySource = "user_action"
const ChargeUnmaskResponseDataStatusHistorySourceSystem ChargeUnmaskResponseDataStatusHistorySource = "system"
Status string

The current status of the charge or payout.

One of the following:
const ChargeUnmaskResponseDataStatusHistoryStatusCreated ChargeUnmaskResponseDataStatusHistoryStatus = "created"
const ChargeUnmaskResponseDataStatusHistoryStatusScheduled ChargeUnmaskResponseDataStatusHistoryStatus = "scheduled"
const ChargeUnmaskResponseDataStatusHistoryStatusFailed ChargeUnmaskResponseDataStatusHistoryStatus = "failed"
const ChargeUnmaskResponseDataStatusHistoryStatusCancelled ChargeUnmaskResponseDataStatusHistoryStatus = "cancelled"
const ChargeUnmaskResponseDataStatusHistoryStatusOnHold ChargeUnmaskResponseDataStatusHistoryStatus = "on_hold"
const ChargeUnmaskResponseDataStatusHistoryStatusPending ChargeUnmaskResponseDataStatusHistoryStatus = "pending"
const ChargeUnmaskResponseDataStatusHistoryStatusPaid ChargeUnmaskResponseDataStatusHistoryStatus = "paid"
const ChargeUnmaskResponseDataStatusHistoryStatusReversed ChargeUnmaskResponseDataStatusHistoryStatus = "reversed"
const ChargeUnmaskResponseDataStatusHistoryStatusValidating ChargeUnmaskResponseDataStatusHistoryStatus = "validating"
Code stringoptional

The status code if applicable.

TraceIDs map[string, string]

Trace Ids.

UpdatedAt Time

Updated at.

formatdate-time
CustomerDetails CustomerDetailsV1optional

Information about the customer associated with the charge or payout.

ID string

Unique identifier for the customer

formatuuid
CustomerType CustomerDetailsV1CustomerType

The type of customer

One of the following:
const CustomerDetailsV1CustomerTypeIndividual CustomerDetailsV1CustomerType = "individual"
const CustomerDetailsV1CustomerTypeBusiness CustomerDetailsV1CustomerType = "business"
Email string

The customer's email address

Name string

The name of the customer

Phone string

The customer's phone number in E.164 format

EffectiveAt Timeoptional

Effective at.

formatdate-time
Metadata map[string, string]optional

Metadata.

PaykeyDetails PaykeyDetailsV1optional
ID string

Unique identifier for the paykey.

formatuuid
CustomerID string

Unique identifier for the customer associated with the paykey.

formatuuid
Label string

Human-readable label that combines the bank name and masked account number to help easility represent this paykey in a UI

Balance int64optional

The most recent balance of the bank account associated with the paykey in dollars.

formatint32
PaymentRail stringoptional

The payment rail used for the charge or payout.

ProcessedAt Timeoptional

Processed at.

formatdate-time

Related payments.

One of the following:

Metadata about the API request, including an identifier and timestamp.

APIRequestID string

Unique identifier for this API request, useful for troubleshooting.

formatuuid
APIRequestTimestamp Time

Timestamp for this API request, useful for troubleshooting.

formatdate-time
ResponseType ChargeUnmaskResponseResponseType

Indicates the structure of the returned content.

  • "object" means the data field contains a single JSON object.
  • "array" means the data field contains an array of objects.
  • "error" means the data field contains an error object with details of the issue.
  • "none" means no data is returned.
One of the following:
const ChargeUnmaskResponseResponseTypeObject ChargeUnmaskResponseResponseType = "object"
const ChargeUnmaskResponseResponseTypeArray ChargeUnmaskResponseResponseType = "array"
const ChargeUnmaskResponseResponseTypeError ChargeUnmaskResponseResponseType = "error"
const ChargeUnmaskResponseResponseTypeNone ChargeUnmaskResponseResponseType = "none"

Get a charge by id.

package main

import (
  "context"
  "fmt"

  "github.com/straddleio/straddle-go"
  "github.com/straddleio/straddle-go/option"
)

func main() {
  client := straddle.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.Charges.Unmask(
    context.TODO(),
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    straddle.ChargeUnmaskParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "amount": 0,
    "config": {
      "balance_check": "required",
      "auto_hold": true,
      "auto_hold_message": "auto_hold_message",
      "sandbox_outcome": "standard"
    },
    "consent_type": "internet",
    "created_at": "2019-12-27T18:11:19.117Z",
    "currency": "currency",
    "description": "description",
    "device": {
      "ip_address": "ip_address"
    },
    "external_id": "external_id",
    "funding_ids": [
      "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
    ],
    "paykey": "paykey",
    "payment_date": "2019-12-27",
    "status": "created",
    "status_details": {
      "changed_at": "2019-12-27T18:11:19.117Z",
      "message": "Payment successfully created and awaiting validation.",
      "reason": "insufficient_funds",
      "source": "system",
      "code": null
    },
    "status_history": [
      {
        "changed_at": "2019-12-27T18:11:19.117Z",
        "message": "Payment successfully created and awaiting validation.",
        "reason": "insufficient_funds",
        "source": "watchtower",
        "status": "created",
        "code": null
      }
    ],
    "trace_ids": {
      "foo": "string"
    },
    "updated_at": "2019-12-27T18:11:19.117Z",
    "customer_details": {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "customer_type": "individual",
      "email": "ron@swanson.com",
      "name": "Ron Swanson",
      "phone": "+1234567890"
    },
    "effective_at": "2019-12-27T18:11:19.117Z",
    "metadata": {
      "foo": "string"
    },
    "paykey_details": {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "customer_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "label": "Bank of America ****1234",
      "balance": 0
    },
    "payment_rail": "ach",
    "processed_at": "2019-12-27T18:11:19.117Z",
    "related_payments": {
      "foo": "original"
    }
  },
  "meta": {
    "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "api_request_timestamp": "2019-12-27T18:11:19.117Z"
  },
  "response_type": "object"
}
Returns Examples
{
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "amount": 0,
    "config": {
      "balance_check": "required",
      "auto_hold": true,
      "auto_hold_message": "auto_hold_message",
      "sandbox_outcome": "standard"
    },
    "consent_type": "internet",
    "created_at": "2019-12-27T18:11:19.117Z",
    "currency": "currency",
    "description": "description",
    "device": {
      "ip_address": "ip_address"
    },
    "external_id": "external_id",
    "funding_ids": [
      "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
    ],
    "paykey": "paykey",
    "payment_date": "2019-12-27",
    "status": "created",
    "status_details": {
      "changed_at": "2019-12-27T18:11:19.117Z",
      "message": "Payment successfully created and awaiting validation.",
      "reason": "insufficient_funds",
      "source": "system",
      "code": null
    },
    "status_history": [
      {
        "changed_at": "2019-12-27T18:11:19.117Z",
        "message": "Payment successfully created and awaiting validation.",
        "reason": "insufficient_funds",
        "source": "watchtower",
        "status": "created",
        "code": null
      }
    ],
    "trace_ids": {
      "foo": "string"
    },
    "updated_at": "2019-12-27T18:11:19.117Z",
    "customer_details": {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "customer_type": "individual",
      "email": "ron@swanson.com",
      "name": "Ron Swanson",
      "phone": "+1234567890"
    },
    "effective_at": "2019-12-27T18:11:19.117Z",
    "metadata": {
      "foo": "string"
    },
    "paykey_details": {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "customer_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "label": "Bank of America ****1234",
      "balance": 0
    },
    "payment_rail": "ach",
    "processed_at": "2019-12-27T18:11:19.117Z",
    "related_payments": {
      "foo": "original"
    }
  },
  "meta": {
    "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "api_request_timestamp": "2019-12-27T18:11:19.117Z"
  },
  "response_type": "object"
}