create_checkout_payment_intent
This endpoint is designed to guide developers through creating a checkout payment intent by providing all the necessary fields and structure upfront. By making this request comprehensive, we ensure that developers know exactly what is expected, reducing the need for an SDK or a dedicated package.
Required Fields for create_checkout_payment_intent
To begin, the POST request to the create_checkout_payment_intent endpoint contains a detailed body in JSON format that specifies various aspects of the transaction. Here's the request structure:
Properties
- Name
 customer- Type
 - object
 - Description
 -  
The customer’s details including name, email, and phone number.
 
- Name
 total_amount- Type
 - integer
 - Description
 -  
The total amount for the transaction in the smallest unit of currency (e.g., cents).
 
- Name
 items- Type
 - array
 - Description
 -  
A list of items being purchased, including their
item_idandquantity. 
- Name
 currency_displayed- Type
 - string
 - Description
 -  
The currency that will be displayed during checkout (e.g., USD).
 
- Name
 tax_percent- Type
 - integer
 - Description
 -  
The tax percentage applied to the transaction.
 
- Name
 tax_amount- Type
 - integer
 - Description
 -  
The tax amount in the smallest unit of currency (e.g., cents).
 
- Name
 crypto_amount_requested- Type
 - string
 - Description
 -  
The amount of cryptocurrency requested for the transaction (e.g., "0.00025 SOL").
 
- Name
 exchange_rate- Type
 - string
 - Description
 -  
The exchange rate between cryptocurrency and fiat (e.g., "1 SOL = $284.14").
 
- Name
 billing_address- Type
 - object
 - Description
 -  
The billing address for the customer, including address, city, state, country, and postal code.
 
- Name
 shipping_address- Type
 - object
 - Description
 -  
The shipping address for the customer, including address, city, state, country, and postal code.
 
Create Checkout Payment Intent
This endpoint takes in your request to generate a checkout for a user, stores this intent to pay in your database and opens a checkout intent on your dashboard. The return is an HTML/JS payload you will embedd into your application to allow the user to pay with Crypto.
Request
curl -X POST https://worker-payments-resolver.hunterwbevis.workers.dev/PUBLIC_KEY/create_checkout_payment_intent \
  -H "Authorization: Bearer {PRIVATE_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "name": "Tim Apple",
      "email": "timapple@fake.com",
      "phone_number": "123-456-7890"
    },
    "total_amount": 19900,
    "items": [
      {
        "item_id": "item_1",
        "quantity": 2
      },
      {
        "item_id": "item_2",
        "quantity": 1
      }
    ],
    "currency_displayed": "USD",
    "tax_percent": 10,
    "tax_amount": 1990,
    "crypto_amount_requested": "0.00025 SOL",
    "exchange_rate": "1 SOL = $284.14",
    "billing_address": {
      "address": "123 Main St",
      "city": "New York",
      "state": "NY",
      "country": "USA",
      "postal_code": "10001"
    },
    "shipping_address": {
      "address": "456 Elm St",
      "city": "Brooklyn",
      "state": "NY",
      "country": "USA",
      "postal_code": "11201"
    }
  }'
Response
{
  "payment_intent_response": {
    "message": "Payment intent created successfully",
    "payment_intent_id": "123-id-number-here"
  }
}