Get payment by ID
GEThttps://api.publicsquare.com/payments/:id
Get a payment by ID in the Account.
Permissions
payment:read
Request
Path Parameters
id stringrequired
Responses
- 200
- 400
- 401
- 403
- 404
OK
- application/json
- Schema
- Example (auto)
Schema
idstringnullable
Payment ID
Example:
pmt_2YKewBonG4tgk12MheY3PiHDy
account_idstringnullable
Account ID
Example:
acc_B518niGwGYKzig6vtrRVZGGGV
environmentstringnullable
Environment - Can be test
or production
Example:
production
external_idstringnullable
Payment ID in merchant's system
Example:
e797ef3c-b586-4333-af90-7168d8427d85
statusstringnullable
Payment status
Example:
successful
declined_reasonstringnullable
Decline reason
Example:
Card lost/stolen
transaction_idstringnullable
Transaction ID
Example:
trx_95rvMJvAVeG68W4NtLdfkN3LG
amountint64
Current amount of the payment in cents
Example:
9500
amount_capturableint64
Amount that is capturable by payment in cents. Will be the amount authorized for capture
Example:
10000
amount_chargedint64
Amount of the payment charged in cents. Will be 0 if the payment requires capture
Example:
10000
amount_refundedint64
Amount refunded of the payment in cents
Example:
500
refundedboolean
Flag if payment has been fully refunded
Example:
false
currencystringnullable
3 character ISO currency code
Example:
USD
payment_method object
customer object
billing_details object
shipping_address object
fraud_details object
transaction object
dynamic_descriptor object
device_information object
created_atdate-timenullable
Date payment was created
Example:
2024-06-30T01:02:29.212Z
modified_atdate-timenullable
Date payment was modified
Example:
2024-06-30T01:02:29.212Z
{
"id": "pmt_2YKewBonG4tgk12MheY3PiHDy",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "production",
"external_id": "e797ef3c-b586-4333-af90-7168d8427d85",
"status": "successful",
"declined_reason": "Card lost/stolen",
"transaction_id": "trx_95rvMJvAVeG68W4NtLdfkN3LG",
"amount": 9500,
"amount_capturable": 10000,
"amount_charged": 10000,
"amount_refunded": 500,
"refunded": false,
"currency": "USD",
"payment_method": {
"card": {
"id": "card_8PajTnDVrviEJ8zYJDALFQm5t",
"cardholder_name": "John Smith",
"last4": "4242",
"exp_month": "12",
"exp_year": "2025",
"fingerprint": "CC2XvyoohnqecEq4r3FtXv6MdCx4TbaW1UUTdCCN5MNL",
"brand": "visa",
"avs_code": "Y",
"cvv2_reply": "M"
},
"bank_account": {
"id": "ba_7Ay5mcUXAxwrN6wQEQUVEHBCJ",
"account_holder_name": "John Doe",
"account_holder_type": "individual",
"account_type": "individual",
"routing_number": "123456789",
"account_number_last4": "1011"
},
"account_balance": {
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"account_name": "Test Company, LLC"
}
},
"customer": {
"id": "cus_7Ay5mcUXAxwrN6wQEQUVEHBCJ",
"external_id": "e797ef3c-b586-4333-af90-7168d8427d85",
"business_name": "Awesome Company, LLC",
"first_name": "John",
"last_name": "Smith",
"government_identifier_last4": "9642",
"email": "john.smith@email.com",
"phone": "+15554829347"
},
"billing_details": {
"address_line_1": "111 Colorado Ave.",
"address_line_2": "Apt 403",
"city": "Des Moines",
"state": "IA",
"postal_code": "51111",
"country": "US"
},
"shipping_address": {
"address_line_1": "111 Colorado Ave.",
"address_line_2": "Apt 403",
"city": "Des Moines",
"state": "IA",
"postal_code": "51111",
"country": "US"
},
"fraud_details": {
"decision": "accept",
"rules": [
{
"rule_engine": "nuvei",
"rule_id": "1287",
"rule_description": "Stolen card"
}
]
},
"transaction": {
"id": "trx_95rvMJvAVeG68W4NtLdfkN3LG",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "production",
"external_id": "e797ef3c-b586-4333-af90-7168d8427d85",
"status": "successful",
"amount": 10000,
"fee_amount": 360,
"net_amount": 9640,
"currency": "USD",
"type_id": "pmt_2YKewBonG4tgk12MheY3PiHDy",
"type": "payment",
"settlement_id": "stl_BGDLZjBLAgNbyqCzJxchSoh5k",
"processor": "nuvei",
"processor_id": "7110000000010554769",
"acquirer_id": "2630000240513800",
"payout": {
"id": "pyt_24NFPd3jSZFTxiaH9UwjuqNdP",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "production",
"external_id": "1268ce56-a4b5-43fa-8526-a500fc2140bb",
"status": "successful",
"declined_reason": "Card lost/stolen",
"transaction_id": "trx_6QgmXzQzk3S5K5EsR3DfEiMRj",
"amount": 9500,
"currency": "USD",
"payment_method": {
"card": {
"id": "card_8PajTnDVrviEJ8zYJDALFQm5t",
"cardholder_name": "John Smith",
"last4": "4242",
"exp_month": "12",
"exp_year": "2025",
"fingerprint": "CC2XvyoohnqecEq4r3FtXv6MdCx4TbaW1UUTdCCN5MNL",
"brand": "visa",
"avs_code": "Y",
"cvv2_reply": "M"
},
"bank_account": {
"id": "ba_7Ay5mcUXAxwrN6wQEQUVEHBCJ",
"account_holder_name": "John Doe",
"account_holder_type": "individual",
"account_type": "individual",
"routing_number": "123456789",
"account_number_last4": "1011"
},
"account_balance": {
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"account_name": "Test Company, LLC"
}
},
"customer": {
"id": "cus_7Ay5mcUXAxwrN6wQEQUVEHBCJ",
"external_id": "e797ef3c-b586-4333-af90-7168d8427d85",
"business_name": "Awesome Company, LLC",
"first_name": "John",
"last_name": "Smith",
"government_identifier_last4": "9642",
"email": "john.smith@email.com",
"phone": "+15554829347"
},
"billing_details": {
"address_line_1": "111 Colorado Ave.",
"address_line_2": "Apt 403",
"city": "Des Moines",
"state": "IA",
"postal_code": "51111",
"country": "US"
},
"dynamic_descriptor": {
"merchant_name": "Test Corporation",
"merchant_contact": "+15552604982"
},
"device_information": {
"browser_family": "Mobile Safari",
"os_family": "iOS",
"device_family": "iPhone",
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3"
},
"created_at": "2024-06-30T01:02:29.212Z",
"modified_at": "2024-06-30T01:02:29.212Z"
},
"refund": {
"id": "rfd_2YKewBonG4tgk12MheY3PiHDy",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "production",
"external_id": "e797ef3c-b586-4333-af90-7168d8427d85",
"status": "successful",
"transaction_id": "trx_95rvMJvAVeG68W4NtLdfkN3LG",
"payment_id": "pmt_2YKewBonG4tgk12MheY3PiHDy",
"amount": 500,
"currency": "USD",
"reason": "Refunding shipping",
"declined_reason": "Suspected fraud",
"device_information": {
"browser_family": "Mobile Safari",
"os_family": "iOS",
"device_family": "iPhone",
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3"
},
"created_at": "2024-06-30T01:02:29.212Z",
"modified_at": "2024-06-30T01:02:29.212Z"
},
"settlement": {
"id": "stl_BGDLZjBLAgNbyqCzJxchSoh5k",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "production",
"status": "successful",
"transaction_id": "trx_95rvMJvAVeG68W4NtLdfkN3LG",
"payment_amount": 1500,
"payment_count": 3,
"refund_amount": 500,
"refund_count": 1,
"total_count": 4,
"amount": 1000,
"currency": "USD",
"settled_at": "2024-06-30T00:00:00.000Z",
"created_at": "2024-06-30T01:02:29.212Z",
"modified_at": "2024-06-30T01:02:29.212Z"
},
"payment_transfer": {
"id": "trnf_7yFLQWACr3DYDSz1xpoEAVfdq",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "production",
"external_id": "e797ef3c-b586-4333-af90-7168d8427d85",
"status": "successful",
"payment_id": "pmt_2YKewBonG4tgk12MheY3PiHDy",
"transaction_id": "trx_95rvMJvAVeG68W4NtLdfkN3LG",
"total_amount": 10000,
"currency": "USD",
"created_at": "2024-06-30T01:02:29.212Z",
"modified_at": "2024-06-30T01:02:29.212Z",
"items": [
{
"id": "trfi_7yFLQWACr3DYDSz1xpoEAVfdq",
"external_id": "e797ef3c-b586-4333-af90-7168d8427d85",
"amount": 10000,
"transfer_fee": 100,
"seller_account_id": "acc_8ooQs32UCdriBvrHnVWbTmJbY"
}
]
},
"refund_transfer": {
"id": "trnf_7yFLQWACr3DYDSz1xpoEAVfdq",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "production",
"external_id": "e797ef3c-b586-4333-af90-7168d8427d85",
"status": "successful",
"refund_id": "rfd_2YKewBonG4tgk12MheY3PiHDy",
"payment_transfer_id": "trnf_7yFLQWACr3DYDSz1xpoEAVfdq",
"transaction_id": "trx_95rvMJvAVeG68W4NtLdfkN3LG",
"total_amount": 10000,
"currency": "USD",
"created_at": "2024-06-30T01:02:29.212Z",
"modified_at": "2024-06-30T01:02:29.212Z",
"items": [
{
"id": "trfi_4iarm41gZ1qyxDoGfEEMXyryJ",
"payment_transfer_item_id": "trfi_7yFLQWACr3DYDSz1xpoEAVfdq",
"external_id": "e797ef3c-b586-4333-af90-7168d8427d85",
"amount": 10000,
"transfer_fee": 100,
"seller_account_id": "acc_8ooQs32UCdriBvrHnVWbTmJbY"
}
]
},
"created_at": "2024-06-30T01:02:29.212Z",
"modified_at": "2024-06-30T01:02:29.212Z"
},
"dynamic_descriptor": {
"merchant_name": "Test Corporation",
"merchant_contact": "+15552604982"
},
"device_information": {
"browser_family": "Mobile Safari",
"os_family": "iOS",
"device_family": "iPhone",
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3"
},
"created_at": "2024-06-30T01:02:29.212Z",
"modified_at": "2024-06-30T01:02:29.212Z"
}
Bad Request
- application/json
- Schema
- Example (auto)
Schema
errors objectnullable
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"errors": {},
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Unauthorized
- application/json
- Schema
- Example (auto)
Schema
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Forbidden
- application/json
- Schema
- Example (auto)
Schema
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Not Found
- application/json
- Schema
- Example (auto)
Schema
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Authorization: X-API-KEY
name: X-API-KEYtype: apiKeyscopes: payment:read
description: Authorization by API Key inside request's X-API-KEY headerin: header
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.publicsquare.com/payments/:id");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-API-KEY", "<X-API-KEY>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear