# CreatedLink

The checkout URL and initial state of a new payment link.

[Definition in OpenAPI](https://api.cadmospay.com/static/api/gateway-machine-api.json#/components/schemas/CreatedLink)

## JSON schema

```json
{
  "type": "object",
  "required": [
    "uuid",
    "status",
    "token",
    "checkoutUrl",
    "receiverAddress",
    "externalReference",
    "localMethods",
    "refusedLocalMethods",
    "paymentReference",
    "amountUsd",
    "countedUsd",
    "leftUsd",
    "paid"
  ],
  "properties": {
    "uuid": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "active"
      ]
    },
    "token": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{43}$",
      "description": "The checkout secret inside `checkoutUrl`."
    },
    "checkoutUrl": {
      "type": "string",
      "format": "uri",
      "description": "The page to send your customer."
    },
    "receiverAddress": {
      "$ref": "#/components/schemas/Address",
      "description": "The link's own receiving address on Arbitrum."
    },
    "externalReference": {
      "type": [
        "string",
        "null"
      ]
    },
    "localMethods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The cash methods the link accepts."
    },
    "refusedLocalMethods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The cash methods you asked for that the link does not accept."
    },
    "paymentReference": {
      "type": [
        "string",
        "null"
      ],
      "description": "The code a cash payer gives, when the link accepts a cash method."
    },
    "amountUsd": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Dollars"
        },
        {
          "type": "null"
        }
      ],
      "description": "The price, or `null` for an open amount."
    },
    "countedUsd": {
      "$ref": "#/components/schemas/Dollars",
      "description": "What the link's settled payments count for, before the Gateway Fee."
    },
    "leftUsd": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Dollars"
        },
        {
          "type": "null"
        }
      ],
      "description": "What is still due; `\"0.00\"` once paid; `null` for an open amount."
    },
    "paid": {
      "type": "boolean",
      "description": "True once what is left is within min($0.49, max($0.02, 0.1 % of the amount)): a bridged payment can land a few cents under. Always false for an open amount."
    }
  }
}
```

## Example

```json
{
  "uuid": "0b6f5a8e-1c2d-4e3f-9a8b-7c6d5e4f3a2b",
  "status": "active",
  "checkoutUrl": "https://cadmospay.com/checkout/example_checkout_token_for_documentation_00",
  "receiverAddress": "0x0000000000000000000000000000000000000042",
  "externalReference": "order-42",
  "localMethods": [],
  "paymentReference": null,
  "amountUsd": "100.00",
  "countedUsd": "0.00",
  "leftUsd": "100.00",
  "paid": false,
  "token": "example_checkout_token_for_documentation_00",
  "refusedLocalMethods": []
}
```
