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,
"tags": [
{
"key": "payment-source",
"dimension_display_name": "Payment Source",
"value": "online-portal",
"value_display_name": "Online Portal"
}
]
}
],
"additional_fees": [
{
"account": {
"type": "StableName",
"stable_name": "MERCHANT_CASH_ADVANCE"
},
"description": "MCA Fee",
"fee_amount": 2
}
],
"tags": [
{
"key": "payment-channel",
"dimension_display_name": "Payment Channel",
"value": "in-store",
"value_display_name": "In Store"
},
{
"key": "department",
"value": "sales"
}
]
}'
{
"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": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
]
}
],
"transaction_tags": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
],
"additional_fees": [
{
"account": {
"type": "AccountId",
"id": "50448df3-6f86-445e-b48f-0e80153e5d42"
},
"description": "MCA Fee",
"fee_amount": 2
}
],
},
"meta": {}
}
Invoice Payments
Record a Payment
This endpoint records a payment made towards an invoice in Layer.
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,
"tags": [
{
"key": "payment-source",
"dimension_display_name": "Payment Source",
"value": "online-portal",
"value_display_name": "Online Portal"
}
]
}
],
"additional_fees": [
{
"account": {
"type": "StableName",
"stable_name": "MERCHANT_CASH_ADVANCE"
},
"description": "MCA Fee",
"fee_amount": 2
}
],
"tags": [
{
"key": "payment-channel",
"dimension_display_name": "Payment Channel",
"value": "in-store",
"value_display_name": "In Store"
},
{
"key": "department",
"value": "sales"
}
]
}'
{
"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": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
]
}
],
"transaction_tags": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
],
"additional_fees": [
{
"account": {
"type": "AccountId",
"id": "50448df3-6f86-445e-b48f-0e80153e5d42"
},
"description": "MCA Fee",
"fee_amount": 2
}
],
},
"meta": {}
}
Path Parameters
Body
string
External ID for the payment within your platform. Idempotency key.
ISO8601 timestamp
required
Date of the payment.
enum
required
Payment method. Possible values are:
CASH, CHECK, CREDIT_CARD, ACH, CREDIT_BALANCE,
OTHERinteger
required
Fee paid by business for processing of payment in positive cents.
array of InvoicePaymentFee objects
Show InvoicePaymentFee properties
Show InvoicePaymentFee properties
string
Optional description of the fee.
object
required
The Account Identifier for the fee.
integer
required
Amount of the fee in cents.
boolean
required
Whether or not the fee is passed to the customer. It is paid by the business otherwise.
integer
required
Payment amount, in cents.
string
Processor used to make the payment, if any.
Any processor name can be provided and will be tracked.
AccountIdentifier
The ledger account to use for the payment (overrides the default determined by the payment method).
array of InvoicePaymentAllocation objects
required
Show InvoicePaymentAllocation properties
Show InvoicePaymentAllocation properties
uuid
Layer ID of the invoice to apply payment. Either the invoice_id or invoice_external_id must be provided.
string
External ID of the invoice payment. Either the invoice_id or invoice_external_id must be provided.
integer
Amount paid towards this invoice in cents. Cannot exceed the amount of the
associated payment.
array of TagKeyValue objects
Show TagKeyValue properties
Show TagKeyValue properties
string
required
The tag dimension key (e.g., “department”, “project”, “location”)
string
Optional display name for the tag dimension. If not specified,
key will be displayed.string
required
The tag value (e.g., “engineering”, “project-alpha”, “san-francisco”)
string
Optional display name for the tag value definition. If not specified,
value will be displayed.array of RefundAllocation objects
List of Refund Allocations associated with this invoice payment.
array of TagKeyValue objects
Show TagKeyValue properties
Show TagKeyValue properties
string
required
The tag dimension key (e.g., “department”, “project”, “location”)
string
Optional display name for the tag dimension. If not specified,
key will be displayed.string
required
The tag value (e.g., “engineering”, “project-alpha”, “san-francisco”)
string
Optional display name for the tag value definition. If not specified,
value will be displayed.Response
Returns the created Invoice Payment Objectcurl -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,
"tags": [
{
"key": "payment-source",
"dimension_display_name": "Payment Source",
"value": "online-portal",
"value_display_name": "Online Portal"
}
]
}
],
"additional_fees": [
{
"account": {
"type": "StableName",
"stable_name": "MERCHANT_CASH_ADVANCE"
},
"description": "MCA Fee",
"fee_amount": 2
}
],
"tags": [
{
"key": "payment-channel",
"dimension_display_name": "Payment Channel",
"value": "in-store",
"value_display_name": "In Store"
},
{
"key": "department",
"value": "sales"
}
]
}'
{
"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": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
]
}
],
"transaction_tags": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
],
"additional_fees": [
{
"account": {
"type": "AccountId",
"id": "50448df3-6f86-445e-b48f-0e80153e5d42"
},
"description": "MCA Fee",
"fee_amount": 2
}
],
},
"meta": {}
}
⌘I