---
updatedAt: 2026-02-09T18:10:20.000Z
agentTools:
  projectIndex: https://forgingblock.readme.io/llms.txt
---

# Create Order

Creates a new payment order. Support both bearer or cookie secure session

An order is created using the **Create Order** API. Once the order is created, redirect the buyer to a ForgingBlock payment page, where they can see the payable amount, choose a supported cryptocurrency, and complete the payment.

ForgingBlock provides two payment URLs:

##### `invoice_url`

* Single-use payment invoice
* Fixed **20-minute lifetime**
* Intended for direct checkout flows
* Automatically expires if unpaid

##### `checkout_url`

* Reusable payment link
* Safe to share via messengers, email, or QR
* Each visit generates a new invoice using the same order data
* Ideal for asynchronous or off-site payments

**Action:**
Redirect the buyer to the URL or share it with them to complete payment.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "ForgingBlock Payment API",
    "description": "API documentation",
    "version": "1.0.0"
  },
  "components": {
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer YOUR_API_KEY",
        "bearerFormat": ""
      }
    }
  },
  "paths": {
    "/api/v1/orders": {
      "post": {
        "summary": "Create order",
        "tags": [
          "Orders"
        ],
        "description": "Creates a new payment order. Support both bearer or cookie secure session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "order_id": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 128,
                    "description": "Optional merchant-side order identifier. Must be unique per user. Used to map this order to your internal system (e.g. WooCommerce order ID)."
                  },
                  "price_amount": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "pattern": "^[0-9]+(\\.[0-9]{1,8})?$"
                      }
                    ],
                    "description": "Order amount in the specified price currency. Must be a positive number or a decimal string with up to 8 decimal places."
                  },
                  "price_currency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3,
                    "description": "ISO-4217 currency code (e.g. USD, EUR). Determines how the order amount is interpreted and converted to crypto."
                  },
                  "title": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 120,
                    "description": "Product name or order title shown to the buyer during checkout and visible in the merchant dashboard."
                  },
                  "description": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 2000,
                    "description": "Detailed description of the order shown to the buyer during checkout. Can include product details, notes, or payment context."
                  },
                  "success_url": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 2048,
                    "description": "Redirect to Merchant URL after successful payment."
                  },
                  "cancel_url": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 2048,
                    "description": "Redirect to Merchant URL when buyer cancels the order or leaves the checkout before completing payment."
                  },
                  "customerInfo": {
                    "type": "object",
                    "additionalProperties": false,
                    "description": "Optional customer information attached to the order for receipts, tracking, and fulfillment.",
                    "properties": {
                      "email": {
                        "type": "string",
                        "format": "email",
                        "minLength": 3,
                        "maxLength": 50,
                        "description": "Customer email address used for receipts, payment updates, and support communication."
                      },
                      "comment": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 500,
                        "description": "Optional note provided by the customer (e.g. special instructions or additional details)."
                      },
                      "shipping": {
                        "type": "object",
                        "additionalProperties": false,
                        "description": "Optional shipping information used for physical goods fulfillment.",
                        "properties": {
                          "firstName": {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 80,
                            "description": "Recipient first name."
                          },
                          "lastName": {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 80,
                            "description": "Recipient last name."
                          },
                          "address": {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 160,
                            "description": "Street address for delivery."
                          },
                          "apartment": {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 50,
                            "description": "Apartment, suite, or unit number."
                          },
                          "city": {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 120,
                            "description": "City for delivery."
                          },
                          "country": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 2,
                            "description": "Two-letter ISO country code (e.g. US, DE)."
                          },
                          "postalCode": {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 32,
                            "description": "Postal or ZIP code."
                          }
                        }
                      }
                    }
                  }
                },
                "required": [
                  "price_amount",
                  "price_currency"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Order successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Order successfully created",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "new"
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "order_id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "price_currency": {
                      "type": "string",
                      "example": "EUR"
                    },
                    "price_amount": {
                      "type": "string",
                      "example": "100.00"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "expire_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "invoice_url": {
                      "type": "string"
                    },
                    "checkout_url": {
                      "type": "string"
                    },
                    "checkout_id": {
                      "type": "string"
                    },
                    "crypto_amount": {
                      "type": "string",
                      "example": "0"
                    },
                    "crypto_overpaid_amount": {
                      "type": "string",
                      "example": "0"
                    },
                    "crypto_underpaid_amount": {
                      "type": "string",
                      "example": "0"
                    },
                    "description": {
                      "type": "string"
                    },
                    "callback_url": {
                      "type": "string"
                    },
                    "success_url": {
                      "type": "string"
                    },
                    "cancel_url": {
                      "type": "string"
                    },
                    "customerInfo": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": "string"
                        },
                        "comment": {
                          "type": "string"
                        },
                        "shipping": {
                          "type": "object",
                          "properties": {
                            "firstName": {
                              "type": "string"
                            },
                            "lastName": {
                              "type": "string"
                            },
                            "address": {
                              "type": "string"
                            },
                            "apartment": {
                              "type": "string"
                            },
                            "city": {
                              "type": "string"
                            },
                            "country": {
                              "type": "string"
                            },
                            "postalCode": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "blockchain_transactions": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "examples": {
                  "OK": {
                    "summary": "OK",
                    "value": "{\n  status: 'new',\n  id: '52e3c42f-7325-442a-b9a4-c365202a42bf',\n  order_id: '3ee7a7af-ba66-41b6-97d2-70a6af17b613',\n  title: 'New order',\n  price_currency: 'USD',\n  price_amount: '0.01000000',\n  created_at: '2026-02-08T16:15:56.470Z',\n  expire_at: '2026-02-08T16:35:56.469Z',\n  invoice_url: 'https://api.forgingblock.io/api/v1/invoice?id=52e3c42f-7325-442a-b9a4-c365202a42bf',\n  checkout_url: 'https://api.forgingblock.io/api/v1/checkout?id=2f94a7b9-1ea9-45b9-bbc2-3ae26f78bd9e',\n  checkout_id: '',\n  crypto_amount: '',\n  crypto_overpaid_amount: '0.000000000000000000',\n  crypto_underpaid_amount: '0.000000000000000000',\n  description: 'My order description',\n  callback_url: '',\n  success_url: '',\n  cancel_url: '',\n  customerInfo: {\n    email: '',\n    comment: '',\n    shipping: {\n      firstName: '',\n      lastName: '',\n      address: '',\n      apartment: '',\n      city: '',\n      country: '',\n      postalCode: ''\n    }\n  },\n  blockchain_transactions: []\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Validation error",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Unauthorized",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Rate limit exceeded",
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "number",
                      "example": 429
                    },
                    "error": {
                      "type": "string",
                      "example": "Too Many Requests"
                    },
                    "message": {
                      "type": "string",
                      "example": "Rate limit exceeded, retry in 2 minutes"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.forgingblock.io",
      "description": "ForgingBlock"
    }
  ],
  "x-readme": {
    "proxy-enabled": false,
    "explorer-enabled": true
  },
  "security": [
    {
      "Bearer": []
    }
  ]
}
```