Create a payment
Create an online or offline payment for an invoice, order, payment request, or credit grant.
Authorization
bearerAuth In: header
Request Body
application/json
Mode of the payment. Offline payments record manual payments made outside of the system. Online payments process payments through a payment provider.
"offline""online" | "offline"ID of the account to record payment for.
Reference for the payment.
For offline payments only. Timestamp when the payment succeeded. Defaults to current time if not provided.
date-timeID of the payment integration to process the payment through. Required for online payments when payment_method_id is not provided.
ID of the payment method to use for the payment. Payment method will be charged immediately. Required for online payments when integration_id is not provided.
ID of the invoice to create payment for. Required when payment_request_id, order_id and credit_grant_id are not provided.
ID of the payment request to create payment for. Required when invoice_id, order_id and credit_grant_id are not provided.
ID of the order to create payment for. Required when invoice_id, payment_request_id and credit_grant_id are not provided.
ID of the credit grant to create payment for. Required when invoice_id, payment_request_id and order_id are not provided.
Response Body
application/json
curl -X POST "https://api.sandbox.billingrails.com/v1/payments" \ -H "Content-Type: application/json" \ -d '{ "mode": "offline", "account_id": "acc_IhMUl3rrZ3", "reference_id": "PAY-REF-001", "invoice_id": "inv_IhMUl3rrZ3" }'{
"payment": {
"object": "payment",
"id": "pay_IhMUl3rrZ3",
"account_id": "acc_IhMUl3rrZ3",
"amount": 1000,
"currency": "USD",
"description": "Payment for invoice INV-0001",
"reference_id": "PAY-REF-001",
"status": "succeeded",
"created_at": "2025-02-14T17:33:40.843Z"
},
"payment_link": "http://example.com"
}