Skip to content

Payments

Operations Summary

Method Endpoint Description
Core CRUD
GET /api/payments/ List Payments
GET /api/payments/{uuid}/ Retrieve
POST /api/payments/ Create
POST /api/payments/{uuid}/unlink_from_invoice/ Unlink from invoice
PUT /api/payments/{uuid}/ Update
PATCH /api/payments/{uuid}/ Partial Update
DELETE /api/payments/{uuid}/ Delete
Other Actions
POST /api/payments/{uuid}/link_to_invoice/ Link to invoice

Core CRUD

List Payments

1
2
3
4
http \
  GET \
  https://api.example.com/api/payments/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.payments import payments_list # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = payments_list.sync(client=client)

for item in response:
    print(item)
  1. API Source: payments_list
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import { paymentsList } from 'waldur-js-client';

try {
  const response = await paymentsList({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Description
date_of_payment string (date)
page integer A page number within the paginated result set.
page_size integer Number of results to return per page.
profile string
profile_uuid string (uuid)

200 -

The response body is an array of objects, where each object has the following structure:

Field Type
uuid string (uuid)
url string (uri)
profile string (uri)
date_of_payment string (date)
sum string (decimal)
proof string (uri)
invoice string (uri)
invoice_uuid string (uuid)
invoice_period string
customer_uuid string (uuid)

Retrieve

1
2
3
4
http \
  GET \
  https://api.example.com/api/payments/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.payments import payments_retrieve # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = payments_retrieve.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: payments_retrieve
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { paymentsRetrieve } from 'waldur-js-client';

try {
  const response = await paymentsRetrieve({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)

200 -

Field Type
uuid string (uuid)
url string (uri)
profile string (uri)
date_of_payment string (date)
sum string (decimal)
proof string (uri)
invoice string (uri)
invoice_uuid string (uuid)
invoice_period string
customer_uuid string (uuid)

Create

1
2
3
4
5
6
http \
  POST \
  https://api.example.com/api/payments/ \
  Authorization:"Token YOUR_API_TOKEN" \
  profile="https://api.example.com/api/profile/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" \
  date_of_payment="2023-10-01"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.payment_request import PaymentRequest # (1)
from waldur_api_client.api.payments import payments_create # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = PaymentRequest(
    profile="https://api.example.com/api/profile/a1b2c3d4-e5f6-7890-abcd-ef1234567890/",
    date_of_payment="2023-10-01"
)
response = payments_create.sync(
    client=client,
    body=body_data
)

print(response)
  1. Model Source: PaymentRequest
  2. API Source: payments_create
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import { paymentsCreate } from 'waldur-js-client';

try {
  const response = await paymentsCreate({
  auth: "Token YOUR_API_TOKEN",
  body: {
    "profile": "https://api.example.com/api/profile/a1b2c3d4-e5f6-7890-abcd-ef1234567890/",
    "date_of_payment": "2023-10-01"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Field Type Required
profile string (uri)
date_of_payment string (date)
sum string (decimal)
proof string (binary)

201 -

Field Type
uuid string (uuid)
url string (uri)
profile string (uri)
date_of_payment string (date)
sum string (decimal)
proof string (uri)
invoice string (uri)
invoice_uuid string (uuid)
invoice_period string
customer_uuid string (uuid)

Unlink a payment from an invoice. Remove connection between payment and existing linked invoice.

1
2
3
4
http \
  POST \
  https://api.example.com/api/payments/a1b2c3d4-e5f6-7890-abcd-ef1234567890/unlink_from_invoice/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.payments import payments_unlink_from_invoice # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = payments_unlink_from_invoice.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: payments_unlink_from_invoice
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { paymentsUnlinkFromInvoice } from 'waldur-js-client';

try {
  const response = await paymentsUnlinkFromInvoice({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)

200 - No response body


Update

1
2
3
4
5
6
http \
  PUT \
  https://api.example.com/api/payments/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN" \
  profile="https://api.example.com/api/profile/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" \
  date_of_payment="2023-10-01"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.payment_request import PaymentRequest # (1)
from waldur_api_client.api.payments import payments_update # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = PaymentRequest(
    profile="https://api.example.com/api/profile/a1b2c3d4-e5f6-7890-abcd-ef1234567890/",
    date_of_payment="2023-10-01"
)
response = payments_update.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

print(response)
  1. Model Source: PaymentRequest
  2. API Source: payments_update
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import { paymentsUpdate } from 'waldur-js-client';

try {
  const response = await paymentsUpdate({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  },
  body: {
    "profile": "https://api.example.com/api/profile/a1b2c3d4-e5f6-7890-abcd-ef1234567890/",
    "date_of_payment": "2023-10-01"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)
Field Type Required
profile string (uri)
date_of_payment string (date)
sum string (decimal)
proof string (binary)

200 -

Field Type
uuid string (uuid)
url string (uri)
profile string (uri)
date_of_payment string (date)
sum string (decimal)
proof string (uri)
invoice string (uri)
invoice_uuid string (uuid)
invoice_period string
customer_uuid string (uuid)

Partial Update

1
2
3
4
http \
  PATCH \
  https://api.example.com/api/payments/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.patched_payment_request import PatchedPaymentRequest # (1)
from waldur_api_client.api.payments import payments_partial_update # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = PatchedPaymentRequest()
response = payments_partial_update.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

print(response)
  1. Model Source: PatchedPaymentRequest
  2. API Source: payments_partial_update
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { paymentsPartialUpdate } from 'waldur-js-client';

try {
  const response = await paymentsPartialUpdate({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)
Field Type Required
profile string (uri)
date_of_payment string (date)
sum string (decimal)
proof string (binary)

200 -

Field Type
uuid string (uuid)
url string (uri)
profile string (uri)
date_of_payment string (date)
sum string (decimal)
proof string (uri)
invoice string (uri)
invoice_uuid string (uuid)
invoice_period string
customer_uuid string (uuid)

Delete

1
2
3
4
http \
  DELETE \
  https://api.example.com/api/payments/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.payments import payments_destroy # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = payments_destroy.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: payments_destroy
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { paymentsDestroy } from 'waldur-js-client';

try {
  const response = await paymentsDestroy({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)

204 - No response body


Other Actions

Link a payment to an invoice. Payment can be linked to an invoice only if they belong to the same customer.

1
2
3
4
5
http \
  POST \
  https://api.example.com/api/payments/a1b2c3d4-e5f6-7890-abcd-ef1234567890/link_to_invoice/ \
  Authorization:"Token YOUR_API_TOKEN" \
  invoice="https://api.example.com/api/invoice/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.link_to_invoice_request import LinkToInvoiceRequest # (1)
from waldur_api_client.api.payments import payments_link_to_invoice # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = LinkToInvoiceRequest(
    invoice="https://api.example.com/api/invoice/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
)
response = payments_link_to_invoice.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

print(response)
  1. Model Source: LinkToInvoiceRequest
  2. API Source: payments_link_to_invoice
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import { paymentsLinkToInvoice } from 'waldur-js-client';

try {
  const response = await paymentsLinkToInvoice({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  },
  body: {
    "invoice": "https://api.example.com/api/invoice/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)
Field Type Required
invoice string (uri)

200 -

Field Type
invoice string (uri)