Contact Us

Payments API

Initiate and manage payments. Requests authenticate by secret key.

List Payments

Request

GET /payment
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnnn
ParameterDescription
limit Payments per page. Default 50, max 100
page Page number. Default 1
search Search text, max 100 characters. Matches accountLastFour, email, firstName, id, and lastName
sort asc or desc (default)
start, end UTC bounds on paymentTime, ending in Z
status Comma-separated statuses

Response

{
  data: [
    {
      accountLastFour: String,
      address: String,
      amount: Number,
      city: String,
      country: String,
      currency: "USD",
      email: String,
      fee: Number,
      firstName: String,
      id: String,
      lastName: String,
      method: "card" | "ach",
      paymentTime: String,
      phone: String,
      postalCode: String,
      pricing: "absorbed" | "dual" | "surcharge",
      rate: Number,
      state: String,
      status: String,
      tax: Number,
      token: String,
      total: Number
    }
  ],
  metadata: {
    limit: Number,
    page: Number,
    pages: Number,
    total: Number
  }
}

See Read Payment below for field details.

FieldTypeDescription
metadata.pages Number Pages of matching payments
metadata.total Number Payments matching filters

Read Payment

Request

GET /payment/:id
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnnn

Response

{
  data: {
    accountLastFour: String,
    address: String,
    amount: Number,
    city: String,
    country: String,
    currency: "USD",
    email: String,
    fee: Number,
    firstName: String,
    id: String,
    lastName: String,
    method: "card" | "ach",
    paymentTime: String,
    phone: String,
    postalCode: String,
    pricing: "absorbed" | "dual" | "surcharge",
    rate: Number,
    refundable: Number,
    refunds: [
      {
        amount: Number,
        fee: Number,
        id: String,
        rate: Number,
        refundTime: String,
        status: "pending" | "success" | "declined",
        tax: Number,
        total: Number
      }
    ],
    state: String,
    status: String,
    tax: Number,
    token: String,
    total: Number
  }
}

Fields

FieldTypeDescription
accountLastFour String or null Last four card or bank account digits
address String or null Street address, including apartment, suite, or unit
amount Number In dollars, before any fee or tax
city String or null  
country String or null
(2 letters)
 
currency String "USD"
email, phone String or null  
fee Number In dollars, if applicable
firstName, lastName String or null  
id String (uuid) Payment ID
method String card or ach
paymentTime String (ISO 8601)  
postalCode String or null ZIP or ZIP+4
pricing String absorbed, dual, or surcharge
rate Number As a fraction, if applicable, such as 0.03
refundable Number (dollars) Amount still refundable
refunds Array of Objects Refunds, each with its own status: pending, success, or declined
state String or null
(2 letters)
 
status String Payment status
tax Number In dollars, if applicable
token String or null Secure representation of payment account to perform future transactions. null when the payment account was not saved
total Number In dollars, amount plus fee and tax when applicable

Status

statusDescription
created Pending, including an unsettled ACH debit
success Card charged or ACH debit sent; includes settled
settled Funds transferred to merchant
partially_refunded Refunded in part
refunded Refunded in full
canceled Voided
declined Declined by card issuer or bank, or not charged for another reason
disputed Under dispute
returned ACH debit returned by bank

Void Payment

Cancel an unsettled payment (status created or success). Settled payments must be refunded. Requires an Idempotency-Key.

Request

POST /payment/:id/void
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnnn
Idempotency-Key: String

Response

{
  data: {
    id: String,
    result: "success" | "error" | "processing",
    detail: String,
    voidTime: String
  }
}
FieldTypeResultDescription
detail String error Error reason
id String (uuid) All Voided payment ID
result String All
  • success
  • error: see detail
  • processing: Not confirmed; repeat request with same Idempotency-Key
voidTime String (ISO 8601) success  

Refund Payment

Partial refunds automatically include their share of fees and tax when applicable. Requires an Idempotency-Key.

Request

POST /payment/:id/refund
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnnn
Idempotency-Key: String
{
  data: {
    amount: Number
  }
}
FieldTypeRequiredDescription
amount Number (dollars) Yes Amount to refund. ACH payments only accept full refunds
refund String No
  • calculate (default): Includes applicable fees and tax
  • exact: Returns exact amount, regardless of fees and tax

