# Payment

An object representing a payment selected for an Order.

# Properties

Property Type Description
uid integer The unique identifier of the payment.
method integer The unique identifier of the PaymentMethod.
params object The parameters for the payment.
externalData object The external data for this payment from the payment provider.
status string The status of the payment. This may be "prepared", "planned", "unpaid", "pending", "reserved", "paid", "cancelled" or "error".
externalRef string The external reference for this payment from the payment provider.
amount number The amount paid with the payment.

# Methods

# capture

Collects payment from the customer's credit or debit card, activates the invoice or changes the payment status to "paid" for any custom payment method. The capture method is always applied to a transaction.

# Parameters

The unique identifier of the payment transaction.

# Errors

Parameter Description
1006 Authorization failed. Only administrators may modify payments.

# get

Fetches an existing payment.

# Parameters

Parameter Description
uid The unique identifier of an existing payment.
query Which info to return. See Query language.

# Example

Payment.get(11092757)

# getSchema

Fetches the JSON Schema which can be used for client-side validation.

# Parameters

The unique identifier of an existing payment or null for a new instance.

# set

Updates an existing payment.

# Parameters

Parameter Description
uid The unique identifier of an existing payment.
patch An object containing the properties and values set for the payment.
query Which info to return. See Query language.

# Example

Payment.set(11092757, {
  "status": "paid",
  "externalRef": "89123735"
}, [
  "method"
])