Lock Credit for Modification, fetching current credit amount
  • 06 Sep 2024
  • 3 Minutes to read
  • Contributors
  • Dark
    Light

Lock Credit for Modification, fetching current credit amount

  • Dark
    Light

Article summary

Put
/credit/v1/customers/{customerId}/{holderType}/{holderId}/_lock

Lock credit associated with a specific entity such as a contract so it can be safely modified. Response will return the current credit amount and the lock key to use when modifying.

Security
HTTP
Type bearer
Path parameters
customerId
stringRequired
Examplecustomer-id-123
holderType
stringRequired
Valid values[ "\"contracts\"" ]
holderId
stringRequired
Examplecontract-id-123
Responses
201

Retrieved and Locked Credit

Expand All
object
data
object
credit
object
holder
object
type
string

Entity that holds the credit

Valid values[ "\"contract\"" ]
id
string

ID of the entity that holds the credit.

Examplecontract-id-123
current
object
credit
Array

Current value of each credit type the entity holds.

Current value of each credit type the entity holds.

OneOf
object
type
string

Type of credit the holder has

Valid values[ "\"monetary\"" ]
amount
object
currencyCode
string

The currency the credit is priced in. The currency code should be provided in the 3 letter (ISO 4217 standard)[https://www.iso.org/iso-4217-currency-codes.html].

Min length3
Max length3
Example1000
value
integer

Value of the credit represented in the base denomination e.g. pence for GBP.

Minimum0
Example1000
updatedAt
string

Timestamp of when the credit was updated in (ISO 8601)[https://www.iso.org/iso-8601-date-and-time-format.html].

Example2024-03-14T15:43:43.375Z
lock
object

The credit lock, used to restrict modifications to a credit holders credit.

key
string

The unique key for this lock, the key is required to modify a credit holders credit.

expiry
string (date-time)

The time at which the lock will expire if not explicitly released.

meta
object

Additional information about the resource.

property*
401

Unauthorized

Expand All
object
error
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.

403

Forbidden

Expand All
object
error
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.

404

Not Found

Expand All
object
error
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.

423

Locked

Expand All
object
error
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.

429

Too Many Requests

Expand All
object
error
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.

500

Internal Server Error

Expand All
object
error
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.

503

Service Unavailable

Expand All
object
error
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.


Was this article helpful?

What's Next