{
  "openapi": "3.0.0",
  "info": {
    "contact": {
      "email": "hello@briqpay.com"
    },
    "description": "The Briqpay API v3. For how to integrate, with guides and examples, see the [Documentation](https://developer.briqpay.com/docs). To get credentials for the playground API, register in the [Merchant Portal](https://app.briqpay.com).",
    "title": "Briqpay API",
    "version": ""
  },
  "servers": [
    {
      "url": "https://playground-api.briqpay.com",
      "description": "Playground"
    },
    {
      "url": "https://api.briqpay.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "Every request uses HTTP Basic authentication, with your merchant ID as the username and your secret as the password. To give access to something you trust less than your own backend, [generate a secret](https://developer.briqpay.com/api-reference/generate-a-secret) that expires after a set time, only works for one session, or only allows the operations you list."
    },
    {
      "name": "Session Management",
      "description": "Briqpay's API allows you to create and manage sessions that are used throughout the payment/signup flow. Our solution is built using an iframe, which enables Briqpay to collect all the necessary customer information and provide your integration with all the relevant data post-purchase. The first step in integrating with Briqpay is to create a session using our API."
    },
    {
      "name": "Order Management",
      "description": "Handle an order after the purchase: capture it when you ship, refund a capture, cancel an authorized order you won't ship, release what's left after a partial capture, or update the cart and references. Which of these an order supports depends on its payment provider."
    },
    {
      "name": "Hosted Page",
      "description": "Send the customer to a payment page Briqpay hosts, instead of embedding the checkout on your own site. [Create a session](https://developer.briqpay.com/api-reference/create-session) first, then create a hosted page for it with the session's ID."
    },
    {
      "name": "Tokenized Payment Methods",
      "description": "Charge a customer's saved payment method (a token) without them going through the checkout again. A charge uses the same endpoint as [Create session](https://developer.briqpay.com/api-reference/create-session), with the `payment_charge_token` intent, and the order that comes back is managed like any other. You can also read, update and deactivate a token."
    },
    {
      "name": "Outgoing Webhooks",
      "description": "These are not API endpoints you call. They describe the POST payloads that Briqpay sends to your configured webhook URLs when events occur. Configure webhook subscriptions using the `hooks` array when creating a session. See the [Webhooks Guide](https://developer.briqpay.com/docs/payment-module#webhooks) for HMAC signature verification and additional details."
    }
  ],
  "paths": {
    "/v3/auth": {
      "post": {
        "summary": "Generate a secret",
        "description": "Optional: See the [Authentication guide](https://developer.briqpay.com/docs/authentication) for more information.",
        "tags": [
          "Authentication"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "Advanced": {
                  "value": {
                    "lifetime": {
                      "unit": "hour",
                      "count": 24
                    },
                    "scopes": {
                      "sessionId": "c366f6fc-2757-43e2-bc50-2b65f57f60a1",
                      "operations": [
                        "read_session"
                      ]
                    }
                  }
                },
                "Session": {
                  "value": {
                    "scopes": {
                      "sessionId": "c366f6fc-2757-43e2-bc50-2b65f57f60a1"
                    }
                  }
                },
                "Operations": {
                  "value": {
                    "scopes": {
                      "operations": [
                        "read_session"
                      ]
                    }
                  }
                },
                "Lifetime": {
                  "value": {
                    "lifetime": {
                      "unit": "hour",
                      "count": 24
                    }
                  }
                }
              },
              "schema": {
                "type": "object",
                "properties": {
                  "lifetime": {
                    "type": "object",
                    "description": "Define how long this secret should be valid for.",
                    "properties": {
                      "unit": {
                        "type": "string",
                        "enum": [
                          "second",
                          "minute",
                          "hour",
                          "day"
                        ],
                        "default": "hour"
                      },
                      "count": {
                        "type": "integer",
                        "example": 24,
                        "default": 24
                      }
                    }
                  },
                  "scopes": {
                    "type": "object",
                    "properties": {
                      "sessionId": {
                        "type": "string",
                        "example": "c366f6fc-2757-43e2-bc50-2b65f57f60a1",
                        "description": "Optional: Scope this secret to only be valid for a specific session."
                      },
                      "tokenId": {
                        "type": "string",
                        "example": "c366f6fc-2757-43e2-bc50-2b65f57f60a1",
                        "description": "Optional: Scope this secret to only be valid for a specific tokenized payment method."
                      },
                      "operations": {
                        "type": "array",
                        "description": "Optional: Define which operations this secret can be used for.",
                        "items": {
                          "type": "string",
                          "example": "read_session",
                          "enum": [
                            "create_session",
                            "read_session",
                            "update_session",
                            "update_session_metadata",
                            "capture_order",
                            "refund_order",
                            "cancel_order",
                            "validate_session",
                            "update_cart",
                            "update_references",
                            "create_hpp",
                            "read_token",
                            "patch_token",
                            "delete_token"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "secret": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string",
                      "example": "2023-04-12T13:16:08.647Z"
                    }
                  }
                }
              }
            },
            "links": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_DATA",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/session": {
      "post": {
        "summary": "Create session",
        "description": "Create a Briqpay session for Checkout, Signup or Payment Module.  \n  \n* To get started, take a look at the examples on the right:  \n**Checkout, Signup or Payment Module**  \n* Read about [Authentication](https://developer.briqpay.com/docs/authentication)  \n",
        "tags": [
          "Session Management"
        ],
        "parameters": [
          {
            "description": "Limit which fields are returned by the API. The `fields` query parameter takes a comma-separated list of fields or 'none'. Example: `fields=sessionId,htmlSnippet`. If 'none' is specified, an empty 204 will be returned.",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Content-Type",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "Payment module": {
                  "value": {
                    "product": {
                      "type": "payment",
                      "intent": "payment_one_time"
                    },
                    "customerType": "consumer",
                    "country": "SE",
                    "locale": "sv-se",
                    "urls": {
                      "terms": "https://example.com/terms",
                      "redirect": "https://example.com/redirect"
                    },
                    "hooks": [
                      {
                        "eventType": "order_status",
                        "statuses": [
                          "order_pending",
                          "order_rejected",
                          "order_cancelled",
                          "order_approved_not_captured"
                        ],
                        "method": "POST",
                        "url": "https://example.com/notifications"
                      },
                      {
                        "eventType": "capture_status",
                        "statuses": [
                          "pending",
                          "approved",
                          "rejected"
                        ],
                        "method": "POST",
                        "url": "https://example.com/notifications"
                      },
                      {
                        "eventType": "refund_status",
                        "statuses": [
                          "pending",
                          "approved",
                          "rejected"
                        ],
                        "method": "POST",
                        "url": "https://example.com/notifications"
                      }
                    ],
                    "data": {
                      "order": {
                        "currency": "SEK",
                        "amountIncVat": 2700,
                        "amountExVat": 2160,
                        "cart": [
                          {
                            "productType": "physical",
                            "reference": "testproduct1",
                            "name": "Test product",
                            "quantity": 2,
                            "quantityUnit": "pc",
                            "unitPrice": 1200,
                            "taxRate": 2500,
                            "discountPercentage": 1000,
                            "unitDiscountAmountIncVat": 120
                          }
                        ]
                      },
                      "billing": {
                        "firstName": "Anna",
                        "lastName": "Andersson",
                        "email": "anna@example.com",
                        "phoneNumber": "+46701234567",
                        "streetAddress": "Storgatan 1",
                        "zip": "11122",
                        "city": "Stockholm",
                        "country": "SE"
                      },
                      "shipping": {
                        "firstName": "Anna",
                        "lastName": "Andersson",
                        "email": "anna@example.com",
                        "phoneNumber": "+46701234567",
                        "streetAddress": "Storgatan 1",
                        "zip": "11122",
                        "city": "Stockholm",
                        "country": "SE"
                      }
                    },
                    "modules": {
                      "loadModules": [
                        "payment"
                      ]
                    }
                  }
                },
                "Checkout": {
                  "value": {
                    "product": {
                      "type": "payment",
                      "intent": "payment_one_time"
                    },
                    "customerType": "business",
                    "country": "SE",
                    "locale": "sv-se",
                    "urls": {
                      "terms": "https://example.com/terms",
                      "redirect": "https://example.com/redirect"
                    },
                    "hooks": [
                      {
                        "eventType": "order_status",
                        "statuses": [
                          "order_pending",
                          "order_rejected",
                          "order_cancelled",
                          "order_approved_not_captured"
                        ],
                        "method": "POST",
                        "url": "https://example.com/notifications"
                      },
                      {
                        "eventType": "capture_status",
                        "statuses": [
                          "pending",
                          "approved",
                          "rejected"
                        ],
                        "method": "POST",
                        "url": "https://example.com/notifications"
                      },
                      {
                        "eventType": "refund_status",
                        "statuses": [
                          "pending",
                          "approved",
                          "rejected"
                        ],
                        "method": "POST",
                        "url": "https://example.com/notifications"
                      }
                    ],
                    "data": {
                      "order": {
                        "currency": "SEK",
                        "amountIncVat": 2700,
                        "amountExVat": 2160,
                        "cart": [
                          {
                            "productType": "physical",
                            "reference": "testproduct1",
                            "name": "Test product",
                            "quantity": 2,
                            "quantityUnit": "pc",
                            "unitPrice": 1200,
                            "taxRate": 2500,
                            "discountPercentage": 1000,
                            "unitDiscountAmountIncVat": 120
                          }
                        ]
                      },
                      "invoiceDetails": {
                        "reference": "invoice-ref-123",
                        "email": "test@test.com"
                      }
                    }
                  }
                },
                "Signup": {
                  "value": {
                    "product": {
                      "type": "signup",
                      "intent": "signup"
                    },
                    "customerType": "business",
                    "country": "SE",
                    "locale": "sv-se",
                    "urls": {
                      "redirect": "https://example.com/redirect"
                    },
                    "hooks": [
                      {
                        "eventType": "session_status",
                        "statuses": [
                          "completed"
                        ],
                        "method": "POST",
                        "url": "https://example.com/notifications"
                      }
                    ]
                  }
                }
              },
              "schema": {
                "required": [
                  "product",
                  "customerType",
                  "country",
                  "locale",
                  "urls"
                ],
                "type": "object",
                "properties": {
                  "product": {
                    "$ref": "#/components/schemas/productRequestObject"
                  },
                  "customerType": {
                    "$ref": "#/components/schemas/customerType"
                  },
                  "country": {
                    "$ref": "#/components/schemas/country"
                  },
                  "locale": {
                    "$ref": "#/components/schemas/locale"
                  },
                  "urls": {
                    "$ref": "#/components/schemas/urls"
                  },
                  "references": {
                    "$ref": "#/components/schemas/references"
                  },
                  "hooks": {
                    "$ref": "#/components/schemas/hooks"
                  },
                  "config": {
                    "$ref": "#/components/schemas/config"
                  },
                  "data": {
                    "$ref": "#/components/schemas/createSessionData"
                  },
                  "modules": {
                    "$ref": "#/components/schemas/modules"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/sessionResponseBody"
                }
              }
            },
            "links": {}
          },
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/session ": {
      "post": {
        "summary": "Charge a token",
        "description": "Charge a tokenized payment method. This is the same endpoint as [Create session](https://developer.briqpay.com/api-reference/create-session) but the requirements are different with the \"payment_charge_token\" intent.  \n  Use the \"Session Mangement\" and \"Order Management\" APIs to handle the returned session.",
        "tags": [
          "Tokenized Payment Methods"
        ],
        "parameters": [
          {
            "description": "Limit which fields are returned by the API. The `fields` query parameter takes a comma-separated list of fields or 'none'. Example: `fields=sessionId,htmlSnippet`. If 'none' is specified, an empty 204 will be returned.",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Content-Type",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "Charge": {
                  "value": {
                    "product": {
                      "type": "payment",
                      "intent": "payment_charge_token"
                    },
                    "hooks": [
                      {
                        "eventType": "order_status",
                        "statuses": [
                          "order_pending",
                          "order_rejected",
                          "order_cancelled",
                          "order_approved_not_captured"
                        ],
                        "method": "POST",
                        "url": "https://example.com/notifications"
                      },
                      {
                        "eventType": "capture_status",
                        "statuses": [
                          "pending",
                          "approved",
                          "rejected"
                        ],
                        "method": "POST",
                        "url": "https://example.com/notifications"
                      },
                      {
                        "eventType": "refund_status",
                        "statuses": [
                          "pending",
                          "approved",
                          "rejected"
                        ],
                        "method": "POST",
                        "url": "https://example.com/notifications"
                      }
                    ],
                    "data": {
                      "order": {
                        "currency": "SEK",
                        "amountIncVat": 2700,
                        "amountExVat": 2160,
                        "cart": [
                          {
                            "productType": "physical",
                            "reference": "testproduct1",
                            "name": "Test product",
                            "quantity": 2,
                            "quantityUnit": "pc",
                            "unitPrice": 1200,
                            "taxRate": 2500,
                            "discountPercentage": 1000,
                            "unitDiscountAmountIncVat": 120
                          }
                        ]
                      },
                      "tokenization": {
                        "tokenId": "c5674f4f-7e84-405c-a44b-c83736bb7209"
                      }
                    }
                  }
                }
              },
              "schema": {
                "required": [
                  "product",
                  "data"
                ],
                "type": "object",
                "properties": {
                  "product": {
                    "type": "object",
                    "title": "Payment",
                    "required": [
                      "type",
                      "intent"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "payment"
                        ],
                        "description": "Type of Briqpay product."
                      },
                      "intent": {
                        "type": "string",
                        "enum": [
                          "payment_charge_token"
                        ]
                      }
                    }
                  },
                  "hooks": {
                    "$ref": "#/components/schemas/hooks"
                  },
                  "references": {
                    "$ref": "#/components/schemas/references"
                  },
                  "data": {
                    "type": "object",
                    "required": [
                      "order",
                      "tokenization"
                    ],
                    "properties": {
                      "order": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/order"
                          },
                          {
                            "description": "The order object contains all information about cart items, amounts and tax/vat. For the EU, VAT is represented with 'taxRate' on every item. For the US, all tax should be calculated into an item with the \"sales_tax\" productType."
                          },
                          {
                            "required": [
                              "currency",
                              "cart",
                              "amountIncVat",
                              "amountExVat"
                            ]
                          }
                        ]
                      },
                      "tokenization": {
                        "$ref": "#/components/schemas/tokenizationDataInput"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/sessionResponseBody"
                }
              }
            },
            "links": {}
          },
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/session/{sessionId}": {
      "get": {
        "summary": "Read session",
        "description": "Read an ongoing or completed session.  \n  \n* Read about [Authentication](https://developer.briqpay.com/docs/authentication)  \n",
        "tags": [
          "Session Management"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "description": "**Format:** UUID",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Limit which fields are returned by the API. The `fields` query parameter takes a comma-separated list of fields or 'none'. Example: `fields=status,data,moduleStatus`. If 'none' is specified, an empty 204 will be returned.",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/sessionResponseBody"
                }
              }
            },
            "links": {}
          },
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      },
      "patch": {
        "summary": "Update session",
        "description": "Update data of a session such as order data, billing details or config for some modules.  \n Only data that you wish to update has to be provided.   \n It is not possible to update a session after it has been completed.   \n  \n* Read about [Authentication](https://developer.briqpay.com/docs/authentication)  \n",
        "tags": [
          "Session Management"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "description": "**Format:** UUID",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Limit which fields are returned by the API. The `fields` query parameter takes a comma-separated list of fields or 'none'. Example: `fields=data`. If 'none' is specified, an empty 204 will be returned.",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Content-Type",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "Update order": {
                  "value": {
                    "data": {
                      "order": {
                        "currency": "SEK",
                        "amountIncVat": 3000,
                        "amountExVat": 2400,
                        "cart": [
                          {
                            "productType": "physical",
                            "reference": "testproduct1",
                            "name": "Test product",
                            "quantity": 2,
                            "quantityUnit": "pc",
                            "unitPrice": 1200,
                            "taxRate": 2500,
                            "discountPercentage": 0
                          }
                        ]
                      }
                    }
                  }
                }
              },
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "$ref": "#/components/schemas/updateSessionData"
                  },
                  "modules": {
                    "type": "object",
                    "description": "Configure the module system.",
                    "properties": {
                      "config": {
                        "$ref": "#/components/schemas/updateSessionConfigs"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/sessionResponseBody"
                }
              }
            },
            "links": {}
          },
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/session/{sessionId}/metadata": {
      "patch": {
        "summary": "Update metadata",
        "description": "Update metadata of a session such as references and urls.  \n  \n* Read about [Authentication](https://developer.briqpay.com/docs/authentication)  \n",
        "tags": [
          "Session Management"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "description": "**Format:** UUID",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Limit which fields are returned by the API. The `fields` query parameter takes a comma-separated list of fields or 'none'. Example: `fields=none`. If 'none' is specified, an empty 204 will be returned.",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Content-Type",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "data"
                ],
                "type": "object",
                "properties": {
                  "urls": {
                    "$ref": "#/components/schemas/urls"
                  },
                  "references": {
                    "$ref": "#/components/schemas/references"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/sessionResponseBody"
                }
              }
            },
            "links": {}
          },
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/session/{sessionId}/decision": {
      "post": {
        "summary": "Make decision",
        "description": "This endpoint is part of the [Decisions](https://developer.briqpay.com/docs/payment-module#4-approve-the-purchase) flow.\n\nThe error messages has support for [markdown links](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN#links) if you want the user to be able to read more or contact someone based on your error message.",
        "tags": [
          "Session Management"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "description": "**Format:** UUID",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Content-Type",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "Allow": {
                  "value": {
                    "decision": "allow"
                  }
                },
                "Soft reject": {
                  "value": {
                    "decision": "reject",
                    "rejectionType": "notify_user",
                    "softErrors": [
                      {
                        "message": "Registration rejected"
                      }
                    ]
                  }
                },
                "Hard reject": {
                  "value": {
                    "decision": "reject",
                    "rejectionType": "reject_session_with_error",
                    "hardError": {
                      "message": "Registration rejected"
                    }
                  }
                }
              },
              "schema": {
                "required": [
                  "decision"
                ],
                "type": "object",
                "example": {
                  "decision": "allow"
                },
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "allow",
                      "reject"
                    ]
                  },
                  "rejectionType": {
                    "type": "string",
                    "enum": [
                      "reject_session_with_error",
                      "notify_user"
                    ],
                    "description": "Required with { \"decision\": \"reject\" }.  \n\"reject_session_with_error\" will close the session and display a message in the client in an overlay.  \n\"notify_user\" will display a message in the client."
                  },
                  "hardError": {
                    "type": "object",
                    "description": "Required with { \"rejectionType\": \"reject_session_with_error\" }. Provide an error message that will be shown in an overlay in the client.",
                    "required": [
                      "message"
                    ],
                    "properties": {
                      "message": {
                        "type": "string",
                        "maxLength": 256
                      }
                    }
                  },
                  "softErrors": {
                    "type": "array",
                    "description": "Optional with { \"rejectionType\": \"notify_user\" }. Provide a list of error messages that will be shown to the user.",
                    "items": {
                      "type": "object",
                      "required": [
                        "message"
                      ],
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/session/{sessionId}/order/capture": {
      "post": {
        "summary": "Capture an order",
        "description": "Capture an order of a completed payment session. The provided cart items must exist on the session.",
        "tags": [
          "Order Management"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "description": "**Format:** UUID",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Content-Type",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": [
                      "order"
                    ],
                    "properties": {
                      "order": {
                        "type": "object",
                        "required": [
                          "amountIncVat",
                          "amountExVat",
                          "currency",
                          "cart"
                        ],
                        "properties": {
                          "amountIncVat": {
                            "$ref": "#/components/schemas/amountIncVat"
                          },
                          "amountExVat": {
                            "$ref": "#/components/schemas/amountExVat"
                          },
                          "currency": {
                            "$ref": "#/components/schemas/currency"
                          },
                          "cart": {
                            "minItems": 1,
                            "$ref": "#/components/schemas/cart"
                          }
                        }
                      }
                    }
                  },
                  "merchantCaptureReference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512,
                    "nullable": true,
                    "description": "A merchant-set reference attached to the capture for merchant-side traceability. Returned on this capture in GET session responses and included in the capture webhook payload."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capture"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "CAPTURE_NOT_SUPPORTED",
                            "PARTIAL_CAPTURE_NOT_SUPPORTED",
                            "INVALID_DATA",
                            "ORDER_REJECTED",
                            "ORDER_PENDING",
                            "ORDER_CANCELLED",
                            "ORDER_FULLY_CAPTURED",
                            "REMAINING_UNCAPTURED_QUANTITY_TOO_LOW",
                            "REMAINING_UNCAPTURED_AMOUNT_TOO_LOW",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/session/{sessionId}/order/refund": {
      "post": {
        "summary": "Refund a capture",
        "description": "Refund a captured order of a payment session.  \n  \n* [Refunds Guide / Documentation](https://developer.briqpay.com/docs/payment-module#6-capture-cancel-and-refund)  \n",
        "tags": [
          "Order Management"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "description": "**Format:** UUID. The session that should be partially or fully refunded.",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Content-Type",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data"
                ],
                "properties": {
                  "captureId": {
                    "type": "string",
                    "description": "**Format:** UUID. The capture that should be partially or fully refunded. Only needed when working with partial captures.",
                    "example": "a068120f-a4f0-46b7-89cf-4b62e8abcf4c"
                  },
                  "data": {
                    "type": "object",
                    "required": [
                      "order"
                    ],
                    "properties": {
                      "order": {
                        "type": "object",
                        "required": [
                          "amountIncVat",
                          "amountExVat",
                          "currency",
                          "cart"
                        ],
                        "properties": {
                          "amountIncVat": {
                            "$ref": "#/components/schemas/amountIncVat"
                          },
                          "amountExVat": {
                            "$ref": "#/components/schemas/amountExVat"
                          },
                          "currency": {
                            "$ref": "#/components/schemas/currency"
                          },
                          "cart": {
                            "minItems": 1,
                            "$ref": "#/components/schemas/cart"
                          }
                        }
                      }
                    }
                  },
                  "merchantRefundReference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512,
                    "nullable": true,
                    "description": "A merchant-set reference attached to the refund for merchant-side traceability. Returned on this refund in GET session responses and included in the refund webhook payload."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/refund"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "REFUND_NOT_SUPPORTED",
                            "REFUND_NOT_ALLOWED",
                            "PARTIAL_REFUND_NOT_ALLOWED",
                            "ORDER_NOT_COMPLETED",
                            "ORDER_NOT_CAPTURED",
                            "ORDER_CANCELLED",
                            "ORDER_PENDING",
                            "REMAINING_UNREFUNDED_QUANTITY_TOO_LOW",
                            "REMAINING_UNREFUNDED_AMOUNT_TOO_LOW",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/session/{sessionId}/order/cancel": {
      "post": {
        "summary": "Cancel an order",
        "description": "Cancel an order of a payment session. It is only possible to cancel an order that has order status `order_approved_not_captured`. If the order has been captured it is no longer possible to cancel the order as it should be refunded instead. It is also not possible to cancel a pending or rejected order.  \n  \nMost payment providers confirm a cancellation right away and you get a `204`. A few process it in the background and answer `202` with `status: cancel_pending` instead. In that case the order sits in `order_cancel_pending` and the authorization stays live until the provider replies. You then get an `order_status` webhook with one of:  \n  \n* `order_cancelled` - the cancellation went through. An authorization that had already expired ends up here too, since it can no longer be captured. Look at `transaction.status` to tell them apart: `cancelled` or `expired`.  \n* `order_approved_not_captured` - the provider refused the cancellation. The order is back where it was and can still be captured.  \n",
        "tags": [
          "Order Management"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "description": "**Format:** UUID",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Content-Type",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The cancellation is accepted but not confirmed yet. The order is now `order_cancel_pending` and the authorization stays live until the provider replies. Wait for the `order_status` webhook - see the endpoint description for the outcomes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "cancel_pending"
                      ]
                    }
                  }
                }
              }
            }
          },
          "204": {
            "description": "The order is cancelled. The payment provider confirmed it right away, so there is no webhook to wait for.",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "CANCEL_NOT_SUPPORTED",
                            "INVALID_DATA",
                            "ORDER_NOT_COMPLETED",
                            "ORDER_REJECTED",
                            "ORDER_PENDING",
                            "ORDER_ALREADY_CAPTURED",
                            "ORDER_ALREADY_CANCELLED",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/session/{sessionId}/order/release-remaining": {
      "post": {
        "summary": "Release remaining order amount",
        "description": "Release the remaining uncaptured amount of a partially captured order. This signals to the payment provider that no further captures will be made, effectively closing out the order. It is only possible to release remaining on an order that has been partially captured (`captured_partial` status). Orders that have not been captured, are fully captured, cancelled, pending, or rejected cannot have their remaining amount released.",
        "tags": [
          "Order Management"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "description": "**Format:** UUID",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Content-Type",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "OPERATION_NOT_SUPPORTED",
                            "ORDER_NOT_COMPLETED",
                            "ORDER_REJECTED",
                            "ORDER_PENDING",
                            "ORDER_ALREADY_CANCELLED",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/session/{sessionId}/order/update/cart": {
      "patch": {
        "summary": "Update cart",
        "description": "Update cart and amounts of a completed but not fully captured session.",
        "tags": [
          "Order Management"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "description": "**Format:** UUID",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Content-Type",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": [
                      "order"
                    ],
                    "properties": {
                      "order": {
                        "type": "object",
                        "required": [
                          "amountIncVat",
                          "amountExVat",
                          "currency",
                          "cart"
                        ],
                        "properties": {
                          "amountIncVat": {
                            "$ref": "#/components/schemas/amountIncVat"
                          },
                          "amountExVat": {
                            "$ref": "#/components/schemas/amountExVat"
                          },
                          "currency": {
                            "$ref": "#/components/schemas/currency"
                          },
                          "cart": {
                            "minItems": 1,
                            "$ref": "#/components/schemas/cart"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "ORDER_NOT_COMPLETED",
                            "ORDER_REJECTED",
                            "ORDER_PENDING",
                            "ORDER_CANCELLED",
                            "UPDATE_NOT_ALLOWED",
                            "UPDATE_NOT_SUPPORTED",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/session/{sessionId}/order/update/references": {
      "patch": {
        "summary": "Update references",
        "description": "Update order references of a completed session.",
        "tags": [
          "Order Management"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "description": "**Format:** UUID",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Content-Type",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "references"
                ],
                "type": "object",
                "properties": {
                  "references": {
                    "$ref": "#/components/schemas/references"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "ORDER_NOT_COMPLETED",
                            "ORDER_REJECTED",
                            "ORDER_PENDING",
                            "ORDER_CANCELLED",
                            "UPDATE_NOT_ALLOWED",
                            "UPDATE_NOT_SUPPORTED",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/token/{tokenId}": {
      "get": {
        "summary": "Get token",
        "description": "Get a tokenized payment method.",
        "tags": [
          "Tokenized Payment Methods"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "tokenId",
            "description": "**Format:** UUID. The tokenId is retrieved from **data.tokenization.tokenId** on a completed session with intent: \"payment_tokenize\" or \"payment_tokenize_and_charge\".",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/tokenResponseBody"
                }
              }
            },
            "links": {}
          },
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      },
      "patch": {
        "summary": "Patch token",
        "description": "Patch data of a tokenized payment method.",
        "tags": [
          "Tokenized Payment Methods"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "tokenId",
            "description": "**Format:** UUID. The tokenId is retrieved from **data.tokenization.tokenId** on a completed session with intent: \"payment_tokenize\" or \"payment_tokenize_and_charge\".",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "data"
                ],
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "billing": {
                        "$ref": "#/components/schemas/addressInput"
                      },
                      "shipping": {
                        "$ref": "#/components/schemas/addressInput"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/tokenResponseBody"
                }
              }
            },
            "links": {}
          },
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "OPERATION_NOT_SUPPORTED",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      },
      "delete": {
        "summary": "Deactivate token",
        "description": "Deactivate a tokenized payment method.",
        "tags": [
          "Tokenized Payment Methods"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "tokenId",
            "description": "**Format:** UUID. The tokenId is retrieved from **data.tokenization.tokenId** on a completed session with intent: \"payment_tokenize\" or \"payment_tokenize_and_charge\".",
            "example": "c5674f4f-7e84-405c-a44b-c83736bb7209",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/tokenResponseBody"
                }
              }
            },
            "links": {}
          },
          "204": {
            "description": "",
            "content": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "OPERATION_NOT_SUPPORTED",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v3/hosted-page": {
      "post": {
        "summary": "Create a hosted payment page",
        "description": "Create a hosted payment page. This requires you to first [create a session](https://developer.briqpay.com/api-reference/create-session), and then with the help of the sessionId from that call, create a hosted page for it.",
        "tags": [
          "Hosted Page"
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Accept",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ]
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "description": "Format: \"Basic <base64(username:secret)>\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sessionId"
                ],
                "properties": {
                  "sessionId": {
                    "type": "string",
                    "name": "sessionId",
                    "description": "**Format:** UUID. The sessionId is retrieved from **data.sessionId** on a previously created session.",
                    "example": "c5674f4f-7e84-405c-a44b-c83736bb7209"
                  },
                  "config": {
                    "type": "object",
                    "required": [],
                    "properties": {
                      "pageTitle": {
                        "type": "string",
                        "description": "A short text of information to display to the end-user beneath the logo.",
                        "minLength": 3,
                        "maxLength": 256
                      },
                      "logoUrl": {
                        "type": "string",
                        "description": "URL to an image: png | jpg | jpeg | svg",
                        "maxLength": 512,
                        "example": "https://example.com/logo.png"
                      },
                      "showCart": {
                        "type": "boolean",
                        "description": "Whether to display the cart items above the payment section or not.",
                        "default": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hostedPageId": {
                      "type": "string",
                      "name": "hostedPageId",
                      "description": "**Format:** UUID.",
                      "example": "c5674f4f-7e84-405c-a44b-c83736bb7209"
                    },
                    "sessionId": {
                      "type": "string",
                      "name": "sessionId",
                      "description": "**Format:** UUID. The sessionId is retrieved from **data.sessionId** on a previously created session.",
                      "example": "c5674f4f-7e84-405c-a44b-c83736bb7209"
                    },
                    "url": {
                      "type": "string",
                      "description": "URL to the newly created Hosted Page.",
                      "example": "https://hp.briqpay.com/payment/4dd11ccf-f999-4176-b181-4f927589a701/3b076046-2913-4a0a-a585-be42d0d5d348"
                    },
                    "config": {
                      "type": "object",
                      "required": [],
                      "properties": {
                        "pageTitle": {
                          "type": "string",
                          "description": "A short text of information to display to the end-user beneath the logo.",
                          "minLength": 3,
                          "maxLength": 256
                        },
                        "logoUrl": {
                          "type": "string",
                          "description": "URL to an image: png | jpg | jpeg | svg",
                          "maxLength": 512,
                          "example": "https://example.com/logo.png"
                        },
                        "showCart": {
                          "type": "boolean",
                          "description": "Whether to display the cart items above the payment section or not.",
                          "default": true
                        }
                      }
                    }
                  }
                }
              }
            },
            "links": {}
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_CREDENTIALS",
                            "INVALID_DATA",
                            "UNKNOWN"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse403"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse404"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "productRequestObject": {
        "type": "object",
        "title": "Payment",
        "required": [
          "type",
          "intent"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "payment",
              "signup"
            ],
            "description": "Type of Briqpay product."
          },
          "intent": {
            "type": "string",
            "enum": [
              "payment_one_time",
              "payment_tokenize",
              "payment_tokenize_and_charge",
              "payment_charge_token",
              "signup"
            ]
          },
          "variantId": {
            "type": "string",
            "example": "a8a7acb2-4c65-4a91-a8e5-d8125bf64fd4",
            "description": "Provide this if you have created an alternate variant configuration in the backoffice that you want to use."
          }
        }
      },
      "productResponseObject": {
        "type": "object",
        "title": "Payment",
        "required": [
          "type",
          "intent"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "payment",
              "signup"
            ],
            "description": "Type of Briqpay product."
          },
          "intent": {
            "type": "string",
            "enum": [
              "payment_one_time",
              "payment_tokenize",
              "payment_tokenize_and_charge",
              "payment_charge_token",
              "signup"
            ]
          },
          "id": {
            "deprecated": true,
            "type": "string",
            "example": "a8a7acb2-4c65-4a91-a8e5-d8125bf64fd4"
          },
          "variantId": {
            "type": "string",
            "example": "a8a7acb2-4c65-4a91-a8e5-d8125bf64fd4",
            "description": "Provide this if you have created an alternate variant configuration in the backoffice that you want to use."
          }
        }
      },
      "customerType": {
        "type": "string",
        "example": "business",
        "enum": [
          "business",
          "consumer"
        ],
        "description": "Which type of customer this session is for."
      },
      "country": {
        "type": "string",
        "description": "Country code in ISO 3166-1 alpha-2 format.",
        "example": "SE"
      },
      "locale": {
        "type": "string",
        "description": "Locale in \"sv-se\" / \"en-gb\" format.",
        "example": "sv-se"
      },
      "references": {
        "type": "object",
        "maxProperties": 10,
        "example": {
          "reference1": "000",
          "orderId": "12345",
          "customerId": "54321"
        },
        "description": "Your own references, we recommend using property name \"reference1\" as your order reference for payments since this property is default for multiple payment providers. But any additional property name can be used e.g. customerId. Example: {  \"reference1\": \"000\", \"customerId\": \"12345\" }",
        "additionalProperties": {
          "type": "string",
          "maxLength": 512
        }
      },
      "urls": {
        "type": "object",
        "required": [
          "redirect"
        ],
        "properties": {
          "terms": {
            "type": "string",
            "example": "https://example.com/terms",
            "description": "URL to your terms & conditions, will be shown in the iframe. Required when product.type is 'payment'."
          },
          "redirect": {
            "type": "string",
            "example": "https://example.com/redirect",
            "description": "URL that users will be redirected to after completing the session. Usually some sort of thank-you page."
          },
          "withdrawalAndReturns": {
            "type": "string",
            "example": "https://example.com/withdrawal-and-returns",
            "description": "URL to your withdrawal and returns policy."
          }
        }
      },
      "hooks": {
        "type": "array",
        "maxItems": 10,
        "description": "**SECURITY: It is strongly recommended to verify incoming webhooks using the HMAC signature provided in the `x-briq-signature` header. See our main [Webhooks Guide](https://developer.briqpay.com/docs/payment-module#webhooks) for details.**  \nSubscribe to events submitted by Briqpay.  \nThe hook response consists of \"event\", \"status\" and \"sessionId\".  \nIf using \"GET\", the response parameters will be sent as query parameters and when using \"POST\" it will be sent as the request body.  \n  \nSee the [Outgoing Webhooks](https://developer.briqpay.com/api-reference/outgoing-webhooks) reference for full payload schemas and examples for each event type: [session_status](https://developer.briqpay.com/api-reference/session-status), [order_status](https://developer.briqpay.com/api-reference/order-status), [capture_status](https://developer.briqpay.com/api-reference/capture-status), [refund_status](https://developer.briqpay.com/api-reference/refund-status).",
        "example": [
          {
            "eventType": "session_status",
            "statuses": [
              "completed"
            ],
            "method": "POST",
            "url": "https://example.com/notifications"
          },
          {
            "eventType": "order_status",
            "statuses": [
              "order_pending",
              "order_rejected",
              "order_cancelled",
              "order_approved_not_captured"
            ],
            "method": "POST",
            "url": "https://example.com/notifications"
          },
          {
            "eventType": "capture_status",
            "statuses": [
              "pending",
              "approved",
              "rejected"
            ],
            "method": "POST",
            "url": "https://example.com/notifications"
          },
          {
            "eventType": "refund_status",
            "statuses": [
              "pending",
              "approved",
              "rejected"
            ],
            "method": "POST",
            "url": "https://example.com/notifications"
          }
        ],
        "items": {
          "oneOf": [
            {
              "type": "object",
              "title": "Session status",
              "properties": {
                "eventType": {
                  "type": "string",
                  "enum": [
                    "session_status"
                  ]
                },
                "statuses": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "completed"
                    ],
                    "description": ""
                  }
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST"
                  ],
                  "example": "GET",
                  "description": ""
                },
                "url": {
                  "type": "string",
                  "example": "https://example.com/notifications",
                  "description": ""
                }
              }
            },
            {
              "type": "object",
              "title": "Order status",
              "properties": {
                "eventType": {
                  "type": "string",
                  "enum": [
                    "order_status"
                  ]
                },
                "statuses": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "order_pending",
                      "order_rejected",
                      "order_cancelled",
                      "order_approved_not_captured"
                    ]
                  }
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST"
                  ],
                  "example": "GET"
                },
                "url": {
                  "type": "string",
                  "example": "https://example.com/notifications"
                }
              }
            },
            {
              "type": "object",
              "title": "Capture status",
              "properties": {
                "eventType": {
                  "type": "string",
                  "enum": [
                    "capture_status"
                  ]
                },
                "statuses": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "approved",
                      "rejected"
                    ]
                  }
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST"
                  ],
                  "example": "GET"
                },
                "url": {
                  "type": "string",
                  "example": "https://example.com/notifications"
                }
              }
            },
            {
              "type": "object",
              "title": "Refund status",
              "properties": {
                "eventType": {
                  "type": "string",
                  "enum": [
                    "refund_status"
                  ]
                },
                "statuses": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "approved",
                      "rejected"
                    ]
                  }
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST"
                  ],
                  "example": "GET"
                },
                "url": {
                  "type": "string",
                  "example": "https://example.com/notifications"
                }
              }
            }
          ]
        }
      },
      "clientToken": {
        "type": "string",
        "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
        "description": "Can be used with the client SDK to render iframes."
      },
      "htmlSnippet": {
        "type": "string",
        "example": "<div><iframe/></div>",
        "description": "The easiest way to render an iframe, simply add the html snippet where you want."
      },
      "createSessionData": {
        "type": "object",
        "description": "Provide data such as billing details and cart items.",
        "properties": {
          "order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/order"
              },
              {
                "description": "The order object contains all information about cart items, amounts and tax/vat. For the EU, VAT is represented with 'taxRate' on every item. For the US, all tax should be calculated into an item with the \"sales_tax\" productType."
              },
              {
                "required": [
                  "currency",
                  "cart",
                  "amountIncVat",
                  "amountExVat"
                ]
              }
            ]
          },
          "company": {
            "type": "object",
            "description": "The company object can only be provided for customerType: \"business\".",
            "properties": {
              "cin": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/cin"
                  },
                  {
                    "nullable": true
                  }
                ]
              },
              "name": {
                "type": "string",
                "description": "Name of the company",
                "nullable": true
              }
            }
          },
          "consumer": {
            "type": "object",
            "description": "The consumer object can only be provided for customerType: \"consumer\".",
            "properties": {
              "identificationNumber": {
                "type": "string",
                "description": "National identification number, social security number or similar. Not applicable for the US.",
                "example": "197001011234"
              },
              "dateOfBirth": {
                "type": "string",
                "description": "Date of birth (YYYY-MM-DD).",
                "example": "1970-01-01"
              },
              "name": {
                "type": "string",
                "description": "Name of the person.",
                "example": "John Smith"
              }
            }
          },
          "billing": {
            "$ref": "#/components/schemas/addressInput"
          },
          "shipping": {
            "$ref": "#/components/schemas/addressInput"
          },
          "tokenization": {
            "$ref": "#/components/schemas/tokenizationDataInput"
          },
          "billingAddresses": {
            "type": "array",
            "maxItems": 256,
            "description": "This data will only be visible when using the billing module, the addresses will be available for selection in the address dropdown. **This feature will have to be enabled by Briqpay before it can be used.**",
            "example": [
              {
                "companyName": "Test company",
                "streetAddress": "Test street 1",
                "streetAddress2": "Test street 2",
                "zip": "12312",
                "city": "Test city",
                "region": "",
                "firstName": "Tester",
                "lastName": "Testsson",
                "email": "test@test.com",
                "phoneNumber": "0123456789",
                "country": "SE"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/externalAddressesInput"
            }
          },
          "shippingAddresses": {
            "type": "array",
            "maxItems": 256,
            "description": "This data will only be visible when using the shipping module, the addresses will be available for selection in the address dropdown. **This feature will have to be enabled by Briqpay before it can be used.**",
            "example": [
              {
                "companyName": "Test company",
                "streetAddress": "Test street 1",
                "streetAddress2": "Test street 2",
                "zip": "12312",
                "city": "Test city",
                "region": "",
                "firstName": "Tester",
                "lastName": "Testsson",
                "email": "test@test.com",
                "phoneNumber": "0123456789",
                "country": "SE"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/externalAddressesInput"
            }
          },
          "invoiceDetails": {
            "type": "object",
            "description": "Pre-fills invoicing fields in checkout; ignored by payment methods that don't collect them, and buyer edits take precedence. Where collected, read back after payment via `data.paymentAdditionalFields` on the session response.",
            "properties": {
              "gln": {
                "type": "string",
                "minLength": 3,
                "maxLength": 256,
                "nullable": true,
                "example": "7300010000001",
                "description": "GLN / EAN for EDI invoicing."
              },
              "reference": {
                "type": "string",
                "minLength": 3,
                "maxLength": 256,
                "nullable": true,
                "example": "invoice-ref-123",
                "description": "Customer or invoice reference."
              },
              "email": {
                "type": "string",
                "minLength": 3,
                "maxLength": 256,
                "nullable": true,
                "example": "test@test.com",
                "description": "Alternative email address for the invoice, when it differs from the billing email."
              },
              "orderNumber": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "nullable": true,
                "example": "PO-2024-0001",
                "description": "The buyer's internal purchase order number."
              }
            }
          }
        }
      },
      "updateSessionData": {
        "type": "object",
        "description": "Provide data such as billing details and cart items.",
        "properties": {
          "order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/order"
              },
              {
                "description": "The order object contains all information about cart items, amounts and tax/vat. For the EU, VAT is represented with 'taxRate' on every item. For the US, all tax should be calculated into an item with the \"sales_tax\" productType."
              },
              {
                "required": [
                  "currency",
                  "cart",
                  "amountIncVat",
                  "amountExVat"
                ]
              }
            ]
          },
          "company": {
            "type": "object",
            "description": "The company object can only be provided for customerType: \"business\".",
            "properties": {
              "cin": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/cin"
                  },
                  {
                    "nullable": true
                  }
                ]
              },
              "name": {
                "type": "string",
                "description": "Name of the company",
                "nullable": true
              }
            }
          },
          "consumer": {
            "type": "object",
            "description": "The consumer object can only be provided for customerType: \"consumer\".",
            "properties": {
              "identificationNumber": {
                "type": "string",
                "description": "National identification number, social security number or similar. Not applicable for the US.",
                "example": "197001011234"
              },
              "dateOfBirth": {
                "type": "string",
                "description": "Date of birth (YYYY-MM-DD).",
                "example": "1970-01-01"
              },
              "name": {
                "type": "string",
                "description": "Name of the person.",
                "example": "John Smith"
              }
            }
          },
          "billing": {
            "$ref": "#/components/schemas/addressInput"
          },
          "shipping": {
            "$ref": "#/components/schemas/addressInput"
          }
        }
      },
      "config": {
        "type": "object",
        "description": "General configuration for this session.",
        "properties": {
          "disableInsightsTracking": {
            "type": "boolean",
            "description": "Disable Briqpay Insights tracking for this session.",
            "default": false
          },
          "disableSessionCompleteRedirect": {
            "type": "boolean",
            "description": "Disable session complete redirect for this session.",
            "default": false
          },
          "realTimeProcessing": {
            "type": "boolean",
            "description": "Enable instant order flow processing. When set to true, webhooks and status updates are delivered immediately instead of being processed in batches, providing faster notifications and near real-time status changes for your integration.\n\n\tImportant: When real-time processing is enabled, event delivery order is not guaranteed. Events are sent as soon as they become available and may arrive out of sequence or in close succession. Your integration must be designed to handle potential race conditions and out-of-order event delivery.",
            "default": false
          }
        }
      },
      "modules": {
        "type": "object",
        "description": "Configure the module system.",
        "properties": {
          "loadModules": {
            "type": "array",
            "description": "Override which partial set of modules should be loaded, e.g. when you only want payments instead of a full flow.",
            "items": {
              "type": "string",
              "enum": [
                "company_lookup",
                "billing",
                "shipping",
                "upsell",
                "cross_border",
                "payment",
                "order_note",
                "custom_form",
                "terms"
              ]
            },
            "example": [
              "payment"
            ]
          },
          "config": {
            "$ref": "#/components/schemas/createSessionConfigs"
          }
        }
      },
      "sessionStatus": {
        "type": "string",
        "enum": [
          "started",
          "modules_in_progress",
          "completed"
        ],
        "description": "Status of the session. Does not indicate status of payments, that can be read from moduleStatus.payment.orderStatus."
      },
      "uiStatus": {
        "type": "string",
        "description": "Status of the module in the UI.",
        "enum": [
          "locked_by_merchant",
          "not_yet_reached",
          "hidden",
          "visible",
          "visible_required",
          "visible_optional",
          "completed"
        ]
      },
      "orderStatus": {
        "type": "string",
        "description": "Order status in the checkout / payment module. `order_cancel_pending` means a cancellation has been requested and is awaiting confirmation from the payment provider; the authorization is still live until it resolves.",
        "enum": [
          "order_pending",
          "order_rejected",
          "order_cancelled",
          "order_cancel_pending",
          "order_approved_not_captured",
          "captured_partial",
          "captured_full"
        ]
      },
      "refundStatus": {
        "type": "string",
        "enum": [
          "not_refunded",
          "partially_refunded",
          "captured_amount_fully_refunded"
        ]
      },
      "amountIncVat": {
        "type": "integer",
        "example": 3000,
        "description": "Amount including vat/tax. Should be in cents / minor units. e.g. 1 SEK = 100. ISK, JPY and KRW also use two-decimal minor units: 10,000 ISK is sent as 1000000. For ISK, JPY and KRW, amountIncVat on sessions, captures and refunds must be a whole unit (a multiple of 100), otherwise the request is rejected with 400 INVALID_DATA."
      },
      "amountExVat": {
        "type": "integer",
        "example": 2400,
        "description": "Amount excluding vat/tax. Should be in cents / minor units. e.g. 1 SEK = 100. ISK, JPY and KRW also use two-decimal minor units: 10,000 ISK is sent as 1000000."
      },
      "currency": {
        "type": "string",
        "example": "SEK",
        "description": "Example: SEK, EUR, USD"
      },
      "date": {
        "type": "string",
        "description": "ISO 8601 format, example: \"2023-04-12T13:16:08.647Z\".",
        "example": "2023-04-12T13:16:08.647Z"
      },
      "uuid": {
        "type": "string",
        "description": "UUID",
        "example": "c5674f4f-7e84-405c-a44b-c83736bb7209"
      },
      "sessionResponseBody": {
        "properties": {
          "createdAt": {
            "$ref": "#/components/schemas/date"
          },
          "sessionId": {
            "$ref": "#/components/schemas/uuid"
          },
          "status": {
            "$ref": "#/components/schemas/sessionStatus"
          },
          "product": {
            "$ref": "#/components/schemas/productResponseObject"
          },
          "customerType": {
            "$ref": "#/components/schemas/customerType"
          },
          "country": {
            "$ref": "#/components/schemas/country"
          },
          "locale": {
            "$ref": "#/components/schemas/locale"
          },
          "urls": {
            "$ref": "#/components/schemas/urls"
          },
          "references": {
            "$ref": "#/components/schemas/references"
          },
          "hooks": {
            "$ref": "#/components/schemas/hooks"
          },
          "htmlSnippet": {
            "$ref": "#/components/schemas/htmlSnippet"
          },
          "clientToken": {
            "$ref": "#/components/schemas/clientToken"
          },
          "moduleStatus": {
            "type": "object",
            "description": "States of individual modules.",
            "properties": {
              "company_lookup": {
                "type": "object",
                "properties": {
                  "uiStatus": {
                    "$ref": "#/components/schemas/uiStatus"
                  }
                }
              },
              "billing": {
                "type": "object",
                "properties": {
                  "uiStatus": {
                    "$ref": "#/components/schemas/uiStatus"
                  }
                }
              },
              "shipping": {
                "type": "object",
                "properties": {
                  "uiStatus": {
                    "$ref": "#/components/schemas/uiStatus"
                  }
                }
              },
              "payment": {
                "type": "object",
                "properties": {
                  "uiStatus": {
                    "$ref": "#/components/schemas/uiStatus"
                  },
                  "orderStatus": {
                    "$ref": "#/components/schemas/orderStatus"
                  },
                  "refundStatus": {
                    "$ref": "#/components/schemas/refundStatus"
                  }
                }
              }
            }
          },
          "data": {
            "type": "object",
            "properties": {
              "company": {
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "cin": {
                        "$ref": "#/components/schemas/cin"
                      },
                      "vatNumber": {
                        "type": "string",
                        "description": "Company EU VAT number. Only available with some lookup providers & countries.",
                        "nullable": true,
                        "example": "SE012345678901"
                      },
                      "name": {
                        "type": "string",
                        "description": "Company name.",
                        "example": "Example Company"
                      }
                    }
                  },
                  {
                    "description": "Only available when the session is completed."
                  }
                ]
              },
              "vatValidation": {
                "type": "object",
                "properties": {
                  "vatNo": {
                    "type": "string"
                  },
                  "valid": {
                    "type": "boolean"
                  },
                  "country": {
                    "$ref": "#/components/schemas/country"
                  }
                }
              },
              "consumer": {
                "type": "object",
                "properties": {
                  "identificationNumber": {
                    "type": "string",
                    "description": "National identification number, social security number or similar.",
                    "example": "19700101****"
                  },
                  "dateOfBirth": {
                    "type": "string",
                    "description": "Date of birth (YYYY-MM-DD).",
                    "example": "1970-01-01"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the person.",
                    "example": "John Smith"
                  }
                }
              },
              "billing": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/addressOutput"
                  },
                  {
                    "description": "Only available when the session is completed."
                  }
                ]
              },
              "shipping": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/addressOutput"
                  },
                  {
                    "description": "Only available when the session is completed."
                  }
                ]
              },
              "order": {
                "$ref": "#/components/schemas/order"
              },
              "transactions": {
                "type": "array",
                "description": "Only available when the session is completed.",
                "items": {
                  "$ref": "#/components/schemas/transaction"
                }
              },
              "captures": {
                "type": "array",
                "description": "Only available when the session is completed.",
                "items": {
                  "$ref": "#/components/schemas/capture"
                }
              },
              "refunds": {
                "type": "array",
                "description": "Only available when the session is completed.",
                "items": {
                  "$ref": "#/components/schemas/refund"
                }
              },
              "paymentTags": {
                "type": "object",
                "description": "Only available when the session is completed. Tags on the payment method used for the initial payment. Example: \"prepaid_invoice\", \"manual_review\".",
                "additionalProperties": {
                  "type": "boolean"
                }
              },
              "paymentAdditionalFields": {
                "type": "object",
                "description": "Only available when the session is completed. Additional fields collected on the payment method used for the initial payment.",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "string"
                    },
                    "header": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    }
                  }
                }
              },
              "pspMetadata": {
                "type": "object",
                "description": "PSP specific information related to the payment transaction. Only available when the session is completed and for certain psps",
                "properties": {
                  "customerFacingReference": {
                    "type": "string",
                    "description": "Payment reference given to the customer by the psp."
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of the underlying payment method selected by the customer."
                  },
                  "type": {
                    "type": "string",
                    "description": "The type of payment used for the transaction."
                  },
                  "payerEmail": {
                    "type": "string",
                    "description": "The email of the payer."
                  },
                  "payerFirstName": {
                    "type": "string",
                    "description": "The first name of the payer."
                  },
                  "payerLastName": {
                    "type": "string",
                    "description": "The last name of the payer."
                  },
                  "pspConsumedGiftcards": {
                    "type": "object",
                    "description": "Details of gift cards used and the remaining balance.",
                    "properties": {
                      "giftcards": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "integer",
                              "example": 1000
                            },
                            "currency": {
                              "type": "string",
                              "example": "EUR"
                            },
                            "issuer": {
                              "type": "string",
                              "example": "bloemplantgiftcard"
                            },
                            "voucherNumber": {
                              "type": "string",
                              "example": "606436492430000****"
                            }
                          }
                        }
                      },
                      "remainderAmount": {
                        "type": "integer",
                        "example": 1500
                      },
                      "remainderCurrency": {
                        "type": "string",
                        "example": "EUR"
                      },
                      "remainderMethod": {
                        "type": "string",
                        "example": "paypal"
                      }
                    }
                  }
                }
              },
              "orderNote": {
                "type": "object",
                "description": "Only available when the session is completed. Object containing order notes submitted by the user. The default structure of the object, unless modified by including config for the order_note module, is { \"note\": { \"value\": \"Note goes here\" } }",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "string"
                    },
                    "header": {
                      "type": "string"
                    }
                  }
                }
              },
              "customForm1": {
                "type": "object",
                "description": "Only available when the session is completed. Contains the form data of the custom form module.",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "string"
                    },
                    "header": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    }
                  }
                }
              },
              "terms": {
                "type": "object",
                "description": "Only available when the session is completed. Contains data for the checkboxes of the terms module.",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "boolean"
                    },
                    "header": {
                      "type": "string"
                    }
                  }
                }
              },
              "strongAuth": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "example": "bankid"
                  },
                  "output": {
                    "type": "object",
                    "properties": {
                      "signedAt": {
                        "type": "string",
                        "example": "2023-11-07T13:12:48.958Z"
                      },
                      "name": {
                        "type": "string",
                        "example": "John Smith"
                      },
                      "surname": {
                        "type": "string",
                        "example": "John"
                      },
                      "givenName": {
                        "type": "string",
                        "example": "Smith"
                      },
                      "dateOfBirth": {
                        "type": "string",
                        "example": "1948-12-16"
                      },
                      "validateSigneeIsCompanySignatory": {
                        "type": "boolean",
                        "example": true
                      },
                      "signeeIsCompanySignatory": {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          "unknown",
                          "approved",
                          "rejected"
                        ]
                      }
                    }
                  }
                }
              },
              "companyExtraData": {
                "type": "object",
                "properties": {
                  "output": {
                    "type": "object",
                    "properties": {
                      "fields": {
                        "type": "object",
                        "description": "Example: { \"score\": 50, \"netTurnover\": 2155 }",
                        "additionalProperties": {}
                      }
                    }
                  }
                }
              },
              "tokenization": {
                "$ref": "#/components/schemas/tokenizationDataOutput"
              }
            }
          }
        }
      },
      "tokenResponseBody": {
        "properties": {
          "tokenId": {
            "type": "string"
          },
          "initialSessionId": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "country": {
            "$ref": "#/components/schemas/country"
          },
          "locale": {
            "$ref": "#/components/schemas/locale"
          },
          "product": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "payment",
                  "signup"
                ],
                "description": "Type of Briqpay product."
              },
              "id": {
                "deprecated": true,
                "type": "string",
                "example": "a8a7acb2-4c65-4a91-a8e5-d8125bf64fd4",
                "description": "Provide this if you have created an alternate variant configuration in the backoffice that you want to use."
              },
              "variantId": {
                "type": "string",
                "example": "a8a7acb2-4c65-4a91-a8e5-d8125bf64fd4",
                "description": "Provide this if you have created an alternate variant configuration in the backoffice that you want to use."
              }
            }
          },
          "customerType": {
            "$ref": "#/components/schemas/customerType"
          },
          "expiryDate": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "paymentMethod": {
            "type": "object",
            "properties": {
              "pspId": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "category": {
                "type": "string"
              },
              "pspDisplayName": {
                "type": "string"
              }
            }
          },
          "chargeSessions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sessionId": {
                  "type": "string"
                },
                "completedAt": {
                  "type": "string"
                },
                "order": {
                  "type": "object",
                  "properties": {
                    "amountIncVat": {
                      "type": "integer"
                    },
                    "amountExVat": {
                      "type": "integer"
                    },
                    "currency": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "data": {
            "properties": {
              "company": {
                "type": "object",
                "properties": {
                  "cin": {
                    "$ref": "#/components/schemas/cin"
                  },
                  "name": {
                    "type": "string",
                    "description": "Company name.",
                    "example": "Example Company"
                  }
                }
              },
              "consumer": {
                "type": "object",
                "properties": {
                  "dateOfBirth": {
                    "type": "string",
                    "description": "Date of birth (YYYY-MM-DD).",
                    "example": "1970-01-01"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the person.",
                    "example": "John Smith"
                  }
                }
              },
              "billing": {
                "$ref": "#/components/schemas/addressOutput"
              },
              "shipping": {
                "$ref": "#/components/schemas/addressOutput"
              }
            }
          }
        }
      },
      "errorResponse403": {
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "INVALID_CREDENTIALS",
                  "INVALID_API_KEY",
                  "AUTH_SECRET_EXPIRED"
                ]
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "errorResponse404": {
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "SESSION_NOT_FOUND"
                ]
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "transaction": {
        "type": "object",
        "properties": {
          "createdAt": {
            "$ref": "#/components/schemas/date"
          },
          "expiresAt": {
            "allOf": [
              {
                "$ref": "#/components/schemas/date"
              },
              {
                "description": "Authorization expiration time. ISO 8601 format, example: \"2025-04-12T13:16:08.647Z\"."
              }
            ]
          },
          "transactionId": {
            "type": "string"
          },
          "reservationId": {
            "type": "string",
            "description": "The primary reference for the payment in the PSP’s system. This is typically used for reconciliation and to locate the order in the PSP’s portal or customer service tools."
          },
          "secondaryReservationId": {
            "type": "string",
            "description": "If the PSP provides an additional important reference (e.g., one shown in reports or reconciliation files), it will be returned here. It serves the same purpose as reservationId: to help with reconciliation and order lookups."
          },
          "pspId": {
            "type": "string",
            "description": "Unique UUID identifier of the payment method."
          },
          "pspDisplayName": {
            "type": "string",
            "description": "Localized name of the payment method that is showed to end users."
          },
          "pspIntegrationName": {
            "type": "string",
            "description": "Name of the payment integration that helps merchants distinguish the payment method processor used. For payment methods integrated via a payment suite (e.g. Adyen, Stripe), this will be in the format: \"{Suitename} - {payment method name}\" (e.g., \"Adyen - Card payments\"). For direct integrations (e.g., PayPal, Klarna, Swish), this will be the name of the payment method provider (e.g., \"PayPal\"). This name is not intended for the end user to see."
          },
          "email": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string",
            "description": "If applicable, the phone number that was used to pay. Otherwise, the phone number from the billing address object."
          },
          "reference": {
            "type": "string"
          },
          "amountIncVat": {
            "$ref": "#/components/schemas/amountIncVat"
          },
          "amountExVat": {
            "$ref": "#/components/schemas/amountExVat"
          },
          "currency": {
            "$ref": "#/components/schemas/currency"
          },
          "status": {
            "type": "string",
            "description": "`cancel_pending` means a cancellation has been requested and is awaiting confirmation from the payment provider. `expired` means the authorization is no longer valid and the order can no longer be captured.",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "cancelled",
              "cancel_pending",
              "expired"
            ]
          },
          "captureStatus": {
            "type": "string",
            "description": "Capture state of the transaction. `partially_captured_and_released` means a partial amount was captured and the remaining uncaptured amount has been permanently released, so nothing further can be captured.",
            "enum": [
              "not_captured",
              "partially_captured",
              "fully_captured",
              "partially_captured_and_released"
            ]
          },
          "refundStatus": {
            "$ref": "#/components/schemas/refundStatus"
          },
          "sessionId": {
            "type": "string"
          },
          "cart": {
            "$ref": "#/components/schemas/cart"
          },
          "autoCaptureEnabled": {
            "type": "boolean",
            "description": "Whether Briqpay will schedule an automatic capture for this transaction when approved. When true, the merchant does not need to send a capture request."
          },
          "pspOrderManagementIds": {
            "type": "object",
            "description": "This feature is in beta.  \nIDs that can be used directly with the API of the used payment method.",
            "properties": {
              "cancel": {
                "type": "object",
                "properties": {
                  "apiTransactionId": {
                    "type": "string"
                  }
                }
              },
              "capture": {
                "type": "object",
                "properties": {
                  "apiTransactionId": {
                    "type": "string"
                  }
                }
              },
              "refund": {
                "type": "object",
                "properties": {
                  "apiTransactionId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "capture": {
        "type": "object",
        "properties": {
          "createdAt": {
            "$ref": "#/components/schemas/date"
          },
          "captureId": {
            "type": "string"
          },
          "parentTransactionId": {
            "type": "string"
          },
          "reservationId": {
            "type": "string",
            "description": "The primary reference for the payment in the PSP’s system. This is typically used for reconciliation and to locate the order in the PSP’s portal or customer service tools."
          },
          "autoCaptured": {
            "type": "boolean",
            "description": "Whether the transaction was automatically captured by the Briqpay system or not."
          },
          "pspId": {
            "type": "string",
            "description": "Unique UUID identifier of the payment method."
          },
          "pspDisplayName": {
            "type": "string",
            "description": "Localized name of the payment method that is showed to end users."
          },
          "pspIntegrationName": {
            "type": "string",
            "description": "Name of the payment integration that helps merchants distinguish the payment method processor used. For payment methods integrated via a payment suite (e.g. Adyen, Stripe), this will be in the format: \"{Suitename} - {payment method name}\" (e.g., \"Adyen - Card payments\"). For direct integrations (e.g., PayPal, Klarna, Swish), this will be the name of the payment method provider (e.g., \"PayPal\"). This name is not intended for the end user to see."
          },
          "email": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string",
            "description": "If applicable, the phone number that was used to pay. Otherwise, the phone number from the billing address object."
          },
          "reference": {
            "type": "string"
          },
          "amountIncVat": {
            "$ref": "#/components/schemas/amountIncVat"
          },
          "amountExVat": {
            "$ref": "#/components/schemas/amountExVat"
          },
          "currency": {
            "$ref": "#/components/schemas/currency"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected"
            ]
          },
          "sessionId": {
            "type": "string"
          },
          "cart": {
            "$ref": "#/components/schemas/cart"
          },
          "pspOrderManagementIds": {
            "type": "object",
            "description": "This feature is in beta.  \nIDs that can be used directly with the API of the used payment method.",
            "properties": {
              "refund": {
                "type": "object",
                "properties": {
                  "apiTransactionId": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "merchantCaptureReference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "nullable": true,
            "description": "A merchant-set reference attached to the capture for merchant-side traceability. Returned on this capture in GET session responses and included in the capture webhook payload."
          }
        }
      },
      "refund": {
        "type": "object",
        "properties": {
          "createdAt": {
            "$ref": "#/components/schemas/date"
          },
          "refundId": {
            "type": "string"
          },
          "parentCaptureId": {
            "type": "string"
          },
          "parentTransactionId": {
            "type": "string"
          },
          "reservationId": {
            "type": "string",
            "description": "The primary reference for the payment in the PSP’s system. This is typically used for reconciliation and to locate the order in the PSP’s portal or customer service tools."
          },
          "pspId": {
            "type": "string",
            "description": "Unique UUID identifier of the payment method."
          },
          "pspDisplayName": {
            "type": "string",
            "description": "Localized name of the payment method that is showed to end users."
          },
          "pspIntegrationName": {
            "type": "string",
            "description": "Name of the payment integration that helps merchants distinguish the payment method processor used. For payment methods integrated via a payment suite (e.g. Adyen, Stripe), this will be in the format: \"{Suitename} - {payment method name}\" (e.g., \"Adyen - Card payments\"). For direct integrations (e.g., PayPal, Klarna, Swish), this will be the name of the payment method provider (e.g., \"PayPal\"). This name is not intended for the end user to see."
          },
          "email": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string",
            "description": "If applicable, the phone number that was used to pay. Otherwise, the phone number from the billing address object."
          },
          "reference": {
            "type": "string"
          },
          "amountIncVat": {
            "$ref": "#/components/schemas/amountIncVat"
          },
          "amountExVat": {
            "$ref": "#/components/schemas/amountExVat"
          },
          "currency": {
            "$ref": "#/components/schemas/currency"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected"
            ]
          },
          "sessionId": {
            "type": "string"
          },
          "cart": {
            "$ref": "#/components/schemas/cart"
          },
          "merchantRefundReference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "nullable": true,
            "description": "A merchant-set reference attached to the refund for merchant-side traceability. Returned on this refund in GET session responses and included in the refund webhook payload."
          }
        }
      },
      "addressInput": {
        "type": "object",
        "properties": {
          "streetAddress": {
            "type": "string",
            "maxLength": 100
          },
          "streetAddress2": {
            "type": "string",
            "maxLength": 100
          },
          "zip": {
            "type": "string",
            "maxLength": 100
          },
          "city": {
            "type": "string",
            "maxLength": 100
          },
          "region": {
            "type": "string",
            "maxLength": 100,
            "description": "State / region. Example: \"CA\" for California in the US."
          },
          "firstName": {
            "type": "string",
            "maxLength": 100
          },
          "lastName": {
            "type": "string",
            "maxLength": 100
          },
          "email": {
            "type": "string",
            "maxLength": 100
          },
          "phoneNumber": {
            "type": "string"
          },
          "country": {
            "$ref": "#/components/schemas/country"
          }
        }
      },
      "externalAddressesInput": {
        "type": "object",
        "properties": {
          "companyName": {
            "type": "string",
            "maxLength": 100,
            "nullable": true
          },
          "streetAddress": {
            "type": "string",
            "maxLength": 100,
            "nullable": true
          },
          "streetAddress2": {
            "type": "string",
            "maxLength": 100,
            "nullable": true
          },
          "zip": {
            "type": "string",
            "maxLength": 100,
            "nullable": true
          },
          "city": {
            "type": "string",
            "maxLength": 100,
            "nullable": true
          },
          "region": {
            "type": "string",
            "maxLength": 100,
            "nullable": true,
            "description": "State / region. Example: \"CA\" for California in the US."
          },
          "firstName": {
            "type": "string",
            "maxLength": 100,
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "maxLength": 100,
            "nullable": true
          },
          "email": {
            "type": "string",
            "maxLength": 100,
            "nullable": true
          },
          "phoneNumber": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "$ref": "#/components/schemas/country",
            "nullable": true
          }
        }
      },
      "cin": {
        "type": "string",
        "description": "Company identification number. Example formats:  \nSweden: Orgnr / VAT  \nNorway: Orgnr / VAT  \nDenmark: CVR / VAT  \nFinland: Business ID / VAT  \nGermany: HRB / VAT  \nNetherlands: KVK / VAT  \nFrance: SIREN / SIRET / VAT  \nUnited Kingdom: CRN  \nUnited States: EIN",
        "example": "0123456789"
      },
      "addressOutput": {
        "type": "object",
        "properties": {
          "companyName": {
            "type": "string",
            "description": "B2B only."
          },
          "cin": {
            "$ref": "#/components/schemas/cin"
          },
          "streetAddress": {
            "type": "string"
          },
          "streetAddress2": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": "string",
            "description": "State / region. Example: \"CA\" for California in the US."
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "country": {
            "$ref": "#/components/schemas/country"
          }
        }
      },
      "cart": {
        "type": "array",
        "items": {
          "oneOf": [
            {
              "type": "object",
              "title": "Regular items",
              "required": [
                "productType",
                "name",
                "quantity",
                "quantityUnit",
                "unitPrice",
                "taxRate"
              ],
              "properties": {
                "productType": {
                  "type": "string",
                  "enum": [
                    "physical",
                    "digital",
                    "discount",
                    "shipping_fee",
                    "deposit",
                    "surcharge",
                    "adjustment"
                  ],
                  "description": "Type of item.   \n'discount' - the unitPrice should be negative.   \n'adjustment' - Can only be used on refunds.",
                  "example": "physical"
                },
                "name": {
                  "example": "Test product",
                  "type": "string",
                  "maxLength": 256
                },
                "reference": {
                  "type": "string",
                  "description": "The SKU of the item",
                  "nullable": true,
                  "example": "testproduct1",
                  "maxLength": 256
                },
                "quantity": {
                  "type": "integer",
                  "example": 2,
                  "minimum": 1
                },
                "quantityUnit": {
                  "type": "string",
                  "example": "pc",
                  "maxLength": 10
                },
                "taxRate": {
                  "type": "integer",
                  "description": "The applicable taxrate in minor units. Eg 25% = 2500",
                  "example": 2500
                },
                "unitPrice": {
                  "type": "integer",
                  "description": "Unit price in minor units (e.g. 1 EUR = 100 unitPrice). Should be excluding VAT and excluding discount. ISK, JPY and KRW also use two-decimal minor units: 10,000 ISK is sent as 1000000.",
                  "example": 1200
                },
                "unitPriceIncVat": {
                  "type": "integer",
                  "description": "Unit price including VAT but excluding any discounts, in minor units. (1 EUR = 100 unitPriceIncVat). ISK, JPY and KRW also use two-decimal minor units: 10,000 ISK is sent as 1000000.   \nunitPrice * (1 + taxRate / 10000)",
                  "nullable": true,
                  "example": 1500
                },
                "discountPercentage": {
                  "type": "integer",
                  "description": "Discount value in percentages. 10% = 1000",
                  "nullable": true,
                  "example": 0
                },
                "unitDiscountAmountIncVat": {
                  "type": "integer",
                  "description": "Fixed discount amount per unit in minor units, including VAT (e.g. 1 EUR = 100). This represents the discount amount applied to each individual unit after VAT calculation. When both discountPercentage and unitDiscountAmountIncVat are provided, they must be consistent within ±1 minor unit, otherwise a validation error will occur.",
                  "nullable": true,
                  "example": 0
                },
                "totalAmount": {
                  "type": "integer",
                  "description": "Total amount for the order line in minor units (e.g. 1 EUR = 100 totalAmount). This value should include VAT, any applied discounts, and multiplied by quantity. ISK, JPY and KRW also use two-decimal minor units: 10,000 ISK is sent as 1000000.   \n(unitPrice * (1 - discountPercentage / 10000)) * quantity * (1 + taxRate / 10000)",
                  "nullable": true,
                  "example": 3000
                },
                "totalVatAmount": {
                  "type": "integer",
                  "description": "The total VAT amount for the line item in minor units (e.g. 1 EUR = 100 totalAmount). Calculated by applying the tax rate to the unit price including discount and multiplying by the quantity.   \n(unitPrice * (1 - discountPercentage / 10000)) * quantity * (taxRate / 10000)",
                  "nullable": true,
                  "example": 600
                },
                "imageUrl": {
                  "type": "string",
                  "description": "URL to an image: png | jpg | jpeg | svg. Image that can be later embedded in communications between certain payment providers. Minimum 250x250 recommended. Limited PSP support.",
                  "maxLength": 1024,
                  "example": "https://example.com/logo.png"
                }
              }
            },
            {
              "type": "object",
              "title": "US sales tax",
              "required": [
                "productType",
                "name",
                "totalTaxAmount"
              ],
              "properties": {
                "productType": {
                  "type": "string",
                  "enum": [
                    "sales_tax"
                  ],
                  "description": "Has to be \"sales_tax\".",
                  "example": "sales_tax"
                },
                "name": {
                  "type": "string",
                  "example": "Sales tax",
                  "maxLength": 256
                },
                "reference": {
                  "type": "string",
                  "description": "Reference",
                  "example": "sales_tax",
                  "maxLength": 256
                },
                "totalTaxAmount": {
                  "type": "integer",
                  "description": "Total tax amount for the order in minor units (e.g. 1 USD = 100 totalTaxAmount).",
                  "example": 1200
                }
              }
            },
            {
              "type": "object",
              "title": "Gift card",
              "required": [
                "productType",
                "name",
                "giftCardAmount"
              ],
              "properties": {
                "productType": {
                  "type": "string",
                  "enum": [
                    "gift_card"
                  ],
                  "description": "Has to be \"gift_card\".",
                  "example": "gift_card"
                },
                "name": {
                  "type": "string",
                  "example": "Gift card",
                  "maxLength": 256
                },
                "reference": {
                  "type": "string",
                  "description": "Reference",
                  "example": "gift_card",
                  "maxLength": 256
                },
                "giftCardAmount": {
                  "type": "integer",
                  "description": "Gift card amount in minor units (e.g. 1 EUR = 100 giftCardAmount).   \n When gift_card is used, a positive value indicates that a gift card is being purchased, and a negative value indicates a gift card being used as part of the payment. Keep in mind that gift cards are generally exempt from VAT/Tax as it's buying a currency and not a product.",
                  "example": 1200
                }
              }
            }
          ]
        }
      },
      "order": {
        "type": "object",
        "properties": {
          "currency": {
            "$ref": "#/components/schemas/currency"
          },
          "amountIncVat": {
            "$ref": "#/components/schemas/amountIncVat"
          },
          "amountExVat": {
            "$ref": "#/components/schemas/amountExVat"
          },
          "cart": {
            "$ref": "#/components/schemas/cart"
          }
        }
      },
      "customInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "string",
              "boolean",
              "object"
            ],
            "example": "string"
          },
          "key": {
            "type": "string",
            "description": "The input key, must be unique between all inputs.",
            "example": "customReference"
          },
          "label": {
            "type": "string",
            "description": "The label to be presented in relation to the input.",
            "example": "reference"
          },
          "minLength": {
            "type": "number",
            "example": 4
          },
          "maxLength": {
            "type": "number",
            "example": 16
          },
          "required": {
            "type": "boolean",
            "example": true,
            "default": false
          },
          "span": {
            "type": "number",
            "enum": [
              "1",
              "2"
            ],
            "description": "Control if the input field should span over 1 or 2 columns.",
            "example": 1
          },
          "enum": {
            "type": "array",
            "description": "Configure available values when using a \"enumRadio\" or \"enumDropdown\" component.",
            "example": [],
            "items": {
              "type": "string"
            }
          },
          "component": {
            "type": "string",
            "example": "textField",
            "enum": [
              "textField",
              "textArea",
              "checkbox",
              "enumRadio",
              "enumDropdown"
            ]
          }
        }
      },
      "customInputCheckbox": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The input key, must be unique between all inputs.",
            "example": "newsletter"
          },
          "label": {
            "type": "string",
            "description": "The label to be presented in relation to the input. Can be formatted with urls as following: \"Yes, I want to subscribe to the \\[Newsletter](https://example.com)\"",
            "example": "Yes"
          },
          "required": {
            "type": "boolean",
            "example": true,
            "nullable": true,
            "default": false
          },
          "default": {
            "type": "boolean",
            "example": true,
            "nullable": true,
            "default": false
          }
        }
      },
      "updateSessionConfigs": {
        "type": "object",
        "description": "Configure modules.",
        "properties": {
          "upsell": {
            "type": "object",
            "description": "Configure which inputs will be collected in the Upsell module.",
            "properties": {
              "customInputs": {
                "type": "array",
                "description": "Inputs that will be collected in the Upsell module.",
                "items": {
                  "$ref": "#/components/schemas/customInput"
                },
                "example": [
                  {
                    "key": "montering",
                    "type": "boolean",
                    "label": "Ja tack, jag vill beställa montering - 249 SEK",
                    "span": 2,
                    "component": "checkbox"
                  }
                ]
              },
              "hideModule": {
                "type": "boolean"
              },
              "header": {
                "type": "string",
                "description": "Module header text.",
                "maxLength": 64
              },
              "subheader": {
                "type": "string",
                "description": "Module sub-header text.",
                "maxLength": 512
              },
              "footer": {
                "type": "string",
                "description": "Module footer text.",
                "maxLength": 512
              }
            }
          }
        }
      },
      "createSessionConfigs": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "company_lookup": {
                "type": "object",
                "properties": {
                  "companyPrefillLock": {
                    "type": "string",
                    "enum": [
                      "none",
                      "locked_with_manual_fallback"
                    ]
                  }
                }
              },
              "billing": {
                "type": "object",
                "properties": {
                  "lockFields": {
                    "$ref": "#/components/schemas/lockFieldsConfiguration"
                  }
                }
              },
              "shipping": {
                "type": "object",
                "properties": {
                  "lockFields": {
                    "$ref": "#/components/schemas/lockFieldsConfiguration"
                  }
                }
              },
              "payment": {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "object",
                    "description": "Configure to enable or disable decision for a payment session, [Read more](https://developer.briqpay.com/docs/payment-module#4-approve-the-purchase)",
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "description": "Should decision be enabled?",
                        "example": false
                      }
                    }
                  },
                  "pspRulesOverride": {
                    "type": "object",
                    "description": "Override rules for payment methods in order to show or hide payment methods.",
                    "properties": {
                      "psp": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "handles",
                            "otherHandles"
                          ],
                          "properties": {
                            "pspId": {
                              "type": "string",
                              "example": "ee5bf226-856c-4ecb-8091-3393b88f8ac6",
                              "description": "The pspId of the payment method that you wish to manually control."
                            },
                            "handles": {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean",
                                  "description": "Should this payment method be enabled?",
                                  "example": false
                                },
                                "locked": {
                                  "type": "boolean",
                                  "description": "Should this payment method be locked?",
                                  "example": false
                                },
                                "strongAuth": {
                                  "type": "boolean",
                                  "description": "Should Strong Authentication be required for this payment method?",
                                  "example": false
                                }
                              }
                            },
                            "config": {
                              "type": "object",
                              "properties": {
                                "lockedMessage": {
                                  "type": "string"
                                },
                                "strongAuthMessage": {
                                  "type": "string"
                                }
                              }
                            },
                            "otherHandles": {
                              "type": "string",
                              "enum": [
                                "run_rules",
                                "disable"
                              ],
                              "description": "How should other handles (locked, strongAuth, etc) configured on this payment method act?",
                              "example": "run_rules"
                            }
                          }
                        }
                      },
                      "otherPsps": {
                        "type": "string",
                        "enum": [
                          "disable",
                          "run_rules"
                        ]
                      }
                    }
                  }
                }
              },
              "signup": {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "object",
                    "description": "Configure to enable or disable decision for a signup session, [Read more](https://developer.briqpay.com/docs/payment-module#4-approve-the-purchase)",
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "description": "Should decision be enabled?",
                        "example": false
                      }
                    }
                  }
                }
              },
              "order_note": {
                "type": "object",
                "description": "Set/override which inputs will be collected in the Order note module.",
                "properties": {
                  "customInputs": {
                    "type": "array",
                    "description": "Inputs that will be collected in the Order note module.",
                    "items": {
                      "$ref": "#/components/schemas/customInput"
                    }
                  },
                  "hideModule": {
                    "type": "boolean"
                  }
                }
              },
              "terms": {
                "type": "object",
                "description": "Set/override which checkboxes exists in the Terms Module.",
                "properties": {
                  "checkboxes": {
                    "type": "array",
                    "description": "Checkboxes that will be collected in the Terms module.",
                    "items": {
                      "$ref": "#/components/schemas/customInputCheckbox"
                    }
                  }
                }
              }
            }
          },
          {
            "$ref": "#/components/schemas/updateSessionConfigs"
          }
        ]
      },
      "lockFieldsConfiguration": {
        "type": "object",
        "description": "Prevent users from editing addresses and user details. \"hard_lock\" - no user edits are possible, even with invalid data. \"soft_lock\" - empty or invalid fields will not be locked.",
        "additionalProperties": {
          "type": "string",
          "enum": [
            "none",
            "soft_lock",
            "hard_lock"
          ]
        },
        "example": {
          "city": "soft_lock"
        }
      },
      "tokenizationDataInput": {
        "type": "object",
        "required": [
          "tokenId"
        ],
        "properties": {
          "tokenId": {
            "type": "string",
            "description": "The token to charge for sessions with product.intent: \"payment_charge_token\"."
          }
        }
      },
      "tokenizationDataOutput": {
        "type": "object",
        "properties": {
          "tokenId": {
            "type": "string",
            "description": "The token related to a tokenized payment method."
          }
        }
      }
    },
    "securitySchemes": {
      "BasicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "x-webhooks": {
    "session_status": {
      "post": {
        "summary": "session_status",
        "description": "Sent when the session status changes. Primarily used for signups / registrations, not payments.  \nThis webhook is triggered when a session reaches the `completed` status.  \n  \nYour `externalReferences` from the session are always included as additional properties in the payload.",
        "tags": [
          "Outgoing Webhooks"
        ],
        "requestBody": {
          "description": "The JSON body sent to your webhook URL.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "event",
                  "status",
                  "sessionId"
                ],
                "properties": {
                  "event": {
                    "type": "string",
                    "enum": [
                      "session_status"
                    ],
                    "description": "The event type."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "completed"
                    ],
                    "description": "The new session status."
                  },
                  "sessionId": {
                    "type": "string",
                    "example": "61c16f84-b42e-4e1c-a114-a117a6e1e27d",
                    "description": "The session ID."
                  }
                }
              },
              "example": {
                "event": "session_status",
                "status": "completed",
                "sessionId": "61c16f84-b42e-4e1c-a114-a117a6e1e27d"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Your server should return a 2xx status code to acknowledge receipt."
          }
        }
      }
    },
    "order_status": {
      "post": {
        "summary": "order_status",
        "description": "Sent when the order status changes.  \nThis webhook is triggered when a transaction is created or its status changes (e.g., approved, rejected, cancelled).  \nThe full `transaction` object is included in the payload.  \n  \nYour `externalReferences` from the session are always included as additional properties in the payload.",
        "tags": [
          "Outgoing Webhooks"
        ],
        "requestBody": {
          "description": "The JSON body sent to your webhook URL.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "event",
                  "status",
                  "sessionId"
                ],
                "properties": {
                  "event": {
                    "type": "string",
                    "enum": [
                      "order_status"
                    ],
                    "description": "The event type."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "order_pending",
                      "order_rejected",
                      "order_cancelled",
                      "order_approved_not_captured"
                    ],
                    "description": "The new order status."
                  },
                  "sessionId": {
                    "type": "string",
                    "example": "61c16f84-b42e-4e1c-a114-a117a6e1e27d",
                    "description": "The session ID."
                  },
                  "transaction": {
                    "$ref": "#/components/schemas/transaction"
                  },
                  "pspMetadata": {
                    "type": "object",
                    "description": "PSP-specific payment metadata, present only for certain PSPs on completed sessions and absent otherwise.",
                    "properties": {
                      "customerFacingReference": {
                        "type": "string",
                        "description": "Payment reference given to the customer by the psp."
                      },
                      "description": {
                        "type": "string",
                        "description": "Description of the underlying payment method selected by the customer."
                      },
                      "type": {
                        "type": "string",
                        "description": "The type of payment used for the transaction."
                      },
                      "payerEmail": {
                        "type": "string",
                        "description": "The email of the payer."
                      },
                      "payerFirstName": {
                        "type": "string",
                        "description": "The first name of the payer."
                      },
                      "payerLastName": {
                        "type": "string",
                        "description": "The last name of the payer."
                      }
                    }
                  }
                }
              },
              "example": {
                "event": "order_status",
                "status": "order_approved_not_captured",
                "sessionId": "61c16f84-b42e-4e1c-a114-a117a6e1e27d",
                "transaction": {
                  "createdAt": "2026-01-12T11:23:24.000Z",
                  "expiresAt": "2026-01-19T11:23:24.000Z",
                  "transactionId": "t_123456789",
                  "reservationId": "res_abc123",
                  "secondaryReservationId": "sec_def456",
                  "pspId": "psp_987654321",
                  "pspDisplayName": "Card Payment",
                  "pspIntegrationName": "Adyen - Card payments",
                  "email": "customer@example.com",
                  "phoneNumber": "+46700000000",
                  "reference": "order-ref-123",
                  "amountIncVat": 1000,
                  "amountExVat": 800,
                  "currency": "SEK",
                  "status": "approved",
                  "autoCaptureEnabled": true,
                  "captureStatus": "not_captured",
                  "refundStatus": "not_refunded",
                  "sessionId": "61c16f84-b42e-4e1c-a114-a117a6e1e27d",
                  "cart": [
                    {
                      "productType": "physical",
                      "reference": "item-1",
                      "name": "Product 1",
                      "quantity": 1,
                      "quantityUnit": "pcs",
                      "unitPrice": 800,
                      "unitPriceIncVat": 1000,
                      "taxRate": 2500,
                      "discountPercentage": 0,
                      "unitDiscountAmountIncVat": 0,
                      "totalAmount": 1000,
                      "totalVatAmount": 200,
                      "imageUrl": "https://example.com/product.png"
                    },
                    {
                      "productType": "sales_tax",
                      "reference": "sales_tax",
                      "name": "Sales tax",
                      "totalTaxAmount": 200
                    },
                    {
                      "productType": "gift_card",
                      "reference": "gift_card",
                      "name": "Gift card",
                      "giftCardAmount": 500
                    }
                  ],
                  "pspOrderManagementIds": {
                    "cancel": {
                      "apiTransactionId": "cancel_xyz"
                    },
                    "capture": {
                      "apiTransactionId": "cap_xyz"
                    },
                    "refund": {
                      "apiTransactionId": "ref_xyz"
                    }
                  }
                },
                "pspMetadata": {
                  "customerFacingReference": "REF-123",
                  "description": "Invoice KA0376778N1",
                  "type": "invoice",
                  "payerEmail": "customer@example.com",
                  "payerFirstName": "John",
                  "payerLastName": "Doe"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Your server should return a 2xx status code to acknowledge receipt."
          }
        }
      }
    },
    "capture_status": {
      "post": {
        "summary": "capture_status",
        "description": "Sent when a capture is created or its status changes.  \nThe full `capture` object is included in the payload along with the `captureId` at the top level.  \n  \nYour `externalReferences` from the session are always included as additional properties in the payload.",
        "tags": [
          "Outgoing Webhooks"
        ],
        "requestBody": {
          "description": "The JSON body sent to your webhook URL.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "event",
                  "status",
                  "sessionId",
                  "captureId"
                ],
                "properties": {
                  "event": {
                    "type": "string",
                    "enum": [
                      "capture_status"
                    ],
                    "description": "The event type."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "approved",
                      "rejected"
                    ],
                    "description": "The new capture status."
                  },
                  "sessionId": {
                    "type": "string",
                    "example": "61c16f84-b42e-4e1c-a114-a117a6e1e27d",
                    "description": "The session ID."
                  },
                  "captureId": {
                    "type": "string",
                    "example": "a3811397-a1fc-44f0-99fd-d134063c9c47",
                    "description": "The ID of the capture."
                  },
                  "autoCaptured": {
                    "type": "boolean",
                    "description": "Whether the capture was automatically triggered by the Briqpay system."
                  },
                  "isPreExistingCapture": {
                    "type": "boolean",
                    "description": "If true, the capture already existed and was not newly created by this request."
                  },
                  "capture": {
                    "$ref": "#/components/schemas/capture"
                  }
                }
              },
              "example": {
                "event": "capture_status",
                "status": "approved",
                "sessionId": "61c16f84-b42e-4e1c-a114-a117a6e1e27d",
                "captureId": "a3811397-a1fc-44f0-99fd-d134063c9c47",
                "autoCaptured": true,
                "isPreExistingCapture": false,
                "capture": {
                  "createdAt": "2026-01-12T11:25:00.000Z",
                  "captureId": "a3811397-a1fc-44f0-99fd-d134063c9c47",
                  "parentTransactionId": "t_123456789",
                  "reservationId": "res_abc123",
                  "autoCaptured": true,
                  "pspId": "psp_987654321",
                  "pspDisplayName": "Card Payment",
                  "pspIntegrationName": "Adyen - Card payments",
                  "email": "customer@example.com",
                  "phoneNumber": "+46700000000",
                  "reference": "order-ref-123",
                  "amountIncVat": 1000,
                  "amountExVat": 800,
                  "currency": "SEK",
                  "status": "approved",
                  "sessionId": "61c16f84-b42e-4e1c-a114-a117a6e1e27d",
                  "cart": [
                    {
                      "productType": "physical",
                      "reference": "item-1",
                      "name": "Product 1",
                      "quantity": 1,
                      "quantityUnit": "pcs",
                      "unitPrice": 800,
                      "unitPriceIncVat": 1000,
                      "taxRate": 2500,
                      "discountPercentage": 0,
                      "unitDiscountAmountIncVat": 0,
                      "totalAmount": 1000,
                      "totalVatAmount": 200,
                      "imageUrl": "https://example.com/product.png"
                    },
                    {
                      "productType": "sales_tax",
                      "reference": "sales_tax",
                      "name": "Sales tax",
                      "totalTaxAmount": 200
                    },
                    {
                      "productType": "gift_card",
                      "reference": "gift_card",
                      "name": "Gift card",
                      "giftCardAmount": 500
                    }
                  ],
                  "pspOrderManagementIds": {
                    "refund": {
                      "apiTransactionId": "ref_xyz"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Your server should return a 2xx status code to acknowledge receipt."
          }
        }
      }
    },
    "refund_status": {
      "post": {
        "summary": "refund_status",
        "description": "Sent when a refund is created or its status changes.  \nThe full `refund` object is included in the payload along with the `refundId` at the top level.  \n  \nYour `externalReferences` from the session are always included as additional properties in the payload.",
        "tags": [
          "Outgoing Webhooks"
        ],
        "requestBody": {
          "description": "The JSON body sent to your webhook URL.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "event",
                  "status",
                  "sessionId",
                  "refundId"
                ],
                "properties": {
                  "event": {
                    "type": "string",
                    "enum": [
                      "refund_status"
                    ],
                    "description": "The event type."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "approved",
                      "rejected"
                    ],
                    "description": "The new refund status."
                  },
                  "sessionId": {
                    "type": "string",
                    "example": "61c16f84-b42e-4e1c-a114-a117a6e1e27d",
                    "description": "The session ID."
                  },
                  "refundId": {
                    "type": "string",
                    "example": "a3811397-a1fc-44f0-99fd-d134063c9c47",
                    "description": "The ID of the refund."
                  },
                  "refund": {
                    "$ref": "#/components/schemas/refund"
                  }
                }
              },
              "example": {
                "event": "refund_status",
                "status": "approved",
                "sessionId": "61c16f84-b42e-4e1c-a114-a117a6e1e27d",
                "refundId": "a3811397-a1fc-44f0-99fd-d134063c9c47",
                "refund": {
                  "createdAt": "2026-01-12T11:30:00.000Z",
                  "refundId": "a3811397-a1fc-44f0-99fd-d134063c9c47",
                  "parentCaptureId": "a3811397-a1fc-44f0-99fd-d134063c9c47",
                  "parentTransactionId": "t_123456789",
                  "reservationId": "res_abc123",
                  "pspId": "psp_987654321",
                  "pspDisplayName": "Card Payment",
                  "pspIntegrationName": "Adyen - Card payments",
                  "email": "customer@example.com",
                  "phoneNumber": "+46700000000",
                  "reference": "order-ref-123",
                  "amountIncVat": 500,
                  "amountExVat": 400,
                  "currency": "SEK",
                  "status": "approved",
                  "sessionId": "61c16f84-b42e-4e1c-a114-a117a6e1e27d",
                  "cart": [
                    {
                      "productType": "physical",
                      "reference": "item-1",
                      "name": "Product 1",
                      "quantity": 1,
                      "quantityUnit": "pcs",
                      "unitPrice": 400,
                      "unitPriceIncVat": 500,
                      "taxRate": 2500,
                      "discountPercentage": 0,
                      "unitDiscountAmountIncVat": 0,
                      "totalAmount": 500,
                      "totalVatAmount": 100,
                      "imageUrl": "https://example.com/product.png"
                    },
                    {
                      "productType": "sales_tax",
                      "reference": "sales_tax",
                      "name": "Sales tax",
                      "totalTaxAmount": 100
                    },
                    {
                      "productType": "gift_card",
                      "reference": "gift_card",
                      "name": "Gift card",
                      "giftCardAmount": 250
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Your server should return a 2xx status code to acknowledge receipt."
          }
        }
      }
    }
  }
}