API Reference
- Getting started
- Add-ons
- Analytics
- Billable metrics
- Coupons
- Credit notes
- Customer usage
- Customers
- Events
- Fees
- Invoices
- Organizations
- Payment requests
- Plans
- Resources
- Subscriptions
- Taxes
- Wallets
- Webhook endpoints
- Webhooks
Create a payment request
This endpoint is used to create a payment request to collect payments of overdue invoices of a given customer
curl --request POST \
--url https://api.getlago.com/api/v1/payment_requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payment_request": {
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"email": "dinesh@piedpiper.test",
"lago_invoice_ids": [
"1a901a90-1a90-1a90-1a90-1a901a901a90"
]
}
}'
{
"payment_request": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"email": "dinesh@piedpiper.test",
"amount_cents": 100,
"amount_currency": "EUR",
"payment_status": "succeeded",
"created_at": "2022-04-29T08:59:51Z",
"customer": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"sequential_id": 1,
"slug": "LAG-1234-001",
"external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"applicable_timezone": "America/Los_Angeles",
"city": "Woodland Hills",
"country": "US",
"currency": "USD",
"email": "dinesh@piedpiper.test",
"legal_name": "Coleman-Blair",
"legal_number": "49-008-2965",
"logo_url": "http://hooli.com/logo.png",
"name": "Gavin Belson",
"firstname": "Gavin",
"lastname": "Belson",
"account_type": "customer",
"customer_type": "company",
"phone": "1-171-883-3711 x245",
"state": "CA",
"tax_identification_number": "EU123456789",
"timezone": "America/Los_Angeles",
"url": "http://hooli.com",
"zipcode": "91364",
"net_payment_term": 30,
"created_at": "2022-04-29T08:59:51Z",
"updated_at": "2022-04-29T08:59:51Z",
"finalize_zero_amount_invoice": "inherit",
"skip_invoice_custom_sections": false,
"billing_configuration": {
"invoice_grace_period": 3,
"payment_provider": "stripe",
"payment_provider_code": "stripe-eu-1",
"provider_customer_id": "cus_12345",
"sync": true,
"sync_with_provider": true,
"document_locale": "fr",
"provider_payment_methods": [
"card",
"sepa_debit",
"us_bank_account",
"bacs_debit",
"link",
"boleto",
"crypto"
]
},
"shipping_address": {
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"city": "Woodland Hills",
"country": "US",
"state": "CA",
"zipcode": "91364"
},
"metadata": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"key": "Purchase Order",
"value": "123456789",
"display_in_invoice": true,
"created_at": "2022-04-29T08:59:51Z"
}
]
},
"invoices": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"sequential_id": 2,
"number": "LAG-1234-001-002",
"issuing_date": "2022-04-30",
"payment_dispute_lost_at": "2022-09-14T16:35:31Z",
"payment_due_date": "2022-04-30",
"payment_overdue": true,
"net_payment_term": 30,
"invoice_type": "subscription",
"status": "finalized",
"payment_status": "succeeded",
"currency": "EUR",
"fees_amount_cents": 100,
"coupons_amount_cents": 10,
"credit_notes_amount_cents": 10,
"sub_total_excluding_taxes_amount_cents": 100,
"taxes_amount_cents": 20,
"sub_total_including_taxes_amount_cents": 120,
"prepaid_credit_amount_cents": 0,
"progressive_billing_credit_amount_cents": 0,
"total_amount_cents": 100,
"version_number": 3,
"self_billed": false,
"file_url": "https://getlago.com/invoice/file",
"created_at": "2022-04-29T08:59:51Z",
"updated_at": "2022-04-29T08:59:51Z"
}
]
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
The customer external unique identifier (provided by your own application)
The customer's email address used for sending dunning notifications
A list of Lago IDs for the customer's overdue invoices to start the dunning process
Response
Unique identifier of the payment request, created by Lago.
The customer's email address used for sending dunning notifications
The sum of the total amounts of all the invoices included in the payment request, expressed in cents.
The currency of the payment request.
AED
, AFN
, ALL
, AMD
, ANG
, AOA
, ARS
, AUD
, AWG
, AZN
, BAM
, BBD
, BDT
, BGN
, BIF
, BMD
, BND
, BOB
, BRL
, BSD
, BWP
, BYN
, BZD
, CAD
, CDF
, CHF
, CLF
, CLP
, CNY
, COP
, CRC
, CVE
, CZK
, DJF
, DKK
, DOP
, DZD
, EGP
, ETB
, EUR
, FJD
, FKP
, GBP
, GEL
, GIP
, GMD
, GNF
, GTQ
, GYD
, HKD
, HNL
, HRK
, HTG
, HUF
, IDR
, ILS
, INR
, ISK
, JMD
, JPY
, KES
, KGS
, KHR
, KMF
, KRW
, KYD
, KZT
, LAK
, LBP
, LKR
, LRD
, LSL
, MAD
, MDL
, MGA
, MKD
, MMK
, MNT
, MOP
, MRO
, MUR
, MVR
, MWK
, MXN
, MYR
, MZN
, NAD
, NGN
, NIO
, NOK
, NPR
, NZD
, PAB
, PEN
, PGK
, PHP
, PKR
, PLN
, PYG
, QAR
, RON
, RSD
, RUB
, RWF
, SAR
, SBD
, SCR
, SEK
, SGD
, SHP
, SLL
, SOS
, SRD
, STD
, SZL
, THB
, TJS
, TOP
, TRY
, TTD
, TWD
, TZS
, UAH
, UGX
, USD
, UYU
, UZS
, VND
, VUV
, WST
, XAF
, XCD
, XOF
, XPF
, YER
, ZAR
, ZMW
The status of the payment associated with the payment request. It can have one of the following values:
pending
: the payment is pending, waiting for payment processing in the payment provider or when the invoice is emitted but users have not updated the payment status through the endpoint.succeeded
: the payment of the payment request has been successfully processed.failed
: the payment of the payment request has failed or encountered an error during processing.
pending
, succeeded
, failed
The date and time when the payment request was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the payment request was initially created.
Was this page helpful?
curl --request POST \
--url https://api.getlago.com/api/v1/payment_requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payment_request": {
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"email": "dinesh@piedpiper.test",
"lago_invoice_ids": [
"1a901a90-1a90-1a90-1a90-1a901a901a90"
]
}
}'
{
"payment_request": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"email": "dinesh@piedpiper.test",
"amount_cents": 100,
"amount_currency": "EUR",
"payment_status": "succeeded",
"created_at": "2022-04-29T08:59:51Z",
"customer": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"sequential_id": 1,
"slug": "LAG-1234-001",
"external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"applicable_timezone": "America/Los_Angeles",
"city": "Woodland Hills",
"country": "US",
"currency": "USD",
"email": "dinesh@piedpiper.test",
"legal_name": "Coleman-Blair",
"legal_number": "49-008-2965",
"logo_url": "http://hooli.com/logo.png",
"name": "Gavin Belson",
"firstname": "Gavin",
"lastname": "Belson",
"account_type": "customer",
"customer_type": "company",
"phone": "1-171-883-3711 x245",
"state": "CA",
"tax_identification_number": "EU123456789",
"timezone": "America/Los_Angeles",
"url": "http://hooli.com",
"zipcode": "91364",
"net_payment_term": 30,
"created_at": "2022-04-29T08:59:51Z",
"updated_at": "2022-04-29T08:59:51Z",
"finalize_zero_amount_invoice": "inherit",
"skip_invoice_custom_sections": false,
"billing_configuration": {
"invoice_grace_period": 3,
"payment_provider": "stripe",
"payment_provider_code": "stripe-eu-1",
"provider_customer_id": "cus_12345",
"sync": true,
"sync_with_provider": true,
"document_locale": "fr",
"provider_payment_methods": [
"card",
"sepa_debit",
"us_bank_account",
"bacs_debit",
"link",
"boleto",
"crypto"
]
},
"shipping_address": {
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"city": "Woodland Hills",
"country": "US",
"state": "CA",
"zipcode": "91364"
},
"metadata": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"key": "Purchase Order",
"value": "123456789",
"display_in_invoice": true,
"created_at": "2022-04-29T08:59:51Z"
}
]
},
"invoices": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"sequential_id": 2,
"number": "LAG-1234-001-002",
"issuing_date": "2022-04-30",
"payment_dispute_lost_at": "2022-09-14T16:35:31Z",
"payment_due_date": "2022-04-30",
"payment_overdue": true,
"net_payment_term": 30,
"invoice_type": "subscription",
"status": "finalized",
"payment_status": "succeeded",
"currency": "EUR",
"fees_amount_cents": 100,
"coupons_amount_cents": 10,
"credit_notes_amount_cents": 10,
"sub_total_excluding_taxes_amount_cents": 100,
"taxes_amount_cents": 20,
"sub_total_including_taxes_amount_cents": 120,
"prepaid_credit_amount_cents": 0,
"progressive_billing_credit_amount_cents": 0,
"total_amount_cents": 100,
"version_number": 3,
"self_billed": false,
"file_url": "https://getlago.com/invoice/file",
"created_at": "2022-04-29T08:59:51Z",
"updated_at": "2022-04-29T08:59:51Z"
}
]
}
}