ResourcesInvoices

Create an invoice

This endpoint allows you to create a new invoice. See the code examples for how to create a new invoice with the SellApp API.

This endpoint allows you to create a new invoice. See the code examples for how to create a new invoice with the SellApp API.

Note

The response now includes a top-level checkout field when a checkout URL is already available for the newly created invoice.

POST
/v2/invoices

Authorization

bearerAuth
AuthorizationBearer <token>

Provide your SellApp API key as a bearer token.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://sell.app/api/v2/invoices" \  -H "Content-Type: application/json" \  -d '{    "customer_email": "user@example.com",    "payment_method": "AUTHNET",    "product_variants": {      "property1": {        "quantity": 0      },      "property2": {        "quantity": 0      }    }  }'
{
  "data": {
    "id": 1,
    "payment": {
      "fee": {
        "base": "0",
        "currency": "USD",
        "units": 1,
        "vat": 0,
        "total": {
          "exclusive": "0",
          "inclusive": "0"
        }
      },
      "gateway": {
        "data": {
          "total": {
            "base": "1999",
            "currency": "USD",
            "units": 1,
            "vat": 0,
            "total": {
              "exclusive": "1999",
              "inclusive": "1999"
            }
          },
          "customer_email": "customer@example.com",
          "transaction_id": "CQEGF35V"
        },
        "type": "COINBASE"
      },
      "subtotal": {
        "base": "1999",
        "currency": "USD",
        "units": 1,
        "vat": 0,
        "total": {
          "exclusive": "1999",
          "inclusive": "1999"
        }
      },
      "expires_at": "2024-01-09T23:50:11.000000Z",
      "full_price": {
        "base": "1999",
        "currency": "USD",
        "units": 1,
        "vat": 0,
        "total": {
          "exclusive": "1999",
          "inclusive": "1999"
        }
      },
      "original_amount": {
        "base": "1999",
        "currency": "USD",
        "units": 1,
        "vat": 0,
        "total": {
          "exclusive": "1999",
          "inclusive": "1999"
        }
      }
    },
    "status": {
      "history": [
        {
          "setAt": "2024-01-09T14:50:11.000000Z",
          "status": "PENDING",
          "updatedAt": "2024-01-09T18:00:50.000000Z"
        }
      ],
      "status": {
        "setAt": "2024-01-09T18:00:50.000000Z",
        "status": "COMPLETED",
        "updatedAt": "2024-01-09T18:00:50.000000Z"
      }
    },
    "webhooks": [],
    "feedback": "",
    "created_at": "2024-01-09T14:50:11.000000Z",
    "updated_at": "2024-01-09T18:00:50.000000Z",
    "store_id": 1,
    "coupon_id": null,
    "subscription_id": null,
    "checkout": "https://checkout.example.com/cashapp",
    "customer_information": {
      "id": 123,
      "email": "customer@example.com",
      "country": "Germany",
      "location": "Munich",
      "ip": "1.3.3.7",
      "proxied": false,
      "browser_agent": "Mozilla/4.9 (Windows 98; sl-SI; rv:1.9.1.20) Gecko/20110422 Firefox/21.0",
      "vat": {
        "amount": 0,
        "country": "DE"
      }
    }
  }
}