Skip to content

Lock payment

Request

Locks a payment. The beneficiary and all intermediary institutions agree to proceed with the payment by making successful Lock Payment requests. When the payment is still in a partially LOCKED state, the beneficiary and all intermediary institutions who have not locked, can reject lock payment or fail payment.

Once fully LOCKED, the originating institution can either fail payment or Settle payment. If the originating institution sends a Settle payment request, one of three things will happen:

  • Successful payments move to the PREPARED state.
  • Payments with insufficient liquidity automatically move into state SETTLEMENT_DECLINED, or
  • Payments that are not settled before the crypto_transaction_id expires move to the FAILED state.

Note: Currently, when making a Create quote to return payment to a RippleNet Cloud account on a RippleNet ledger, the RippleNet user must lock and complete the payment. This means that the RippleNet user takes all action on the return: Get and Accept Quote, Lock, Settle, and Complete payment.

Security
Bearer
Path
payment_idstring, (uuid)required

Unique identifier of the payment to lock.

Bodyapplication/jsonrequired
internal_idstring, <= 128 characters

ID that intermediaries and the receiver can set when locking a payment. The ID is viewable only by the node that set it.

user_infoobject

Provide one or more arbitrary key/value pairs.

Caution: Ripple recommends that you always include this object, even when empty, to ensure that the RippleNet Payment Object includes the created_at timestamp, which records when the payment was locked. To add an empty object, include: {"user_info":[]}

curl -i -X POST \
  'https://docs.ripple.com/_mock/products/payments-odl/api-docs/ripplenet/reference/openapi/payments/{payment_id}/lock' \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "internal_id": "string",
    "user_info": {}
  }'

Responses

Successfully locked payment.

Bodyapplication/json
payment_idstring, (uuid)required

Unique identifier of a payment.

Example:"d485f100-2af7-4e48-9ab1-3c7e28775691"
contract_hashstringrequired

Hash of all values in the Contract object used to ensure immutability. Once a payment transitions to the LOCKED state, the values in this object cannot change.

Example:"ccb23bd87f13cc13b9d616a9723f76e112aeac8628b2082e0f8bf3b8c670b103"
payment_statestringrequired

State of the payment. For details about payment states, see Payment States in the RippleNet Developer Guide.

Enum:"ACCEPTED""AWAITING_COLLECTION""COMPLETED""EXECUTED""FAILED""FORWARDED""LOCK_DECLINED""LOCKED""PREPARED""RETURNED"
Example:"COMPLETED"
modified_atstring, (date-time)required

Date and time at which the payment was last modified, as an ISO-8601 timestamp in UTC.

Example:"2019-10-01T18:25:47.347Z"
contractobjectrequired

Represents all immutable parts of a payment agreed upon by all participants as a part of the Lock payment flow. Once a payment transitions to the LOCKED state, the values in this object cannot change.

ripplenet_infoArray of objects

Application-provided data explaining actions taken by RippleNet applications.

execution_conditionstringrequired

A Base64-encoded execution condition for this payment, the fulfillment of which will be presented to the validator to complete this payment. This value must match the execution_condition in the associated crypto transaction.

Example:"PrefixSha256Condition{subtypes=[ED25519-SHA-256], type=PREFIX-SHA-256, fingerprint=sfGGHCrkyaMsLQNB62w_4zarlPChHKm47JkXVQbs1z0, cost=132360}"
crypto_transaction_idstringrequired

Unique identifier of the crypto transaction associated with this payment.

Example:"4e05da26-7872-4a1f-b9b7-db7604757c37"
validatorstringrequired

Address of the validator that validated the payment.

Example:"rn.us.ca.san_francisco"
payment_typestringrequired

Payment type.

Enum:"REGULAR""RETURN"
Example:"REGULAR"
returns_payment_with_idstring, (uuid)required

If the payment_type is RETURN, provides the payment ID of the original payment that this payment returns. Otherwise, this field value is set to null.

returned_by_payment_with_idstring, (uuid)required

If the payment_type is REGULAR and the payment has an associated return payment, provides the payment ID of the return payment. Otherwise, this field value is set to null.

execution_resultsArray of objectsrequired

Represents the actual movement of funds in a payment. Each execution result corresponds to a quote element and represents its execution in a payment.

liquidation_execution_resultsArray of objects

Represents the actual movement of funds in a payment as part of liquidation of a Wallet Receive payment.

liquidation_detailsobject

Contains details of liquidation if applicable.

push_forward_execution_resultsArray of objects

Represents the movement of funds after an On-Demand Liquidity payment fails at intermediary transfer or destination exchange.

accepted_atstring, (date-time)required

Date and time at which the payment was last accepted, as an ISO-8601 timestamp in UTC.

Example:"2019-10-01T18:25:47.347Z"
locked_atstring, (date-time)

Date and time at which the payment was last locked, as an ISO-8601 timestamp in UTC.

Example:"2019-10-01T18:25:47.347Z"
executed_atstring, (date-time)

Date and time at which the payment was last executed, as an ISO-8601 timestamp in UTC.

Example:"2019-10-01T18:25:47.347Z"
completed_atstring, (date-time)

Date and time at which the payment was last completed, as an ISO-8601 timestamp in UTC.

Example:"2019-10-01T18:25:47.347Z"
returned_atstring, (date-time)

Date and time at which the payment was returned, as an ISO-8601 timestamp in UTC.

Example:"2019-10-01T18:25:47.347Z"
internal_infoobjectrequired

JSON object containing information that only the RippleNet instance that set it can view. This value can be set by the sender when accepting a payment and by an intermediary or receiver when locking the payment.

user_infoArray of objectsrequired

User-provided data with arbitrary key/value pairs.

Response
{ "payment_id": "d485f100-2af7-4e48-9ab1-3c7e28775691", "contract_hash": "ccb23bd87f13cc13b9d616a9723f76e112aeac8628b2082e0f8bf3b8c670b103", "payment_state": "COMPLETED", "modified_at": "2019-10-01T18:25:47.347Z", "contract": { "sender_end_to_end_id": "string", "created_at": "2019-10-01T18:18:13.665Z", "expires_at": "2019-10-01T18:55:22.824Z", "quote": { … }, "fee_info": { … } }, "ripplenet_info": [ { … } ], "execution_condition": "PrefixSha256Condition{subtypes=[ED25519-SHA-256], type=PREFIX-SHA-256, fingerprint=sfGGHCrkyaMsLQNB62w_4zarlPChHKm47JkXVQbs1z0, cost=132360}", "crypto_transaction_id": "4e05da26-7872-4a1f-b9b7-db7604757c37", "validator": "rn.us.ca.san_francisco", "payment_type": "REGULAR", "returns_payment_with_id": "a69b322f-faa4-4531-bcff-897e5839c130", "returned_by_payment_with_id": "c929a87b-81b8-4878-b21c-1aeaa4fe9276", "execution_results": [ { … } ], "liquidation_execution_results": [ { … } ], "liquidation_details": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "status": "string", "failure_reason": "string", "failure_count": 0 }, "push_forward_execution_results": [ { … } ], "accepted_at": "2019-10-01T18:25:47.347Z", "locked_at": "2019-10-01T18:25:47.347Z", "executed_at": "2019-10-01T18:25:47.347Z", "completed_at": "2019-10-01T18:25:47.347Z", "returned_at": "2019-10-01T18:25:47.347Z", "internal_info": { "connector_role": "RECEIVING", "labels": [ … ], "internal_id": "string" }, "user_info": [ { … } ] }