PATCH
/
observability
/
payments
/
{paymentId}
Update an external payment
curl --request PATCH \
  --url https://api.sandbox.primer.io/observability/payments/{paymentId} \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "paymentId": "IHQlakKC",
  "currencyCode": "EUR",
  "amount": 700,
  "createdAt": "2022-12-22T17:27:08Z",
  "processor": {
    "name": "STRIPE",
    "merchantId": "processor-merchant-id-1"
  },
  "status": "DECLINED",
  "statusReason": {
    "type": "APPLICATION_ERROR",
    "declineType": "HARD_DECLINE",
    "code": "EXPIRED_CARD"
  },
  "metadata": {
    "key-123": "value-123"
  },
  "paymentType": "FIRST_PAYMENT",
  "order": {
    "id": "order-abc",
    "countryCode": "GB"
  },
  "descriptor": "Authorized ticket charge",
  "paymentMethod": {
    "paymentMethodType": "PAYMENT_CARD",
    "threeDSecureAuthentication": {
      "transStatus": "A",
      "transStatusReason": "01",
      "responseCode": "NOT_PERFORMED",
      "eci": "02",
      "challengeIssued": false,
      "protocolVersion": "2.1.0",
      "reasonCode": "NOT_SUPPORTED_BY_ISSUER",
      "reasonText": "Access Not Authorized"
    },
    "data": {
      "first6Digits": "220073",
      "binData": {
        "network": "VISA",
        "issuerCountryCode": "GB",
        "issuerName": "121 FINANCIAL CREDIT UNION",
        "productUsageType": "BUSINESS",
        "accountFundingType": "PREPAID"
      }
    }
  }
}'
{
  "paymentId": "IHQlakKC",
  "currencyCode": "EUR",
  "amount": 700,
  "createdAt": "2022-12-22T17:27:08Z",
  "processor": {
    "name": "STRIPE",
    "merchantId": "processor-merchant-id-1"
  },
  "status": "DECLINED",
  "statusReason": {
    "type": "APPLICATION_ERROR",
    "declineType": "HARD_DECLINE",
    "code": "EXPIRED_CARD"
  },
  "metadata": {
    "key-123": "value-123"
  },
  "paymentType": "FIRST_PAYMENT",
  "order": {
    "id": "order-abc",
    "countryCode": "GB"
  },
  "descriptor": "Authorized ticket charge",
  "paymentMethod": {
    "paymentMethodType": "PAYMENT_CARD",
    "threeDSecureAuthentication": {
      "transStatus": "A",
      "transStatusReason": "01",
      "responseCode": "NOT_PERFORMED",
      "eci": "02",
      "challengeIssued": false,
      "protocolVersion": "2.1.0",
      "reasonCode": "NOT_SUPPORTED_BY_ISSUER",
      "reasonText": "Access Not Authorized"
    },
    "data": {
      "first6Digits": "220073",
      "binData": {
        "network": "VISA",
        "issuerCountryCode": "GB",
        "issuerName": "121 FINANCIAL CREDIT UNION",
        "productUsageType": "BUSINESS",
        "accountFundingType": "PREPAID"
      }
    }
  }
}

Authorizations

X-API-KEY
string
header
required

Path Parameters

paymentId
string
required

Body

application/json
paymentId
string

The payment ID.

The payment ID must be unique. You can use this unique payment ID to update payment details.

Maximum length: 250
currencyCode
enum<string>

The 3-letter currency code in ISO 4217 format.

e.g. use USD for US dollars.

Available options:
AED,
AFN,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BOV,
BRL,
BSD,
BTN,
BWP,
BYR,
BYN,
BZD,
CAD,
CDF,
CHE,
CHF,
CHW,
CLP,
CNY,
COP,
COU,
CRC,
CUC,
CUP,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
ERN,
ETB,
EUR,
FJD,
FKP,
GBP,
GEL,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
INR,
IQD,
IRR,
ISK,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KPW,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LYD,
MAD,
MDL,
MKD,
MMK,
MNT,
MOP,
MRO,
MUR,
MVR,
MWK,
MXN,
MXV,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SDG,
SEK,
SGD,
SHP,
SOS,
SRD,
SSP,
SVC,
SYP,
SZL,
THB,
TJS,
TMT,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
USD,
UYU,
UZS,
VND,
VUV,
WST,
XAF,
XAG,
XAU,
XBA,
XBB,
XBC,
XBD,
XCD,
XDR,
XFU,
XOF,
XPD,
XPF,
XPT,
XSU,
XTS,
XUA,
YER,
ZAR,
ZMW,
ZWL
processor
object
amount
integer

The amount you would like to charge the customer, in minor units. e.g. for $7, use 700.

Some currencies, such as Japanese Yen, do not have minor units. In this case you should use the value as it is, without any formatting. For example for ¥100, use 100. The minimum amount is 0.

Required range: x >= 0
createdAt
string<date-time>

The payment creation date and time (UTC) in ISO 8601 format.

Cannot be updated in partial updates PATCH.

order
object
status
enum<string>

See the payment lifecycle for more information.

