Contents
On this page
Pay Layaway - Plugixa POS for WooCommerce
POST /plugixa-pos/v1/layaways/{id}/payments
Take a payment towards the balance. When the balance reaches zero the layaway is completed and the goods leave the store.
Needs a user with the plugixa_pos_sell capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators hold it; other roles only when you grant it. The user must also be allowed to use the register (register access).
Request
POST https://your-site.example/wp-json/plugixa-pos/v1/layaways/4460/payments
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The layaway’s order id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
register_id |
integer |
Yes | The register, with an open session. |
client_uuid |
string |
Yes | Your id for this payment, as for a sale: a resent request is not paid twice. |
amount |
string |
Yes | Amount towards the balance. |
payments |
object[] |
Yes | 1 to 10 payments: method, amount, reference. |
{
"register_id": 1,
"client_uuid": "4a5b6c7d-8e9f-4a1b-2c3d-4e5f6a7b8c9d",
"amount": "17.00",
"payments": [
{
"method": "card",
"amount": "17.00"
}
]
}
Responses
201 Created, or 200 with meta.replayed: true for a resent client_uuid.
{
"success": true,
"data": {
"layaway": {
"id": 4460,
"number": "4460",
"status": "completed",
"customer_id": 88,
"customer": "Camille Martin",
"phone": "06 10 20 31 40",
"register_id": 1,
"total": "27.00",
"paid": "27.00",
"balance": "0.00",
"lines": [
{
"name": "French press 1 L",
"qty": 1,
"total": "27.00"
}
],
"deposits": [
{
"ticket": 315,
"amount": "10.00",
"methods": "Cash",
"at": "2026-11-18T20:00:35+00:00"
}
],
"refund": null,
"created_at": "2026-11-18T21:00:35+01:00"
},
"receipt": {
"order_id": 4460,
"order_number": "4460",
"ticket": 316,
"date": "November 19, 2026 3:12 pm",
"store": {
"name": "Maison Plugixa Marais",
"address": {
"address_1": "12 rue des Archives",
"city": "Paris",
"postcode": "75004",
"country": "FR",
"address_2": ""
},
"phone": "",
"tax_id": "FR 40 123 456 789"
},
"register": "R1",
"cashier": "Emma Laurent",
"customer": "Camille Martin",
"currency": "EUR",
"lines": [
{
"name": "Canvas tote - Natural",
"options": [],
"qty": 1,
"subtotal": "25.00",
"total": "25.00"
},
{
"name": "Greeting card",
"options": [],
"qty": 1,
"subtotal": "4.00",
"total": "4.00"
}
],
"discount": "0.00",
"coupons": [],
"taxes": [
{
"label": "TVA",
"rate": "20%",
"amount": "4.83"
}
],
"tax_total": "4.83",
"total": "29.00",
"payments": [
{
"method": "cash",
"label": "Cash",
"amount": "30.00"
}
],
"tendered": "30.00",
"change": "1.00",
"fiscal": {
"hash_short": "EC60-5CEF",
"software": "Plugixa POS 1.0.0"
},
"header": "Maison Plugixa\n12 rue des Archives, 75004 Paris",
"footer": "Exchanges within 30 days with this receipt.\nThank you and see you soon!",
"refunded": "0.00",
"status": "completed"
},
"completed": true
},
"meta": {
"replayed": false
}
}
| Field | Type | Meaning |
|---|---|---|
data.layaway |
object |
The layaway, as in Get Layaway |
data.receipt |
object |
The receipt of the deposit or payment, as in Get Receipt |
data.completed |
boolean |
This payment finished the layaway |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_pos_not_found |
No layaway with that id. |
403 |
plugixa_pos_register_forbidden |
The register is missing or archived, or the user may not use it. |
409 |
plugixa_pos_layaway_closed |
Already paid or cancelled. |
409 |
plugixa_pos_session_closed |
No open session. |
409 |
plugixa_pos_in_progress |
Another register is updating this layaway. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/layaways/4460/payments" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"register_id":1,"client_uuid":"4a5b6c7d-8e9f-4a1b-2c3d-4e5f6a7b8c9d","amount":"17.00","payments":[{"method":"card","amount":"17.00"}]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/layaways/4460/payments');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'register_id' => 1,
'client_uuid' => '4a5b6c7d-8e9f-4a1b-2c3d-4e5f6a7b8c9d',
'amount' => '17.00',
'payments' => [
[
'method' => 'card',
'amount' => '17.00',
],
],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/layaways/4460/payments', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ register_id: 1, client_uuid: '4a5b6c7d-8e9f-4a1b-2c3d-4e5f6a7b8c9d', amount: '17.00', payments: [{ method: 'card', amount: '17.00' }] }),
});
const { data } = await response.json();
Quick Links
Share