ASDinCloudDocs
API ReferencePayment methods

Payment methods

View as Markdown

The payment method object

View as Markdown

Payment methods describe how payments are recorded and which option is selected by default.

Attributes

idinteger
Identifier assigned by the API.
labelstring
Unique label, up to 64 characters.
is_activeboolean
Whether the method is active. Deactivation clears the default flag.
sort_orderinteger
Non-negative display order.
traceableboolean
Whether the payment method is traceable.
is_defaultboolean
Set true on an active method to select it as the workspace default.

List payment methods

View as Markdown
GET/api/v1/payment_methods

Lists payment method records in the workspace.

Permissions

Send your API key in X-API-Key. Required permissions are Payment methods → Read.

Query parameters

qstring
Search by label.
is_activeboolean
Filter by active state when supplied.
lengthinteger
Number of records to return.
startinteger
Zero-based offset.
drawstring
Optional request marker echoed in the response.
sortstring
Sort by id, label, is_active, sort_order, traceable, is_default, tsc, or tsu. Prefix the field name with a minus sign for descending order.
orderstring
Direction for unprefixed sort fields. Use asc or desc.

Returns

Returns items in data, counts before and after text search, and the optional draw marker.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.

Retrieve a payment method

View as Markdown
GET/api/v1/payment_methods/{id}

Returns one payment method by ID.

Permissions

Send your API key in X-API-Key. Required permissions are Payment methods → Read.

Path parameters

idintegerRequired
ID of the payment method.

Returns

The payment method is returned in data.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The requested record was not found.

Create a payment method

View as Markdown
POST/api/v1/payment_methods

Creates a payment method.

Permissions

Send your API key in X-API-Key. Required permissions are Payment methods → Write.

Body parameters

labelstringRequired
Unique label, up to 64 characters.
is_activeboolean
Whether the method is active. Deactivation clears the default flag.
sort_orderinteger
Non-negative display order.
traceableboolean
Whether the payment method is traceable.
is_defaultboolean
Set true on an active method to select it as the workspace default.

Returns

The created payment method is returned in data.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
422
One or more fields failed validation.
500
The change could not be saved.

Update a payment method

View as Markdown
PATCH / PUT / POST/api/v1/payment_methods/{id}

Updates a payment method by ID.

Permissions

Send your API key in X-API-Key. Required permissions are Payment methods → Write.

Path parameters

idintegerRequired
ID of the payment method.

Body parameters

labelstring
Unique label, up to 64 characters.
is_activeboolean
Whether the method is active. Deactivation clears the default flag.
sort_orderinteger
Non-negative display order.
traceableboolean
Whether the payment method is traceable.
is_defaultboolean
Set true on an active method to select it as the workspace default.

Returns

Returns a successful update response.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The requested record was not found.
400
A payment method ID cannot be changed.
422
One or more fields failed validation.
500
The change could not be saved.

Delete a payment method

View as Markdown
DELETE/api/v1/payment_methods/{id}
POST/api/v1/payment_methods/{id}/delete

Deletes a payment method unless a current payment uses it.

Permissions

Send your API key in X-API-Key. Required permissions are Payment methods → Write.

Path parameters

idintegerRequired
ID of the payment method.

Returns

Returns a successful removal response.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The requested record was not found.
400
The record is in use or could not be removed.