Available options:
DECLINED,
CANCELLED,
FAILED,
SETTLING,
PARTIALLY_SETTLED,
AUTHORIZED,
SETTLED,
PENDING
statusReason
object

Pass more information regarding the payment's status in this field.

This is especially useful when the status is DECLINED or FAILED.

paymentMethod
object
metadata
object

Additional data to be used throughout the payment lifecycle.

Ad dictionary of key-value pairs where the values can only be strings or integers.

e.g. {"productId": 1001, "merchantId": "88278a"}

paymentType
enum<string>

Payment types, primarily to be used for recurring payments.

Note: If you successfully vault a SINGLE_USE token on payment creation, then there's no need to set a value for this field and it will be flagged as FIRST_PAYMENT. Otherwise, see the table below for all possible values.

paymentTypeUse case
FIRST_PAYMENTa customer-initiated payment which is the first in a series of recurring payments or subscription, or a card on file scenario.
ECOMMERCEa customer-initiated payment using stored payment details where the cardholder is present.
SUBSCRIPTIONa merchant-initiated payment as part of a series of payments on a fixed schedule and a set amount.
UNSCHEDULEDa merchant-initiated payment using stored payment details with no fixed schedule or amount.
MOTOa merchant-initiated mail order or telephone order payment.
IN_STOREa customer-initiated payment where the customer is physically present in a shop.
Available options:
FIRST_PAYMENT,
ECOMMERCE,
SUBSCRIPTION,
UNSCHEDULED,
MOTO,
IN_STORE
descriptor
string

A description of the payment, as it would typically appear on a bank statement.

Maximum length: 250

Response

200 - application/json
paymentId
string
required

The payment ID.

The payment ID must be unique. You can use this unique payment ID to update payment details.

Maximum length: 250
currencyCode
enum<string>
required

The 3-letter currency code in ISO 4217 format.

e.g. use USD for US dollars.

Available options:
AED,
AFN,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BOV,
BRL,
BSD,
BTN,
BWP,
BYR,
BYN,
BZD,
CAD,
CDF,
CHE,
CHF,
CHW,
CLP,
CNY,
COP,
COU,
CRC,
CUC,
CUP,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
ERN,
ETB,
EUR,
FJD,
FKP,
GBP,
GEL,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
INR,
IQD,
IRR,
ISK,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KPW,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LYD,
MAD,
MDL,
MKD,
MMK,
MNT,
MOP,
MRO,
MUR,
MVR,
MWK,
MXN,
MXV,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SDG,
SEK,
SGD,
SHP,
SOS,
SRD,
SSP,
SVC,
SYP,
SZL,
THB,
TJS,
TMT,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
USD,
UYU,
UZS,
VND,
VUV,
WST,
XAF,
XAG,
XAU,
XBA,
XBB,
XBC,
XBD,
XCD,
XDR,
XFU,
XOF,
XPD,
XPF,
XPT,
XSU,
XTS,
XUA,
YER,
ZAR,
ZMW,
ZWL
processor
object
required
amount
integer
required

The amount you would like to charge the customer, in minor units. e.g. for $7, use 700.

Some currencies, such as Japanese Yen, do not have minor units. In this case you should use the value as it is, without any formatting. For example for ¥100, use 100. The minimum amount is 0. The maximum amount is the limit of int64.

Required range: x >= 0
createdAt
string<date-time>
required

The payment creation date and time (UTC) in ISO 8601 format.

Cannot be updated in partial updates PATCH.

order
object
required
paymentMethod
object
required
status
enum<string>

See the payment lifecycle for more information.

Available options:
DECLINED,
CANCELLED,
FAILED,
SETTLING,
PARTIALLY_SETTLED,
AUTHORIZED,
SETTLED,
PENDING
statusReason
object

Pass more information regarding the payment's status in this field.

This is especially useful when the status is DECLINED or FAILED.

metadata
object

Additional data to be used throughout the payment lifecycle.

Ad dictionary of key-value pairs where the values can only be strings or integers.

e.g. {"productId": 1001, "merchantId": "88278a"}

paymentType
enum<string>

Payment types, primarily to be used for recurring payments.

Note: If you successfully vault a SINGLE_USE token on payment creation, then there's no need to set a value for this field and it will be flagged as FIRST_PAYMENT. Otherwise, see the table below for all possible values.

paymentTypeUse case
FIRST_PAYMENTa customer-initiated payment which is the first in a series of recurring payments or subscription, or a card on file scenario.
ECOMMERCEa customer-initiated payment using stored payment details where the cardholder is present.
SUBSCRIPTIONa merchant-initiated payment as part of a series of payments on a fixed schedule and a set amount.
UNSCHEDULEDa merchant-initiated payment using stored payment details with no fixed schedule or amount.
MOTOa merchant-initiated mail order or telephone order payment.
IN_STOREa customer-initiated payment where the customer is physically present in a shop.
Available options:
FIRST_PAYMENT,
ECOMMERCE,
SUBSCRIPTION,
UNSCHEDULED,
MOTO,
IN_STORE
descriptor
string

A description of the payment, as it would typically appear on a bank statement.

Maximum length: 250