From 7d7a351aa3e36eaff8cd90eaf3663c4e89238334 Mon Sep 17 00:00:00 2001 From: Gleb Date: Mon, 24 Apr 2023 15:44:04 -0700 Subject: [PATCH] Add badges for OpenAPI docs (#126) --- .eslintrc.js | 1 + ap_api/callbacks/del-customer.api.mdx | 7 +++- ap_api/callbacks/gen-address.api.mdx | 7 +++- ap_api/callbacks/get-customer.api.mdx | 7 +++- ap_api/callbacks/get-fee.api.mdx | 7 +++- ap_api/callbacks/get-rates.api.mdx | 9 +++-- ap_api/callbacks/put-customer.api.mdx | 7 +++- ap_api/callbacks/sidebar.js | 2 +- ap_api/resources/get-quote.api.mdx | 9 +++-- ap_api/resources/get-quotes.api.mdx | 13 +++--- ap_api/resources/get-transaction.api.mdx | 9 +++-- ap_api/resources/patch-transactions.api.mdx | 9 +++-- ap_api/resources/sidebar.js | 2 +- docusaurus.config.js | 2 + openapi/ap/Callbacks API.yml | 9 +++++ openapi/ap/Platform API.yml | 10 ++++- openapi/ap/bundled.yml | 10 ++++- openapi/ap/bundled_callback.yml | 9 +++++ src/components/SepBadge.tsx | 21 ++++++++++ src/template.mustache | 45 +++++++++++++++++++++ tsconfig.json | 1 + 21 files changed, 165 insertions(+), 31 deletions(-) create mode 100644 src/components/SepBadge.tsx create mode 100644 src/template.mustache diff --git a/.eslintrc.js b/.eslintrc.js index 109acc337..ae6cd8b04 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,5 +2,6 @@ module.exports = { extends: ["@stellar/eslint-config"], rules: { "import/no-unresolved": 0, + "react/jsx-filename-extension": [1, { "extensions": [".tsx", ".ts"] }] }, }; diff --git a/ap_api/callbacks/del-customer.api.mdx b/ap_api/callbacks/del-customer.api.mdx index f5724e1b4..7874a8a95 100644 --- a/ap_api/callbacks/del-customer.api.mdx +++ b/ap_api/callbacks/del-customer.api.mdx @@ -5,12 +5,16 @@ description: "The request for this endpoint is identical to the" 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 \n[`DELETE /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-delete) \nrequest 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 \n[`DELETE /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-delete) \nrequest 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"}} +api: {"tags":["Customers","SEP-12","SEP-31"],"description":"The request for this endpoint is identical to the \n[`DELETE /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-delete) \nrequest 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 \n[`DELETE /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-delete) \nrequest 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 { SepBadge } from "@site/src/components/SepBadge"; + + + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; @@ -40,4 +44,3 @@ Success. Customer not found.
Schema
- \ No newline at end of file diff --git a/ap_api/callbacks/gen-address.api.mdx b/ap_api/callbacks/gen-address.api.mdx index f269a7fb1..107988e5e 100644 --- a/ap_api/callbacks/gen-address.api.mdx +++ b/ap_api/callbacks/gen-address.api.mdx @@ -5,12 +5,16 @@ description: "If the platform is configured with `depositInfoGeneratorType: api` 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](/ap_api/resources/get-transaction).\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](/ap_api/resources/get-transaction).\n","type":"text/plain"},"key":"transaction_id","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +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","SEP-31"],"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](/ap_api/resources/get-transaction).\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](/ap_api/resources/get-transaction).\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 { SepBadge } from "@site/src/components/SepBadge"; + + + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; @@ -51,4 +55,3 @@ An object containing the unique `stellar_address:memo` pair used to identify a d 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 index dd0210acc..9bb4f6577 100644 --- a/ap_api/callbacks/get-customer.api.mdx +++ b/ap_api/callbacks/get-customer.api.mdx @@ -5,12 +5,16 @@ 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 \n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) 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 \n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) 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"}} +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 \n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) 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","SEP-12","SEP-31"],"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 \n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) 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 { SepBadge } from "@site/src/components/SepBadge"; + + + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; @@ -58,4 +62,3 @@ Error. 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 index 7624e30c5..3f9eadb19 100644 --- a/ap_api/callbacks/get-fee.api.mdx +++ b/ap_api/callbacks/get-fee.api.mdx @@ -5,12 +5,16 @@ description: "The Platform will make this request to the anchor every time a tra 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 it 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 it 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"}} +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","SEP-31"],"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 it 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 it 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 { SepBadge } from "@site/src/components/SepBadge"; + + + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; @@ -54,4 +58,3 @@ error message provided by the anchor in the response body. 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-rates.api.mdx b/ap_api/callbacks/get-rates.api.mdx index 45225fa40..2b7349bf3 100644 --- a/ap_api/callbacks/get-rates.api.mdx +++ b/ap_api/callbacks/get-rates.api.mdx @@ -5,12 +5,16 @@ description: "Transactions that involve two non-equivalent on & off-chain assets 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":"getRates","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"}} +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","SEP-31"],"operationId":"getRates","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 { SepBadge } from "@site/src/components/SepBadge"; + + + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; @@ -51,7 +55,7 @@ Success. Fees are NOT USED when `type=indicative_prices`. -
details object[]
  • Array [
  • ]
  • +
    details object[]
  • Array [
  • ]
  • Unprocessable Entity. This status should be returned when the anchor understood the request but cannot return a success response. @@ -64,4 +68,3 @@ and include the error message provided by the anchor in the response body. 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.api.mdx b/ap_api/callbacks/put-customer.api.mdx index ef335af74..d92596ec2 100644 --- a/ap_api/callbacks/put-customer.api.mdx +++ b/ap_api/callbacks/put-customer.api.mdx @@ -5,12 +5,16 @@ 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 \n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) \nrequest 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-24","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-24","id_expiration_date":"2023-04-24","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 \n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) \nrequest 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"}}}}} +api: {"tags":["Customers","SEP-12","SEP-31"],"description":"**The Anchor Platform does not persist any customer KYC data.**\n\nThe request and response for this endpoint are identical to the \n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) \nrequest 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-24","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-24","id_expiration_date":"2023-04-24","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 \n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) \nrequest 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 { SepBadge } from "@site/src/components/SepBadge"; + + + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; @@ -47,4 +51,3 @@ Invalid data. Not Found.
    Schema
    - \ No newline at end of file diff --git a/ap_api/callbacks/sidebar.js b/ap_api/callbacks/sidebar.js index 66b818f12..8b2e35e20 100644 --- a/ap_api/callbacks/sidebar.js +++ b/ap_api/callbacks/sidebar.js @@ -1 +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/get-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/del-customer","label":"Delete Customer Data","className":"api-method delete"}]}]; \ No newline at end of file +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/get-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/del-customer","label":"Delete Customer Data","className":"api-method delete"}]},{"type":"category","label":"SEP-31","link":{"type":"generated-index","title":"SEP-31","slug":"/category/callbacks/sep-31"},"items":[{"type":"doc","id":"callbacks/gen-address","label":"Generate Unique Address","className":"api-method get"},{"type":"doc","id":"callbacks/get-fee","label":"Retrieve Fees","className":"api-method get"},{"type":"doc","id":"callbacks/get-rates","label":"Retrieve Rates","className":"api-method get"},{"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/del-customer","label":"Delete Customer Data","className":"api-method delete"}]},{"type":"category","label":"SEP-12","link":{"type":"generated-index","title":"SEP-12","slug":"/category/callbacks/sep-12"},"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/del-customer","label":"Delete Customer Data","className":"api-method delete"}]}]; \ 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 2c51a1e06..d4b5df2d9 100644 --- a/ap_api/resources/get-quote.api.mdx +++ b/ap_api/resources/get-quote.api.mdx @@ -5,12 +5,16 @@ description: "Only relevant for SEP-38 (used by SEP-31). Fetches the quote that sidebar_label: "Retrieve a Quote" hide_title: true hide_table_of_contents: true -api: {"tags":["Quotes"],"operationId":"getQuote","description":"Only relevant for SEP-38 (used by SEP-31). Fetches the quote that was created by a client application using SEP-38's `POST /quote` endpoint.","parameters":[{"in":"path","name":"id","description":"The ID returned as a result of creating the quote via SEP-38's `POST /quote` endpoint.","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sell_amount":{"type":"string"},"sell_asset":{"type":"string"},"buy_amount":{"type":"string"},"buy_asset":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"price":{"type":"string"},"total_price":{"type":"string"},"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"},"transaction_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"title":"Quote"}}}},"404":{"description":"Not Found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/exchange/quotes/{id}","info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"Retrieve a Quote","description":{"content":"Only relevant for SEP-38 (used by SEP-31). Fetches the quote that was created by a client application using SEP-38's `POST /quote` endpoint.","type":"text/plain"},"url":{"path":["exchange","quotes",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The ID returned as a result of creating the quote via SEP-38's `POST /quote` endpoint.","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Quotes","SEP-38","SEP-31"],"operationId":"getQuote","description":"Only relevant for SEP-38 (used by SEP-31). Fetches the quote that was created by a client application using SEP-38's `POST /quote` endpoint.","parameters":[{"in":"path","name":"id","description":"The ID returned as a result of creating the quote via SEP-38's `POST /quote` endpoint.","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sell_amount":{"type":"string"},"sell_asset":{"type":"string"},"buy_amount":{"type":"string"},"buy_asset":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"price":{"type":"string"},"total_price":{"type":"string"},"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"},"transaction_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"title":"Quote"}}}},"404":{"description":"Not Found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/exchange/quotes/{id}","info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"Retrieve a Quote","description":{"content":"Only relevant for SEP-38 (used by SEP-31). Fetches the quote that was created by a client application using SEP-38's `POST /quote` endpoint.","type":"text/plain"},"url":{"path":["exchange","quotes",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The ID returned as a result of creating the quote via SEP-38's `POST /quote` endpoint.","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: api/resources/platform-api custom_edit_url: null --- +import { SepBadge } from "@site/src/components/SepBadge"; + + + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; @@ -39,9 +43,8 @@ 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.
    Schema
    - \ No newline at end of file diff --git a/ap_api/resources/get-quotes.api.mdx b/ap_api/resources/get-quotes.api.mdx index e76a6f458..74f351bd1 100644 --- a/ap_api/resources/get-quotes.api.mdx +++ b/ap_api/resources/get-quotes.api.mdx @@ -1,16 +1,20 @@ --- id: get-quotes title: "List all Quotes" -description: "Only relevant for SEP-38 (used by SEP-31). Fetches the quotes that were created by client applications using SEP-38's `POST /quote` endpoint." +description: "Fetches the quotes that were created by client applications using SEP-38's `POST /quote` endpoint." sidebar_label: "List all Quotes" hide_title: true hide_table_of_contents: true -api: {"tags":["Quotes"],"operationId":"getQuotes","description":"Only relevant for SEP-38 (used by SEP-31). Fetches the quotes that were created by client applications using SEP-38's `POST /quote` endpoint.","parameters":[{"in":"query","name":"order","description":"Either ascending or descending by `order_by` value.","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"in":"query","name":"order_by","description":"The data to be used for ordering transactions.","required":false,"schema":{"type":"string","enum":["created_at","expires_at","used_at"],"default":"created_at"}},{"in":"query","name":"cursor","description":"Cursor used for pagination. Each response will include a `cursor` value that can be used to view the next page, assuming all other parameters kept the same.","required":false,"schema":{"type":"string"}},{"in":"query","name":"after","description":"Timestamp for which all `order_by` values will be after (exclusive), in UTC.","required":false,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"before","description":"Timestamp for which all `order_by` values will be before (exclusive), in UTC.","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sell_amount":{"type":"string"},"sell_asset":{"type":"string"},"buy_amount":{"type":"string"},"buy_asset":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"price":{"type":"string"},"total_price":{"type":"string"},"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"},"transaction_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"title":"Quote"}},"cursor":{"type":"string"}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/exchange/quotes","info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"List all Quotes","description":{"content":"Only relevant for SEP-38 (used by SEP-31). Fetches the quotes that were created by client applications using SEP-38's `POST /quote` endpoint.","type":"text/plain"},"url":{"path":["exchange","quotes"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Either ascending or descending by `order_by` value.","type":"text/plain"},"key":"order","value":""},{"disabled":false,"description":{"content":"The data to be used for ordering transactions.","type":"text/plain"},"key":"order_by","value":""},{"disabled":false,"description":{"content":"Cursor used for pagination. Each response will include a `cursor` value that can be used to view the next page, assuming all other parameters kept the same.","type":"text/plain"},"key":"cursor","value":""},{"disabled":false,"description":{"content":"Timestamp for which all `order_by` values will be after (exclusive), in UTC.","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"Timestamp for which all `order_by` values will be before (exclusive), in UTC.","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Quotes","SEP-31","SEP-38"],"operationId":"getQuotes","description":"Fetches the quotes that were created by client applications using SEP-38's `POST /quote` endpoint.","parameters":[{"in":"query","name":"order","description":"Either ascending or descending by `order_by` value.","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"in":"query","name":"order_by","description":"The data to be used for ordering transactions.","required":false,"schema":{"type":"string","enum":["created_at","expires_at","used_at"],"default":"created_at"}},{"in":"query","name":"cursor","description":"Cursor used for pagination. Each response will include a `cursor` value that can be used to view the next page, assuming all other parameters kept the same.","required":false,"schema":{"type":"string"}},{"in":"query","name":"after","description":"Timestamp for which all `order_by` values will be after (exclusive), in UTC.","required":false,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"before","description":"Timestamp for which all `order_by` values will be before (exclusive), in UTC.","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sell_amount":{"type":"string"},"sell_asset":{"type":"string"},"buy_amount":{"type":"string"},"buy_asset":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"price":{"type":"string"},"total_price":{"type":"string"},"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"},"transaction_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"title":"Quote"}},"cursor":{"type":"string"}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/exchange/quotes","info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"List all Quotes","description":{"content":"Fetches the quotes that were created by client applications using SEP-38's `POST /quote` endpoint.","type":"text/plain"},"url":{"path":["exchange","quotes"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Either ascending or descending by `order_by` value.","type":"text/plain"},"key":"order","value":""},{"disabled":false,"description":{"content":"The data to be used for ordering transactions.","type":"text/plain"},"key":"order_by","value":""},{"disabled":false,"description":{"content":"Cursor used for pagination. Each response will include a `cursor` value that can be used to view the next page, assuming all other parameters kept the same.","type":"text/plain"},"key":"cursor","value":""},{"disabled":false,"description":{"content":"Timestamp for which all `order_by` values will be after (exclusive), in UTC.","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"Timestamp for which all `order_by` values will be before (exclusive), in UTC.","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: api/resources/platform-api custom_edit_url: null --- +import { SepBadge } from "@site/src/components/SepBadge"; + + + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; @@ -24,7 +28,7 @@ import TabItem from "@theme/TabItem"; -Only relevant for SEP-38 (used by SEP-31). Fetches the quotes that were created by client applications using SEP-38's `POST /quote` endpoint. +Fetches the quotes that were created by client applications using SEP-38's `POST /quote` endpoint.
    Query Parameters
    @@ -39,9 +43,8 @@ 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
    Schema
    - \ No newline at end of file diff --git a/ap_api/resources/get-transaction.api.mdx b/ap_api/resources/get-transaction.api.mdx index ac4eb76fe..dc360c7a9 100644 --- a/ap_api/resources/get-transaction.api.mdx +++ b/ap_api/resources/get-transaction.api.mdx @@ -5,12 +5,16 @@ description: "Provides the information necessary for the business to determine t sidebar_label: "Retreive a Transaction" hide_title: true hide_table_of_contents: true -api: {"tags":["Transactions"],"operationId":"getTransaction","description":"Provides the information necessary for the business to determine the state of the transaction identified by `id`, decide if any action must be taken to continue processing the transaction, and act on the decision.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Transaction found.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["id","sep","kind","status","amount_expected","destination_account","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24"]},"kind":{"type":"string","enum":["deposit","withdrawal"]},"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"]},"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"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_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"},"memo":{"type":"string"},"memo_type":{"type":"string"}},"title":"TransactionSEP24"},{"type":"object","properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["31"]},"kind":{"type":"string","enum":["receive"]},"status":{"type":"string","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","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"},"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"}},"external_transaction_id":{"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":"TransactionSEP31"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"404":{"description":"Transaction not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/transactions/{id}","info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"Retreive a Transaction","description":{"content":"Provides the information necessary for the business to determine the state of the transaction identified by `id`, decide if any action must be taken to continue processing the transaction, and act on the decision.","type":"text/plain"},"url":{"path":["transactions",":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":"GET"}} +api: {"tags":["Transactions","SEP-24","SEP-31"],"operationId":"getTransaction","description":"Provides the information necessary for the business to determine the state of the transaction identified by `id`, decide if any action must be taken to continue processing the transaction, and act on the decision.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Transaction found.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["id","sep","kind","status","amount_expected","destination_account","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24"]},"kind":{"type":"string","enum":["deposit","withdrawal"]},"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"]},"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"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_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"},"memo":{"type":"string"},"memo_type":{"type":"string"}},"title":"TransactionSEP24"},{"type":"object","properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["31"]},"kind":{"type":"string","enum":["receive"]},"status":{"type":"string","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","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"},"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"}},"external_transaction_id":{"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":"TransactionSEP31"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"404":{"description":"Transaction not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/transactions/{id}","info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"Retreive a Transaction","description":{"content":"Provides the information necessary for the business to determine the state of the transaction identified by `id`, decide if any action must be taken to continue processing the transaction, and act on the decision.","type":"text/plain"},"url":{"path":["transactions",":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":"GET"}} sidebar_class_name: "get api-method" info_path: api/resources/platform-api custom_edit_url: null --- +import { SepBadge } from "@site/src/components/SepBadge"; + + + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; @@ -63,7 +67,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 @@ -72,4 +76,3 @@ Bad Request Transaction not found.
    Schema
    - \ No newline at end of file diff --git a/ap_api/resources/patch-transactions.api.mdx b/ap_api/resources/patch-transactions.api.mdx index 2fa649fdc..89452ed64 100644 --- a/ap_api/resources/patch-transactions.api.mdx +++ b/ap_api/resources/patch-transactions.api.mdx @@ -5,12 +5,16 @@ 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-04-24T18:31:43.925Z","updated_at":"2023-04-24T18:31:43.925Z","completed_at":"2023-04-24T18:31:43.925Z","transfer_received_at":"2023-04-24T18:31:43.925Z","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-24T18:31:43.925Z","refunded_at":"2023-04-24T18:31:43.925Z"}]},"stellar_transactions":[{"id":"string","memo":"string","memo_type":"text","created_at":"2023-04-24T18:31:43.925Z","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","SEP-24","SEP-31"],"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-24T22:09:00.738Z","updated_at":"2023-04-24T22:09:00.738Z","completed_at":"2023-04-24T22:09:00.738Z","transfer_received_at":"2023-04-24T22:09:00.738Z","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-24T22:09:00.739Z","refunded_at":"2023-04-24T22:09:00.739Z"}]},"stellar_transactions":[{"id":"string","memo":"string","memo_type":"text","created_at":"2023-04-24T22:09:00.739Z","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 --- +import { SepBadge } from "@site/src/components/SepBadge"; + + + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; @@ -96,9 +100,8 @@ 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.
    Schema
    - \ No newline at end of file diff --git a/ap_api/resources/sidebar.js b/ap_api/resources/sidebar.js index bf0c337f0..b46dac127 100644 --- a/ap_api/resources/sidebar.js +++ b/ap_api/resources/sidebar.js @@ -1 +1 @@ -module.exports = [{"type":"doc","id":"resources/platform-api"},{"type":"category","label":"Transactions","link":{"type":"generated-index","title":"Transactions","slug":"/category/resources/transactions"},"items":[{"type":"doc","id":"resources/patch-transactions","label":"Accept updated information on transactions","className":"api-method patch"},{"type":"doc","id":"resources/get-transaction","label":"Retreive a Transaction","className":"api-method get"}]},{"type":"category","label":"Quotes","link":{"type":"generated-index","title":"Quotes","slug":"/category/resources/quotes"},"items":[{"type":"doc","id":"resources/get-quotes","label":"List all Quotes","className":"api-method get"},{"type":"doc","id":"resources/get-quote","label":"Retrieve a Quote","className":"api-method get"}]}]; \ No newline at end of file +module.exports = [{"type":"doc","id":"resources/platform-api"},{"type":"category","label":"Transactions","link":{"type":"generated-index","title":"Transactions","slug":"/category/resources/transactions"},"items":[{"type":"doc","id":"resources/patch-transactions","label":"Accept updated information on transactions","className":"api-method patch"},{"type":"doc","id":"resources/get-transaction","label":"Retreive a Transaction","className":"api-method get"}]},{"type":"category","label":"Quotes","link":{"type":"generated-index","title":"Quotes","slug":"/category/resources/quotes"},"items":[{"type":"doc","id":"resources/get-quotes","label":"List all Quotes","className":"api-method get"},{"type":"doc","id":"resources/get-quote","label":"Retrieve a Quote","className":"api-method get"}]},{"type":"category","label":"SEP-24","link":{"type":"generated-index","title":"SEP-24","slug":"/category/resources/sep-24"},"items":[{"type":"doc","id":"resources/patch-transactions","label":"Accept updated information on transactions","className":"api-method patch"},{"type":"doc","id":"resources/get-transaction","label":"Retreive a Transaction","className":"api-method get"}]},{"type":"category","label":"SEP-31","link":{"type":"generated-index","title":"SEP-31","slug":"/category/resources/sep-31"},"items":[{"type":"doc","id":"resources/patch-transactions","label":"Accept updated information on transactions","className":"api-method patch"},{"type":"doc","id":"resources/get-transaction","label":"Retreive a Transaction","className":"api-method get"},{"type":"doc","id":"resources/get-quotes","label":"List all Quotes","className":"api-method get"},{"type":"doc","id":"resources/get-quote","label":"Retrieve a Quote","className":"api-method get"}]},{"type":"category","label":"SEP-38","link":{"type":"generated-index","title":"SEP-38","slug":"/category/resources/sep-38"},"items":[{"type":"doc","id":"resources/get-quotes","label":"List all Quotes","className":"api-method get"},{"type":"doc","id":"resources/get-quote","label":"Retrieve a Quote","className":"api-method get"}]}]; \ No newline at end of file diff --git a/docusaurus.config.js b/docusaurus.config.js index feaf0bf6e..3a6b7b9d6 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -50,6 +50,7 @@ const config = { sidebarOptions: { groupPathsBy: "tag", }, + template: "src/template.mustache", // Customize API MDX with mustache template }, ap_callbacks: { specPath: "openapi/ap/bundled_callback.yml", // Path to designated spec file @@ -57,6 +58,7 @@ const config = { sidebarOptions: { groupPathsBy: "tag", }, + template: "src/template.mustache", // Customize API MDX with mustache template }, }, }, diff --git a/openapi/ap/Callbacks API.yml b/openapi/ap/Callbacks API.yml index 44a679c69..edbba8d34 100644 --- a/openapi/ap/Callbacks API.yml +++ b/openapi/ap/Callbacks API.yml @@ -38,6 +38,7 @@ paths: operationId: genAddress tags: - Unique Address + - SEP-31 parameters: - in: query name: transaction_id @@ -96,6 +97,7 @@ paths: When this change is made, the request schema will be adapted to support the use case. tags: - Fees + - SEP-31 summary: Retrieve Fees operationId: getFee parameters: @@ -199,6 +201,7 @@ paths: response returned, and if so, for how long. tags: - Rates + - SEP-31 summary: Retrieve Rates operationId: getRates parameters: @@ -338,6 +341,8 @@ paths: If the server still needs more info, or the server needs updated information, it should return the fields required. tags: - Customers + - SEP-12 + - SEP-31 summary: Retrieve Customer's Info operationId: getCustomer parameters: @@ -401,6 +406,8 @@ paths: put: tags: - Customers + - SEP-12 + - SEP-31 description: | **The Anchor Platform does not persist any customer KYC data.** @@ -440,6 +447,8 @@ paths: delete: tags: - Customers + - SEP-12 + - SEP-31 description: | The request for this endpoint is identical to the [`DELETE /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-delete) diff --git a/openapi/ap/Platform API.yml b/openapi/ap/Platform API.yml index fe2a98ade..853161302 100644 --- a/openapi/ap/Platform API.yml +++ b/openapi/ap/Platform API.yml @@ -12,6 +12,8 @@ paths: patch: tags: - "Transactions" + - SEP-24 + - SEP-31 summary: Accept updated information on transactions operationId: patchTransactions description: @@ -58,6 +60,8 @@ paths: get: tags: - "Transactions" + - SEP-24 + - SEP-31 summary: Retreive a Transaction operationId: getTransaction description: @@ -94,10 +98,12 @@ paths: get: tags: - Quotes + - SEP-31 + - SEP-38 summary: List all Quotes operationId: getQuotes description: - Only relevant for SEP-38 (used by SEP-31). Fetches the quotes that were created by client applications using + Fetches the quotes that were created by client applications using SEP-38's `POST /quote` endpoint. parameters: - in: query @@ -162,6 +168,8 @@ paths: get: tags: - Quotes + - SEP-38 + - SEP-31 summary: Retrieve a Quote operationId: getQuote description: diff --git a/openapi/ap/bundled.yml b/openapi/ap/bundled.yml index 14c3fcaf5..d26323fa7 100644 --- a/openapi/ap/bundled.yml +++ b/openapi/ap/bundled.yml @@ -12,6 +12,8 @@ paths: patch: tags: - Transactions + - SEP-24 + - SEP-31 summary: Accept updated information on 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. @@ -53,6 +55,8 @@ paths: get: tags: - Transactions + - SEP-24 + - SEP-31 summary: Retreive a Transaction operationId: getTransaction description: Provides the information necessary for the business to determine the state of the transaction identified by `id`, decide if any action must be taken to continue processing the transaction, and act on the decision. @@ -87,9 +91,11 @@ paths: get: tags: - Quotes + - SEP-31 + - SEP-38 summary: List all Quotes operationId: getQuotes - description: Only relevant for SEP-38 (used by SEP-31). Fetches the quotes that were created by client applications using SEP-38's `POST /quote` endpoint. + description: Fetches the quotes that were created by client applications using SEP-38's `POST /quote` endpoint. parameters: - in: query name: order @@ -156,6 +162,8 @@ paths: get: tags: - Quotes + - SEP-38 + - SEP-31 summary: Retrieve a Quote operationId: getQuote description: Only relevant for SEP-38 (used by SEP-31). Fetches the quote that was created by a client application using SEP-38's `POST /quote` endpoint. diff --git a/openapi/ap/bundled_callback.yml b/openapi/ap/bundled_callback.yml index 6003be8f8..500acac40 100644 --- a/openapi/ap/bundled_callback.yml +++ b/openapi/ap/bundled_callback.yml @@ -38,6 +38,7 @@ paths: operationId: genAddress tags: - Unique Address + - SEP-31 parameters: - in: query name: transaction_id @@ -95,6 +96,7 @@ paths: When this change is made, the request schema will be adapted to support the use case. tags: - Fees + - SEP-31 summary: Retrieve Fees operationId: getFee parameters: @@ -198,6 +200,7 @@ paths: response returned, and if so, for how long. tags: - Rates + - SEP-31 summary: Retrieve Rates operationId: getRates parameters: @@ -337,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 + - SEP-12 + - SEP-31 summary: Retrieve Customer's Info operationId: getCustomer parameters: @@ -400,6 +405,8 @@ paths: put: tags: - Customers + - SEP-12 + - SEP-31 description: | **The Anchor Platform does not persist any customer KYC data.** @@ -439,6 +446,8 @@ paths: delete: tags: - Customers + - SEP-12 + - SEP-31 description: | The request for this endpoint is identical to the [`DELETE /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-delete) diff --git a/src/components/SepBadge.tsx b/src/components/SepBadge.tsx new file mode 100644 index 000000000..e5580fad1 --- /dev/null +++ b/src/components/SepBadge.tsx @@ -0,0 +1,21 @@ +import React from "react"; + +type ProductProps = { + tags: string; +}; + +export const SepBadge: React.FC = (props) => { + const tags = props.tags.split(","); + const seps = tags.filter(w => w.toLowerCase().includes("sep")).sort(); + + if (seps.length === 0) { + return <>; + } + + return (
    + {seps.map((sep) => ( + {sep} + ))} +
    ); +}; diff --git a/src/template.mustache b/src/template.mustache new file mode 100644 index 000000000..0a56d2230 --- /dev/null +++ b/src/template.mustache @@ -0,0 +1,45 @@ +--- +id: {{{id}}} +title: "{{{title}}}" +description: "{{{frontMatter.description}}}" +{{^api}} +sidebar_label: Introduction +{{/api}} +{{#api}} +sidebar_label: "{{{title}}}" +{{/api}} +{{^api}} +sidebar_position: 0 +{{/api}} +hide_title: true +{{#api}} +hide_table_of_contents: true +{{/api}} +{{#json}} +api: {{{json}}} +{{/json}} +{{#api.method}} +sidebar_class_name: "{{{api.method}}} api-method" +{{/api.method}} +{{#infoPath}} +info_path: {{{infoPath}}} +{{/infoPath}} +custom_edit_url: null +{{#frontMatter.proxy}} +proxy: {{{frontMatter.proxy}}} +{{/frontMatter.proxy}} +{{#frontMatter.hide_send_button}} +hide_send_button: true +{{/frontMatter.hide_send_button}} +{{#frontMatter.show_extensions}} +show_extensions: true +{{/frontMatter.show_extensions}} +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + +{{#api}} + +{{/api}} + +{{{markdown}}} diff --git a/tsconfig.json b/tsconfig.json index fb35f9408..277392ebf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "target": "ES6", "baseUrl": "./src", "moduleResolution": "node", + "jsx": "react" }, "exclude": [ "node_modules",