Skip to main content
POST
/
api
/
v1
/
payments
/
{paymentId}
/
charge
Charge payment
curl --request POST \
  --url https://payments.coinbase.com/api/v1/payments/{paymentId}/charge \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'x-idempotency-key: <x-idempotency-key>' \
  --data '
{
  "amount": "<string>",
  "feeBps": 123,
  "feeReceiver": "<string>",
  "merchantId": "<string>",
  "metadata": {},
  "sendRewards": [
    {
      "campaignAddress": "<string>",
      "tokenAddress": "<string>",
      "chainId": 123
    }
  ]
}
'
{
  "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 charge.

Body

application/json

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

amount
string
required

Amount to charge in the escrow protocol.

feeBps
integer<int32>
required

Fee in basis points.

feeReceiver
string
required

Fee recipient address.

merchantId
string

Custom merchant ID, which will be returned in the webhook.

metadata
Metadata · object

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

sendRewards
RewardInput · object[]

List of rewards to process during payment charge.

Response

A successful response.

Response payload for payment charge 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