Modify Credit
  • 22 Nov 2024
  • 3 Minutes to read
  • Contributors
  • Dark
    Light

Modify Credit

  • Dark
    Light

Article summary

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

Modify the credit associated with a specific entity such as contract or customer. Note that modifying credit requires that you acquire a lock and then provide a key during modification, otherwise the request is rejected. Locks are valid for 120s.

Security
HTTP
Type bearer
Header parameters
X-Lock-Key
stringRequired
Path parameters
customerId
stringRequired
holderType
stringRequired
Valid values[ "contracts" ]
holderId
stringRequired
Examplecontract-id-123
Body parameters
Expand All
object
reason
string Required

A textual reason for modification(s)

modifications
Array Required

The modifications to make to the credit holder's credit. Each credit type (i.e. monetary etc.) can only be modified once per operation.

Min items1
OneOf
object
type
string Required

Modify the monetary credit

Valid values[ "monetary" ]
changeAmount
object Required
currencyCode
string Required

The currency to price the order 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
ExampleGBP
value
integer Required

Amount to update the current credit by, represented in the base denomination e.g. pence for GBP. A positive value will increase the current credit of the account, whilst a negative value will decrease the current credit.

Example1000
Responses
200

Modified Credit Holder

Expand All
object
data
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
meta
object

Additional information about the resource.

property*
400

Invalid request body

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.

401

Unauthorised

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.

422

Unprocessable Content

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.

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