credits

Get a credit top-up

Changed on

Reads the checkout from Coinbase and credits it on the spot once it has settled, so polling here returns credited: true without waiting on the webhook.

get/api/v1/credits/topups/{checkoutId}

Request

  • Base URL
    https://api.morphllm.com
  • Auth
    HTTP bearer

Path parameters

checkoutIdstring required

Checkout id returned when the top-up was created.

Example:6ae3c4f9b78e569c621631be

Identifies the top-up to read.

Response

The top-up state.

checkoutIdstring required

Checkout id.

status'ACTIVE' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED' | 'DEACTIVATED' | 'REFUNDED' | 'PARTIALLY_REFUNDED' required

Coinbase checkout status. ACTIVE accepts payment at x402_url; PROCESSING means capture is under way; COMPLETED means settled. FAILED, EXPIRED and DEACTIVATED are terminal and unpaid, so start a new top-up. A completed top-up can later become REFUNDED or PARTIALLY_REFUNDED.

amountstring required

USD amount of the top-up, two decimals.

currency'USDC' required

Currency the top-up settles in.

creditedboolean required

True once the amount has been added to the balance. Gate on this.

transactionHashstring nullable required

On-chain capture transaction on Base, once settled.

x402_urlstring uri nullable required

Payment URL while the checkout is still ACTIVE and unpaid; null otherwise.

Example response

{
  "checkoutId": "6ae3c4f9b78e569c621631be",
  "status": "COMPLETED",
  "amount": "25.00",
  "currency": "USDC",
  "credited": true,
  "transactionHash": "0x8f5c0e5b8d1f6a3c9e2b7d4a1f0c3e6b9a2d5f8c1e4b7a0d3f6c9e2b5a8d1f4c",
  "x402_url": null
}

Changes