From e1047cbb0f61879dc723610467b33d74500b6802 Mon Sep 17 00:00:00 2001 From: Gleb Date: Fri, 21 Apr 2023 12:58:32 -0700 Subject: [PATCH] Basic OpenAPI support for SEP-31 (#123) * Basic OpenAPI support for SEP-31 * Update headers --- ap_api/callbacks/_category_.json | 5 + ap_api/callbacks/customer/index.mdx | 20 + ap_api/callbacks/del-customer.api.mdx | 41 + ap_api/callbacks/fee/index.mdx | 17 + ap_api/callbacks/gen-address.api.mdx | 54 ++ ap_api/callbacks/gen-rates.api.mdx | 67 ++ ap_api/callbacks/get-customer.api.mdx | 60 ++ ap_api/callbacks/get-fee.api.mdx | 57 ++ .../callbacks/put-customer-callback.api.mdx | 55 ++ ap_api/callbacks/put-customer.api.mdx | 48 ++ ap_api/callbacks/rate/index.mdx | 17 + ap_api/callbacks/sidebar.js | 1 + ap_api/callbacks/unique-address/index.mdx | 17 + ap_api/resources/get-quote.api.mdx | 2 +- ap_api/resources/get-quotes.api.mdx | 2 +- ap_api/resources/get-transaction.api.mdx | 2 +- ap_api/resources/patch-transactions.api.mdx | 4 +- .../get-effects-by-account-id.api.mdx | 4 +- docusaurus.config.js | 7 + openapi/ap/Callbacks API.yml | 14 + openapi/ap/bundled_callback.yml | 708 ++++++++++++++++++ openapi/bundled.yml | 2 +- package.json | 4 +- src/sidebar-api-generator.js | 28 + 24 files changed, 1226 insertions(+), 10 deletions(-) create mode 100644 ap_api/callbacks/_category_.json create mode 100644 ap_api/callbacks/customer/index.mdx create mode 100644 ap_api/callbacks/del-customer.api.mdx create mode 100644 ap_api/callbacks/fee/index.mdx create mode 100644 ap_api/callbacks/gen-address.api.mdx create mode 100644 ap_api/callbacks/gen-rates.api.mdx create mode 100644 ap_api/callbacks/get-customer.api.mdx create mode 100644 ap_api/callbacks/get-fee.api.mdx create mode 100644 ap_api/callbacks/put-customer-callback.api.mdx create mode 100644 ap_api/callbacks/put-customer.api.mdx create mode 100644 ap_api/callbacks/rate/index.mdx create mode 100644 ap_api/callbacks/sidebar.js create mode 100644 ap_api/callbacks/unique-address/index.mdx create mode 100644 openapi/ap/bundled_callback.yml diff --git a/ap_api/callbacks/_category_.json b/ap_api/callbacks/_category_.json new file mode 100644 index 000000000..e12fdc242 --- /dev/null +++ b/ap_api/callbacks/_category_.json @@ -0,0 +1,5 @@ +{ + "position": 30, + "label": "Callbacks" + } + \ No newline at end of file diff --git a/ap_api/callbacks/customer/index.mdx b/ap_api/callbacks/customer/index.mdx new file mode 100644 index 000000000..e77289af0 --- /dev/null +++ b/ap_api/callbacks/customer/index.mdx @@ -0,0 +1,20 @@ +--- +title: Customers +order: 0 +--- + +import {EndpointsTable} from "@site/src/components/EndpointsTable"; + + + +| | | +| --- | --------------------- | +| GET | [/customer](../get-customer.api.mdx) | +| PUT | [/customer](../put-customer.api.mdx) | +| PUT | [/customer/callback](../put-customer-callback.api.mdx) | +| DELETE | [/customer/:id](../del-customer.api.mdx) | + + + + +[sep-38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md \ No newline at end of file diff --git a/ap_api/callbacks/del-customer.api.mdx b/ap_api/callbacks/del-customer.api.mdx new file mode 100644 index 000000000..93cae479a --- /dev/null +++ b/ap_api/callbacks/del-customer.api.mdx @@ -0,0 +1,41 @@ +--- +id: del-customer +title: "Delete Customer Data" +description: "The request for this endpoint is identical to the `PUT /customer/callback` request defined in SEP-12." +sidebar_label: "Delete Customer Data" +hide_title: true +hide_table_of_contents: true +api: {"tags":["Customers"],"description":"The request for this endpoint is identical to the `PUT /customer/callback` request defined in SEP-12.\n\nDelete the customer's data or queue the customers data for deletion.\n","operationId":"delCustomer","parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Success."},"404":{"description":"Customer not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"delete","path":"/customer/{id}","info":{"version":"2.0.0","description":"The Synchronous Callbacks API specification for the Stellar Anchor Platform project.\n\nThe Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The \nanchor's responses to these requests affect the Platform responses to the client application.\n","title":"Synchronous Callbacks API"},"postman":{"name":"Delete Customer Data","description":{"content":"The request for this endpoint is identical to the `PUT /customer/callback` request defined in SEP-12.\n\nDelete the customer's data or queue the customers data for deletion.\n","type":"text/plain"},"url":{"path":["customer",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +sidebar_class_name: "delete api-method" +info_path: api/callbacks/synchronous-callbacks-api +custom_edit_url: null +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Delete Customer Data + + + +The request for this endpoint is identical to the `PUT /customer/callback` request defined in SEP-12. + +Delete the customer's data or queue the customers data for deletion. + + +
Path Parameters
+ +Success. + +
+ +Customer not found. + +
Schema
+ \ No newline at end of file diff --git a/ap_api/callbacks/fee/index.mdx b/ap_api/callbacks/fee/index.mdx new file mode 100644 index 000000000..064bab15e --- /dev/null +++ b/ap_api/callbacks/fee/index.mdx @@ -0,0 +1,17 @@ +--- +title: Fees +order: 0 +--- + +import {EndpointsTable} from "@site/src/components/EndpointsTable"; + + + +| | | +| --- | --------------------- | +| GET | [/fee](../get-fee.api.mdx) | + + + + +[sep-38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md \ No newline at end of file diff --git a/ap_api/callbacks/gen-address.api.mdx b/ap_api/callbacks/gen-address.api.mdx new file mode 100644 index 000000000..741112cca --- /dev/null +++ b/ap_api/callbacks/gen-address.api.mdx @@ -0,0 +1,54 @@ +--- +id: gen-address +title: "Generate Unique Address" +description: "If the platform is configured with `depositInfoGeneratorType: api`, the Platform will be executing this request to" +sidebar_label: "Generate Unique Address" +hide_title: true +hide_table_of_contents: true +api: {"description":"If the platform is configured with `depositInfoGeneratorType: api`, the Platform will be executing this request to \nthe Anchor backend every time a transaction is initiated by a client application.\n\nThe Anchor must guarantee that the memo returned in this request is unique, so it can be mapped 1-to-1 to a Platform\nresource such as a [SEP-31](https://stellar.org/protocol/sep-31) transaction.\n\nIt is possible that these memos are never used by the client who initiated the transaction though.\n\nHere is how this flow would be used for Receiving Anchors that need to create their unique `stellar_address:memo` pairs\noutside the platform, using Circle:\n\n[![](https://mermaid.ink/img/pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1)](https://mermaid.live/edit#pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1)\n","operationId":"genAddress","tags":["Unique Address"],"parameters":[{"in":"query","name":"transaction_id","description":"The platform server will save the posted transaction and pass the `transaction_id` through this endpoint. \nIf the anchor wishes to return transaction-dependent unique_address, the anchor may query the [`GET /transactions` endpoint of the Platform API](https://github.com/stellar/java-stellar-anchor-sdk/blob/main/docs/03%20-%20Implementing%20the%20Anchor%20Server/Communication/Platform%20API.yml).\n","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"unique_address":{"description":"An object containing the unique `stellar_address:memo` pair used to identify a destination.","type":"object","properties":{"stellar_address":{"description":"A `G...` stellar address or a `M...` [muxed stellar address](https://developers.stellar.org/docs/glossary/muxed-accounts/) of an **existing** account in the Stellar network.","type":"string"},"memo":{"description":"The memo to attach to the Stellar payment.","type":"string"},"memo_type":{"description":"The type of memo to attach to the Stellar payment (text, hash, or id).","type":"string","enum":["text","hash","id"]}},"required":["stellar_address"]}}}}}},"500":{"description":"Error. The Platform will respond to the client application with the same response code and body.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/unique_address","info":{"version":"2.0.0","description":"The Synchronous Callbacks API specification for the Stellar Anchor Platform project.\n\nThe Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The \nanchor's responses to these requests affect the Platform responses to the client application.\n","title":"Synchronous Callbacks API"},"postman":{"name":"Generate Unique Address","description":{"content":"If the platform is configured with `depositInfoGeneratorType: api`, the Platform will be executing this request to \nthe Anchor backend every time a transaction is initiated by a client application.\n\nThe Anchor must guarantee that the memo returned in this request is unique, so it can be mapped 1-to-1 to a Platform\nresource such as a [SEP-31](https://stellar.org/protocol/sep-31) transaction.\n\nIt is possible that these memos are never used by the client who initiated the transaction though.\n\nHere is how this flow would be used for Receiving Anchors that need to create their unique `stellar_address:memo` pairs\noutside the platform, using Circle:\n\n[![](https://mermaid.ink/img/pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1)](https://mermaid.live/edit#pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1)\n","type":"text/plain"},"url":{"path":["unique_address"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The platform server will save the posted transaction and pass the `transaction_id` through this endpoint. \nIf the anchor wishes to return transaction-dependent unique_address, the anchor may query the [`GET /transactions` endpoint of the Platform API](https://github.com/stellar/java-stellar-anchor-sdk/blob/main/docs/03%20-%20Implementing%20the%20Anchor%20Server/Communication/Platform%20API.yml).\n","type":"text/plain"},"key":"transaction_id","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" +info_path: api/callbacks/synchronous-callbacks-api +custom_edit_url: null +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Generate Unique Address + + + +If the platform is configured with `depositInfoGeneratorType: api`, the Platform will be executing this request to +the Anchor backend every time a transaction is initiated by a client application. + +The Anchor must guarantee that the memo returned in this request is unique, so it can be mapped 1-to-1 to a Platform +resource such as a [SEP-31](https://stellar.org/protocol/sep-31) transaction. + +It is possible that these memos are never used by the client who initiated the transaction though. + +Here is how this flow would be used for Receiving Anchors that need to create their unique `stellar_address:memo` pairs +outside the platform, using Circle: + +[![](https://mermaid.ink/img/pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1)](https://mermaid.live/edit#pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1) + + +
Query Parameters
+ +Success. + +
Schema
    unique_address object
    + +An object containing the unique `stellar_address:memo` pair used to identify a destination. + +
+ +Error. The Platform will respond to the client application with the same response code and body. + +
Schema
+ \ No newline at end of file diff --git a/ap_api/callbacks/gen-rates.api.mdx b/ap_api/callbacks/gen-rates.api.mdx new file mode 100644 index 000000000..e734be25d --- /dev/null +++ b/ap_api/callbacks/gen-rates.api.mdx @@ -0,0 +1,67 @@ +--- +id: gen-rates +title: "Retrieve Rates" +description: "Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must" +sidebar_label: "Retrieve Rates" +hide_title: true +hide_table_of_contents: true +api: {"description":"Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must \nuse exchange rates that are communicated to the client application requesting the transaction. When clients make\nrequests to the Platform for these exchange rates, the Platform sends this request to the anchor to fetch it.\n\nRates can be [indicative](https://www.investopedia.com/terms/i/indicativequote.asp) or \n[firm](https://www.investopedia.com/terms/f/firmquote.asp). The anchor must provide an expiration if the client\nrequests a firm rate.\n\nAnchors can provide discounted rates specific client applications. The Platform includes the `client_id` parameter \nfor this reason.\n\nEither `sell_amount` or `buy_amount` will be included in requests as parameters, but never both. In the same way,\neither `sell_delivery_method` and `buy_delivery_method` may be included in requests, but never both, since either\n`sell_asset` or `buy_asset` is a Stellar asset.\n\nIn the future, we may add headers to the response that informs the Platform on whether or not it can cache the\nresponse returned, and if so, for how long.\n","tags":["Rates"],"operationId":"genRates","parameters":[{"in":"query","name":"type","description":"The type of rate requested. `firm` and `indicative_price` rates need to return a \"fee\" and \"total_price\" fields, while `indicative_prices` doesn't.","schema":{"type":"string","enum":["indicative_price","indicative_prices","firm"]},"required":true},{"in":"query","name":"context","description":"The context it will be used for. It is mandatory for the types `indicative_price` and `firm`.","schema":{"type":"string","enum":["sep6","sep31"]}},{"in":"query","name":"client_id","description":"An identifier for the client application making the request. This ID can be used to offer different fees to different clients.\n\nClient IDs will be the Stellar public key the public key used to authenticate via SEP-10. Anchors must ensure\nthat the public key specified in the request matches a public key known to belong to the sending anchor.\n\nThis parameter will only be specified if the client is authenticated via SEP-10. Anchors can define whether or not \nauthentication is required for fetching indicative rates. Firm rates always require authentication.\n","schema":{"type":"string"}},{"in":"query","name":"sell_asset","description":"The asset the client application will send to the anchor in exchange for `buy_asset` in \n[Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format).\n","schema":{"type":"string"},"required":true},{"in":"query","name":"buy_asset","description":"The asset the that the anchor will send in exchange for `sell_asset` in \n[Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format).\n","schema":{"type":"string"},"required":true},{"in":"query","name":"sell_amount","description":"The amount of `sell_asset` the client application will send in exchange for `buy_asset`. Will not be used in\nconjuction with `buy_amount`.\n","schema":{"type":"string"}},{"in":"query","name":"buy_amount","description":"The amount of `buy_asset` the anchor will send in exchange for `sell_asset`. Will not be used in conjuction\nwith `sell_amount`.\n","schema":{"type":"string"}},{"in":"query","name":"country_code","description":"The [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code of the user's current address.\nAnchors should expect this parameter to be provided if one of the assets of the buy/sell pair is fiat and it \nis available in two or more countries.\n","schema":{"type":"string"}},{"in":"query","name":"expire_after","description":"The client's desired `expires_at` date and time for the quote that can be used if this is a firm quote. This should\nbe a [UTC ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) string. Anchors should return `400 Bad\nRequest` if an expiration date on or after the requested value cannot be provided.\n","schema":{"type":"string"}},{"in":"query","name":"sell_delivery_method","description":"The method the client or user will use to deliver `sell_asset` to the Anchor. This value may affect the \nexpiration and price provided. The values used for this parameter is defined in the application's configuration.\nWill not be used in conjuction with `buy_delivery_method`.\n","schema":{"type":"string"}},{"in":"query","name":"buy_delivery_method","description":"The method the client or user wants used to receive `buy_asset` from the Anchor. This value may affect the \nexpiration and price provided. The values used for this parameter is defined in the application's configuration.\nWill not be used in conjuction with `sell_delivery_method`.\n","schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"rate":{"type":"object","properties":{"id":{"type":"string","description":"Id of the firm quote. NOT USED when `type=indicative*`."},"expires_at":{"type":"string","format":"date-time","description":"Expirations are NOT USED when `type=indicative*`."},"price":{"type":"string","description":"The conversion price offered by the anchor for one unit of `buy_asset` in terms of `sell_asset`, without including fees. In traditional finance, `buy_asset` would be referred to as the base asset and `sell_asset` as the counter asset. The formula `sell_amount - fee = price * buy_amount` must hold true ([ref](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#price-formulas))."},"total_price":{"type":"string","description":"The total conversion price offered by the anchor for one unit of `buy_asset` in terms of `sell_asset`, including fees. In traditional finance, `buy_asset` would be referred to as the base asset and `sell_asset` as the counter asset. NOT USED when `type=indicative_prices`. The formula `sell_amount = total_price * buy_amount` must hold true ([ref](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#price-formulas))."},"sell_amount":{"type":"string","description":"The amount of `sell_asset` the anchor will exchange for `buy_asset`. It could be different from the `sell_amount` provided in the request, depending on how fees are applied by the Anchor."},"buy_amount":{"type":"string","description":"The amount of `buy_asset` the anchor will provide with `sell_asset`. It could be different from the `buy_amount` provided in the request, depending on how fees are applied by the Anchor."},"fee":{"type":"object","description":"Fees are NOT USED when `type=indicative_prices`.","properties":{"total":{"type":"string","description":"The total fee to be applied."},"asset":{"type":"string","description":"The asset the fee will be charged in. Must be represented in [Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format)."},"details":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the fee, for example `ACH fee`, `Brazilian conciliation fee`, `Service fee`, etc."},"description":{"type":"string","description":"A text describing the fee."},"amount":{"type":"string","description":"The amount of asset applied. If `fee.details` is provided, `sum(fee.details.amount)` should be equals `fee.total`."}},"required":["name","amount"],"title":"RateFeeDetailResponse"}}},"required":["total","asset"],"title":"RateFeeResponse"}},"required":["price","sell_amount","buy_amount"]}},"title":"RateResponse"}}}},"422":{"description":"Unprocessable Entity. This status should be returned when the anchor understood the request but cannot \nreturn a success response.\nIn these cases, the Platform will respond to the client application's request with a `400 Bad Request` \nand include the error message provided by the anchor in the response body.\n","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"500":{"description":"Error. The Platform will respond to the client application with the same response code and body.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/rate","info":{"version":"2.0.0","description":"The Synchronous Callbacks API specification for the Stellar Anchor Platform project.\n\nThe Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The \nanchor's responses to these requests affect the Platform responses to the client application.\n","title":"Synchronous Callbacks API"},"postman":{"name":"Retrieve Rates","description":{"content":"Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must \nuse exchange rates that are communicated to the client application requesting the transaction. When clients make\nrequests to the Platform for these exchange rates, the Platform sends this request to the anchor to fetch it.\n\nRates can be [indicative](https://www.investopedia.com/terms/i/indicativequote.asp) or \n[firm](https://www.investopedia.com/terms/f/firmquote.asp). The anchor must provide an expiration if the client\nrequests a firm rate.\n\nAnchors can provide discounted rates specific client applications. The Platform includes the `client_id` parameter \nfor this reason.\n\nEither `sell_amount` or `buy_amount` will be included in requests as parameters, but never both. In the same way,\neither `sell_delivery_method` and `buy_delivery_method` may be included in requests, but never both, since either\n`sell_asset` or `buy_asset` is a Stellar asset.\n\nIn the future, we may add headers to the response that informs the Platform on whether or not it can cache the\nresponse returned, and if so, for how long.\n","type":"text/plain"},"url":{"path":["rate"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of rate requested. `firm` and `indicative_price` rates need to return a \"fee\" and \"total_price\" fields, while `indicative_prices` doesn't.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The context it will be used for. It is mandatory for the types `indicative_price` and `firm`.","type":"text/plain"},"key":"context","value":""},{"disabled":false,"description":{"content":"An identifier for the client application making the request. This ID can be used to offer different fees to different clients.\n\nClient IDs will be the Stellar public key the public key used to authenticate via SEP-10. Anchors must ensure\nthat the public key specified in the request matches a public key known to belong to the sending anchor.\n\nThis parameter will only be specified if the client is authenticated via SEP-10. Anchors can define whether or not \nauthentication is required for fetching indicative rates. Firm rates always require authentication.\n","type":"text/plain"},"key":"client_id","value":""},{"disabled":false,"description":{"content":"(Required) The asset the client application will send to the anchor in exchange for `buy_asset` in \n[Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format).\n","type":"text/plain"},"key":"sell_asset","value":""},{"disabled":false,"description":{"content":"(Required) The asset the that the anchor will send in exchange for `sell_asset` in \n[Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format).\n","type":"text/plain"},"key":"buy_asset","value":""},{"disabled":false,"description":{"content":"The amount of `sell_asset` the client application will send in exchange for `buy_asset`. Will not be used in\nconjuction with `buy_amount`.\n","type":"text/plain"},"key":"sell_amount","value":""},{"disabled":false,"description":{"content":"The amount of `buy_asset` the anchor will send in exchange for `sell_asset`. Will not be used in conjuction\nwith `sell_amount`.\n","type":"text/plain"},"key":"buy_amount","value":""},{"disabled":false,"description":{"content":"The [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code of the user's current address.\nAnchors should expect this parameter to be provided if one of the assets of the buy/sell pair is fiat and it \nis available in two or more countries.\n","type":"text/plain"},"key":"country_code","value":""},{"disabled":false,"description":{"content":"The client's desired `expires_at` date and time for the quote that can be used if this is a firm quote. This should\nbe a [UTC ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) string. Anchors should return `400 Bad\nRequest` if an expiration date on or after the requested value cannot be provided.\n","type":"text/plain"},"key":"expire_after","value":""},{"disabled":false,"description":{"content":"The method the client or user will use to deliver `sell_asset` to the Anchor. This value may affect the \nexpiration and price provided. The values used for this parameter is defined in the application's configuration.\nWill not be used in conjuction with `buy_delivery_method`.\n","type":"text/plain"},"key":"sell_delivery_method","value":""},{"disabled":false,"description":{"content":"The method the client or user wants used to receive `buy_asset` from the Anchor. This value may affect the \nexpiration and price provided. The values used for this parameter is defined in the application's configuration.\nWill not be used in conjuction with `sell_delivery_method`.\n","type":"text/plain"},"key":"buy_delivery_method","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" +info_path: api/callbacks/synchronous-callbacks-api +custom_edit_url: null +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Retrieve Rates + + + +Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must +use exchange rates that are communicated to the client application requesting the transaction. When clients make +requests to the Platform for these exchange rates, the Platform sends this request to the anchor to fetch it. + +Rates can be [indicative](https://www.investopedia.com/terms/i/indicativequote.asp) or +[firm](https://www.investopedia.com/terms/f/firmquote.asp). The anchor must provide an expiration if the client +requests a firm rate. + +Anchors can provide discounted rates specific client applications. The Platform includes the `client_id` parameter +for this reason. + +Either `sell_amount` or `buy_amount` will be included in requests as parameters, but never both. In the same way, +either `sell_delivery_method` and `buy_delivery_method` may be included in requests, but never both, since either +`sell_asset` or `buy_asset` is a Stellar asset. + +In the future, we may add headers to the response that informs the Platform on whether or not it can cache the +response returned, and if so, for how long. + + +
Query Parameters
+ +Success. + +
Schema
    rate object
    fee object
    + +Fees are NOT USED when `type=indicative_prices`. + +
    details object[]
  • Array [
  • ]
+ +Unprocessable Entity. This status should be returned when the anchor understood the request but cannot +return a success response. +In these cases, the Platform will respond to the client application's request with a `400 Bad Request` +and include the error message provided by the anchor in the response body. + + +
Schema
+ +Error. The Platform will respond to the client application with the same response code and body. + +
Schema
+ \ No newline at end of file diff --git a/ap_api/callbacks/get-customer.api.mdx b/ap_api/callbacks/get-customer.api.mdx new file mode 100644 index 000000000..a772c7e11 --- /dev/null +++ b/ap_api/callbacks/get-customer.api.mdx @@ -0,0 +1,60 @@ +--- +id: get-customer +title: "Retrieve Customer's Info" +description: "The request and response for this endpoint is identical to the" +sidebar_label: "Retrieve Customer's Info" +hide_title: true +hide_table_of_contents: true +api: {"description":"The request and response for this endpoint is identical to the \n[`GET /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get) \nrequest and response defined in SEP-12.\n\nThis endpoint allows clients to:\n\n 1. Fetch the fields the server requires in order to register a new customer via a SEP-12 `PUT /customer` request\n\nIf the server does not have a customer registered for the parameters sent in the request, it should return the \nfields required in the response. The same response should be returned when no parameters are sent.\n\n 2. Check the status of a customer that may already be registered\n\nThis allows clients to check whether the customers information was accepted, rejected, or still needs more info. \nIf the server still needs more info, or the server needs updated information, it should return the fields required.\n","tags":["Customers"],"operationId":"getCustomer","parameters":[{"in":"query","name":"id","description":"The ID of the customer as returned in the response of a previous PUT request.","schema":{"type":"string"}},{"in":"query","name":"account","description":"The Stellar or Muxed Account authenticated with the Platform via SEP-10.","schema":{"type":"string"}},{"in":"query","name":"memo","description":"The memo value identifying a customer with a shared account, where the shared account is `account`.","schema":{"type":"string"}},{"in":"query","name":"memo_type","description":"The type of memo used to identify a customer with a shared account.","schema":{"type":"string","enum":["id","hash","text"]}},{"in":"query","name":"type","description":"The type of action the customer is being KYCd for. See the \n[Type Specification](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#type-specification)\ndocumented in SEP-12.\n","schema":{"type":"string"}},{"in":"query","name":"lang","description":"Defaults to `en`. Language code specified using ISO 639-1. Human readable descriptions, choices, and \nmessages should be in this language.\n","schema":{"type":"string"}}],"responses":{"200":{"description":"Valid request. Customer either already exists or the customer identified by the parameters is new and must \nprovide the field values described in the repsonse body. Response bodies are identical to the schema defined \nin SEP-12.\n"},"400":{"description":"Error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"404":{"description":"Not Found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/customer","info":{"version":"2.0.0","description":"The Synchronous Callbacks API specification for the Stellar Anchor Platform project.\n\nThe Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The \nanchor's responses to these requests affect the Platform responses to the client application.\n","title":"Synchronous Callbacks API"},"postman":{"name":"Retrieve Customer's Info","description":{"content":"The request and response for this endpoint is identical to the \n[`GET /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get) \nrequest and response defined in SEP-12.\n\nThis endpoint allows clients to:\n\n 1. Fetch the fields the server requires in order to register a new customer via a SEP-12 `PUT /customer` request\n\nIf the server does not have a customer registered for the parameters sent in the request, it should return the \nfields required in the response. The same response should be returned when no parameters are sent.\n\n 2. Check the status of a customer that may already be registered\n\nThis allows clients to check whether the customers information was accepted, rejected, or still needs more info. \nIf the server still needs more info, or the server needs updated information, it should return the fields required.\n","type":"text/plain"},"url":{"path":["customer"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The ID of the customer as returned in the response of a previous PUT request.","type":"text/plain"},"key":"id","value":""},{"disabled":false,"description":{"content":"The Stellar or Muxed Account authenticated with the Platform via SEP-10.","type":"text/plain"},"key":"account","value":""},{"disabled":false,"description":{"content":"The memo value identifying a customer with a shared account, where the shared account is `account`.","type":"text/plain"},"key":"memo","value":""},{"disabled":false,"description":{"content":"The type of memo used to identify a customer with a shared account.","type":"text/plain"},"key":"memo_type","value":""},{"disabled":false,"description":{"content":"The type of action the customer is being KYCd for. See the \n[Type Specification](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#type-specification)\ndocumented in SEP-12.\n","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"Defaults to `en`. Language code specified using ISO 639-1. Human readable descriptions, choices, and \nmessages should be in this language.\n","type":"text/plain"},"key":"lang","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" +info_path: api/callbacks/synchronous-callbacks-api +custom_edit_url: null +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Retrieve Customer's Info + + + +The request and response for this endpoint is identical to the +[`GET /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get) +request and response defined in SEP-12. + +This endpoint allows clients to: + + 1. Fetch the fields the server requires in order to register a new customer via a SEP-12 `PUT /customer` request + +If the server does not have a customer registered for the parameters sent in the request, it should return the +fields required in the response. The same response should be returned when no parameters are sent. + + 2. Check the status of a customer that may already be registered + +This allows clients to check whether the customers information was accepted, rejected, or still needs more info. +If the server still needs more info, or the server needs updated information, it should return the fields required. + + +
Query Parameters
+ +Valid request. Customer either already exists or the customer identified by the parameters is new and must +provide the field values described in the repsonse body. Response bodies are identical to the schema defined +in SEP-12. + + +
+ +Error. + +
Schema
+ +Not Found. + +
Schema
+ \ No newline at end of file diff --git a/ap_api/callbacks/get-fee.api.mdx b/ap_api/callbacks/get-fee.api.mdx new file mode 100644 index 000000000..370b74da0 --- /dev/null +++ b/ap_api/callbacks/get-fee.api.mdx @@ -0,0 +1,57 @@ +--- +id: get-fee +title: "Retrieve Fees" +description: "The Platform will make this request to the anchor every time a transaction is initiated by a client application" +sidebar_label: "Retrieve Fees" +hide_title: true +hide_table_of_contents: true +api: {"description":"The Platform will make this request to the anchor every time a transaction is initiated by a client application\nwithout a `quote_id`.\n\nThe Anchor must ensure that the sending and receiving customers specified in the request meet the KYC requirements\nnecessary to partake in the transaction described in the request.\n\nThe anchor must return the fee it will charge for the transaction.\n\nIn the future, this endpoint may be used to provide estimated fees to client applications prior to initiating transactions.\nWhen this change is made, the request schema will be adapted to support the use case.\n","tags":["Fees"],"operationId":"getFee","parameters":[{"in":"query","name":"send_asset","description":"The asset the client application will send to the anchor in exchange for `receive_asset` in \n[Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format).\n","schema":{"type":"string"},"required":true},{"in":"query","name":"receive_asset","description":"The asset the that the anchor will send in exchange for `send_asset` in \n[Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format).\n","schema":{"type":"string"},"required":true},{"in":"query","name":"send_amount","description":"The amount of `send_asset` the client application will send in exchange for `receive_asset`. One of `send_amount` \nor `receive_amount` will always be included in the request. If the client application specified a `quote_id` in \nits transaction creation request, both amounts specified in the referenced quote will be passed.\n","schema":{"type":"string"}},{"in":"query","name":"receive_amount","description":"The amount of `receive_asset` the anchor will send in exchange for `send_asset`. One of `send_amount` or \n`receive_amount` will always be included in the request. If the client application specified a `quote_id` in its \ntransaction creation request, both amounts specified in the referenced quote will be passed.\n","schema":{"type":"string"}},{"in":"query","name":"client_id","description":"An identifier for the client application making the request. This ID can be used to offer different fees to different clients.\nA client ID can be one of the following:\n1. the `client_domain`: In SEP-24, if the transaction is initiated from a non-custodial wallet, the `client_id` must match the `client_domain` if wallet attribution is required. \n2. the Stellar custodial/omnibus account: In SEP-24, if the transaction is initiated from a custodian, such as Wyre, the `client_id` should match a known pooled/omnibus account configured in the [`omnibusAccountList`] of the YAML file](https://github.com/stellar/java-stellar-anchor-sdk/blob/main/platform/src/main/resources/anchor-config-defaults.yaml). \n3. The Stellar account of a sending anchor: In SEP-31, the `client_id` should match the account of a known SEP-31 sending anchor match the one used to authenticate via SEP-10.\n","schema":{"type":"string"},"required":true},{"in":"query","name":"sender_id","description":"The SEP-12 customer ID of the sending user.\n","schema":{"type":"string"},"required":true},{"in":"query","name":"receiver_id","description":"The SEP-12 customer ID of the receiving user.\n","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}},"title":"FeeResponse"}}}},"422":{"description":"Unprocessable Entity. This status should be returned when the anchor understood the request but cannot \nreturn a success response. An example for when this response code would be appropriate is if the sender \nand/or receiver is not permitted to initiate a transaction with the specified amounts. In these cases, \nthe Platform will respond to the client application's request with a `400 Bad Request` and include the \nerror message provided by the anchor in the response body.\n","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"500":{"description":"Error. The Platform will respond to the client application with the same response code and body.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/fee","info":{"version":"2.0.0","description":"The Synchronous Callbacks API specification for the Stellar Anchor Platform project.\n\nThe Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The \nanchor's responses to these requests affect the Platform responses to the client application.\n","title":"Synchronous Callbacks API"},"postman":{"name":"Retrieve Fees","description":{"content":"The Platform will make this request to the anchor every time a transaction is initiated by a client application\nwithout a `quote_id`.\n\nThe Anchor must ensure that the sending and receiving customers specified in the request meet the KYC requirements\nnecessary to partake in the transaction described in the request.\n\nThe anchor must return the fee it will charge for the transaction.\n\nIn the future, this endpoint may be used to provide estimated fees to client applications prior to initiating transactions.\nWhen this change is made, the request schema will be adapted to support the use case.\n","type":"text/plain"},"url":{"path":["fee"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The asset the client application will send to the anchor in exchange for `receive_asset` in \n[Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format).\n","type":"text/plain"},"key":"send_asset","value":""},{"disabled":false,"description":{"content":"(Required) The asset the that the anchor will send in exchange for `send_asset` in \n[Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format).\n","type":"text/plain"},"key":"receive_asset","value":""},{"disabled":false,"description":{"content":"The amount of `send_asset` the client application will send in exchange for `receive_asset`. One of `send_amount` \nor `receive_amount` will always be included in the request. If the client application specified a `quote_id` in \nits transaction creation request, both amounts specified in the referenced quote will be passed.\n","type":"text/plain"},"key":"send_amount","value":""},{"disabled":false,"description":{"content":"The amount of `receive_asset` the anchor will send in exchange for `send_asset`. One of `send_amount` or \n`receive_amount` will always be included in the request. If the client application specified a `quote_id` in its \ntransaction creation request, both amounts specified in the referenced quote will be passed.\n","type":"text/plain"},"key":"receive_amount","value":""},{"disabled":false,"description":{"content":"(Required) An identifier for the client application making the request. This ID can be used to offer different fees to different clients.\nA client ID can be one of the following:\n1. the `client_domain`: In SEP-24, if the transaction is initiated from a non-custodial wallet, the `client_id` must match the `client_domain` if wallet attribution is required. \n2. the Stellar custodial/omnibus account: In SEP-24, if the transaction is initiated from a custodian, such as Wyre, the `client_id` should match a known pooled/omnibus account configured in the [`omnibusAccountList`] of the YAML file](https://github.com/stellar/java-stellar-anchor-sdk/blob/main/platform/src/main/resources/anchor-config-defaults.yaml). \n3. The Stellar account of a sending anchor: In SEP-31, the `client_id` should match the account of a known SEP-31 sending anchor match the one used to authenticate via SEP-10.\n","type":"text/plain"},"key":"client_id","value":""},{"disabled":false,"description":{"content":"(Required) The SEP-12 customer ID of the sending user.\n","type":"text/plain"},"key":"sender_id","value":""},{"disabled":false,"description":{"content":"(Required) The SEP-12 customer ID of the receiving user.\n","type":"text/plain"},"key":"receiver_id","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" +info_path: api/callbacks/synchronous-callbacks-api +custom_edit_url: null +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Retrieve Fees + + + +The Platform will make this request to the anchor every time a transaction is initiated by a client application +without a `quote_id`. + +The Anchor must ensure that the sending and receiving customers specified in the request meet the KYC requirements +necessary to partake in the transaction described in the request. + +The anchor must return the fee it will charge for the transaction. + +In the future, this endpoint may be used to provide estimated fees to client applications prior to initiating transactions. +When this change is made, the request schema will be adapted to support the use case. + + +
Query Parameters
+ +Success. + +
Schema
    fee object
+ +Unprocessable Entity. This status should be returned when the anchor understood the request but cannot +return a success response. An example for when this response code would be appropriate is if the sender +and/or receiver is not permitted to initiate a transaction with the specified amounts. In these cases, +the Platform will respond to the client application's request with a `400 Bad Request` and include the +error message provided by the anchor in the response body. + + +
Schema
+ +Error. The Platform will respond to the client application with the same response code and body. + +
Schema
+ \ No newline at end of file diff --git a/ap_api/callbacks/put-customer-callback.api.mdx b/ap_api/callbacks/put-customer-callback.api.mdx new file mode 100644 index 000000000..6e4ed2910 --- /dev/null +++ b/ap_api/callbacks/put-customer-callback.api.mdx @@ -0,0 +1,55 @@ +--- +id: put-customer-callback +title: "Create or Update Callback Url" +description: "The request for this endpoint is identical to the `PUT /customer/callback` request defined in SEP-12." +sidebar_label: "Create or Update Callback Url" +hide_title: true +hide_table_of_contents: true +api: {"tags":["Customers"],"description":"The request for this endpoint is identical to the `PUT /customer/callback` request defined in SEP-12.\n\nAllows the wallet to provide a callback URL to the anchor. The provided callback URL will replace (and supercede)\nany previously-set callback URL for this customer.\n\nWhenever the customer's `status` changes, the anchor must make a POST request to the callback URL. The payload \nof the POST request will be the same as the response of SEP-12's `GET /customer`. **The Anchor Platform does not \nmake these callback requests to clients**.\n\nIt's the wallet's responsibility to send a working callback URL to the anchor.\n\nAnchors will make POST requests until the customer's status changes to ACCEPTED or REJECTED. If a wallet needs \nto watch a user's KYC status after that, it will need to set a callback again.\n","operationId":"putCustomerCallback","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"The ID of the customer as returned in the response of a previous PUT request.","type":"string"},"account":{"description":"The Stellar or Muxed Account authenticated with the Platform via SEP-10.","type":"string"},"memo":{"description":"The memo value identifying a customer with a shared account, where the shared account is `account`.","type":"string"},"memo_type":{"description":"The type of memo used to identify a customer with a shared account.","type":"string","enum":["id","hash","text"]},"url":{"description":"A callback URL that the SEP-12 server will POST to when the status of the customer changes.","type":"string"}},"title":"PutCustomerCallbackRequest"}}}},"responses":{"204":{"description":"Success"},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"404":{"description":"Customer not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"put","path":"/customer/callback","jsonRequestBodyExample":{"id":"string","account":"string","memo":"string","memo_type":"id","url":"string"},"info":{"version":"2.0.0","description":"The Synchronous Callbacks API specification for the Stellar Anchor Platform project.\n\nThe Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The \nanchor's responses to these requests affect the Platform responses to the client application.\n","title":"Synchronous Callbacks API"},"postman":{"name":"Create or Update Callback Url","description":{"content":"The request for this endpoint is identical to the `PUT /customer/callback` request defined in SEP-12.\n\nAllows the wallet to provide a callback URL to the anchor. The provided callback URL will replace (and supercede)\nany previously-set callback URL for this customer.\n\nWhenever the customer's `status` changes, the anchor must make a POST request to the callback URL. The payload \nof the POST request will be the same as the response of SEP-12's `GET /customer`. **The Anchor Platform does not \nmake these callback requests to clients**.\n\nIt's the wallet's responsibility to send a working callback URL to the anchor.\n\nAnchors will make POST requests until the customer's status changes to ACCEPTED or REJECTED. If a wallet needs \nto watch a user's KYC status after that, it will need to set a callback again.\n","type":"text/plain"},"url":{"path":["customer","callback"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "put api-method" +info_path: api/callbacks/synchronous-callbacks-api +custom_edit_url: null +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Create or Update Callback Url + + + +The request for this endpoint is identical to the `PUT /customer/callback` request defined in SEP-12. + +Allows the wallet to provide a callback URL to the anchor. The provided callback URL will replace (and supercede) +any previously-set callback URL for this customer. + +Whenever the customer's `status` changes, the anchor must make a POST request to the callback URL. The payload +of the POST request will be the same as the response of SEP-12's `GET /customer`. **The Anchor Platform does not +make these callback requests to clients**. + +It's the wallet's responsibility to send a working callback URL to the anchor. + +Anchors will make POST requests until the customer's status changes to ACCEPTED or REJECTED. If a wallet needs +to watch a user's KYC status after that, it will need to set a callback again. + + +
Request Body
+ +Success + +
+ +Invalid request. + +
Schema
+ +Customer not found. + +
Schema
+ \ No newline at end of file diff --git a/ap_api/callbacks/put-customer.api.mdx b/ap_api/callbacks/put-customer.api.mdx new file mode 100644 index 000000000..a43687047 --- /dev/null +++ b/ap_api/callbacks/put-customer.api.mdx @@ -0,0 +1,48 @@ +--- +id: put-customer +title: "Create or Update Customer info" +description: "**The Anchor Platform does not persist any customer KYC data.**" +sidebar_label: "Create or Update Customer info" +hide_title: true +hide_table_of_contents: true +api: {"tags":["Customers"],"description":"**The Anchor Platform does not persist any customer KYC data.**\n\nThe request and response for this endpoint are identical to the `PUT /customer` request and response defined in SEP-12.\n\nClient applications make requests with the following request body, which is forwarded to the anchor. Anchors \nmust validate and persist the data passed, and return the customer's `id`.\n","operationId":"putCustomer","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"The ID of the customer as returned in the response of a previous PUT request.","type":"string"},"account":{"description":"The Stellar or Muxed Account authenticated with the Platform via SEP-10.","type":"string"},"memo":{"description":"The memo value identifying a customer with a shared account, where the shared account is `account`.","type":"string"},"memo_type":{"description":"The type of memo used to identify a customer with a shared account.","type":"string","enum":["id","hash","text"]},"type":{"description":"The type of action the customer is being KYCd for. See the \n[Type Specification](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#type-specification) \ndocumented in SEP-12.\n","type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"additional_name":{"type":"string"},"address_country_code":{"type":"string"},"state_or_province":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"address":{"type":"string"},"mobile_number":{"type":"string"},"email_address":{"type":"string"},"birth_date":{"type":"string","format":"date"},"birth_place":{"type":"string"},"birth_country_code":{"type":"string"},"bank_account_number":{"type":"string"},"bank_account_type":{"type":"string"},"bank_number":{"type":"string"},"bank_phone_number":{"type":"string"},"bank_branch_number":{"type":"string"},"tax_id":{"type":"string"},"tax_id_name":{"type":"string"},"occupation":{"type":"string"},"employer_name":{"type":"string"},"employer_address":{"type":"string"},"language_code":{"type":"string"},"id_type":{"type":"string"},"id_country_code":{"type":"string"},"id_issue_date":{"type":"string","format":"date"},"id_expiration_date":{"type":"string","format":"date"},"id_number":{"type":"string"},"ip_address":{"type":"string"},"sex":{"type":"string"}},"title":"PutCustomerRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"title":"PutCustomerResponse"}}}},"400":{"description":"Invalid data.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"404":{"description":"Not Found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"put","path":"/customer","jsonRequestBodyExample":{"id":"string","account":"string","memo":"string","memo_type":"id","type":"string","first_name":"string","last_name":"string","additional_name":"string","address_country_code":"string","state_or_province":"string","city":"string","postal_code":"string","address":"string","mobile_number":"string","email_address":"string","birth_date":"2023-04-21","birth_place":"string","birth_country_code":"string","bank_account_number":"string","bank_account_type":"string","bank_number":"string","bank_phone_number":"string","bank_branch_number":"string","tax_id":"string","tax_id_name":"string","occupation":"string","employer_name":"string","employer_address":"string","language_code":"string","id_type":"string","id_country_code":"string","id_issue_date":"2023-04-21","id_expiration_date":"2023-04-21","id_number":"string","ip_address":"string","sex":"string"},"info":{"version":"2.0.0","description":"The Synchronous Callbacks API specification for the Stellar Anchor Platform project.\n\nThe Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The \nanchor's responses to these requests affect the Platform responses to the client application.\n","title":"Synchronous Callbacks API"},"postman":{"name":"Create or Update Customer info","description":{"content":"**The Anchor Platform does not persist any customer KYC data.**\n\nThe request and response for this endpoint are identical to the `PUT /customer` request and response defined in SEP-12.\n\nClient applications make requests with the following request body, which is forwarded to the anchor. Anchors \nmust validate and persist the data passed, and return the customer's `id`.\n","type":"text/plain"},"url":{"path":["customer"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "put api-method" +info_path: api/callbacks/synchronous-callbacks-api +custom_edit_url: null +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Create or Update Customer info + + + +**The Anchor Platform does not persist any customer KYC data.** + +The request and response for this endpoint are identical to the `PUT /customer` request and response defined in SEP-12. + +Client applications make requests with the following request body, which is forwarded to the anchor. Anchors +must validate and persist the data passed, and return the customer's `id`. + + +
Request Body
+ +Success. + +
Schema
+ +Invalid data. + +
Schema
+ +Not Found. + +
Schema
+ \ No newline at end of file diff --git a/ap_api/callbacks/rate/index.mdx b/ap_api/callbacks/rate/index.mdx new file mode 100644 index 000000000..4bf15259e --- /dev/null +++ b/ap_api/callbacks/rate/index.mdx @@ -0,0 +1,17 @@ +--- +title: Rates +order: 0 +--- + +import {EndpointsTable} from "@site/src/components/EndpointsTable"; + + + +| | | +| --- | --------------------- | +| GET | [/fee](../get-fee.api.mdx) | + + + + +[sep-38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md \ No newline at end of file diff --git a/ap_api/callbacks/sidebar.js b/ap_api/callbacks/sidebar.js new file mode 100644 index 000000000..8b576c24f --- /dev/null +++ b/ap_api/callbacks/sidebar.js @@ -0,0 +1 @@ +module.exports = [{"type":"doc","id":"callbacks/synchronous-callbacks-api"},{"type":"category","label":"Unique Address","link":{"type":"generated-index","title":"Unique Address","slug":"/category/callbacks/unique-address"},"items":[{"type":"doc","id":"callbacks/gen-address","label":"Generate Unique Address","className":"api-method get"}]},{"type":"category","label":"Fees","link":{"type":"generated-index","title":"Fees","slug":"/category/callbacks/fees"},"items":[{"type":"doc","id":"callbacks/get-fee","label":"Retrieve Fees","className":"api-method get"}]},{"type":"category","label":"Rates","link":{"type":"generated-index","title":"Rates","slug":"/category/callbacks/rates"},"items":[{"type":"doc","id":"callbacks/gen-rates","label":"Retrieve Rates","className":"api-method get"}]},{"type":"category","label":"Customers","link":{"type":"generated-index","title":"Customers","slug":"/category/callbacks/customers"},"items":[{"type":"doc","id":"callbacks/get-customer","label":"Retrieve Customer's Info","className":"api-method get"},{"type":"doc","id":"callbacks/put-customer","label":"Create or Update Customer info","className":"api-method put"},{"type":"doc","id":"callbacks/put-customer-callback","label":"Create or Update Callback Url","className":"api-method put"},{"type":"doc","id":"callbacks/del-customer","label":"Delete Customer Data","className":"api-method delete"}]}]; \ No newline at end of file diff --git a/ap_api/callbacks/unique-address/index.mdx b/ap_api/callbacks/unique-address/index.mdx new file mode 100644 index 000000000..93fea4ff1 --- /dev/null +++ b/ap_api/callbacks/unique-address/index.mdx @@ -0,0 +1,17 @@ +--- +title: Unique Address +order: 0 +--- + +import {EndpointsTable} from "@site/src/components/EndpointsTable"; + + + +| | | +| --- | --------------------- | +| GET | [/unique_address](../gen-address.api.mdx) | + + + + +[sep-38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md \ No newline at end of file diff --git a/ap_api/resources/get-quote.api.mdx b/ap_api/resources/get-quote.api.mdx index f6d20cd54..90656a1b2 100644 --- a/ap_api/resources/get-quote.api.mdx +++ b/ap_api/resources/get-quote.api.mdx @@ -39,7 +39,7 @@ For a SEP-12 customer, the `id` field should be sufficient to fully identify the For a SEP-31 Sending Anchor, the `account` field should be used. -
+
Not Found. diff --git a/ap_api/resources/get-quotes.api.mdx b/ap_api/resources/get-quotes.api.mdx index 62f2a5a0a..5fdc5f163 100644 --- a/ap_api/resources/get-quotes.api.mdx +++ b/ap_api/resources/get-quotes.api.mdx @@ -39,7 +39,7 @@ For a SEP-12 customer, the `id` field should be sufficient to fully identify the For a SEP-31 Sending Anchor, the `account` field should be used. -
  • ]
  • +
  • ]
  • Bad Request diff --git a/ap_api/resources/get-transaction.api.mdx b/ap_api/resources/get-transaction.api.mdx index 1efa249b5..b45d4f457 100644 --- a/ap_api/resources/get-transaction.api.mdx +++ b/ap_api/resources/get-transaction.api.mdx @@ -63,7 +63,7 @@ For a SEP-12 customer, the `id` field should be sufficient to fully identify the For a SEP-31 Sending Anchor, the `account` field should be used. -
    +
    Bad Request diff --git a/ap_api/resources/patch-transactions.api.mdx b/ap_api/resources/patch-transactions.api.mdx index 9efb86efc..b8a9dfa21 100644 --- a/ap_api/resources/patch-transactions.api.mdx +++ b/ap_api/resources/patch-transactions.api.mdx @@ -5,7 +5,7 @@ description: "Accepts one or more objects containing updated information on tran sidebar_label: "Accept updated information on transactions" hide_title: true hide_table_of_contents: true -api: {"tags":["Transactions"],"operationId":"patchTransactions","description":"Accepts one or more objects containing updated information on transactions. Note that requests containing invalid data for any transaction will result in a 400 Bad Request and no transactions will be updated. Importantly, this operation is NOT atomic. If one update fails, all previous updates would be applied, all subsequent updates would be discarded, and an error would be raised. Note that this endpoint accepts a subset of transaction information defined in the `MutableTransaction` schema.","responses":{"200":{"description":"Transaction(s) updated.","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24","31","38"]},"kind":{"type":"string","enum":["deposit","withdrawal","receive"]},"status":{"type":"string","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"]},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"kyc_verified":{"type":"boolean"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"custodial_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"}}},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"}},"title":"MutableTransaction"}}}}}}},"400":{"description":"Invalid request body. The error returned pertains to the transaction first determined to be invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string","description":"The `id` of the transaction first determined to be invalid."}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"transaction":{"type":"object","properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24","31","38"]},"kind":{"type":"string","enum":["deposit","withdrawal","receive"]},"status":{"type":"string","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"]},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"kyc_verified":{"type":"boolean"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"custodial_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"}}},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"}},"title":"MutableTransaction"}},"title":"PatchTransactionRequest"}}}}}}},"method":"patch","path":"/transactions","jsonRequestBodyExample":{"records":[{"transaction":{"id":"string","sep":"24","kind":"deposit","status":"incomplete","amount_expected":{"amount":"string","asset":"string"},"amount_in":{"amount":"string","asset":"string"},"amount_out":{"amount":"string","asset":"string"},"amount_fee":{"amount":"string","asset":"string"},"kyc_verified":true,"quote_id":"string","started_at":"2023-03-29T17:10:07.532Z","updated_at":"2023-03-29T17:10:07.532Z","completed_at":"2023-03-29T17:10:07.532Z","transfer_received_at":"2023-03-29T17:10:07.532Z","message":"string","refunds":{"amount_refunded":{"amount":"string","asset":"string"},"amount_fee":{"amount":"string","asset":"string"},"payments":[{"id":"string","id_type":"stellar","amount":{"amount":"string","asset":"string"},"fee":{"amount":"string","asset":"string"},"requested_at":"2023-03-29T17:10:07.532Z","refunded_at":"2023-03-29T17:10:07.532Z"}]},"stellar_transactions":[{"id":"string","memo":"string","memo_type":"text","created_at":"2023-03-29T17:10:07.532Z","envelope":"string","payments":[{"id":"string","payment_type":"payment","source_account":"string","destination_account":"string","amount":{"amount":"string","asset":"string"}}]}],"source_account":"string","destination_account":"string","external_transaction_id":"string","custodial_transaction_id":"string","memo":"string","memo_type":"string","customers":{"sender":{"id":"string","account":"string"},"receiver":{"id":"string","account":"string"}},"creator":{"id":"string","account":"string"}}}]},"info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"Accept updated information on transactions","description":{"content":"Accepts one or more objects containing updated information on transactions. Note that requests containing invalid data for any transaction will result in a 400 Bad Request and no transactions will be updated. Importantly, this operation is NOT atomic. If one update fails, all previous updates would be applied, all subsequent updates would be discarded, and an error would be raised. Note that this endpoint accepts a subset of transaction information defined in the `MutableTransaction` schema.","type":"text/plain"},"url":{"path":["transactions"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"tags":["Transactions"],"operationId":"patchTransactions","description":"Accepts one or more objects containing updated information on transactions. Note that requests containing invalid data for any transaction will result in a 400 Bad Request and no transactions will be updated. Importantly, this operation is NOT atomic. If one update fails, all previous updates would be applied, all subsequent updates would be discarded, and an error would be raised. Note that this endpoint accepts a subset of transaction information defined in the `MutableTransaction` schema.","responses":{"200":{"description":"Transaction(s) updated.","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24","31","38"]},"kind":{"type":"string","enum":["deposit","withdrawal","receive"]},"status":{"type":"string","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"]},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"kyc_verified":{"type":"boolean"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"custodial_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"}}},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"}},"title":"MutableTransaction"}}}}}}},"400":{"description":"Invalid request body. The error returned pertains to the transaction first determined to be invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string","description":"The `id` of the transaction first determined to be invalid."}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"transaction":{"type":"object","properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24","31","38"]},"kind":{"type":"string","enum":["deposit","withdrawal","receive"]},"status":{"type":"string","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"]},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"kyc_verified":{"type":"boolean"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"custodial_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"}}},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` field should be used.\n","properties":{"id":{"type":"string","description":"The `id` of the customer registered through SEP-12."},"account":{"type":"string","description":"Either the Stellar account or Muxed account address of the on-chain entity."}},"title":"StellarId"}},"title":"MutableTransaction"}},"title":"PatchTransactionRequest"}}}}}}},"method":"patch","path":"/transactions","jsonRequestBodyExample":{"records":[{"transaction":{"id":"string","sep":"24","kind":"deposit","status":"incomplete","amount_expected":{"amount":"string","asset":"string"},"amount_in":{"amount":"string","asset":"string"},"amount_out":{"amount":"string","asset":"string"},"amount_fee":{"amount":"string","asset":"string"},"kyc_verified":true,"quote_id":"string","started_at":"2023-04-21T19:52:21.470Z","updated_at":"2023-04-21T19:52:21.470Z","completed_at":"2023-04-21T19:52:21.470Z","transfer_received_at":"2023-04-21T19:52:21.470Z","message":"string","refunds":{"amount_refunded":{"amount":"string","asset":"string"},"amount_fee":{"amount":"string","asset":"string"},"payments":[{"id":"string","id_type":"stellar","amount":{"amount":"string","asset":"string"},"fee":{"amount":"string","asset":"string"},"requested_at":"2023-04-21T19:52:21.470Z","refunded_at":"2023-04-21T19:52:21.470Z"}]},"stellar_transactions":[{"id":"string","memo":"string","memo_type":"text","created_at":"2023-04-21T19:52:21.470Z","envelope":"string","payments":[{"id":"string","payment_type":"payment","source_account":"string","destination_account":"string","amount":{"amount":"string","asset":"string"}}]}],"source_account":"string","destination_account":"string","external_transaction_id":"string","custodial_transaction_id":"string","memo":"string","memo_type":"string","customers":{"sender":{"id":"string","account":"string"},"receiver":{"id":"string","account":"string"}},"creator":{"id":"string","account":"string"}}}]},"info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"Accept updated information on transactions","description":{"content":"Accepts one or more objects containing updated information on transactions. Note that requests containing invalid data for any transaction will result in a 400 Bad Request and no transactions will be updated. Importantly, this operation is NOT atomic. If one update fails, all previous updates would be applied, all subsequent updates would be discarded, and an error would be raised. Note that this endpoint accepts a subset of transaction information defined in the `MutableTransaction` schema.","type":"text/plain"},"url":{"path":["transactions"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: api/resources/platform-api custom_edit_url: null @@ -96,7 +96,7 @@ For a SEP-12 customer, the `id` field should be sufficient to fully identify the For a SEP-31 Sending Anchor, the `account` field should be used. -
  • ]
  • +
  • ]
  • Invalid request body. The error returned pertains to the transaction first determined to be invalid. diff --git a/api/resources/get-effects-by-account-id.api.mdx b/api/resources/get-effects-by-account-id.api.mdx index 849064ca7..6cbb7fe5d 100644 --- a/api/resources/get-effects-by-account-id.api.mdx +++ b/api/resources/get-effects-by-account-id.api.mdx @@ -5,7 +5,7 @@ description: "This endpoint returns the effects of a specific account and can be sidebar_label: "Retrieve an Account's Effects" hide_title: true hide_table_of_contents: true -api: {"tags":["Accounts"],"description":"This endpoint returns the effects of a specific account and can be used in streaming mode. Streaming mode allows you to listen for new effects for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time.","operationId":"GetEffectsByAccountId","parameters":[{"name":"account_id","in":"path","required":true,"description":"This account’s public key encoded in a base32 string representation.","schema":{"type":"string","example":"GDMQQNJM4UL7QIA66P7R2PZHMQINWZBM77BEBMHLFXD5JEUAHGJ7R4JZ"}},{"name":"cursor","in":"query","required":false,"description":"A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.","schema":{"type":"integer","example":6606617478959105}},{"name":"order","in":"query","required":false,"description":"A designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc.","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","required":false,"description":"The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.","schema":{"type":"integer","example":10}}],"x-supports-streaming":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"next":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"prev":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}}}},"title":"Links"},{"oneOf":[{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"transaction":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"effects":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"succeeds":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"precedes":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}},"required":["self","transaction","effects","succeeds","precedes"]},"id":{"type":"string","title":"id"},"paging_token":{"type":"string"},"transaction_successful":{"type":"boolean"},"source_account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"type":{"type":"string","example":"create_account"},"type_i":{"type":"number","example":0},"created_at":{"type":"string"},"transaction_hash":{"type":"string"},"starting_balance":{"type":"string"},"funder":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}},"required":["id","paging_token","transaction_successful","source_account","type","type_i","created_at","transaction_hash","starting_balance","funder","account"],"title":"CreateAccount"},{"type":"object","properties":{"_embedded":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"transaction":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"effects":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"succeeds":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"precedes":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}},"required":["self","transaction","effects","succeeds","precedes"]},"id":{"type":"string","title":"id"},"paging_token":{"type":"string"},"transaction_successful":{"type":"boolean"},"source_account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"type":{"type":"string","example":"payment"},"type_i":{"type":"string"},"created_at":{"type":"string"},"transaction_hash":{"type":"string"},"asset_type":{"type":"string"},"asset_code":{"enum":["native","credit_alphanum4","credit_alphanum12"]},"asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"from":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"to":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"amount":{"type":"string"}},"required":["id","paging_token","transaction_successful","source_account","type","type_i","created_at","transaction_hash","asset_type","from","to","amount"]}}}}},"title":"Payment"},{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"transaction":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"effects":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"succeeds":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"precedes":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}},"required":["self","transaction","effects","succeeds","precedes"]},"id":{"type":"string","title":"id"},"paging_token":{"type":"string"},"transaction_successful":{"type":"boolean"},"source_account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"type":{"type":"string","example":"path_payment_strict_receive"},"type_i":{"type":"number","example":2},"created_at":{"type":"string"},"transaction_hash":{"type":"string"},"asset_type":{"type":"string","enum":["native","credit_alphanum4","credit_alphanum12"]},"asset_code":{"type":"string"},"asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"from":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"to":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"amount":{"type":"string"},"path":{"type":"array","items":{"type":"object","properties":{"asset_type":{"type":"string","enum":["native","credit_alphanum4","credit_alphanum12"]},"asset_code":{"type":"string"},"asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}}}},"source_amount":{"type":"string"},"destination_min":{"type":"string"},"source_asset_type":{"type":"string"},"source_asset_code":{"type":"string"},"source_asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}},"required":["id","paging_token","transaction_successful","source_account","type","type_i","created_at","transaction_hash","from","to","amount","path","source_amount","destination_min"],"title":"PathPaymentStrictReceive"},{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"transaction":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"effects":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"succeeds":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"precedes":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}},"required":["self","transaction","effects","succeeds","precedes"]},"id":{"type":"string","title":"id"},"paging_token":{"type":"string"},"transaction_successful":{"type":"boolean"},"source_account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"type":{"type":"string","example":"path_payment_strict_send"},"type_i":{"type":"number","example":13},"created_at":{"type":"string"},"transaction_hash":{"type":"string"},"asset_type":{"type":"string","enum":["native","credit_alphanum4","credit_alphanum12"]},"asset_code":{"type":"string"},"asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"from":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"to":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"amount":{"type":"string"},"path":{"type":"array","items":{"type":"object","properties":{"asset_type":{"type":"string","enum":["native","credit_alphanum4","credit_alphanum12"]},"asset_code":{"type":"string"},"asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}}}},"source_amount":{"type":"string"},"source_max":{"type":"string"},"source_asset_type":{"type":"string"},"source_asset_code":{"type":"string"},"source_asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}},"required":["id","paging_token","transaction_successful","source_account","type","type_i","created_at","transaction_hash","from","to","amount","path","source_amount","source_asset_type"],"title":"PathPaymentStrictSend"},{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"transaction":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"effects":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"succeeds":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"precedes":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}},"required":["self","transaction","effects","succeeds","precedes"]},"id":{"type":"string","title":"id"},"paging_token":{"type":"string"},"transaction_successful":{"type":"boolean"},"source_account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"type":{"type":"string","example":"account_merge"},"type_i":{"type":"number","example":8},"created_at":{"type":"string"},"transaction_hash":{"type":"string"},"account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"into":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}},"required":["id","paging_token","transaction_successful","source_account","type","type_i","created_at","transaction_hash","account","into"],"title":"AccountMerge"}]}]},"examples":{"RetrieveAnAccountsEffects":{"value":{"_links":{"self":{"href":"https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=&limit=10&order=asc"},"next":{"href":"https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=147350483860869151-1&limit=10&order=asc"},"prev":{"href":"https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=110694007436259329-1&limit=10&order=desc"}},"_embedded":{"records":[{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/110694007436259329"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=110694007436259329-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=110694007436259329-1"}},"id":"0110694007436259329-0000000001","paging_token":"110694007436259329-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_created","type_i":0,"created_at":"2019-09-11T13:16:44Z","starting_balance":"1.0000000"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/110694007436259329"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=110694007436259329-3"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=110694007436259329-3"}},"id":"0110694007436259329-0000000003","paging_token":"110694007436259329-3","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"signer_created","type_i":10,"created_at":"2019-09-11T13:16:44Z","weight":1,"public_key":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","key":""},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/110694007436259330"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=110694007436259330-2"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=110694007436259330-2"}},"id":"0110694007436259330-0000000002","paging_token":"110694007436259330-2","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_credited","type_i":2,"created_at":"2019-09-11T13:16:44Z","asset_type":"native","amount":"355.2904739"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/115354197276323841"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=115354197276323841-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=115354197276323841-1"}},"id":"0115354197276323841-0000000001","paging_token":"115354197276323841-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_credited","type_i":2,"created_at":"2019-11-18T19:59:40Z","asset_type":"native","amount":"688.4065454"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/117356420835532801"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=117356420835532801-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=117356420835532801-1"}},"id":"0117356420835532801-0000000001","paging_token":"117356420835532801-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_credited","type_i":2,"created_at":"2019-12-18T08:23:35Z","asset_type":"native","amount":"355.3887598"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/119399833130811393"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=119399833130811393-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=119399833130811393-1"}},"id":"0119399833130811393-0000000001","paging_token":"119399833130811393-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"trustline_created","type_i":20,"created_at":"2020-01-17T20:13:22Z","asset_type":"credit_alphanum4","asset_code":"USD","asset_issuer":"GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX","limit":"922337203685.4775000"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/119399833130811394"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=119399833130811394-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=119399833130811394-1"}},"id":"0119399833130811394-0000000001","paging_token":"119399833130811394-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"trade","type_i":33,"created_at":"2020-01-17T20:13:22Z","seller":"GCM4PT6XDZBWOOENDS6FOU22GJQLJPV2GC7VRVII4TFGZBA3ZXNM55SV","offer_id":"147625249","sold_amount":"539.0320108","sold_asset_type":"native","bought_amount":"32.8490620","bought_asset_type":"credit_alphanum4","bought_asset_code":"USD","bought_asset_issuer":"GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/119399833130811394"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=119399833130811394-3"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=119399833130811394-3"}},"id":"0119399833130811394-0000000003","paging_token":"119399833130811394-3","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"trade","type_i":33,"created_at":"2020-01-17T20:13:22Z","seller":"GBDVKE33GVVMBXX73OHIBRP6RAHKHHW2P4PQVV6UNOKQCOXU7GNUM4QI","offer_id":"147618811","sold_amount":"854.9537682","sold_asset_type":"native","bought_amount":"52.0920258","bought_asset_type":"credit_alphanum4","bought_asset_code":"USD","bought_asset_issuer":"GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/119400713599217665"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=119400713599217665-2"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=119400713599217665-2"}},"id":"0119400713599217665-0000000002","paging_token":"119400713599217665-2","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_debited","type_i":3,"created_at":"2020-01-17T20:32:38Z","asset_type":"credit_alphanum4","asset_code":"USD","asset_issuer":"GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX","amount":"84.9410878"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/147350483860869151"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=147350483860869151-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=147350483860869151-1"}},"id":"0147350483860869151-0000000001","paging_token":"147350483860869151-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_credited","type_i":2,"created_at":"2021-03-06T19:27:33Z","asset_type":"native","amount":"0.0000001"}]}}}}}}}},"method":"get","path":"/accounts/{account_id}/effects","servers":[{"url":"https://horizon.stellar.org","description":"The main network"},{"url":"https://horizon-testnet.stellar.org","description":"The test network"}],"info":{"title":"Horizon","version":"0.0.1"},"postman":{"name":"Retrieve an Account's Effects","description":{"content":"This endpoint returns the effects of a specific account and can be used in streaming mode. Streaming mode allows you to listen for new effects for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time.","type":"text/plain"},"url":{"path":["accounts",":account_id","effects"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.","type":"text/plain"},"key":"cursor","value":""},{"disabled":false,"description":{"content":"A designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc.","type":"text/plain"},"key":"order","value":""},{"disabled":false,"description":{"content":"The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.","type":"text/plain"},"key":"limit","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) This account’s public key encoded in a base32 string representation.","type":"text/plain"},"type":"any","value":"","key":"account_id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Accounts"],"description":"This endpoint returns the effects of a specific account and can be used in streaming mode. Streaming mode allows you to listen for new effects for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time.","operationId":"GetEffectsByAccountId","parameters":[{"name":"account_id","in":"path","required":true,"description":"This account’s public key encoded in a base32 string representation.","schema":{"type":"string","example":"GDMQQNJM4UL7QIA66P7R2PZHMQINWZBM77BEBMHLFXD5JEUAHGJ7R4JZ"}},{"name":"cursor","in":"query","required":false,"description":"A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.","schema":{"type":"integer","example":6606617478959105}},{"name":"order","in":"query","required":false,"description":"A designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc.","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","required":false,"description":"The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.","schema":{"type":"integer","example":10}}],"x-supports-streaming":true,"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"next":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"prev":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}}}},"title":"Links"},{"oneOf":[{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"transaction":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"effects":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"succeeds":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"precedes":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}},"required":["self","transaction","effects","succeeds","precedes"]},"id":{"type":"string","title":"id"},"paging_token":{"type":"string"},"transaction_successful":{"type":"boolean"},"source_account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"type":{"type":"string","example":"create_account"},"type_i":{"type":"number","example":0},"created_at":{"type":"string"},"transaction_hash":{"type":"string"},"starting_balance":{"type":"string"},"funder":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}},"required":["id","paging_token","transaction_successful","source_account","type","type_i","created_at","transaction_hash","starting_balance","funder","account"],"title":"CreateAccount"},{"type":"object","properties":{"_embedded":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"transaction":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"effects":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"succeeds":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"precedes":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}},"required":["self","transaction","effects","succeeds","precedes"]},"id":{"type":"string","title":"id"},"paging_token":{"type":"string"},"transaction_successful":{"type":"boolean"},"source_account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"type":{"type":"string","example":"payment"},"type_i":{"type":"string"},"created_at":{"type":"string"},"transaction_hash":{"type":"string"},"asset_type":{"type":"string"},"asset_code":{"enum":["native","credit_alphanum4","credit_alphanum12"]},"asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"from":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"to":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"amount":{"type":"string"}},"required":["id","paging_token","transaction_successful","source_account","type","type_i","created_at","transaction_hash","asset_type","from","to","amount"]}}}}},"title":"Payment"},{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"transaction":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"effects":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"succeeds":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"precedes":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}},"required":["self","transaction","effects","succeeds","precedes"]},"id":{"type":"string","title":"id"},"paging_token":{"type":"string"},"transaction_successful":{"type":"boolean"},"source_account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"type":{"type":"string","example":"path_payment_strict_receive"},"type_i":{"type":"number","example":2},"created_at":{"type":"string"},"transaction_hash":{"type":"string"},"asset_type":{"type":"string","enum":["native","credit_alphanum4","credit_alphanum12"]},"asset_code":{"type":"string"},"asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"from":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"to":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"amount":{"type":"string"},"path":{"type":"array","items":{"type":"object","properties":{"asset_type":{"type":"string","enum":["native","credit_alphanum4","credit_alphanum12"]},"asset_code":{"type":"string"},"asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}}}},"source_amount":{"type":"string"},"destination_min":{"type":"string"},"source_asset_type":{"type":"string"},"source_asset_code":{"type":"string"},"source_asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}},"required":["id","paging_token","transaction_successful","source_account","type","type_i","created_at","transaction_hash","from","to","amount","path","source_amount","destination_min"],"title":"PathPaymentStrictReceive"},{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"transaction":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"effects":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"succeeds":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"precedes":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}},"required":["self","transaction","effects","succeeds","precedes"]},"id":{"type":"string","title":"id"},"paging_token":{"type":"string"},"transaction_successful":{"type":"boolean"},"source_account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"type":{"type":"string","example":"path_payment_strict_send"},"type_i":{"type":"number","example":13},"created_at":{"type":"string"},"transaction_hash":{"type":"string"},"asset_type":{"type":"string","enum":["native","credit_alphanum4","credit_alphanum12"]},"asset_code":{"type":"string"},"asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"from":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"to":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"amount":{"type":"string"},"path":{"type":"array","items":{"type":"object","properties":{"asset_type":{"type":"string","enum":["native","credit_alphanum4","credit_alphanum12"]},"asset_code":{"type":"string"},"asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}}}},"source_amount":{"type":"string"},"source_max":{"type":"string"},"source_asset_type":{"type":"string"},"source_asset_code":{"type":"string"},"source_asset_issuer":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}},"required":["id","paging_token","transaction_successful","source_account","type","type_i","created_at","transaction_hash","from","to","amount","path","source_amount","source_asset_type"],"title":"PathPaymentStrictSend"},{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"transaction":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"effects":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"succeeds":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"precedes":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}},"required":["self","transaction","effects","succeeds","precedes"]},"id":{"type":"string","title":"id"},"paging_token":{"type":"string"},"transaction_successful":{"type":"boolean"},"source_account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"type":{"type":"string","example":"account_merge"},"type_i":{"type":"number","example":8},"created_at":{"type":"string"},"transaction_hash":{"type":"string"},"account":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"},"into":{"type":"string","pattern":"G[A-Z0-9]{55}","title":"address"}},"required":["id","paging_token","transaction_successful","source_account","type","type_i","created_at","transaction_hash","account","into"],"title":"AccountMerge"}]}]},"examples":{"RetrieveAnAccountsEffects":{"value":{"_links":{"self":{"href":"https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=&limit=10&order=asc"},"next":{"href":"https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=147350483860869151-1&limit=10&order=asc"},"prev":{"href":"https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=110694007436259329-1&limit=10&order=desc"}},"_embedded":{"records":[{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/110694007436259329"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=110694007436259329-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=110694007436259329-1"}},"id":"0110694007436259329-0000000001","paging_token":"110694007436259329-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_created","type_i":0,"created_at":"2019-09-11T13:16:44Z","starting_balance":"1.0000000"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/110694007436259329"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=110694007436259329-3"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=110694007436259329-3"}},"id":"0110694007436259329-0000000003","paging_token":"110694007436259329-3","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"signer_created","type_i":10,"created_at":"2019-09-11T13:16:44Z","weight":1,"public_key":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","key":""},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/110694007436259330"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=110694007436259330-2"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=110694007436259330-2"}},"id":"0110694007436259330-0000000002","paging_token":"110694007436259330-2","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_credited","type_i":2,"created_at":"2019-09-11T13:16:44Z","asset_type":"native","amount":"355.2904739"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/115354197276323841"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=115354197276323841-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=115354197276323841-1"}},"id":"0115354197276323841-0000000001","paging_token":"115354197276323841-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_credited","type_i":2,"created_at":"2019-11-18T19:59:40Z","asset_type":"native","amount":"688.4065454"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/117356420835532801"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=117356420835532801-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=117356420835532801-1"}},"id":"0117356420835532801-0000000001","paging_token":"117356420835532801-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_credited","type_i":2,"created_at":"2019-12-18T08:23:35Z","asset_type":"native","amount":"355.3887598"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/119399833130811393"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=119399833130811393-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=119399833130811393-1"}},"id":"0119399833130811393-0000000001","paging_token":"119399833130811393-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"trustline_created","type_i":20,"created_at":"2020-01-17T20:13:22Z","asset_type":"credit_alphanum4","asset_code":"USD","asset_issuer":"GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX","limit":"922337203685.4775000"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/119399833130811394"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=119399833130811394-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=119399833130811394-1"}},"id":"0119399833130811394-0000000001","paging_token":"119399833130811394-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"trade","type_i":33,"created_at":"2020-01-17T20:13:22Z","seller":"GCM4PT6XDZBWOOENDS6FOU22GJQLJPV2GC7VRVII4TFGZBA3ZXNM55SV","offer_id":"147625249","sold_amount":"539.0320108","sold_asset_type":"native","bought_amount":"32.8490620","bought_asset_type":"credit_alphanum4","bought_asset_code":"USD","bought_asset_issuer":"GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/119399833130811394"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=119399833130811394-3"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=119399833130811394-3"}},"id":"0119399833130811394-0000000003","paging_token":"119399833130811394-3","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"trade","type_i":33,"created_at":"2020-01-17T20:13:22Z","seller":"GBDVKE33GVVMBXX73OHIBRP6RAHKHHW2P4PQVV6UNOKQCOXU7GNUM4QI","offer_id":"147618811","sold_amount":"854.9537682","sold_asset_type":"native","bought_amount":"52.0920258","bought_asset_type":"credit_alphanum4","bought_asset_code":"USD","bought_asset_issuer":"GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/119400713599217665"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=119400713599217665-2"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=119400713599217665-2"}},"id":"0119400713599217665-0000000002","paging_token":"119400713599217665-2","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_debited","type_i":3,"created_at":"2020-01-17T20:32:38Z","asset_type":"credit_alphanum4","asset_code":"USD","asset_issuer":"GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX","amount":"84.9410878"},{"_links":{"operation":{"href":"https://horizon.stellar.org/operations/147350483860869151"},"succeeds":{"href":"https://horizon.stellar.org/effects?order=desc&cursor=147350483860869151-1"},"precedes":{"href":"https://horizon.stellar.org/effects?order=asc&cursor=147350483860869151-1"}},"id":"0147350483860869151-0000000001","paging_token":"147350483860869151-1","account":"GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE","type":"account_credited","type_i":2,"created_at":"2021-03-06T19:27:33Z","asset_type":"native","amount":"0.0000001"}]}}}}}}}},"method":"get","path":"/accounts/{account_id}/effects","servers":[{"url":"https://horizon.stellar.org","description":"The main network"},{"url":"https://horizon-testnet.stellar.org","description":"The test network"}],"info":{"title":"Horizon","version":"0.0.1"},"postman":{"name":"Retrieve an Account's Effects","description":{"content":"This endpoint returns the effects of a specific account and can be used in streaming mode. Streaming mode allows you to listen for new effects for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time.","type":"text/plain"},"url":{"path":["accounts",":account_id","effects"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.","type":"text/plain"},"key":"cursor","value":""},{"disabled":false,"description":{"content":"A designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc.","type":"text/plain"},"key":"order","value":""},{"disabled":false,"description":{"content":"The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.","type":"text/plain"},"key":"limit","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) This account’s public key encoded in a base32 string representation.","type":"text/plain"},"type":"any","value":"","key":"account_id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: api/resources/horizon custom_edit_url: null @@ -28,7 +28,7 @@ This endpoint returns the effects of a specific account and can be used in strea
    Path Parameters
    Query Parameters
    -OK +Success
    Schema
      _links object
      self object
      next object
      prev object
    \ No newline at end of file diff --git a/docusaurus.config.js b/docusaurus.config.js index f856908a2..feaf0bf6e 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -51,6 +51,13 @@ const config = { groupPathsBy: "tag", }, }, + ap_callbacks: { + specPath: "openapi/ap/bundled_callback.yml", // Path to designated spec file + outputDir: "ap_api/callbacks", // Output directory for generated .mdx docs + sidebarOptions: { + groupPathsBy: "tag", + }, + }, }, }, ], diff --git a/openapi/ap/Callbacks API.yml b/openapi/ap/Callbacks API.yml index 75d17cdc6..c740438ce 100644 --- a/openapi/ap/Callbacks API.yml +++ b/openapi/ap/Callbacks API.yml @@ -34,6 +34,8 @@ paths: outside the platform, using Circle: [![](https://mermaid.ink/img/pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1)](https://mermaid.live/edit#pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1) + summary: Generate Unique Address + operationId: genAddress tags: - Unique Address parameters: @@ -94,6 +96,8 @@ paths: When this change is made, the request schema will be adapted to support the use case. tags: - Fees + summary: Retrieve Fees + operationId: getFee parameters: - in: query name: send_asset @@ -198,6 +202,8 @@ paths: response returned, and if so, for how long. tags: - Rates + summary: Retrieve Rates + operationId: genRates parameters: - in: query name: type @@ -334,6 +340,8 @@ paths: If the server still needs more info, or the server needs updated information, it should return the fields required. tags: - Customers + summary: Retrieve Customer's Info + operationId: getCustomer parameters: - in: query name: id @@ -402,6 +410,8 @@ paths: Client applications make requests with the following request body, which is forwarded to the anchor. Anchors must validate and persist the data passed, and return the customer's `id`. + summary: Create or Update Customer info + operationId: putCustomer requestBody: content: application/json: @@ -444,6 +454,8 @@ paths: Anchors will make POST requests until the customer's status changes to ACCEPTED or REJECTED. If a wallet needs to watch a user's KYC status after that, it will need to set a callback again. + summary: Create or Update Callback Url + operationId: putCustomerCallback requestBody: content: application/json: @@ -472,6 +484,8 @@ paths: The request for this endpoint is identical to the `PUT /customer/callback` request defined in SEP-12. Delete the customer's data or queue the customers data for deletion. + summary: Delete Customer Data + operationId: delCustomer parameters: - in: path name: id diff --git a/openapi/ap/bundled_callback.yml b/openapi/ap/bundled_callback.yml new file mode 100644 index 000000000..b53c95178 --- /dev/null +++ b/openapi/ap/bundled_callback.yml @@ -0,0 +1,708 @@ +openapi: 3.0.0 +info: + version: 2.0.0 + description: | + The Synchronous Callbacks API specification for the Stellar Anchor Platform project. + + The Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The + anchor's responses to these requests affect the Platform responses to the client application. + title: Synchronous Callbacks API +tags: + - name: Unique Address + description: (optional) Provide a unique `stellar_address:memo` pair that will be used to correlate a Stellar payment 1-to-1 with a Platform resource such as a [SEP-31](https://stellar.org/protocol/sep-31) transaction. + - name: Fees + description: Requests containing data that can be used to calculate transaction fees. + - name: Rates + description: Requests containing data that can be used to provide exchange rates between on & off-chain assets. + - name: Customers + description: | + [SEP-12](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md) requests made from client + applications. +paths: + /unique_address: + get: + description: | + If the platform is configured with `depositInfoGeneratorType: api`, the Platform will be executing this request to + the Anchor backend every time a transaction is initiated by a client application. + + The Anchor must guarantee that the memo returned in this request is unique, so it can be mapped 1-to-1 to a Platform + resource such as a [SEP-31](https://stellar.org/protocol/sep-31) transaction. + + It is possible that these memos are never used by the client who initiated the transaction though. + + Here is how this flow would be used for Receiving Anchors that need to create their unique `stellar_address:memo` pairs + outside the platform, using Circle: + + [![](https://mermaid.ink/img/pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1)](https://mermaid.live/edit#pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1) + summary: Generate Unique Address + operationId: genAddress + tags: + - Unique Address + parameters: + - in: query + name: transaction_id + description: | + The platform server will save the posted transaction and pass the `transaction_id` through this endpoint. + If the anchor wishes to return transaction-dependent unique_address, the anchor may query the [`GET /transactions` endpoint of the Platform API](https://github.com/stellar/java-stellar-anchor-sdk/blob/main/docs/03%20-%20Implementing%20the%20Anchor%20Server/Communication/Platform%20API.yml). + schema: + type: string + required: true + responses: + '200': + description: Success. + content: + application/json: + schema: + type: object + properties: + unique_address: + description: An object containing the unique `stellar_address:memo` pair used to identify a destination. + type: object + properties: + stellar_address: + description: A `G...` stellar address or a `M...` [muxed stellar address](https://developers.stellar.org/docs/glossary/muxed-accounts/) of an **existing** account in the Stellar network. + type: string + memo: + description: The memo to attach to the Stellar payment. + type: string + memo_type: + description: The type of memo to attach to the Stellar payment (text, hash, or id). + type: string + enum: + - text + - hash + - id + required: + - stellar_address + '500': + description: Error. The Platform will respond to the client application with the same response code and body. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /fee: + get: + description: | + The Platform will make this request to the anchor every time a transaction is initiated by a client application + without a `quote_id`. + + The Anchor must ensure that the sending and receiving customers specified in the request meet the KYC requirements + necessary to partake in the transaction described in the request. + + The anchor must return the fee it will charge for the transaction. + + In the future, this endpoint may be used to provide estimated fees to client applications prior to initiating transactions. + When this change is made, the request schema will be adapted to support the use case. + tags: + - Fees + summary: Retrieve Fees + operationId: getFee + parameters: + - in: query + name: send_asset + description: | + The asset the client application will send to the anchor in exchange for `receive_asset` in + [Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format). + schema: + type: string + required: true + - in: query + name: receive_asset + description: | + The asset the that the anchor will send in exchange for `send_asset` in + [Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format). + schema: + type: string + required: true + - in: query + name: send_amount + description: | + The amount of `send_asset` the client application will send in exchange for `receive_asset`. One of `send_amount` + or `receive_amount` will always be included in the request. If the client application specified a `quote_id` in + its transaction creation request, both amounts specified in the referenced quote will be passed. + schema: + type: string + - in: query + name: receive_amount + description: | + The amount of `receive_asset` the anchor will send in exchange for `send_asset`. One of `send_amount` or + `receive_amount` will always be included in the request. If the client application specified a `quote_id` in its + transaction creation request, both amounts specified in the referenced quote will be passed. + schema: + type: string + - in: query + name: client_id + description: | + An identifier for the client application making the request. This ID can be used to offer different fees to different clients. + A client ID can be one of the following: + 1. the `client_domain`: In SEP-24, if the transaction is initiated from a non-custodial wallet, the `client_id` must match the `client_domain` if wallet attribution is required. + 2. the Stellar custodial/omnibus account: In SEP-24, if the transaction is initiated from a custodian, such as Wyre, the `client_id` should match a known pooled/omnibus account configured in the [`omnibusAccountList`] of the YAML file](https://github.com/stellar/java-stellar-anchor-sdk/blob/main/platform/src/main/resources/anchor-config-defaults.yaml). + 3. The Stellar account of a sending anchor: In SEP-31, the `client_id` should match the account of a known SEP-31 sending anchor match the one used to authenticate via SEP-10. + schema: + type: string + required: true + - in: query + name: sender_id + description: | + The SEP-12 customer ID of the sending user. + schema: + type: string + required: true + - in: query + name: receiver_id + description: | + The SEP-12 customer ID of the receiving user. + schema: + type: string + required: true + responses: + '200': + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/FeeResponse' + '422': + description: | + Unprocessable Entity. This status should be returned when the anchor understood the request but cannot + return a success response. An example for when this response code would be appropriate is if the sender + and/or receiver is not permitted to initiate a transaction with the specified amounts. In these cases, + the Platform will respond to the client application's request with a `400 Bad Request` and include the + error message provided by the anchor in the response body. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Error. The Platform will respond to the client application with the same response code and body. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /rate: + get: + description: | + Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must + use exchange rates that are communicated to the client application requesting the transaction. When clients make + requests to the Platform for these exchange rates, the Platform sends this request to the anchor to fetch it. + + Rates can be [indicative](https://www.investopedia.com/terms/i/indicativequote.asp) or + [firm](https://www.investopedia.com/terms/f/firmquote.asp). The anchor must provide an expiration if the client + requests a firm rate. + + Anchors can provide discounted rates specific client applications. The Platform includes the `client_id` parameter + for this reason. + + Either `sell_amount` or `buy_amount` will be included in requests as parameters, but never both. In the same way, + either `sell_delivery_method` and `buy_delivery_method` may be included in requests, but never both, since either + `sell_asset` or `buy_asset` is a Stellar asset. + + In the future, we may add headers to the response that informs the Platform on whether or not it can cache the + response returned, and if so, for how long. + tags: + - Rates + summary: Retrieve Rates + operationId: genRates + parameters: + - in: query + name: type + description: The type of rate requested. `firm` and `indicative_price` rates need to return a "fee" and "total_price" fields, while `indicative_prices` doesn't. + schema: + type: string + enum: + - indicative_price + - indicative_prices + - firm + required: true + - in: query + name: context + description: The context it will be used for. It is mandatory for the types `indicative_price` and `firm`. + schema: + type: string + enum: + - sep6 + - sep31 + - in: query + name: client_id + description: | + An identifier for the client application making the request. This ID can be used to offer different fees to different clients. + + Client IDs will be the Stellar public key the public key used to authenticate via SEP-10. Anchors must ensure + that the public key specified in the request matches a public key known to belong to the sending anchor. + + This parameter will only be specified if the client is authenticated via SEP-10. Anchors can define whether or not + authentication is required for fetching indicative rates. Firm rates always require authentication. + schema: + type: string + - in: query + name: sell_asset + description: | + The asset the client application will send to the anchor in exchange for `buy_asset` in + [Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format). + schema: + type: string + required: true + - in: query + name: buy_asset + description: | + The asset the that the anchor will send in exchange for `sell_asset` in + [Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format). + schema: + type: string + required: true + - in: query + name: sell_amount + description: | + The amount of `sell_asset` the client application will send in exchange for `buy_asset`. Will not be used in + conjuction with `buy_amount`. + schema: + type: string + - in: query + name: buy_amount + description: | + The amount of `buy_asset` the anchor will send in exchange for `sell_asset`. Will not be used in conjuction + with `sell_amount`. + schema: + type: string + - in: query + name: country_code + description: | + The [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code of the user's current address. + Anchors should expect this parameter to be provided if one of the assets of the buy/sell pair is fiat and it + is available in two or more countries. + schema: + type: string + - in: query + name: expire_after + description: | + The client's desired `expires_at` date and time for the quote that can be used if this is a firm quote. This should + be a [UTC ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) string. Anchors should return `400 Bad + Request` if an expiration date on or after the requested value cannot be provided. + schema: + type: string + - in: query + name: sell_delivery_method + description: | + The method the client or user will use to deliver `sell_asset` to the Anchor. This value may affect the + expiration and price provided. The values used for this parameter is defined in the application's configuration. + Will not be used in conjuction with `buy_delivery_method`. + schema: + type: string + - in: query + name: buy_delivery_method + description: | + The method the client or user wants used to receive `buy_asset` from the Anchor. This value may affect the + expiration and price provided. The values used for this parameter is defined in the application's configuration. + Will not be used in conjuction with `sell_delivery_method`. + schema: + type: string + responses: + '200': + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/RateResponse' + '422': + description: | + Unprocessable Entity. This status should be returned when the anchor understood the request but cannot + return a success response. + In these cases, the Platform will respond to the client application's request with a `400 Bad Request` + and include the error message provided by the anchor in the response body. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Error. The Platform will respond to the client application with the same response code and body. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /customer: + get: + description: | + The request and response for this endpoint is identical to the + [`GET /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get) + request and response defined in SEP-12. + + This endpoint allows clients to: + + 1. Fetch the fields the server requires in order to register a new customer via a SEP-12 `PUT /customer` request + + If the server does not have a customer registered for the parameters sent in the request, it should return the + fields required in the response. The same response should be returned when no parameters are sent. + + 2. Check the status of a customer that may already be registered + + This allows clients to check whether the customers information was accepted, rejected, or still needs more info. + If the server still needs more info, or the server needs updated information, it should return the fields required. + tags: + - Customers + summary: Retrieve Customer's Info + operationId: getCustomer + parameters: + - in: query + name: id + description: The ID of the customer as returned in the response of a previous PUT request. + schema: + type: string + - in: query + name: account + description: The Stellar or Muxed Account authenticated with the Platform via SEP-10. + schema: + type: string + - in: query + name: memo + description: The memo value identifying a customer with a shared account, where the shared account is `account`. + schema: + type: string + - in: query + name: memo_type + description: The type of memo used to identify a customer with a shared account. + schema: + type: string + enum: + - id + - hash + - text + - in: query + name: type + description: | + The type of action the customer is being KYCd for. See the + [Type Specification](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#type-specification) + documented in SEP-12. + schema: + type: string + - in: query + name: lang + description: | + Defaults to `en`. Language code specified using ISO 639-1. Human readable descriptions, choices, and + messages should be in this language. + schema: + type: string + responses: + '200': + description: | + Valid request. Customer either already exists or the customer identified by the parameters is new and must + provide the field values described in the repsonse body. Response bodies are identical to the schema defined + in SEP-12. + '400': + description: Error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Not Found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - Customers + description: | + **The Anchor Platform does not persist any customer KYC data.** + + The request and response for this endpoint are identical to the `PUT /customer` request and response defined in SEP-12. + + Client applications make requests with the following request body, which is forwarded to the anchor. Anchors + must validate and persist the data passed, and return the customer's `id`. + summary: Create or Update Customer info + operationId: putCustomer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PutCustomerRequest' + responses: + '200': + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/PutCustomerResponse' + '400': + description: Invalid data. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Not Found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /customer/callback: + put: + tags: + - Customers + description: | + The request for this endpoint is identical to the `PUT /customer/callback` request defined in SEP-12. + + Allows the wallet to provide a callback URL to the anchor. The provided callback URL will replace (and supercede) + any previously-set callback URL for this customer. + + Whenever the customer's `status` changes, the anchor must make a POST request to the callback URL. The payload + of the POST request will be the same as the response of SEP-12's `GET /customer`. **The Anchor Platform does not + make these callback requests to clients**. + + It's the wallet's responsibility to send a working callback URL to the anchor. + + Anchors will make POST requests until the customer's status changes to ACCEPTED or REJECTED. If a wallet needs + to watch a user's KYC status after that, it will need to set a callback again. + summary: Create or Update Callback Url + operationId: putCustomerCallback + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PutCustomerCallbackRequest' + responses: + '204': + description: Success + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Customer not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /customer/{id}: + delete: + tags: + - Customers + description: | + The request for this endpoint is identical to the `PUT /customer/callback` request defined in SEP-12. + + Delete the customer's data or queue the customers data for deletion. + summary: Delete Customer Data + operationId: delCustomer + parameters: + - in: path + name: id + schema: + type: string + required: true + responses: + '204': + description: Success. + '404': + description: Customer not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' +components: + schemas: + Error: + type: object + properties: + error: + type: string + id: + type: string + required: + - error + Amount: + type: object + required: + - amount + - asset + properties: + amount: + type: string + asset: + type: string + FeeResponse: + type: object + properties: + fee: + $ref: '#/components/schemas/Amount' + RateFeeDetailResponse: + type: object + properties: + name: + type: string + description: The name of the fee, for example `ACH fee`, `Brazilian conciliation fee`, `Service fee`, etc. + description: + type: string + description: A text describing the fee. + amount: + type: string + description: The amount of asset applied. If `fee.details` is provided, `sum(fee.details.amount)` should be equals `fee.total`. + required: + - name + - amount + RateFeeResponse: + type: object + description: Fees are NOT USED when `type=indicative_prices`. + properties: + total: + type: string + description: The total fee to be applied. + asset: + type: string + description: The asset the fee will be charged in. Must be represented in [Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format). + details: + type: array + items: + $ref: '#/components/schemas/RateFeeDetailResponse' + required: + - total + - asset + RateResponse: + type: object + properties: + rate: + type: object + properties: + id: + type: string + description: Id of the firm quote. NOT USED when `type=indicative*`. + expires_at: + type: string + format: date-time + description: Expirations are NOT USED when `type=indicative*`. + price: + type: string + description: The conversion price offered by the anchor for one unit of `buy_asset` in terms of `sell_asset`, without including fees. In traditional finance, `buy_asset` would be referred to as the base asset and `sell_asset` as the counter asset. The formula `sell_amount - fee = price * buy_amount` must hold true ([ref](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#price-formulas)). + total_price: + type: string + description: The total conversion price offered by the anchor for one unit of `buy_asset` in terms of `sell_asset`, including fees. In traditional finance, `buy_asset` would be referred to as the base asset and `sell_asset` as the counter asset. NOT USED when `type=indicative_prices`. The formula `sell_amount = total_price * buy_amount` must hold true ([ref](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#price-formulas)). + sell_amount: + type: string + description: The amount of `sell_asset` the anchor will exchange for `buy_asset`. It could be different from the `sell_amount` provided in the request, depending on how fees are applied by the Anchor. + buy_amount: + type: string + description: The amount of `buy_asset` the anchor will provide with `sell_asset`. It could be different from the `buy_amount` provided in the request, depending on how fees are applied by the Anchor. + fee: + $ref: '#/components/schemas/RateFeeResponse' + required: + - price + - sell_amount + - buy_amount + PutCustomerRequest: + type: object + properties: + id: + description: The ID of the customer as returned in the response of a previous PUT request. + type: string + account: + description: The Stellar or Muxed Account authenticated with the Platform via SEP-10. + type: string + memo: + description: The memo value identifying a customer with a shared account, where the shared account is `account`. + type: string + memo_type: + description: The type of memo used to identify a customer with a shared account. + type: string + enum: + - id + - hash + - text + type: + description: | + The type of action the customer is being KYCd for. See the + [Type Specification](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#type-specification) + documented in SEP-12. + type: string + first_name: + type: string + last_name: + type: string + additional_name: + type: string + address_country_code: + type: string + state_or_province: + type: string + city: + type: string + postal_code: + type: string + address: + type: string + mobile_number: + type: string + email_address: + type: string + birth_date: + type: string + format: date + birth_place: + type: string + birth_country_code: + type: string + bank_account_number: + type: string + bank_account_type: + type: string + bank_number: + type: string + bank_phone_number: + type: string + bank_branch_number: + type: string + tax_id: + type: string + tax_id_name: + type: string + occupation: + type: string + employer_name: + type: string + employer_address: + type: string + language_code: + type: string + id_type: + type: string + id_country_code: + type: string + id_issue_date: + type: string + format: date + id_expiration_date: + type: string + format: date + id_number: + type: string + ip_address: + type: string + sex: + type: string + PutCustomerResponse: + type: object + properties: + id: + type: string + PutCustomerCallbackRequest: + type: object + properties: + id: + description: The ID of the customer as returned in the response of a previous PUT request. + type: string + account: + description: The Stellar or Muxed Account authenticated with the Platform via SEP-10. + type: string + memo: + description: The memo value identifying a customer with a shared account, where the shared account is `account`. + type: string + memo_type: + description: The type of memo used to identify a customer with a shared account. + type: string + enum: + - id + - hash + - text + url: + description: A callback URL that the SEP-12 server will POST to when the status of the customer changes. + type: string diff --git a/openapi/bundled.yml b/openapi/bundled.yml index a6465ef1e..1ba594a31 100644 --- a/openapi/bundled.yml +++ b/openapi/bundled.yml @@ -182,7 +182,7 @@ paths: x-supports-streaming: true responses: '200': - description: OK + description: Success content: application/json: schema: diff --git a/package.json b/package.json index 635619ffb..38634ea8b 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "clear": "docusaurus clear", "serve": "docusaurus serve", "api:clean": "docusaurus clean-api-docs all", - "api:bundle": "redocly bundle openapi/main.yml --output openapi/bundled.yml", - "api:gen": "docusaurus gen-api-docs all && rm api/resources/*.info.mdx && rm ap_api/resources/*.info.mdx", + "api:bundle": "redocly bundle openapi/main.yml --output openapi/bundled.yml && redocly bundle openapi/ap/Platform\\ API.yml --output openapi/ap/bundled.yml && yarn redocly bundle openapi/ap/Callbacks\\ API.yml --output openapi/ap/bundled_callback.yml", + "api:gen": "docusaurus gen-api-docs all && rm api/resources/*.info.mdx && rm ap_api/resources/*.info.mdx && rm ap_api/callbacks/*.info.mdx", "api": "yarn api:clean && yarn api:bundle && yarn api:gen", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", diff --git a/src/sidebar-api-generator.js b/src/sidebar-api-generator.js index 075ac2c5f..f6f6ae75c 100644 --- a/src/sidebar-api-generator.js +++ b/src/sidebar-api-generator.js @@ -39,5 +39,33 @@ module.exports = async ({ defaultSidebarItemsGenerator, ...args }) => { }); } + const resources2 = sidebarItems.find( + (item) => + item.type === "category" && item.label.toLowerCase() === "callbacks", + ); + + const sidebarPath2 = path.join( + args.version.contentPath, + "./callbacks/sidebar.js", + ); + + if (resources2 && fs.existsSync(sidebarPath2)) { + const generatedApiSidebar = require(sidebarPath2); + + const categories = resources2.items.filter( + (item) => item.type === "category", + ); + + categories.forEach((category) => { + const generatedCategory = generatedApiSidebar.find( + (item) => item.type === "category" && item.label === category.label, + ); + + if (generatedCategory) { + category.items = [...category.items, ...generatedCategory.items]; + } + }); + } + return sidebarItems; };