{"templateId":"markdown","versions":[{"version":"v2026.04","label":"v2026.04","link":"/pt-br/products/payments-direct-2/api-docs/developer-guides/create-a-payment","default":true,"active":true,"folderId":"7e5507fe"},{"version":"v2026.03","label":"v2026.03","link":"/pt-br/products/payments-direct-2/v2026.03/api-docs/developer-guides/create-a-payment","default":false,"active":false,"folderId":"7e5507fe"},{"version":"v2025.11","label":"v2025.11","link":"/pt-br/products/payments-direct-2/v2025.11/api-docs/developer-guides/create-a-payment","default":false,"active":false,"folderId":"7e5507fe"}],"sharedDataIds":{"sidebar":"sidebar-@l10n/pt-BR/products/payments-direct-2/@v2025.11/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition","tabs","tab"]},"type":"markdown"},"seo":{"title":"Criar um pagamento","description":"User guides, API reference, and support resources.","siteUrl":"https://docs.ripple.com","lang":"en-US"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"criar-um-pagamento","__idx":0},"children":["Criar um pagamento"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Corredores compatíveis"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Para conhecer os corredores de pagamento compatíveis, consulte ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/payments-direct-2/introduction/payout-network"},"children":["Payout network"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Neste tutorial, você percorrerá as etapas necessárias para criar um pagamento usando a API do ","Payments Direct"," com o novo ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["endpoint de pagamentos v3"]},":"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Criar uma coleção de cotações para um pagamento proposto."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Escolher uma cotação da coleção."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Criar um pagamento usando a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["operação de pagamentos v3"]},", incluindo:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beneficiaryIdentityId"]}," (ID da identidade do pagamento do beneficiário)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beneficiaryFinancialInstrumentId"]}," (ID do instrumento financeiro / método de pagamento do beneficiário)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["(Opcionalmente) ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originatorIdentityId"]}," (ID da identidade do pagamento do ordenante, para pagamentos de terceiros)"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Obter as transições de estado do pagamento para confirmar que ele chegou a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETED"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Para saber mais sobre identidades do pagamento e instrumentos financeiros, consulte ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/payments-direct-2/introduction/concepts/payment-identities"},"children":["Identidades do pagamento"]}," e ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/payments-direct-2/introduction/concepts/financial-instruments"},"children":["Instrumentos financeiros"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"antes-de-começar","__idx":1},"children":["Antes de começar"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Para seguir este tutorial, você deve ter:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Acesso ao ambiente UAT da API do ","Payments Direct","."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Um ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["token de acesso"]}," OAuth2 válido com escopos para cotações e pagamentos."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ao menos uma ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["identidade de ordenante"]}," (e, opcionalmente, uma identidade para fluxos de ordenante de terceiros)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ao menos uma ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["identidade de beneficiário"]}," e um ou mais ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["instrumentos financeiros"]}," para esse beneficiário."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"etapa-1-criar-uma-coleção-de-cotações","__idx":2},"children":["Etapa 1: Criar uma coleção de cotações"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Primeiro, solicite uma ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["coleção de cotações"]}," que descreva quanto o seu beneficiário receberá, a taxa de câmbio, as tarifas e quando a cotação expira."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Neste exemplo, um remetente está enviando ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["10.000 USD"]}," a um beneficiário no ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["México"]},", que receberá ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["MXN"]}," em uma conta bancária."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"endpoint","__idx":3},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v3/quotes/quote-collection"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parâmetros-do-corpo-da-requisição","__idx":4},"children":["Parâmetros do corpo da requisição"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No mínimo, forneça:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quoteAmount"]}," – O valor que você deseja cotar."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quoteAmountType"]}," – Se quoteAmount é um valor de origem ou de destino (por exemplo, SOURCE_AMOUNT)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sourceCurrency"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destinationCurrency"]}," – As moedas de envio e de recebimento."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destinationCountry"]}," – O país do beneficiário (código ISO 3166-1 alfa-2), obrigatório para um payout em moeda fiduciária. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sourceCountry"]},", o país do ordenante, é opcional."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentRail"]}," – Opcional. Solicita uma cotação para apenas um payment rail. Omita o campo para receber uma cotação para cada payment rail disponível para o corredor. Consulte ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/payments-direct-2/api-docs/integration-resources/payment-rail-reference"},"children":["Referência de payment rails"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payinCategory"]}," – Como você financia o pagamento (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PRE_FUNDING"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CREDIT_FUNDING"]}," ou ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["JIT_FUNDING"]},"). Para mais detalhes, consulte ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/payments-direct-2/introduction/concepts/quotes#modelo-de-financiamento-payincategory"},"children":["Modelo de financiamento"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"exemplo-de-requisição","__idx":5},"children":["Exemplo de requisição"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -i -X POST \\\n  https://api.test.ripple.com/v3/quotes/quote-collection \\\n  -H \"Authorization: Bearer <YOUR_JWT_HERE>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"quoteAmount\": 10000,\n    \"quoteAmountType\": \"SOURCE_AMOUNT\",\n    \"sourceCurrency\": \"USD\",\n    \"destinationCurrency\": \"MXN\",\n    \"sourceCountry\": \"US\",\n    \"destinationCountry\": \"MX\",\n    \"payinCategory\": \"PRE_FUNDING\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"exemplo-de-resposta-truncado","__idx":6},"children":["Exemplo de resposta (truncado)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"quoteCollectionId\": \"11111111-aaaa-2222-bbbb-222222222222\",\n  \"quotes\": [\n    {\n      \"quoteId\": \"7ea3399c-1234-5678-8d8f-d320ea406630\",\n      \"quoteStatus\": \"ACTIVE\",\n      \"quoteAmountType\": \"SOURCE_AMOUNT\",\n      \"sourceAmount\": 10000,\n      \"destinationAmount\": 204533.30,\n      \"sourceCurrency\": \"USD\",\n      \"destinationCurrency\": \"MXN\",\n      \"destinationCountry\": \"MX\",\n      \"payinCategory\": \"PRE_FUNDING\",\n      \"paymentRail\": \"SPEI\",\n      \"adjustedExchangeRate\": {\n        \"adjustedRate\": 20.4136\n      },\n      \"fees\": [\n        {\n          \"totalFee\": 14,\n          \"feeCurrency\": \"USD\"\n        }\n      ],\n      \"createdAt\": \"2025-11-13T22:44:34.711Z\",\n      \"expiresAt\": \"2025-11-13T22:59:34.767Z\"\n    }\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"O que verificar"},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quoteStatus"]}," deve ser ACTIVE."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Anote o ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quoteId"]}," que você deseja usar; você o passará para a operação Criar pagamento."]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"etapa-2-escolher-uma-cotação","__idx":7},"children":["Etapa 2: Escolher uma cotação"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Uma coleção de cotações contém uma cotação para cada payment rail disponível para o corredor, e cada cotação indica o seu payment rail. O México oferece um único rail, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SPEI"]},", portanto esta coleção contém uma única cotação. Em um corredor com vários rails, a lógica da sua aplicação deve:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Iterar por ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quotes[]"]}," na resposta."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Aplicar os seus critérios (por exemplo, o payment rail, as tarifas ou a taxa de câmbio)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Selecionar um único ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quoteId"]}," para a etapa Criar pagamento."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["O payment rail indicado na cotação que você escolher é o rail que o pagamento usa."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Para o restante deste tutorial, vamos supor que você selecione:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quoteId = 7ea3399c-1234-5678-8d8f-d320ea406630"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"etapa-3-criar-um-pagamento-com-a-operação-de-pagamentos-v3","__idx":8},"children":["Etapa 3: Criar um pagamento com a operação de pagamentos v3"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Depois de selecionar uma cotação, você pode criar um pagamento usando a operação de pagamentos v3. É aqui que você conecta:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A cotação (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quoteId"]},")"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A identidade do beneficiário (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beneficiaryIdentityId"]},")"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["O instrumento financeiro do beneficiário (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beneficiaryFinancialInstrumentId"]},")"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["(Opcionalmente)"]}," a identidade do ordenante (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originatorIdentityId"]},"), caso você esteja enviando em nome de um cliente"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["O ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beneficiaryFinancialInstrumentId"]}," identifica a conta que recebe os fundos. Cada identidade tem um instrumento financeiro ativo, portanto este é o instrumento atualmente vinculado à identidade do beneficiário."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"rótulos-de-pagamento","__idx":9},"children":["Rótulos de pagamento"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentLabels"]}," são strings simples que você pode usar para categorizar e pesquisar pagamentos. Um padrão comum é armazenar pares chave=valor."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Por exemplo:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"\"paymentLabels\": [\n  \"customerSegment=PREMIUM\",\n  \"invoiceNumber=INV-2025-0615\"\n]\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Esses rótulos podem ser atualizados posteriormente por meio da operação ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Update payment labels"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"endpoint-1","__idx":10},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v3/payments"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"campos-obrigatórios-e-opcionais","__idx":11},"children":["Campos obrigatórios e opcionais"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Campos obrigatórios principais na requisição de pagamento v3:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quoteId"]}," – O quoteId da cotação que você selecionou."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beneficiaryIdentityId"]}," – O token de identidade do beneficiário."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beneficiaryFinancialInstrumentId"]}," – O token do instrumento financeiro da conta de pagamento do beneficiário."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Opcionais, mas comumente usados:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originatorIdentityId"]}," – Inclua para pagamentos de terceiros em que você envia em nome de uma empresa ou instituição. Omita (ou use a sua própria identidade) quando você for o ordenante."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["receiverRelationship"]}," – Relação entre o ordenante e o beneficiário (por exemplo, FAMILY, SUPPLIER)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentMemo"]}," – Memo de texto livre usado para conciliação; não é armazenado na PII."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentLabels"]}," – Rótulos de string definidos pela aplicação para agrupar e categorizar pagamentos (por exemplo, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["customerSegment=PREMIUM"]},"). Os rótulos são armazenados como strings simples; uma convenção comum é usar pares ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["chave=valor"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Outros campos opcionais, como ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["internalId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["purposeCode"]}," e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sourceOfCash"]},", podem estar disponíveis dependendo da sua configuração."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Transações diretas vs. pagamentos de terceiros"},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Transação direta:"]}," Você é o ordenante; o ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originatorIdentityId"]}," é omitido ou definido como a sua própria identidade."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Terceiros:"]}," Você envia em nome de um cliente; o ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originatorIdentityId"]}," deve ser definido como o token de identidade desse cliente."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"exemplos-de-requisição","__idx":12},"children":["Exemplos de requisição"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Vamos mostrar lado a lado os exemplos de transação direta e de terceiros."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Transação direta","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Neste exemplo, você é o ordenante. Você omite o ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originatorIdentityId"]}," (ou usa a sua própria identidade)."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -i -X POST \\\n  https://api.test.ripple.com/v3/payments \\\n  -H \"Authorization: Bearer <YOUR_JWT_HERE>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"quoteId\": \"7ea3399c-1234-5678-8d8f-d320ea406630\",\n    \"beneficiaryIdentityId\": \"99254c4f-f207-4792-a846-06928825018c\",\n    \"beneficiaryFinancialInstrumentId\": \"0e0d7b5a-7f2b-4c75-9bb9-8c4d0ff5f2a1\",\n    \"receiverRelationship\": \"SUPPLIER\",\n    \"paymentMemo\": \"INVOICE 2025-0615\",\n    \"paymentLabels\": [\n      \"customerSegment=PREMIUM\",\n      \"invoiceNumber=INV-2025-0615\"\n    ]\n  }'\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Pagamento de terceiros","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Neste exemplo, você está enviando em nome de um cliente corporativo. Você deve incluir o ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originatorIdentityId"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -i -X POST \\\n  https://api.test.ripple.com/v3/payments \\\n  -H \"Authorization: Bearer <YOUR_JWT_HERE>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"quoteId\": \"7ea3399c-1234-5678-8d8f-d320ea406630\",\n    \"originatorIdentityId\": \"c1e92b47-4579-4a7e-9c9a-02f3e3e4bb11\",\n    \"beneficiaryIdentityId\": \"99254c4f-f207-4792-a846-06928825018c\",\n    \"beneficiaryFinancialInstrumentId\": \"0e0d7b5a-7f2b-4c75-9bb9-8c4d0ff5f2a1\",\n    \"receiverRelationship\": \"SUPPLIER\",\n    \"paymentMemo\": \"INVOICE 2025-0615\",\n    \"paymentLabels\": [\n      \"customerSegment=PREMIUM\",\n      \"invoiceNumber=INV-2025-0615\"\n    ]\n  }'\n","lang":"bash"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"exemplo-de-resposta","__idx":13},"children":["Exemplo de resposta"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Em caso de sucesso, a API retorna uma resposta 201 com detalhes do pagamento e um ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentId"]}," que você pode usar para monitorá-lo. O ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentId"]}," tem o mesmo valor do ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quoteId"]}," que você aceitou, porque um pagamento é identificado pela sua cotação."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"paymentId\": \"7ea3399c-1234-5678-8d8f-d320ea406630\",\n  \"quoteId\": \"7ea3399c-1234-5678-8d8f-d320ea406630\",\n  \"paymentState\": \"INITIATED\",\n  \"receiverRelationship\": \"SUPPLIER\",\n  \"paymentMemo\": \"INVOICE 2025-0615\",\n  \"paymentLabels\": [\n    \"customerSegment=PREMIUM\",\n    \"invoiceNumber=INV-2025-0615\"\n  ],\n  \"originator\": {\n    \"originatorIdentityId\": \"c1e92b47-4579-4a7e-9c9a-02f3e3e4bb11\",\n    \"sourceCurrency\": \"USD\",\n    \"sourceAmount\": \"10000.00\",\n    \"sourceCountry\": \"US\"\n  },\n  \"destination\": {\n    \"beneficiaryIdentityId\": \"99254c4f-f207-4792-a846-06928825018c\",\n    \"beneficiaryFinancialInstrumentId\": \"0e0d7b5a-7f2b-4c75-9bb9-8c4d0ff5f2a1\",\n    \"destinationCurrency\": \"MXN\",\n    \"destinationAmount\": \"204533.30\",\n    \"destinationCountry\": \"MX\"\n  },\n  \"fees\": {\n    \"totalFeesAmount\": \"14.00\",\n    \"totalFeesCurrency\": \"USD\"\n  },\n  \"createdAt\": \"2025-03-15T10:23:45Z\",\n  \"initiatedAt\": \"2025-03-15T10:23:45Z\",\n  \"expiresAt\": \"2025-03-15T10:28:45Z\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"O valor-chave a capturar é:"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentId = 7ea3399c-1234-5678-8d8f-d320ea406630"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Você o usará nas etapas posteriores."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Pagamentos financiados via JIT"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Se você usou ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payinCategory: JIT_FUNDING"]}," na sua cotação, o pagamento estará inicialmente no estado ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AWAITING_FUNDING"]}," em vez de ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["INITIATED"]},". A resposta incluirá um timestamp ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jitFundingExpiresAt"]},". Você deve transferir os recursos necessários para a sua conta no ledger da Ripple antes desse horário para que o pagamento prossiga. Se o prazo passar sem o financiamento, o pagamento expira e você deve criar uma nova cotação e um novo pagamento."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"etapa-4-obter-um-pagamento-por-id-opcional-mas-recomendado","__idx":14},"children":["Etapa 4: Obter um pagamento por ID (opcional, mas recomendado)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Para verificar o status atual de um pagamento ou recuperar os seus detalhes, chame a operação ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Get payment by ID"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"endpoint-2","__idx":15},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v3/payments/{paymentId}"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"exemplo-de-requisição-1","__idx":16},"children":["Exemplo de requisição"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -i -X GET \\\n  https://api.test.ripple.com/v3/payments/7ea3399c-1234-5678-8d8f-d320ea406630 \\\n  -H \"Authorization: Bearer <YOUR_JWT_HERE>\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"exemplo-de-resposta-truncado-1","__idx":17},"children":["Exemplo de resposta (truncado)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"paymentId\": \"7ea3399c-1234-5678-8d8f-d320ea406630\",\n  \"initiatedAt\": \"2025-03-15T10:23:45Z\",\n  \"expiresAt\": \"2025-03-15T10:28:45Z\",\n  \"lastStateUpdatedAt\": \"2025-03-15T10:24:15Z\",\n  \"paymentState\": \"TRANSFERRING\",\n  \"originator\": {\n    \"originatorIdentityId\": \"c1e92b47-4579-4a7e-9c9a-02f3e3e4bb11\",\n    \"sourceCountry\": \"US\",\n    \"sourceCurrency\": \"USD\",\n    \"sourceAmount\": 10000,\n    \"payin\": \"PRE_FUNDING\"\n  },\n  \"destination\": {\n    \"destinationAmount\": 204533.30,\n    \"destinationCountry\": \"MX\",\n    \"destinationCurrency\": \"MXN\",\n    \"beneficiaryIdentityId\": \"99254c4f-f207-4792-a846-06928825018c\",\n    \"beneficiaryFinancialInstrumentId\": \"0e0d7b5a-7f2b-4c75-9bb9-8c4d0ff5f2a1\",\n    \"selectedPaymentRail\": \"SPEI\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Você pode usar este endpoint para:"},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Inspecionar o ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentState"]}," para ver em que ponto do ciclo de vida o pagamento está."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Persistir a resposta para as suas próprias auditorias ou painéis internos."]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"etapa-5-obter-as-transições-de-estado-para-confirmar-a-conclusão","__idx":18},"children":["Etapa 5: Obter as transições de estado para confirmar a conclusão"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Para ver como um pagamento se moveu pelo seu ciclo de vida, especialmente para confirmar que ele chegou a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETED"]},", use a operação ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Get state transitions"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v3/payments/{paymentId}/states"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"exemplo-de-requisição-2","__idx":19},"children":["Exemplo de requisição"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -i -X GET \\\n  https://api.test.ripple.com/v3/payments/7ea3399c-1234-5678-8d8f-d320ea406630/states \\\n  -H \"Authorization: Bearer <YOUR_JWT_HERE>\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"exemplo-de-resposta-1","__idx":20},"children":["Exemplo de resposta"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"stateTransitions\": [\n    {\n      \"updatedFrom\": \"QUOTED\",\n      \"updatedTo\": \"INITIATED\",\n      \"updatedAt\": \"2025-03-15T10:23:45Z\"\n    },\n    {\n      \"updatedFrom\": \"INITIATED\",\n      \"updatedTo\": \"VALIDATING\",\n      \"updatedAt\": \"2025-03-15T10:23:47Z\"\n    },\n    {\n      \"updatedFrom\": \"VALIDATING\",\n      \"updatedTo\": \"TRANSFERRING\",\n      \"updatedAt\": \"2025-03-15T10:23:55Z\"\n    },\n    {\n      \"updatedFrom\": \"TRANSFERRING\",\n      \"updatedTo\": \"COMPLETED\",\n      \"updatedAt\": \"2025-03-15T10:25:12Z\"\n    }\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A sua aplicação pode:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Consultar este endpoint por polling até que o estado mais recente seja COMPLETED, ou"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Usar um mecanismo de eventos/webhook, se disponível no seu ambiente."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Interpretando as transições de estado"},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Cada objeto em ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["stateTransitions[]"]}," registra uma mudança em ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentState"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Considere o pagamento concluído com sucesso quando o valor updatedTo da última transição for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETED"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Outros estados terminais podem incluir ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FAILED"]}," ou ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RETURNED"]},", dependendo do comportamento do corredor e da rede de pagamento."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Se o pagamento for rejeitado ou devolvido, você verá estados terminais como ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DECLINED"]}," ou ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RETURNED"]}," em vez de ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETED"]},"."]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"tratamento-de-erros","__idx":21},"children":["Tratamento de erros"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Os erros comuns neste fluxo de trabalho incluem:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["400 Bad Request"]}," – corpo da requisição malformado, campos obrigatórios faltando ou combinações inválidas (por exemplo, moeda/trilho incompatíveis)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["404 Not Found"]}," – coleção de cotações, cotação ou ID de pagamento inexistente."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["409 Conflict"]}," – mudanças conflitantes ou restrições de negócio (por exemplo, uso de uma identidade ou instrumento inativo)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["422 Unprocessable Entity"]}," – o pagamento não pode prosseguir devido a falhas de validação específicas do corredor."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["500 Internal Server Error"]}," – problemas inesperados no servidor; tente novamente ou entre em contato com o suporte se persistir."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Os erros relacionados a pagamentos são retornados em um schema de erro padrão que inclui:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["code"]}," – código de erro legível por máquina"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["title"]}," – resumo curto legível por humanos"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["description"]}," – explicação mais detalhada e dicas de correção"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Consulte a seção ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/payments-direct-2/api-docs/error-handling/api-errors"},"children":["Erros da API"]}," da documentação da API do ","Payments Direct"," para obter uma lista completa de códigos de erro."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"resumo-e-próximos-passos","__idx":22},"children":["Resumo e próximos passos"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Neste tutorial, você:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Criou uma coleção de cotações para precificar um pagamento internacional."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Selecionou uma cotação e usou o seu ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quoteId"]}," para criar um pagamento com a operação v3, incluindo:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beneficiaryIdentityId"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beneficiaryFinancialInstrumentId"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["O ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originatorIdentityId"]}," opcional para pagamentos de terceiros"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Recuperou o pagamento e, em seguida, as suas transições de estado para confirmar que ele chegou a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETED"]},"."]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Em seguida, você pode:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Para saber como criar e gerenciar as identidades referenciadas por ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originatorIdentityId"]}," e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beneficiaryIdentityId"]},", consulte ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/payments-direct-2/api-docs/developer-guides/create-and-manage-identities"},"children":["Criar e gerenciar identidades"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Para saber como criar, atualizar e desativar as contas bancárias referenciadas por ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beneficiaryFinancialInstrumentId"]},", consulte ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt-br/products/payments-direct-2/api-docs/developer-guides/create-and-manage-financial-instruments"},"children":["Criar e gerenciar instrumentos financeiros"]},"."]}]}]},"headings":[{"value":"Criar um pagamento","id":"criar-um-pagamento","depth":1},{"value":"Antes de começar","id":"antes-de-começar","depth":2},{"value":"Etapa 1: Criar uma coleção de cotações","id":"etapa-1-criar-uma-coleção-de-cotações","depth":2},{"value":"Endpoint","id":"endpoint","depth":3},{"value":"Parâmetros do corpo da requisição","id":"parâmetros-do-corpo-da-requisição","depth":3},{"value":"Exemplo de requisição","id":"exemplo-de-requisição","depth":3},{"value":"Exemplo de resposta (truncado)","id":"exemplo-de-resposta-truncado","depth":3},{"value":"Etapa 2: Escolher uma cotação","id":"etapa-2-escolher-uma-cotação","depth":2},{"value":"Etapa 3: Criar um pagamento com a operação de pagamentos v3","id":"etapa-3-criar-um-pagamento-com-a-operação-de-pagamentos-v3","depth":2},{"value":"Rótulos de pagamento","id":"rótulos-de-pagamento","depth":3},{"value":"Endpoint","id":"endpoint-1","depth":3},{"value":"Campos obrigatórios e opcionais","id":"campos-obrigatórios-e-opcionais","depth":3},{"value":"Exemplos de requisição","id":"exemplos-de-requisição","depth":3},{"value":"Exemplo de resposta","id":"exemplo-de-resposta","depth":3},{"value":"Etapa 4: Obter um pagamento por ID (opcional, mas recomendado)","id":"etapa-4-obter-um-pagamento-por-id-opcional-mas-recomendado","depth":2},{"value":"Endpoint","id":"endpoint-2","depth":3},{"value":"Exemplo de requisição","id":"exemplo-de-requisição-1","depth":3},{"value":"Exemplo de resposta (truncado)","id":"exemplo-de-resposta-truncado-1","depth":3},{"value":"Etapa 5: Obter as transições de estado para confirmar a conclusão","id":"etapa-5-obter-as-transições-de-estado-para-confirmar-a-conclusão","depth":2},{"value":"Exemplo de requisição","id":"exemplo-de-requisição-2","depth":3},{"value":"Exemplo de resposta","id":"exemplo-de-resposta-1","depth":3},{"value":"Tratamento de erros","id":"tratamento-de-erros","depth":2},{"value":"Resumo e próximos passos","id":"resumo-e-próximos-passos","depth":2}],"frontmatter":{"title":"Criar um pagamento","toc":{"enable":true,"maxDepth":2},"seo":{"title":"Criar um pagamento"}},"lastModified":"2026-10-21T04:11:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/pt-br/products/payments-direct-2/api-docs/developer-guides/create-a-payment","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}