Response

{
  data: {
    amount: Number,
    detail: String,
    fee: Number,
    id: String,
    paymentId: String,
    rate: Number,
    result: "success" | "error" | "processing",
    tax: Number,
    total: Number
  }
}
FieldTypeResultDescription
amount Number All In dollars, before any fee or tax
detail String error Error reason
fee Number All Portion refunded, if applicable, in dollars
id String (uuid) All Refund ID, as listed in payment refunds
paymentId String (uuid) All Refunded payment ID
rate Number All As a fraction, if applicable, such as 0.03
result String All
  • success
  • error: see detail
  • processing: Not confirmed; repeat request with same Idempotency-Key
tax Number All Portion refunded, if applicable, in dollars
total Number All In dollars, amount plus applicable fee and tax

Create Session

Optionally authenticate frontend sessions with the Embedded Payments SDK. Configure amount and other payment attributes. Returns an id to open the frontend modal. Payments must complete within one hour of creating the session.

Request

POST /payment/session
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnnn
{
  data: {
    amount: Number,
    customerReference: String,
    product: String,
    sdkProduct: String
  }
}
FieldTypeRequiredDescription
amount Number (dollars) Yes Subtotal before fee, at most 2 decimals
customerReference String No Your id for the customer: 1 to 64 letters, digits and - _ . : / #. The payment is linked to that customer
sdkProduct String No lightbox by default

Response

{
  data: {
    expiresAt: String
    id: String,
  }
}
FieldTypeDescription
expiresAt String (ISO 8601) When the session can no longer be opened or paid
id String (uuid) Frontend sessionId to call open

New Payment

Initiate a new payment with a token from the Embedded Payments SDK. Requires an Idempotency-Key.

Request

POST /payment
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnnn
Idempotency-Key: String
{
  data: {
    amount: Number,
    token: String
  }
}
FieldTypeRequiredDescription
amount Number (dollars) Yes Before fee
token String Yes Card or ACH token from the Embedded Payments SDK

Response

{
  data: {
    amount: Number,
    currency: "USD",
    detail: String,
    fee: Number,
    id: String,
    result: "success" | "declined" | "error" | "processing",
    tax: Number,
    token: String,
    total: Number
  }
}
FieldTypeResultDescription
amount Number (dollars) All Before fee and tax
currency String All "USD"
detail String declined, error Decline or error reason
fee Number (dollars) success, declined, error Additional card price or surcharge, not including tax
id String (uuid) All Payment ID. Omitted when no payment was recorded
result String All
  • success: Card charged or ACH debit sent
  • declined: Declined by card issuer or bank
  • error: Not charged, see detail
  • processing: Not confirmed yet (HTTP 202). Repeat the request with the same Idempotency-Key
tax Number (dollars) success, declined, error Tax added; 0 when none, and always 0 under dual pricing
token String success Secure representation of payment account to perform future transactions
total Number (dollars) success, declined, error Amount charged to payer: amount plus fee plus tax

Delete Token

Delete a stored payment token.

Request

DELETE /token/:token
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnnn

Response

{
  data: {
    token: String,
    status: "deleted"
  }
}

Idempotency

Idempotency allows requests to be repeated without repeating the effect. Idempotency prevents a network fault from charging a payer twice.

New, refund, and void requests require an Idempotency-Key header of 1 to 255 characters. Use a unique key for each unique request. Use the same key to repeat a request after receiving an error.

POST /payment
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnnn
Idempotency-Key: 4f9c1a52-3b0e-4d8e-9a8f-2f6d3c1e7b10

Errors

{
  errors: [
    {
      status: Number,
      title: String,
      detail: String
    }
  ]
}
StatusCause
400 Bad Request Missing or malformed field, see detail for mitigation
401 Unauthorized Invalid secret key
403 Forbidden Organization does not have Payments API enabled, contact support@findustryai.com
404 Not Found Payment or token not found
409 Conflict Payment state does not allow refund or void, or same request is in progress. Retry an in-progress request unchanged
429 Too Many Requests Secret key rate limit reached
502 Bad Gateway Payment service failed. Retry with same Idempotency-Key
504 Gateway Timeout Payment service timed out. Retry with same Idempotency-Key