{
  "openapi": "3.1.0",
  "info": {
    "title": "Truss API",
    "version": "0.1.499",
    "x-operation-name": true,
    "description": "API for integrations into Truss"
  },
  "paths": {
    "/v1/action-requests/": {
      "post": {
        "operationId": "createActionRequestViaIntegration",
        "summary": "Create action request",
        "tags": [
          "Action Requests",
          "Integration: Action Requests"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateActionRequestRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/CreateActionRequestRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CreateActionRequestRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionRequestResource"
                }
              }
            },
            "description": ""
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                },
                "examples": {
                  "Non-FieldValidationError": {
                    "value": {
                      "non_field_errors": [
                        "This state is invalid."
                      ]
                    },
                    "summary": "Non-Field Validation Error"
                  },
                  "FieldValidationError": {
                    "value": {
                      "field_name": [
                        "This field is required."
                      ]
                    },
                    "summary": "Field Validation Error"
                  }
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "action_requests:write"
        ],
        "description": "###### Required Scopes: ######\n------\n`action_requests:write`"
      }
    },
    "/v1/action-requests/{uid}/": {
      "get": {
        "operationId": "retrieveActionRequestViaIntegration",
        "summary": "Retrieve action request",
        "parameters": [
          {
            "in": "path",
            "name": "uid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "tags": [
          "Action Requests",
          "Integration: Action Requests"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionRequestResource"
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "action_requests:read"
        ],
        "description": "###### Required Scopes: ######\n------\n`action_requests:read`"
      }
    },
    "/v1/company/": {
      "get": {
        "operationId": "getCompanyViaIntegration",
        "description": "Get company details\n\n###### Required Scopes: ######\n------\n`company:read`",
        "summary": "Get company",
        "tags": [
          "Company"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Company"
                  }
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "company:read"
        ]
      }
    },
    "/v1/contacts/": {
      "get": {
        "operationId": "listContactsViaIntegration",
        "description": "Allows filtering contacts using OR logic instead of the default AND, enabling matches on any of the specified criteria.\n\n###### Required Scopes: ######\n------\n`contacts:read`",
        "summary": "List contacts",
        "parameters": [
          {
            "in": "query",
            "name": "email",
            "schema": {
              "type": "string"
            },
            "description": "Filter by contact email (partial match)"
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            },
            "description": "Filter by contact name (partial match)"
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "phone",
            "schema": {
              "type": "string"
            },
            "description": "Filter by phone number (partial match)"
          },
          {
            "in": "query",
            "name": "secondary_email",
            "schema": {
              "type": "string"
            },
            "description": "Filter by secondary email (partial match)"
          }
        ],
        "tags": [
          "Integration: Contacts",
          "Contacts"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedContactList"
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "contacts:read"
        ]
      }
    },
    "/v1/contacts/{uid}/": {
      "get": {
        "operationId": "getContactViaIntegration",
        "summary": "Get contact",
        "parameters": [
          {
            "in": "path",
            "name": "uid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The `uid` of the contact",
            "required": true
          }
        ],
        "tags": [
          "Integration: Contacts",
          "Contacts"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "contacts:read"
        ],
        "description": "###### Required Scopes: ######\n------\n`contacts:read`"
      },
      "patch": {
        "operationId": "updateContactViaIntegration",
        "summary": "Update contact",
        "parameters": [
          {
            "in": "path",
            "name": "uid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The `uid` of the contact",
            "required": true
          }
        ],
        "tags": [
          "Integration: Contacts",
          "Contacts"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateContactRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/UpdateContactRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/UpdateContactRequest"
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": ""
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                },
                "examples": {
                  "Non-FieldValidationError": {
                    "value": {
                      "non_field_errors": [
                        "This state is invalid."
                      ]
                    },
                    "summary": "Non-Field Validation Error"
                  },
                  "FieldValidationError": {
                    "value": {
                      "field_name": [
                        "This field is required."
                      ]
                    },
                    "summary": "Field Validation Error"
                  }
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "contacts:write"
        ],
        "description": "###### Required Scopes: ######\n------\n`contacts:write`"
      }
    },
    "/v1/payment-intents/inbound/": {
      "get": {
        "operationId": "listInboundPaymentIntentViaIntegration",
        "description": "List user's inbound payment intents\n\n###### Required Scopes: ######\n------\n`payment_intent.inbound:read`",
        "summary": "List inbound payment intents",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "tags": [
          "Integration: Inbound Payment Intents",
          "Inbound Payment Intents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedPaymentIntentList"
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "payment_intent.inbound:read"
        ]
      },
      "post": {
        "operationId": "createInboundPaymentIntentViaIntegration",
        "description": "Create an inbound payment intent (invoice)\n\n###### Required Scopes: ######\n------\n`payment_intent.inbound:write` `transactions:read`",
        "summary": "Create inbound payment intent",
        "tags": [
          "Integration: Inbound Payment Intents",
          "Inbound Payment Intents"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInboundPaymentIntentRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/CreateInboundPaymentIntentRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CreateInboundPaymentIntentRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            },
            "description": ""
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                },
                "examples": {
                  "Non-FieldValidationError": {
                    "value": {
                      "non_field_errors": [
                        "This state is invalid."
                      ]
                    },
                    "summary": "Non-Field Validation Error"
                  },
                  "FieldValidationError": {
                    "value": {
                      "field_name": [
                        "This field is required."
                      ]
                    },
                    "summary": "Field Validation Error"
                  }
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "payment_intent.inbound:write",
          "transactions:read"
        ]
      }
    },
    "/v1/payment-intents/inbound/{uid}/": {
      "get": {
        "operationId": "getInboundPaymentIntentViaIntegration",
        "description": "Fetch an inbound payment intent\n\n###### Required Scopes: ######\n------\n`payment_intent.inbound:read` `transactions:read`",
        "summary": "Get Inbound Payment Intent via Integration",
        "parameters": [
          {
            "in": "path",
            "name": "uid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The `uid` of the payment intent",
            "required": true
          }
        ],
        "tags": [
          "Integration: Inbound Payment Intents",
          "Inbound Payment Intents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "payment_intent.inbound:read",
          "transactions:read"
        ]
      },
      "patch": {
        "operationId": "updateInboundPaymentIntentViaIntegration",
        "description": "Update a user's inbound payment intent\n\n###### Required Scopes: ######\n------\n`payment_intent.inbound:write` `transactions:read`",
        "summary": "Update inbound payment intent",
        "parameters": [
          {
            "in": "path",
            "name": "uid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The `uid` of the payment intent",
            "required": true
          }
        ],
        "tags": [
          "Integration: Inbound Payment Intents",
          "Inbound Payment Intents"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentIntentRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentIntentRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentIntentRequest"
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": ""
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                },
                "examples": {
                  "Non-FieldValidationError": {
                    "value": {
                      "non_field_errors": [
                        "This state is invalid."
                      ]
                    },
                    "summary": "Non-Field Validation Error"
                  },
                  "FieldValidationError": {
                    "value": {
                      "field_name": [
                        "This field is required."
                      ]
                    },
                    "summary": "Field Validation Error"
                  }
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "payment_intent.inbound:write",
          "transactions:read"
        ]
      }
    },
    "/v1/payment-intents/inbound/{uid}/cancel/": {
      "post": {
        "operationId": "cancelInboundPaymentIntentViaIntegration",
        "description": "Cancel an inbound payment intent\n\n###### Required Scopes: ######\n------\n`payment_intent.inbound:write` `transactions:read`",
        "summary": "Cancel inbound payment intent",
        "parameters": [
          {
            "in": "path",
            "name": "uid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The `uid` of the payment intent",
            "required": true
          }
        ],
        "tags": [
          "Integration: Inbound Payment Intents",
          "Inbound Payment Intents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": ""
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                },
                "examples": {
                  "Non-FieldValidationError": {
                    "value": {
                      "non_field_errors": [
                        "This state is invalid."
                      ]
                    },
                    "summary": "Non-Field Validation Error"
                  },
                  "FieldValidationError": {
                    "value": {
                      "field_name": [
                        "This field is required."
                      ]
                    },
                    "summary": "Field Validation Error"
                  }
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "payment_intent.inbound:write",
          "transactions:read"
        ]
      }
    },
    "/v1/payment-intents/outbound/": {
      "get": {
        "operationId": "listOutboundPaymentIntentViaIntegration",
        "description": "List user's outbound payment intents\n\n###### Required Scopes: ######\n------\n`payment_intent.outbound:read`",
        "summary": "List outbound payment intents",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "tags": [
          "Integration: Outbound Payment Intents",
          "Outbound Payment Intents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedPaymentIntentList"
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "payment_intent.outbound:read"
        ]
      },
      "post": {
        "operationId": "createOutboundPaymentIntentViaIntegration",
        "description": "Create an outbound payment intent (bill). After create, send company users to `/dashboard/bills?view=pay-bill&id=new&paymentIntentUid={uid}` to pay the bill, using the `uid` from this response. To let them review the bill first, link to `/dashboard/bills?view=payment-intent&id={uid}` instead.\n\n###### Required Scopes: ######\n------\n`payment_intent.outbound:write` `transactions:read`",
        "summary": "Create outbound payment intent",
        "tags": [
          "Integration: Outbound Payment Intents",
          "Outbound Payment Intents"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOutboundPaymentIntentRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/CreateOutboundPaymentIntentRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CreateOutboundPaymentIntentRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            },
            "description": ""
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                },
                "examples": {
                  "Non-FieldValidationError": {
                    "value": {
                      "non_field_errors": [
                        "This state is invalid."
                      ]
                    },
                    "summary": "Non-Field Validation Error"
                  },
                  "FieldValidationError": {
                    "value": {
                      "field_name": [
                        "This field is required."
                      ]
                    },
                    "summary": "Field Validation Error"
                  }
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "payment_intent.outbound:write",
          "transactions:read"
        ]
      }
    },
    "/v1/payment-intents/outbound/{uid}/": {
      "get": {
        "operationId": "getOutboundPaymentIntentViaIntegration",
        "description": "Fetch an outbound payment intent\n\n###### Required Scopes: ######\n------\n`payment_intent.outbound:read` `transactions:read`",
        "summary": "Get Outbound Payment Intent via Integration",
        "parameters": [
          {
            "in": "path",
            "name": "uid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The `uid` of the payment intent",
            "required": true
          }
        ],
        "tags": [
          "Integration: Outbound Payment Intents",
          "Outbound Payment Intents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "payment_intent.outbound:read",
          "transactions:read"
        ]
      },
      "patch": {
        "operationId": "updateOutboundPaymentIntentViaIntegration",
        "description": "Update a user's outbound payment intent\n\n###### Required Scopes: ######\n------\n`payment_intent.outbound:write` `transactions:read`",
        "summary": "Update outbound payment intent",
        "parameters": [
          {
            "in": "path",
            "name": "uid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The `uid` of the payment intent",
            "required": true
          }
        ],
        "tags": [
          "Integration: Outbound Payment Intents",
          "Outbound Payment Intents"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOutboundPaymentIntentRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOutboundPaymentIntentRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOutboundPaymentIntentRequest"
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": ""
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                },
                "examples": {
                  "Non-FieldValidationError": {
                    "value": {
                      "non_field_errors": [
                        "This state is invalid."
                      ]
                    },
                    "summary": "Non-Field Validation Error"
                  },
                  "FieldValidationError": {
                    "value": {
                      "field_name": [
                        "This field is required."
                      ]
                    },
                    "summary": "Field Validation Error"
                  }
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "payment_intent.outbound:write",
          "transactions:read"
        ]
      }
    },
    "/v1/payment-intents/outbound/{uid}/cancel/": {
      "post": {
        "operationId": "cancelOutboundPaymentIntentViaIntegration",
        "description": "Cancel an outbound payment intent\n\n###### Required Scopes: ######\n------\n`payment_intent.outbound:write` `transactions:read`",
        "summary": "Cancel outbound payment intent",
        "parameters": [
          {
            "in": "path",
            "name": "uid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The `uid` of the payment intent",
            "required": true
          }
        ],
        "tags": [
          "Integration: Outbound Payment Intents",
          "Outbound Payment Intents"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": ""
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                },
                "examples": {
                  "Non-FieldValidationError": {
                    "value": {
                      "non_field_errors": [
                        "This state is invalid."
                      ]
                    },
                    "summary": "Non-Field Validation Error"
                  },
                  "FieldValidationError": {
                    "value": {
                      "field_name": [
                        "This field is required."
                      ]
                    },
                    "summary": "Field Validation Error"
                  }
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "payment_intent.outbound:write",
          "transactions:read"
        ]
      }
    },
    "/v1/wallets/": {
      "get": {
        "operationId": "listWalletsViaIntegration",
        "summary": "List wallets",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "tags": [
          "Integration: Wallets",
          "Wallets"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedWalletList"
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "wallets:read"
        ],
        "description": "###### Required Scopes: ######\n------\n`wallets:read`"
      }
    },
    "/v1/wallets/{uid}/": {
      "get": {
        "operationId": "getWalletViaIntegration",
        "summary": "Get wallet",
        "parameters": [
          {
            "in": "path",
            "name": "uid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The `uid` of the wallet",
            "required": true
          }
        ],
        "tags": [
          "Integration: Wallets",
          "Wallets"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Wallet"
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": ""
          }
        },
        "x-required-scopes": [
          "wallets:read"
        ],
        "description": "###### Required Scopes: ######\n------\n`wallets:read`"
      }
    },
    "/v1/oauth2/token": {
      "post": {
        "servers": [
          {
            "url": "https://auth.foundation.dev.trusspayments.com",
            "description": "Development Auth"
          },
          {
            "url": "https://auth.foundation.sandbox.trusspayments.com",
            "description": "Sandbox Auth"
          },
          {
            "url": "https://auth.foundation.trusspayments.com",
            "description": "Production Auth"
          }
        ],
        "operationId": "exchangeToken",
        "summary": "Exchange authorization code or refresh token",
        "description": "Exchange an authorization code for access and refresh tokens, or use a refresh token to obtain a new access token.\n\nThis endpoint supports two grant types:\n\n- **`authorization_code`** — Exchange the authorization code received from the OAuth callback for access and refresh tokens.\n- **`refresh_token`** — Use a valid refresh token to obtain a new access token without requiring re-authorization.\n\nAccess tokens expire after 60 minutes. Use the `refresh_token` grant type to obtain a new access token before expiry.",
        "tags": [
          "Authentication"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/AuthorizationCodeTokenRequest"
                  },
                  {
                    "$ref": "#/components/schemas/RefreshTokenRequest"
                  }
                ]
              },
              "examples": {
                "AuthorizationCodeExchange": {
                  "summary": "Exchange authorization code for tokens",
                  "value": {
                    "grant_type": "authorization_code",
                    "code": "your-authorization-code",
                    "redirect_uri": "https://yourapp.com/oauth/callback",
                    "client_id": "your-client-id",
                    "client_secret": "your-client-secret"
                  }
                },
                "RefreshToken": {
                  "summary": "Refresh an expired access token",
                  "value": {
                    "grant_type": "refresh_token",
                    "refresh_token": "your-refresh-token",
                    "client_id": "your-client-id",
                    "client_secret": "your-client-secret"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token exchange successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g. invalid grant type, expired code, invalid refresh token)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid client credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ActionRequestResource": {
        "type": "object",
        "properties": {
          "action_type": {
            "enum": [
              "create_wallet"
            ],
            "type": "string",
            "description": "* `create_wallet` - Create Wallet",
            "x-spec-enum-id": "f83f33cdbc668e88",
            "readOnly": true
          },
          "approved_data": {
            "oneOf": [
              {},
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "dashboard_review_url": {
            "type": "string",
            "readOnly": true
          },
          "requested_data": {
            "readOnly": true
          },
          "result": {
            "oneOf": [
              {},
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "status": {
            "enum": [
              "approved",
              "executing",
              "failed",
              "pending",
              "rejected"
            ],
            "type": "string",
            "description": "* `approved` - Approved\n* `executing` - Executing\n* `failed` - Failed\n* `pending` - Pending\n* `rejected` - Rejected",
            "x-spec-enum-id": "8a26a50cb227c785",
            "readOnly": true
          },
          "uid": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          }
        },
        "required": [
          "action_type",
          "approved_data",
          "created_at",
          "dashboard_review_url",
          "requested_data",
          "result",
          "status",
          "uid"
        ]
      },
      "Company": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "checkout_link_id": {
            "type": "string",
            "readOnly": true,
            "description": "A unique identifier for the company's checkout link. Use this ID to construct the checkout URL for accepting payments."
          }
        },
        "required": [
          "checkout_link_id",
          "name",
          "uid"
        ]
      },
      "Contact": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "readOnly": true
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "readOnly": true
          },
          "secondary_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "readOnly": true
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "oauth_connection_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "email",
          "name",
          "phone",
          "secondary_email",
          "uid"
        ]
      },
      "CreateActionRequestRequest": {
        "type": "object",
        "properties": {
          "action_type": {
            "enum": [
              "create_wallet"
            ],
            "type": "string",
            "description": "* `create_wallet` - Create Wallet",
            "x-spec-enum-id": "f83f33cdbc668e88"
          },
          "data": {
            "$ref": "#/components/schemas/CreateWalletActionDataRequest"
          }
        },
        "required": [
          "action_type"
        ]
      },
      "CreateInboundPaymentIntentRequest": {
        "type": "object",
        "properties": {
          "total": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,12}(?:\\.\\d{0,2})?$",
            "description": "The total amount due for the payment intent. Must be greater or equal to 1.00."
          },
          "addenda": {
            "type": "string",
            "minLength": 1,
            "description": "Payment intent description, which will also be used as the addenda on any payments made on the payment intent.",
            "maxLength": 80
          },
          "note": {
            "type": "string",
            "description": "A note to the payee/customer.",
            "maxLength": 500
          },
          "memo": {
            "type": "string",
            "description": "A private memo for internal use.",
            "maxLength": 500
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The due date for payment of payment intent. Must be a string with format YYYY-MM-DD representing a date in the future."
          },
          "send_email": {
            "type": "boolean",
            "description": "If true, the customer will receive an email notification letting them know the payment intent is available to pay with a payment portal link."
          },
          "send_sms": {
            "type": "boolean",
            "description": "If true, the customer will receive a sms notification letting them know the payment intent is available to pay with a payment portal link."
          },
          "contact": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CreateOrUpdateContactRequest"
              },
              {
                "type": "null"
              }
            ],
            "description": "A dictionary containing information about the customer to which the payment intent belongs to. If provided, the name/uid will be used to match an existing customer and update it with the data provided. If a match does not exist, a new customer will be created. Omit for contactless payment intents."
          },
          "wallet_uid": {
            "type": "string",
            "format": "uuid",
            "description": "The uid of the company wallet that should receive the payment. Omit to use the company's primary wallet."
          }
        },
        "required": [
          "addenda",
          "total"
        ]
      },
      "CreateOrUpdateContactRequest": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string",
            "format": "uuid",
            "description": "A unique identifier corresponding to an existing customer. If provided, the existing customer will be used and updated. One of uid or name with email must be provided."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Unique name identifying the customer. If uid was not provided and a customer already exists with this name, the existing customer will be used and updated.  One of uid or name with email must be provided."
          },
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 1,
            "description": "The primary email for the customer. Notifications related to the payment intent (if enabled) will be sent to this email.  One of uid or name with email must be provided."
          },
          "secondary_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "A secondary for the customer.  Must be different from email. Notifications related to the payment intent (if enabled) will be sent to this email."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "An SMS-enabled phone number for the customer. Must be a US or Canadian-based number.",
            "maxLength": 11
          }
        }
      },
      "CreateOutboundPaymentIntentRequest": {
        "type": "object",
        "properties": {
          "total": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,12}(?:\\.\\d{0,2})?$",
            "description": "The total amount due for the payment intent. Must be greater or equal to 1.00."
          },
          "addenda": {
            "type": "string",
            "minLength": 1,
            "description": "Payment intent description, which will also be used as the addenda on any payments made on the payment intent.",
            "maxLength": 80
          },
          "note": {
            "type": "string",
            "description": "A note to the payee/vendor.",
            "maxLength": 500
          },
          "memo": {
            "type": "string",
            "description": "A private memo for internal use.",
            "maxLength": 500
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The due date for payment of payment intent. Must be a string with format YYYY-MM-DD representing a date in the future."
          },
          "vendor": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CreateOrUpdateContactRequest"
              }
            ],
            "description": "A dictionary containing information about the vendor to which the payment intent belongs. The name/uid will be used to match an existing vendor and update it with the data provided. If a match does not exist, a new vendor will be created."
          },
          "wallet_uid": {
            "type": "string",
            "format": "uuid",
            "description": "The uid of the company wallet that should fund the payment. Omit to use the company's primary wallet."
          }
        },
        "required": [
          "addenda",
          "total",
          "vendor"
        ]
      },
      "CreateWalletActionDataRequest": {
        "type": "object",
        "properties": {
          "nickname": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 32
          }
        }
      },
      "NotFoundErrorResponse": {
        "type": "object",
        "properties": {
          "detail": {
            "type": "string",
            "default": "Not found."
          },
          "error_code": {
            "type": "string"
          }
        }
      },
      "PaginatedContactList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          }
        }
      },
      "PaginatedPaymentIntentList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentIntent"
            }
          }
        }
      },
      "PaginatedWalletList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Wallet"
            }
          }
        }
      },
      "PaymentIntent": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "total": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,12}(?:\\.\\d{0,2})?$",
            "readOnly": true
          },
          "addenda": {
            "type": "string",
            "readOnly": true
          },
          "direction": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "`0`: Inbound, `1`: Outbound"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "memo": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "readOnly": true
          },
          "contact": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Contact"
              },
              {
                "type": "null"
              }
            ]
          },
          "wallet_uid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "readOnly": true,
            "description": "The uid of the company wallet this payment intent is booked to: the funding wallet for an outbound bill, or the receiving wallet for an inbound invoice."
          },
          "status": {
            "type": "string",
            "readOnly": true
          },
          "balance_paid": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,12}(?:\\.\\d{0,2})?$"
          },
          "checkout_url": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true,
            "description": "Guest checkout URL for contactless payment intents only (contact is null). Omitted on list and webhook payloads. Invoices with a contact use the authenticated partner checkout path instead."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "pending_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "canceled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentIntentTransaction"
            },
            "description": "List of transactions associated with this payment intent. Only populated on retrieve, not on list or webhook payloads."
          }
        },
        "required": [
          "addenda",
          "balance_paid",
          "canceled_at",
          "checkout_url",
          "contact",
          "created_at",
          "direction",
          "due_date",
          "memo",
          "note",
          "paid_at",
          "pending_at",
          "status",
          "total",
          "transactions",
          "uid",
          "wallet_uid"
        ]
      },
      "PaymentIntentTransaction": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string",
            "format": "uuid"
          },
          "amount": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,12}(?:\\.\\d{0,2})?$"
          },
          "addenda": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "enum": [
              "transaction",
              "draft",
              "external"
            ],
            "type": "string",
            "description": "* `transaction` - Transaction\n* `draft` - Draft\n* `external` - External",
            "x-spec-enum-id": "77a7252e56da1027"
          },
          "payment_method": {
            "enum": [
              "ach",
              "book",
              "credit_card",
              "check_deposit",
              "card_repayment",
              "uncontrolled",
              "card_payment_intent",
              "push_to_card",
              "astra_account_to_card",
              "check_payment",
              "interest",
              "legacy",
              "email",
              "direct_deposit",
              "instant_payment",
              "check",
              "cash",
              "bank_transfer",
              "discount",
              "other"
            ],
            "type": "string",
            "description": "* `ach` - Ach\n* `book` - Book\n* `credit_card` - Credit Card\n* `check_deposit` - Check Deposit\n* `card_repayment` - Card Repayment\n* `uncontrolled` - Uncontrolled\n* `card_payment_intent` - Card Payment Intent\n* `push_to_card` - Push To Card\n* `astra_account_to_card` - Astra Account To Card\n* `check_payment` - Check Payment\n* `interest` - Interest\n* `legacy` - Legacy\n* `email` - Email\n* `direct_deposit` - Direct Deposit\n* `instant_payment` - Instant Payment\n* `check` - Check\n* `cash` - Cash\n* `bank_transfer` - Bank Transfer\n* `discount` - Discount\n* `other` - Other",
            "x-spec-enum-id": "79c7ee28a86c9467"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "preprocessed_at": {
            "type": "string",
            "format": "date-time"
          },
          "processed_at": {
            "type": "string",
            "format": "date-time"
          },
          "posted_at": {
            "type": "string",
            "format": "date-time"
          },
          "settled_at": {
            "type": "string",
            "format": "date-time"
          },
          "returned_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "enum": [
              "ReturnedTransaction",
              "RefundedTransaction",
              "CanceledTransaction",
              "ReturnTransaction",
              "RefundTransaction",
              "PendingCredit",
              "AcceptedCredit",
              "ProcessedCredit",
              "PaidDebit",
              "ProcessedDebit",
              "SettledDebit",
              "OnHold",
              "Error",
              "DraftCredit",
              "ExternalCredit"
            ],
            "type": "string",
            "description": "* `ReturnedTransaction` - Returned Transaction\n* `RefundedTransaction` - Refunded Transaction\n* `CanceledTransaction` - Canceled Transaction\n* `ReturnTransaction` - Return Transaction\n* `RefundTransaction` - Refund Transaction\n* `PendingCredit` - Pending Credit\n* `AcceptedCredit` - Accepted Credit\n* `ProcessedCredit` - Processed Credit\n* `PaidDebit` - Paid Debit\n* `ProcessedDebit` - Processed Debit\n* `SettledDebit` - Settled Debit\n* `OnHold` - On Hold\n* `Error` - Error\n* `DraftCredit` - Draft Credit\n* `ExternalCredit` - External Credit",
            "x-spec-enum-id": "ffba647976c96904"
          },
          "direction": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "`0`: Inbound, `1`: Outbound"
          }
        },
        "required": [
          "amount",
          "date",
          "direction",
          "payment_method",
          "status",
          "type",
          "uid"
        ]
      },
      "PaymentIntentTransactionAddedEventPayload": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "total": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,12}(?:\\.\\d{0,2})?$",
            "readOnly": true
          },
          "addenda": {
            "type": "string",
            "readOnly": true
          },
          "direction": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "`0`: Inbound, `1`: Outbound"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "memo": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "readOnly": true
          },
          "contact": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Contact"
              },
              {
                "type": "null"
              }
            ]
          },
          "wallet_uid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "readOnly": true
          },
          "status": {
            "type": "string",
            "readOnly": true
          },
          "balance_paid": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,12}(?:\\.\\d{0,2})?$"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "pending_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "canceled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "transaction": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentIntentTransaction"
              }
            ],
            "description": "The specific transaction that was added to this payment intent, triggering the event."
          }
        },
        "required": [
          "addenda",
          "balance_paid",
          "canceled_at",
          "contact",
          "created_at",
          "direction",
          "due_date",
          "memo",
          "note",
          "paid_at",
          "pending_at",
          "status",
          "total",
          "transaction",
          "uid",
          "wallet_uid"
        ]
      },
      "ValidationErrorResponse": {
        "type": "object",
        "properties": {
          "non_field_errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error_code": {
            "type": "string"
          }
        }
      },
      "Wallet": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "is_primary": {
            "type": "boolean",
            "readOnly": true,
            "description": "Whether this wallet is the company's primary wallet."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true,
            "description": "The wallet's bank account nickname, or its internal name when no nickname is set."
          },
          "mask": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true,
            "description": "The last four digits of the wallet's bank account number."
          }
        },
        "required": [
          "is_primary",
          "mask",
          "name",
          "uid"
        ]
      },
      "UpdateContactRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "The contact's display name.",
            "maxLength": 60
          },
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 1,
            "description": "The primary email for the contact."
          },
          "secondary_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "A secondary email for the contact. Must be different from email."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "An SMS-enabled phone number for the contact. Must be a US or Canadian-based number.",
            "maxLength": 11
          }
        }
      },
      "UpdateOutboundPaymentIntentRequest": {
        "type": "object",
        "properties": {
          "total": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,12}(?:\\.\\d{0,2})?$",
            "description": "The total amount due for the payment intent. If updated, the remaining balance due (total - sum of existing payments) must be greater or equal to 1.00. This field cannot be updated on fully paid or canceled payment intents."
          },
          "addenda": {
            "type": "string",
            "minLength": 1,
            "description": "Payment intent description, which will also be used as the addenda on any payments made on the payment intent. This field cannot be updated on fully paid or canceled payment intents.",
            "maxLength": 80
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "A note to the payee/vendor. This field cannot be updated on fully paid or canceled payment intents.",
            "maxLength": 500
          },
          "memo": {
            "type": [
              "string",
              "null"
            ],
            "description": "A private memo for internal use.",
            "maxLength": 500
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The due date for payment of payment intent. Must be a string with format YYYY-MM-DD representing a date in the future."
          }
        }
      },
      "UpdatePaymentIntentRequest": {
        "type": "object",
        "properties": {
          "total": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,12}(?:\\.\\d{0,2})?$",
            "description": "The total amount due for the payment intent. If updated, the remaining balance due (total - sum of existing payments) must be greater or equal to 1.00. This field cannot be updated on fully paid or canceled payment intents."
          },
          "addenda": {
            "type": "string",
            "minLength": 1,
            "description": "Payment intent description, which will also be used as the addenda on any payments made on the payment intent. This field cannot be updated on fully paid or canceled payment intents.",
            "maxLength": 80
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "A note to the payee/customer. This field cannot be updated on fully paid or canceled payment intents.",
            "maxLength": 500
          },
          "memo": {
            "type": [
              "string",
              "null"
            ],
            "description": "A private memo for internal use.",
            "maxLength": 500
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The due date for payment of payment intent. Must be a string with format YYYY-MM-DD representing a date in the future."
          },
          "resend_email": {
            "type": "boolean",
            "description": "If true, the customer will receive an email notification letting them know the payment intent has been updated and is available to pay with a payment portal link. Email notifications cannot be resent on fully paid or canceled payment intents."
          }
        }
      },
      "AuthorizationCodeTokenRequest": {
        "type": "object",
        "description": "Request body for exchanging an authorization code for tokens",
        "properties": {
          "grant_type": {
            "type": "string",
            "enum": [
              "authorization_code"
            ],
            "description": "Must be `authorization_code`"
          },
          "code": {
            "type": "string",
            "description": "The authorization code received from the OAuth callback"
          },
          "redirect_uri": {
            "type": "string",
            "format": "uri",
            "description": "Must match the redirect_uri used in the authorization request"
          },
          "client_id": {
            "type": "string",
            "description": "Your application's client ID"
          },
          "client_secret": {
            "type": "string",
            "description": "Your application's client secret"
          }
        },
        "required": [
          "grant_type",
          "code",
          "redirect_uri",
          "client_id",
          "client_secret"
        ]
      },
      "RefreshTokenRequest": {
        "type": "object",
        "description": "Request body for refreshing an access token",
        "properties": {
          "grant_type": {
            "type": "string",
            "enum": [
              "refresh_token"
            ],
            "description": "Must be `refresh_token`"
          },
          "refresh_token": {
            "type": "string",
            "description": "The refresh token obtained from a previous token exchange"
          },
          "client_id": {
            "type": "string",
            "description": "Your application's client ID"
          },
          "client_secret": {
            "type": "string",
            "description": "Your application's client secret"
          }
        },
        "required": [
          "grant_type",
          "refresh_token",
          "client_id",
          "client_secret"
        ]
      },
      "TokenResponse": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "JWT access token to include in API request Authorization headers"
          },
          "refresh_token": {
            "type": "string",
            "description": "Token used to obtain a new access token when the current one expires"
          },
          "token_type": {
            "type": "string",
            "enum": [
              "bearer"
            ]
          },
          "expires_in": {
            "type": "integer",
            "description": "Token lifetime in seconds (typically 3600)"
          },
          "scope": {
            "type": "string",
            "description": "Space-separated list of granted scopes"
          }
        },
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ]
      },
      "OAuthError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error code (e.g. `invalid_grant`, `invalid_client`, `invalid_request`)"
          },
          "error_description": {
            "type": "string",
            "description": "Human-readable error message"
          }
        },
        "required": [
          "error"
        ]
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "Authentication",
      "tags": [
        "Authentication"
      ]
    },
    {
      "name": "Company",
      "tags": [
        "Company"
      ]
    },
    {
      "name": "Contacts",
      "tags": [
        "Contacts"
      ]
    },
    {
      "name": "Wallets",
      "tags": [
        "Wallets"
      ]
    },
    {
      "name": "Action Requests",
      "tags": [
        "Action Requests"
      ]
    },
    {
      "name": "Payment Intents",
      "tags": [
        "Inbound Payment Intents",
        "Outbound Payment Intents"
      ]
    },
    {
      "name": "Webhooks",
      "tags": [
        "Webhooks"
      ]
    }
  ],
  "servers": [
    {
      "url": "https://api.foundation.dev.trusspayments.com",
      "description": "Development"
    },
    {
      "url": "https://api.foundation.sandbox.trusspayments.com",
      "description": "Sandbox"
    },
    {
      "url": "https://api.foundation.trusspayments.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "OAuth 2.0 token exchange and refresh"
    },
    {
      "name": "Company",
      "description": "Company management"
    },
    {
      "name": "Contacts",
      "description": "Contact management"
    },
    {
      "name": "Wallets",
      "description": "Company wallet directory"
    },
    {
      "name": "Action Requests",
      "description": "Integrator action requests"
    },
    {
      "name": "Inbound Payment Intents",
      "description": "Inbound payment intent management"
    },
    {
      "name": "Outbound Payment Intents",
      "description": "Outbound payment intent (bill) management"
    },
    {
      "name": "Webhooks",
      "description": "Webhook events fired by Truss.\n\n### Verifying signatures\n\nWhen your subscription has a signing secret, every delivery includes an `X-Webhook-Signature` header so you can confirm the request came from Truss and was not modified in transit.\n\nThe header has the format `t=<timestamp>,v1=<signature>`, where `timestamp` is the Unix time the request was signed and `signature` is a hex-encoded HMAC-SHA256.\n\nTo verify a delivery:\n\n1. Parse the `t` and `v1` values from the header.\n2. Compute the HMAC-SHA256 of the string `<timestamp>.<raw_request_body>` using your signing secret as the key. Sign the **raw** request body exactly as received — do not parse and re-serialize the JSON, or the signature will not match.\n3. Compare your result to `v1` using a constant-time comparison.\n4. Reject the delivery if the signature does not match, or if `timestamp` is more than 5 minutes old (replay protection)."
    }
  ],
  "webhooks": {
    "payment_intent.paid": {
      "post": {
        "description": "Fired when a payment intent is marked paid (`paid_at` is set). For bill payments, this can occur when the full payment is initiated, before transaction processing or settlement.",
        "summary": "Payment Intent Paid",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "event_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "event_name": {
                    "type": "string"
                  },
                  "event_payload": {
                    "$ref": "#/components/schemas/PaymentIntent"
                  }
                },
                "required": [
                  "event_created_at",
                  "event_id",
                  "event_name",
                  "event_payload"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "No response body"
          }
        },
        "parameters": [
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Signature used to verify the payload originated from Truss. Format `t=<timestamp>,v1=<signature>`, where the signature is the HMAC-SHA256 of `<timestamp>.<raw_request_body>` keyed with your signing secret. See this section's overview for the full verification steps. Present only when the subscription has a signing secret."
          }
        ]
      }
    },
    "payment_intent.canceled": {
      "post": {
        "description": "Fired when a payment intent is canceled.",
        "summary": "Payment Intent Canceled",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "event_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "event_name": {
                    "type": "string"
                  },
                  "event_payload": {
                    "$ref": "#/components/schemas/PaymentIntent"
                  }
                },
                "required": [
                  "event_created_at",
                  "event_id",
                  "event_name",
                  "event_payload"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "No response body"
          }
        },
        "parameters": [
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Signature used to verify the payload originated from Truss. Format `t=<timestamp>,v1=<signature>`, where the signature is the HMAC-SHA256 of `<timestamp>.<raw_request_body>` keyed with your signing secret. See this section's overview for the full verification steps. Present only when the subscription has a signing secret."
          }
        ]
      }
    },
    "payment_intent.updated": {
      "post": {
        "description": "Fired when a payment intent is updated.",
        "summary": "Payment Intent Updated",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "event_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "event_name": {
                    "type": "string"
                  },
                  "event_payload": {
                    "$ref": "#/components/schemas/PaymentIntent"
                  }
                },
                "required": [
                  "event_created_at",
                  "event_id",
                  "event_name",
                  "event_payload"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "No response body"
          }
        },
        "parameters": [
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Signature used to verify the payload originated from Truss. Format `t=<timestamp>,v1=<signature>`, where the signature is the HMAC-SHA256 of `<timestamp>.<raw_request_body>` keyed with your signing secret. See this section's overview for the full verification steps. Present only when the subscription has a signing secret."
          }
        ]
      }
    },
    "payment_intent.transaction.added": {
      "post": {
        "description": "Fired when a transaction or external transaction is added to a payment intent, either by creation or by matching an existing transaction to a payment intent.",
        "summary": "Payment Intent Transaction Added",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "event_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "event_name": {
                    "type": "string"
                  },
                  "event_payload": {
                    "$ref": "#/components/schemas/PaymentIntentTransactionAddedEventPayload"
                  }
                },
                "required": [
                  "event_created_at",
                  "event_id",
                  "event_name",
                  "event_payload"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "No response body"
          }
        },
        "parameters": [
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Signature used to verify the payload originated from Truss. Format `t=<timestamp>,v1=<signature>`, where the signature is the HMAC-SHA256 of `<timestamp>.<raw_request_body>` keyed with your signing secret. See this section's overview for the full verification steps. Present only when the subscription has a signing secret."
          }
        ]
      }
    },
    "action_request.updated": {
      "post": {
        "description": "Fired when an action request is approved, rejected, or failed.",
        "summary": "Action Request Updated",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "event_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "event_name": {
                    "type": "string"
                  },
                  "event_payload": {
                    "$ref": "#/components/schemas/ActionRequestWebhook"
                  }
                },
                "required": [
                  "event_created_at",
                  "event_id",
                  "event_name",
                  "event_payload"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "No response body"
          }
        },
        "parameters": [
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Signature used to verify the payload originated from Truss. Format `t=<timestamp>,v1=<signature>`, where the signature is the HMAC-SHA256 of `<timestamp>.<raw_request_body>` keyed with your signing secret. See this section's overview for the full verification steps. Present only when the subscription has a signing secret."
          }
        ]
      }
    }
  },
  "x-ext-urls": {}
}