How do Amelia API payment endpoints work
Amelia payment endpoints let you create, update, retrieve, refund, and delete payments related to appointments, events, and packages.
- Postman collection: You can review all endpoints and examples in the Amelia API Postman collection.
- Authorization: All endpoints use an API key via the Amelia request header.
- Base path:
{{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1
How do I add a payment to a booking?
Use this endpoint to create a payment record and attach it to an existing booking.
- Method: POST
- Path:
/payments
Required properties
- customerBookingId (integer); booking ID the payment belongs to
- amount (number); payment amount
- gateway (string);
onSite,payPal,stripe,wc,mollie,razorpay - status (string);
paid,pending,partiallyPaid,refunded - packageCustomerId (integer); required when the payment is related to a package purchase
- entity (string);
appointment,event,package
Other properties
- dateTime (string);
YYYY-MM-DD HH:mm - gatewayTitle (string); for WooCommerce gateways (example: Stripe, Cash on Delivery, Bank transfer)
- actionsCompleted (boolean); whether post-booking actions are completed
- wcOrderId (integer); WooCommerce order ID
- transactionId (string); online gateway transaction ID (used for refund when not using WooCommerce)
Example
Request
curl --location 'https://example.website/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/payments' \
--header 'Content-Type: application/json' \
--header 'Amelia: YOUR_API_KEY' \
--data '{
"customerBookingId": 268,
"amount": 10,
"dateTime": "2026-01-14 15:00:00",
"status": "paid",
"gateway": "stripe",
"data": {},
"packageCustomerId": null,
"entity": "appointment"
}'
Response
{
"message": "New payment successfully created.",
"data": {
"payment": {
"id": null,
"customerBookingId": 268,
"packageCustomerId": null,
"parentId": null,
"amount": 10,
"gateway": "stripe",
"gatewayTitle": "",
"dateTime": "2026-01-14 15:00:00",
"status": "paid",
"data": "[]",
"entity": "appointment",
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null
}
}
}
How do I update an existing payment?
Use this endpoint to update one or more payment properties. Send only the fields you want to change.
- Method: POST
- Path:
/payments/{{payment_id}}
Optional properties
- customerBookingId (integer)
- amount (number)
- gateway (string);
onSite,payPal,stripe,wc,mollie,razorpay - status (string);
paid,pending,partiallyPaid,refunded - packageCustomerId (integer)
- entity (string);
appointment,event,package - dateTime (string);
YYYY-MM-DD HH:mm - gatewayTitle (string)
- actionsCompleted (boolean)
- wcOrderId (integer)
- transactionId (string)
Example
Request
curl --location 'https://example.website/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/payments/280' \
--header 'Content-Type: application/json' \
--header 'Amelia: YOUR_API_KEY' \
--data '{
"customerBookingId": 268,
"amount": 15,
"dateTime": "2026-02-03 15:00:00",
"status": "paid",
"gateway": "stripe",
"gatewayTitle": null,
"data": null,
"packageCustomerId": null,
"entity": "appointment",
"actionsCompleted": 1,
"wcOrderId": null,
"transactionId": null
}'
Response
{
"message": "Payment successfully updated.",
"data": {
"payment": {
"id": null,
"customerBookingId": 268,
"packageCustomerId": null,
"parentId": null,
"amount": 15,
"gateway": "stripe",
"gatewayTitle": "",
"dateTime": "2026-02-03 15:00:00",
"status": "paid",
"data": "",
"entity": null,
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null
}
}
}
How do I retrieve a single payment?
Use this endpoint to retrieve details for a specific payment ID.
- Method: GET
- Path:
/payments/{{payment_id}}
Example
Request
curl --location 'https://example.website/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/payments/312' \
--header 'Amelia: YOUR_API_KEY'
Response
{
"message": "Successfully retrieved payment.",
"data": {
"payment": {
"id": 312,
"customerBookingId": 268,
"packageCustomerId": null,
"parentId": null,
"amount": 10,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2026-03-11 13:00:00",
"status": "paid",
"data": "",
"entity": "appointment",
"created": "2026-03-11 11:18:32",
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null
}
}
}
How do I retrieve a list of payments?
Use this endpoint to list payments. You can filter results by date range and page.
- Method: GET
- Path:
/payments
Query parameters
- dates (string); start and end date, separated by a comma (example:
2026-02-01,2026-02-29) - page (integer); result page number (the per-page limit is defined in Amelia settings)
Example
Request
curl --location 'https://example.website/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/payments&page=1&dates=2026-02-01,2026-02-29' \
--header 'Amelia: YOUR_API_KEY'
Response
{
"message": "Successfully retrieved payments.",
"data": {
"payments": [
{
"id": 234,
"dateTime": "2026-02-05 11:00:00",
"bookingStart": "2026-02-05 11:00:00",
"status": "pending",
"wcOrderId": null,
"gateway": "onSite",
"gatewayTitle": "",
"name": "free service",
"customerBookingId": 196,
"packageCustomerId": null,
"amount": 0,
"providers": [
{
"id": 3,
"fullName": "Mila Petrovic",
"email": "mila.petrovic@example.test"
}
],
"customerId": 11,
"serviceId": 6,
"appointmentId": 128,
"packageId": null,
"bookedPrice": 10,
"bookableName": "free service",
"customerFirstName": "Jordan",
"customerLastName": "Parker",
"info": "{\"firstName\":\"Jordan\",\"lastName\":\"Parker\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"customerEmail": "jordan.parker@example.test",
"coupon": null,
"persons": 1,
"aggregatedPrice": 1,
"bookingExtrasSum": 0,
"secondaryPayments": []
},
{
"id": 260,
"dateTime": "2026-02-05 11:00:00",
"bookingStart": "2026-02-05 11:00:00",
"status": "pending",
"wcOrderId": null,
"gateway": "onSite",
"gatewayTitle": "",
"name": "consultation",
"customerBookingId": 219,
"packageCustomerId": null,
"amount": 0,
"providers": [
{
"id": 1,
"fullName": "Elena Ilic",
"email": "elena.ilic@example.test"
}
],
"customerId": 17,
"serviceId": 2,
"appointmentId": 144,
"packageId": null,
"bookedPrice": 100,
"bookableName": "consultation",
"customerFirstName": "Sofia",
"customerLastName": "Kovacevic",
"info": null,
"customerEmail": "sofia.kovacevic@example.test",
"coupon": null,
"persons": 1,
"aggregatedPrice": 1,
"bookingExtrasSum": 0,
"secondaryPayments": []
},
{
"id": 312,
"dateTime": "2026-02-14 15:00:00",
"bookingStart": "2026-02-23 09:00:00",
"status": "paid",
"wcOrderId": null,
"gateway": "onSite",
"gatewayTitle": "",
"name": "amelia service",
"customerBookingId": 268,
"packageCustomerId": null,
"amount": 10,
"providers": [
{
"id": 1,
"fullName": "Elena Ilic",
"email": "elena.ilic@example.test"
}
],
"customerId": 2,
"serviceId": 1,
"appointmentId": 181,
"packageId": null,
"bookedPrice": 20,
"bookableName": "amelia service",
"customerFirstName": "Jordan",
"customerLastName": "Parker",
"info": "{\"firstName\":\"Jordan\",\"lastName\":\"Parker\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"customerEmail": "jordan.parker@example.test",
"coupon": null,
"persons": 1,
"aggregatedPrice": 1,
"bookingExtrasSum": 0,
"secondaryPayments": [
{
"id": 309,
"customerBookingId": 268,
"packageCustomerId": null,
"parentId": null,
"amount": 5,
"gateway": "square",
"gatewayTitle": "",
"dateTime": "2026-02-13 17:32:38",
"status": "partiallyPaid",
"data": "",
"entity": "appointment",
"created": "2026-02-13 15:32:38",
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null
}
]
}
],
"filteredCount": 6,
"totalCount": 265
}
}
How do I retrieve a payment transaction amount?
Use this endpoint to retrieve the transaction amount from the online gateway for a specific payment.
- Method: GET
- Path:
/payments/transaction/{{payment_id}}
Example
Request
curl --location 'https://example.website/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/payments/transaction/312' \
--header 'Amelia: YOUR_API_KEY'
Response
{
"message": "Successfully retrieved payment.",
"data": {
"payment": {
"id": 312,
"customerBookingId": 268,
"packageCustomerId": null,
"parentId": null,
"amount": 10,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2026-03-11 13:00:00",
"status": "paid",
"data": "",
"entity": "appointment",
"created": "2026-03-11 11:18:32",
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null
}
}
}
How do I calculate the payment amount for a booking?
Use this endpoint to calculate the payable amount and currency for a booking payload.
- Method: POST
- Path:
/payments/amount
Required properties
- type (string);
appointment,event,package - bookings (array); bookings data
- bookingStart (string); booking start date/time
- locationId (integer)
- providerId (integer)
- serviceId (integer)
- recurring (array); required for recurring bookings
Optional properties
- couponCode (string)
Example
Request
curl --location 'https://example.website/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/payments/amount' \
--header 'Content-Type: application/json' \
--header 'Amelia: YOUR_API_KEY' \
--data '{
"type": "appointment",
"bookings": [
{
"extras": [
{
"extraId": 4,
"quantity": 1
}
],
"deposit": true,
"persons": 2,
"duration": 1800
}
],
"bookingStart": "2026-01-22 19:00",
"locationId": 2,
"providerId": 1,
"serviceId": 1,
"recurring": [],
"couponCode": null
}'
Response
{
"message": null,
"data": {
"amount": 28,
"currency": "USD"
}
}
How do I create a payment link for a booking?
Use this endpoint to generate a payment link for a booking and a supported gateway.
- Method: POST
- Path:
/payments/link
Required properties
- data (object); must include type and bookingId
- paymentMethod (string);
payPal,stripe,mollie,razorpay,wc
Optional properties
- redirectUrl (string); where to redirect after successful payment (defaults to the customer panel link from Amelia settings)
Example
Request
curl --location 'https://example.website/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/payments/link' \
--header 'Content-Type: application/json' \
--header 'Amelia: YOUR_API_KEY' \
--data '{
"data": {
"type": "appointment",
"bookingId": 901
},
"paymentMethod": "payPal",
"redirectUrl": null
}'
Response
{
"message": null,
"data": {
"paymentLink": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-3D332917B6694771R&useraction=commit",
"error": null
}
}
How do I refund a payment?
Use this endpoint to request an online payment refund. The refund is processed through the gateway based on the stored transaction ID.
- Method: POST
- Path:
/payments/refund/{{payment_id}}
Example
Request
curl --location --request POST 'https://example.website/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/payments/refund/917' \
--header 'Amelia: YOUR_API_KEY'
Response
{
"message": "Payment successfully refunded.",
"data": {
"payment": {
"id": 917,
"customerBookingId": 901,
"packageCustomerId": null,
"parentId": null,
"amount": 13,
"gateway": "payPal",
"gatewayTitle": "",
"dateTime": "2026-03-02 10:30:50",
"status": "paid",
"data": "",
"entity": "appointment",
"created": "2026-03-01 16:59:19",
"actionsCompleted": true,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": "PAYID-MTUIFFI1Y628646J56263609"
},
"response": {
"error": false
}
}
}
How do I delete a payment?
Use this endpoint to delete a payment record from Amelia.
- Method: POST
- Path:
/payments/delete/{{payment_id}}
Example
Request
curl --location --request POST 'https://example.website/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/payments/delete/313' \
--header 'Amelia: YOUR_API_KEY'
Response
{
"message": "Payment successfully deleted.",
"data": {
"payment": {
"id": 313,
"customerBookingId": 268,
"packageCustomerId": null,
"parentId": null,
"amount": 15,
"gateway": "stripe",
"gatewayTitle": "",
"dateTime": "2026-02-18 13:00:00",
"status": "paid",
"data": "",
"entity": "appointment",
"created": "2026-02-18 11:22:49",
"actionsCompleted": true,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null
}
}
}