POST
/
v1
/
businesses
/
{business_id}
/
invoices
/
payments
curl -X POST https://sandbox.layerfi.com/v1/businesses/{business_id}/invoices/payments \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "payment-1",
    "paid_at": "2024-02-27T02:22:55.163005Z",
    "method": "CREDIT_CARD",
    "fee": 20,
    "amount": 90,
    "processor": "STRIPE",
    "invoice_payments": [
      {
        "invoice_id": "3a9c378e-dc02-4700-9158-f629d632a83b",
        "amount": 90
      }
    ],
    "additional_fees": [
      {
        "account": {
          "type": "StableName",
          "stable_name": "MERCHANT_CASH_ADVANCE"
        },
        "description": "MCA Fee",
        "fee_amount": 2
      }
    ]
  }'
{
  "data": {
    "type": "Payment",
    "id": "e67c216b-28f4-4a0e-9a21-7f05c19e4c66",
    "external_id": "payment-1",
    "at": "2024-02-27T02:16:40.369432Z",
    "method": "CREDIT_CARD",
    "fee": 20,
    "amount": 90,
    "processor": "STRIPE",
    "imported_at": "2024-02-27T02:16:40.389772Z",
    "allocations": [
      {
        "invoice_id": "57f0fada-bb56-4f3e-9afa-2a222b68009e",
        "payment_id": "e67c216b-28f4-4a0e-9a21-7f05c19e4c66",
        "amount": 90,
        "transaction_tags": []
      }
    ],
    "transaction_tags": [],
    "additional_fees": [
      {
        "account": {
          "type": "AccountId",
          "id": "50448df3-6f86-445e-b48f-0e80153e5d42"
        },
        "description": "MCA Fee",
        "fee_amount": 2
      }
    ],
  },
  "meta": {}
}

Path Parameters

business_id
string
required
ID of the Business the invoice is associated with.

Body

external_id
string
External ID for the payment within your platform. Idempotency key.
paid_at
ISO8601 timestamp
required
Date of the payment.
method
enum
required
Payment method. Possible values are: CASH, CHECK, CREDIT_CARD, ACH, CREDIT_BALANCE, OTHER
fee
integer
required
Fee paid by business for processing of payment in positive cents.
additional_fees
array of InvoicePaymentFee objects
amount
integer
required
Payment amount, in cents.
processor
string
Processor used to make the payment, if any. Any processor name can be provided and will be tracked.
payment_clearing_account_identifier
AccountIdentifier
The ledger account to use for the payment (overrides the default determined by the payment method).
invoice_payments
array of InvoicePaymentAllocation objects
required
dedicated_refunds
array of RefundAllocation objects
List of Refund Allocations associated with this invoice payment.
tags
Array of Tags

Response

Returns the created Invoice Payment Object
curl -X POST https://sandbox.layerfi.com/v1/businesses/{business_id}/invoices/payments \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "payment-1",
    "paid_at": "2024-02-27T02:22:55.163005Z",
    "method": "CREDIT_CARD",
    "fee": 20,
    "amount": 90,
    "processor": "STRIPE",
    "invoice_payments": [
      {
        "invoice_id": "3a9c378e-dc02-4700-9158-f629d632a83b",
        "amount": 90
      }
    ],
    "additional_fees": [
      {
        "account": {
          "type": "StableName",
          "stable_name": "MERCHANT_CASH_ADVANCE"
        },
        "description": "MCA Fee",
        "fee_amount": 2
      }
    ]
  }'
{
  "data": {
    "type": "Payment",
    "id": "e67c216b-28f4-4a0e-9a21-7f05c19e4c66",
    "external_id": "payment-1",
    "at": "2024-02-27T02:16:40.369432Z",
    "method": "CREDIT_CARD",
    "fee": 20,
    "amount": 90,
    "processor": "STRIPE",
    "imported_at": "2024-02-27T02:16:40.389772Z",
    "allocations": [
      {
        "invoice_id": "57f0fada-bb56-4f3e-9afa-2a222b68009e",
        "payment_id": "e67c216b-28f4-4a0e-9a21-7f05c19e4c66",
        "amount": 90,
        "transaction_tags": []
      }
    ],
    "transaction_tags": [],
    "additional_fees": [
      {
        "account": {
          "type": "AccountId",
          "id": "50448df3-6f86-445e-b48f-0e80153e5d42"
        },
        "description": "MCA Fee",
        "fee_amount": 2
      }
    ],
  },
  "meta": {}
}