Customer Credits
Operations Summary
| Method | Endpoint | Description |
|---|---|---|
| Core CRUD | ||
| GET | /api/customer-credits/ |
List Customer Credits |
| GET | /api/customer-credits/{uuid}/ |
Retrieve |
| POST | /api/customer-credits/ |
Create |
| PUT | /api/customer-credits/{uuid}/ |
Update |
| PATCH | /api/customer-credits/{uuid}/ |
Partial Update |
| DELETE | /api/customer-credits/{uuid}/ |
Delete |
| Other Actions | ||
| GET | /api/customer-credits/{uuid}/consumptions/ |
Get credit consumption history grouped by month |
| POST | /api/customer-credits/{uuid}/adjust_withdrawable/ |
Adjust withdrawable |
| POST | /api/customer-credits/{uuid}/apply_compensations/ |
Apply compensations |
| POST | /api/customer-credits/{uuid}/clear_compensations/ |
Clear compensations |
Core CRUD
List Customer Credits
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 11 | |
- Model Source:
CustomerCreditOEnum - API Source:
customer_credits_list
1 2 3 4 5 6 7 8 9 10 | |
| Name | Type | Description |
|---|---|---|
customer_name |
string | |
customer_slug |
string | |
customer_uuid |
string (uuid) | |
o |
array | Ordering |
page |
integer | A page number within the paginated result set. |
page_size |
integer | Number of results to return per page. |
query |
string |
200 -
The response body is an array of objects, where each object has the following structure:
| Field | Type | Description |
|---|---|---|
uuid |
string (uuid) | |
url |
string (uri) | |
value |
string (decimal) | |
customer |
string (uri) | |
customer_name |
string | |
customer_uuid |
string (uuid) | |
customer_slug |
string | |
offerings |
array of objects | |
offerings.uuid |
string (uuid) | |
offerings.url |
string (uri) | |
offerings.type |
string | |
offerings.name |
string | |
end_date |
string (date) | |
expected_consumption |
string (decimal) | |
minimal_consumption |
number (double) | |
minimal_consumption_logic |
string | Enum: fixed, linear |
grace_coefficient |
string (decimal) | |
apply_as_minimal_consumption |
boolean | |
allocated_to_projects |
number (double) | |
consumption_last_month |
number (double) | |
withdrawable_balance |
number (double) | Part of the credit that may leave the platform via payouts or transfers: earnings-typed ledger inflows minus outflows, capped by the current credit value so that staff-granted (promotional) credit is never withdrawable and credit expiry wipes earnings too. |
Retrieve
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 11 12 | |
- API Source:
customer_credits_retrieve
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
| Name | Type | Required |
|---|---|---|
uuid |
string (uuid) | ✓ |
200 -
| Field | Type | Description |
|---|---|---|
uuid |
string (uuid) | |
url |
string (uri) | |
value |
string (decimal) | |
customer |
string (uri) | |
customer_name |
string | |
customer_uuid |
string (uuid) | |
customer_slug |
string | |
offerings |
array of objects | |
offerings.uuid |
string (uuid) | |
offerings.url |
string (uri) | |
offerings.type |
string | |
offerings.name |
string | |
end_date |
string (date) | |
expected_consumption |
string (decimal) | |
minimal_consumption |
number (double) | |
minimal_consumption_logic |
string | Enum: fixed, linear |
grace_coefficient |
string (decimal) | |
apply_as_minimal_consumption |
boolean | |
allocated_to_projects |
number (double) | |
consumption_last_month |
number (double) | |
withdrawable_balance |
number (double) | Part of the credit that may leave the platform via payouts or transfers: earnings-typed ledger inflows minus outflows, capped by the current credit value so that staff-granted (promotional) credit is never withdrawable and credit expiry wipes earnings too. |
Create
1 2 3 4 5 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
- Model Source:
CreateCustomerCreditRequest - API Source:
customer_credits_create
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
| Field | Type | Required |
|---|---|---|
value |
string (decimal) | |
customer |
string (uri) | ✓ |
offerings |
array of string (uri)s | |
end_date |
string (date) | |
expected_consumption |
string (decimal) | |
minimal_consumption_logic |
string | |
grace_coefficient |
string (decimal) | |
apply_as_minimal_consumption |
boolean |
201 -
| Field | Type | Description |
|---|---|---|
uuid |
string (uuid) | |
url |
string (uri) | |
value |
string (decimal) | |
customer |
string (uri) | |
customer_name |
string | |
customer_uuid |
string (uuid) | |
customer_slug |
string | |
offerings |
array of string (uri)s | |
end_date |
string (date) | |
expected_consumption |
string (decimal) | |
minimal_consumption |
number (double) | |
minimal_consumption_logic |
string | Enum: fixed, linear |
grace_coefficient |
string (decimal) | |
apply_as_minimal_consumption |
boolean | |
allocated_to_projects |
number (double) | |
consumption_last_month |
number (double) | |
withdrawable_balance |
number (double) | Part of the credit that may leave the platform via payouts or transfers: earnings-typed ledger inflows minus outflows, capped by the current credit value so that staff-granted (promotional) credit is never withdrawable and credit expiry wipes earnings too. |
Update
1 2 3 4 5 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
- Model Source:
CreateCustomerCreditRequest - API Source:
customer_credits_update
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
| Name | Type | Required |
|---|---|---|
uuid |
string (uuid) | ✓ |
| Field | Type | Required |
|---|---|---|
value |
string (decimal) | |
customer |
string (uri) | ✓ |
offerings |
array of string (uri)s | |
end_date |
string (date) | |
expected_consumption |
string (decimal) | |
minimal_consumption_logic |
string | |
grace_coefficient |
string (decimal) | |
apply_as_minimal_consumption |
boolean |
200 -
| Field | Type | Description |
|---|---|---|
uuid |
string (uuid) | |
url |
string (uri) | |
value |
string (decimal) | |
customer |
string (uri) | |
customer_name |
string | |
customer_uuid |
string (uuid) | |
customer_slug |
string | |
offerings |
array of string (uri)s | |
end_date |
string (date) | |
expected_consumption |
string (decimal) | |
minimal_consumption |
number (double) | |
minimal_consumption_logic |
string | Enum: fixed, linear |
grace_coefficient |
string (decimal) | |
apply_as_minimal_consumption |
boolean | |
allocated_to_projects |
number (double) | |
consumption_last_month |
number (double) | |
withdrawable_balance |
number (double) | Part of the credit that may leave the platform via payouts or transfers: earnings-typed ledger inflows minus outflows, capped by the current credit value so that staff-granted (promotional) credit is never withdrawable and credit expiry wipes earnings too. |
Partial Update
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
- Model Source:
PatchedCreateCustomerCreditRequest - API Source:
customer_credits_partial_update
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
| Name | Type | Required |
|---|---|---|
uuid |
string (uuid) | ✓ |
| Field | Type | Required |
|---|---|---|
value |
string (decimal) | |
customer |
string (uri) | |
offerings |
array of string (uri)s | |
end_date |
string (date) | |
expected_consumption |
string (decimal) | |
minimal_consumption_logic |
string | |
grace_coefficient |
string (decimal) | |
apply_as_minimal_consumption |
boolean |
200 -
| Field | Type | Description |
|---|---|---|
uuid |
string (uuid) | |
url |
string (uri) | |
value |
string (decimal) | |
customer |
string (uri) | |
customer_name |
string | |
customer_uuid |
string (uuid) | |
customer_slug |
string | |
offerings |
array of string (uri)s | |
end_date |
string (date) | |
expected_consumption |
string (decimal) | |
minimal_consumption |
number (double) | |
minimal_consumption_logic |
string | Enum: fixed, linear |
grace_coefficient |
string (decimal) | |
apply_as_minimal_consumption |
boolean | |
allocated_to_projects |
number (double) | |
consumption_last_month |
number (double) | |
withdrawable_balance |
number (double) | Part of the credit that may leave the platform via payouts or transfers: earnings-typed ledger inflows minus outflows, capped by the current credit value so that staff-granted (promotional) credit is never withdrawable and credit expiry wipes earnings too. |
Delete
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 11 12 | |
- API Source:
customer_credits_destroy
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
| Name | Type | Required |
|---|---|---|
uuid |
string (uuid) | ✓ |
204 - No response body
Other Actions
Get credit consumption history grouped by month
Get credit consumption history grouped by month.
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
- Model Source:
CustomerCreditOEnum - API Source:
customer_credits_consumptions_list
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
| Name | Type | Required |
|---|---|---|
uuid |
string (uuid) | ✓ |
| Name | Type | Description |
|---|---|---|
customer_name |
string | |
customer_slug |
string | |
customer_uuid |
string (uuid) | |
o |
array | Ordering |
page |
integer | A page number within the paginated result set. |
page_size |
integer | Number of results to return per page. |
query |
string |
200 -
The response body is an array of objects, where each object has the following structure:
| Field | Type |
|---|---|
date |
string (date) |
price |
string (decimal) |
Adjust withdrawable
Staff adjustment of the withdrawable part of the credit. Records a signed ledger entry with a comment and changes the credit value by the same amount.
1 2 3 4 5 6 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
- Model Source:
WithdrawableAdjustmentRequest - API Source:
customer_credits_adjust_withdrawable
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
| Name | Type | Required |
|---|---|---|
uuid |
string (uuid) | ✓ |
| Field | Type | Required |
|---|---|---|
amount |
string (decimal) | ✓ |
comment |
string | ✓ |
200 -
| Field | Type | Description |
|---|---|---|
uuid |
string (uuid) | |
url |
string (uri) | |
value |
string (decimal) | |
customer |
string (uri) | |
customer_name |
string | |
customer_uuid |
string (uuid) | |
customer_slug |
string | |
offerings |
array of objects | |
offerings.uuid |
string (uuid) | |
offerings.url |
string (uri) | |
offerings.type |
string | |
offerings.name |
string | |
end_date |
string (date) | |
expected_consumption |
string (decimal) | |
minimal_consumption |
number (double) | |
minimal_consumption_logic |
string | Enum: fixed, linear |
grace_coefficient |
string (decimal) | |
apply_as_minimal_consumption |
boolean | |
allocated_to_projects |
number (double) | |
consumption_last_month |
number (double) | |
withdrawable_balance |
number (double) | Part of the credit that may leave the platform via payouts or transfers: earnings-typed ledger inflows minus outflows, capped by the current credit value so that staff-granted (promotional) credit is never withdrawable and credit expiry wipes earnings too. |
Apply compensations
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 11 12 | |
- API Source:
customer_credits_apply_compensations
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
| Name | Type | Required |
|---|---|---|
uuid |
string (uuid) | ✓ |
200 - No response body
Clear compensations
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 11 12 | |
- API Source:
customer_credits_clear_compensations
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
| Name | Type | Required |
|---|---|---|
uuid |
string (uuid) | ✓ |
200 - No response body