Payment

An object representing a payment selected for an Order.

Properties

Property Description
externalData The external data for this payment from the payment provider.
externalRef The external reference for this payment from the payment provider.
method The unique identifier of the payment method.
params The parameters for the payment.
status The status of the payment. This may be "prepared", "planned", "unpaid", "pending", "reserved", "paid", "cancelled" or "error".
uid The unique identifier of 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

API Console
Payment.get(11092757)
Response
{
  "method": 36480,
  "status": "prepared",
  "uid": 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 payment.

Example

API Console
Payment.getSchema(null)
Response
{
  "additionalProperties": false,
  "description": "Payment schema connected to a specific order",
  "properties": {
    "externalData": {
      "additionalProperties": true,
      "description": "The external data from the payment provider.",
      "title": "Data",
      "type": "object"
    },
    "externalRef": {
      "description": "The external reference from the payment provider.",
      "readonly": true,
      "title": "Reference",
      "type": "string"
    },
    "method": {
      "description": "Payoption instance UID.",
      "readonly": true,
      "title": "Payment method",
      "type": "integer"
    },
    "params: {
      "description": "Parameters set on this payment.",
      "title": "Parameters",
      "type": "object"
    },
    "status": {
      "description": "The status of the payment.",
      "enum": [
        "prepared",
        "planned",
        "unpaid",
        "pending",
        "reserved",
        "paid",
        "cancelled",
        "error"
      ],
      "readonly": true,
      "title": "Status",
      "type": "string"
    },
    "uid": {
      "readonly": true,
      "title": "Uid",
      "type": "integer"
    }
  },
  "title": "Payment",
  "type": "object"
}

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

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