curl --request POST \
--url https://payments.coinbase.com/api/v1/payments/{paymentId}/authorize \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"amount": "<string>",
"allocateRewards": [
{
"campaignAddress": "<string>",
"tokenAddress": "<string>",
"chainId": 123
}
],
"merchantId": "<string>",
"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>"
}
]
}Authorize funds for a payment using the payment ID. This simplified endpoint fetches payment details from the database.
curl --request POST \
--url https://payments.coinbase.com/api/v1/payments/{paymentId}/authorize \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"amount": "<string>",
"allocateRewards": [
{
"campaignAddress": "<string>",
"tokenAddress": "<string>",
"chainId": 123
}
],
"merchantId": "<string>",
"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>"
}
]
}Authorization header using the Bearer scheme. Learn more about JWT tokens in the Coinbase Developer Portal.
Unique identifier to ensure request idempotency
The unique identifier of the payment to authorize.
Request payload for authorizing a payment using the payment ID. This simplified endpoint fetches payment details from the database.
Amount to authorize in the escrow protocol.
List of rewards to allocate during payment authorization.
Custom merchant ID, which will be returned in the webhook.
Metadata for the payment operation that will be returned in the webhook.
A successful response.
Response payload for payment authorization requests.
Identifier for the payment operation.
List of reward operations with detailed information, if rewards were processed.
Show child attributes
Unique identifier for the reward operation.
Type of reward operation (e.g., REWARD_OPERATION_ACTION_DISTRIBUTE).
REWARD_OPERATION_ACTION_ALLOCATE, REWARD_OPERATION_ACTION_DEALLOCATE, REWARD_OPERATION_ACTION_DISTRIBUTE, REWARD_OPERATION_ACTION_SEND Current status of the reward operation.
REWARD_OPERATION_STATUS_PENDING, REWARD_OPERATION_STATUS_SUCCEEDED, REWARD_OPERATION_STATUS_FAILED Timestamp when the reward operation was created.
Timestamp when the reward operation was last updated.
Detailed reward object associated with this operation.
Show child attributes
Unique identifier for the reward.
Onchain address of the campaign contract.
Hash of the payment info that this reward is associated with.
Blockchain address that will receive the reward.
Address of the token contract used for the reward.
The blockchain network identifier where the reward is processed.
Timestamp when the reward was created.
Timestamp when the reward was last updated.
Amount involved in this reward operation.
Blockchain transaction hash for this reward operation.
Error message if the reward operation failed.
Error code of the reward operation.
Blockchain revert reason of the reward operation.
Block number of the reward operation.
Additional metadata as a free-form object.
List of operation steps associated with this reward operation.
Show child attributes
Entity type, usually 'operation-step'.
Unique identifier of the operation step.
Type of the operation step (e.g., AUTH_ESCROW, CROSSCHAIN, FLYWHEEL).
OPERATION_STEP_TYPE_AUTH_ESCROW, OPERATION_STEP_TYPE_CROSSCHAIN, OPERATION_STEP_TYPE_FLYWHEEL Identifier of the parent operation.
Type of the parent operation (e.g., PAYMENT, REWARD).
OPERATION_TYPE_PAYMENT, OPERATION_TYPE_REWARD Current status of the operation step.
OPERATION_STEP_STATUS_SUCCEEDED, OPERATION_STEP_STATUS_FAILED, OPERATION_STEP_STATUS_PENDING Timestamp when the operation step was created.
Timestamp when the operation step was last updated.
Parameters for the operation step as a free-form object.
Error message if the operation step failed.
Error code if the operation step failed.
Blockchain transactions associated with this operation step.
Show child attributes
Entity type, usually 'transaction'.
Blockchain transaction hash.
Block number where the transaction was included.
Timestamp when the transaction record was created.
Timestamp when the transaction record was last updated.
Revert reason if the transaction failed.
Identifier of the operation step this transaction belongs to.
List of rewards that were invalid/unable to be processed with detailed reasoning
Show child attributes
The reward input that was invalid
Show child attributes
Reason why this reward input is invalid
Was this page helpful?