Skip to main content
POST
/
api
/
v1
/
payments
/
{paymentId}
/
capture
Capture payment
curl --request POST \
  --url https://payments.coinbase.com/api/v1/payments/{paymentId}/capture \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'x-idempotency-key: <x-idempotency-key>' \
  --data '
{
  "amount": "<string>",
  "feeBps": 123,
  "feeReceiver": "<string>",
  "distributeRewards": [
    {
      "campaignAddress": "<string>",
      "tokenAddress": "<string>",
      "chainId": 123
    }
  ],
  "metadata": {}
}
'
{
  "operationId": "<string>",
  "rewardOperations": [
    {
      "id": "<string>",
      "action": "REWARD_OPERATION_ACTION_ALLOCATE",
      "status": "REWARD_OPERATION_STATUS_PENDING",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "reward": {
        "id": "<string>",
        "campaignAddress": "<string>",
        "paymentInfoHash": "<string>",
        "recipientAddress": "<string>",
        "tokenAddress": "<string>",
        "chainId": 123,
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z"
      },
      "amount": "<string>",
      "transactionHash": "<string>",
      "error": "<string>",
      "errorCode": "<string>",
      "revertReason": "<string>",
      "blockNumber": "<string>",
      "metadata": {},
      "operationSteps": [
        {
          "entity": "<string>",
          "id": "<string>",
          "type": "OPERATION_STEP_TYPE_AUTH_ESCROW",
          "operationId": "<string>",
          "operationType": "OPERATION_TYPE_PAYMENT",
          "status": "OPERATION_STEP_STATUS_SUCCEEDED",
          "createdAt": "2023-11-07T05:31:56Z",
          "updatedAt": "2023-11-07T05:31:56Z",
          "params": {},
          "error": "<string>",
          "errorCode": "<string>",
          "transactions": [
            {
              "entity": "<string>",
              "transactionHash": "<string>",
              "blockNumber": "<string>",
              "createdAt": "2023-11-07T05:31:56Z",
              "updatedAt": "2023-11-07T05:31:56Z",
              "revertReason": "<string>",
              "operationStepId": "<string>"
            }
          ]
        }
      ]
    }
  ],
  "invalidRewardInputs": [
    {
      "rewardInput": {
        "campaignAddress": "<string>",
        "tokenAddress": "<string>",
        "chainId": 123
      },
      "invalidReason": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Authorization header using the Bearer scheme. Learn more about JWT tokens in the Coinbase Developer Portal.

Headers

x-idempotency-key
string
required

Unique identifier to ensure request idempotency

Path Parameters

paymentId
string
required

The unique identifier of the payment to capture.

Body

application/json

Request payload for capturing a payment using the payment ID. This simplified endpoint fetches payment details from the database.

amount
string
required

Amount to capture in the escrow protocol.

feeBps
integer<int32>
required

Fee in basis points.

feeReceiver
string
required

Address of the fee receiver.

distributeRewards
RewardInput · object[]

List of rewards to distribute during payment capture.

metadata
Metadata · object

Metadata for the payment operation that will be returned in the webhook.

Response

A successful response.

Response payload for payment capture requests.

operationId
string
required

Identifier for the payment operation.

rewardOperations
RewardOperation · object[]

List of reward operations with detailed information, if rewards were processed.

invalidRewardInputs
InvalidRewardInput · object[]

List of rewards that were invalid/unable to be processed with detailed reasoning