Assina um cliente a um ou mais preçosrecurring. Sem trialEnd, o primeiro período é cobrado na hora, pelo método escolhido; com trialEnd, a assinatura começa em trialing e nada é cobrado até essa data.A assinatura nasce incomplete e vira active quando a fatura do primeiro período é paga:
Cartão aprovado: a resposta já volta active.
Pix: continua incomplete até o cliente pagar. A fatura e a cobrança do primeiro período são criadas automaticamente; para achar o QR code, liste as faturas do cliente (customer, status=open), pegue a de subscription igual ao ID e consulte a cobrança em payments[].charge (veja Obter cobrança).
Cartão recusado: a assinatura continua incomplete (a criação não falha). Acompanhe por webhook.
Permissão: subscription.write. Apenas chave secreta (sk_…).
Os exemplos usam o sandbox (https://api.upag.dev/v1). Em produção use https://api.upag.io/v1 com sk_live_….
Neste endpoint o teste é uma data fixa (trialEnd) e o paymentMethod é opcional. Para um teste relativo (14 dias) e para escolher o que acontece sem método de pagamento (trialSettings), use um link de pagamento ou uma sessão de checkout. Veja o fluxo completo em Teste grátis.
Pelo menos um item. Todos os preços precisam ser recurring, com o mesmo interval, intervalCount e moeda; o primeiro define os da assinatura. Não repita o mesmo preço.
UUID de um cartão tokenizado. Obrigatório quando paymentMethod é card e proibido nos demais casos. O cartão precisa estar ativo e já pertencer ao customer. Um cartão recém-tokenizado não pertence a ninguém: ele passa a ser do cliente quando é usado numa cobrança de cartão ou numa confirmação de checkout. Para assinar um cliente novo no cartão, use o checkout.
Com trialEnd, status vem trialing, trialStartDate e trialEndDate preenchidos, startDate e o período atual null e nenhuma fatura é criada. Se o teste acabar sem método de pagamento, a fatura é gerada e a assinatura fica past_due até você definir um paymentMethod ou a fatura ser paga.
O cartão não existe, está inativo ou não pertence ao cliente (inclusive um token novo, ainda sem cliente)
400
SUBSCRIPTION_PRICE_NOT_RECURRING
Um dos preços não é recurring
400
SUBSCRIPTION_PRICE_MISMATCH
Os preços têm intervalo ou moeda diferentes
400
SUBSCRIPTION_DUPLICATE_PRICE
O mesmo preço aparece mais de uma vez em items
422
VALIDATION_FAILED
Sem paymentMethod nem trialEnd; card ausente com paymentMethod: "card" (ou enviado sem ele); trialEnd no passado
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Upag Documentation","colors":{"primary":"#06AEDD","light":"#13C6F9","dark":"#0583A6"},"logo":{"light":"https://mintcdn.com/upag/J0FSTIds_wQSyfe4/logo/light.svg?fit=max\u0026auto=format\u0026n=J0FSTIds_wQSyfe4\u0026q=85\u0026s=69934217fd5359442c60393a5611af74","dark":"https://mintcdn.com/upag/J0FSTIds_wQSyfe4/logo/dark.svg?fit=max\u0026auto=format\u0026n=J0FSTIds_wQSyfe4\u0026q=85\u0026s=17e82005fbb54288e4d8a5d7918e98ee"},"favicon":"https://mintcdn.com/upag/J0FSTIds_wQSyfe4/favicon.svg?fit=max\u0026auto=format\u0026n=J0FSTIds_wQSyfe4\u0026q=85\u0026s=f25e12f43de622c85348e03828014f7b","api":{"playground":{"display":"interactive","proxy":true},"examples":{"defaults":"required","languages":["curl","javascript","node"],"prefill":false,"autogenerate":true},"url":"full","mdx":{"auth":{"method":"bearer"}}},"navbar":{"links":[{"href":"/llm.txt","label":"llm.txt"}]},"seo":{"metatags":{"canonical":"https://docs.upag.io","og:locale":"pt_BR","language":"pt-BR"},"organization":{"name":"Upag","url":"https://upag.io"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"upag","hasAudioNarration":false,"actualSubdomain":"upag","customDomains":["docs.upag.io"],"gitSource":{"type":"github","owner":"upaghq","repo":"documentation","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ac77c4fdf14e6603e2e7221","collectionId":"963f6f45-482c-44a6-a108-8476cd42d472","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ac77c4fdf14e6603e2e7221"},"entitlements":{},"buildId":"6ac77c4fdf14e6603e2e7221","clientVersion":"0.0.4074","searchFilterCounts":[{"language":"default","tag":"Referência","count":113},{"language":"default","tag":"Webhooks","count":19},{"language":"default","tag":"Sessões de checkout","count":14},{"language":"default","tag":"Apps","count":11},{"language":"default","tag":"Faturas","count":11},{"language":"default","tag":"Links de pagamento","count":11},{"language":"default","tag":"Assinaturas","count":11},{"language":"default","tag":"Guias","count":10},{"language":"default","tag":"Payloads","count":8},{"language":"default","tag":"Layouts de checkout","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"pages/subscriptions/create","slug":"/pages/subscriptions/create","pageMetadata":{"title":"Criar assinatura","description":"Assina um cliente a preços recorrentes, com Pix, cartão ou período de teste","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/subscriptions","href":"/pages/subscriptions/create"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Assina um cliente a preços recorrentes, com Pix, cartão ou período de teste\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Note,ParamField,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Assina um `,_jsx(_components.a,{href:`/pages/customers/reference`,children:`cliente`}),` a um ou mais `,_jsx(_components.a,{href:`/pages/prices/reference`,children:`preços`}),` `,_jsx(_components.code,{children:`recurring`}),`. Sem `,_jsx(_components.code,{children:`trialEnd`}),`, o primeiro período é cobrado na hora, pelo método escolhido; com `,_jsx(_components.code,{children:`trialEnd`}),`, a assinatura começa em `,_jsx(_components.code,{children:`trialing`}),` e nada é cobrado até essa data.`]}),`\n`,_jsxs(_components.p,{children:[`A assinatura nasce `,_jsx(_components.code,{children:`incomplete`}),` e vira `,_jsx(_components.code,{children:`active`}),` quando a fatura do primeiro período é paga:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Cartão aprovado`}),`: a resposta já volta `,_jsx(_components.code,{children:`active`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Pix`}),`: continua `,_jsx(_components.code,{children:`incomplete`}),` até o cliente pagar. A fatura e a cobrança do primeiro período são criadas automaticamente; para achar o QR code, `,_jsx(_components.a,{href:`/pages/invoices/list`,children:`liste as faturas`}),` do cliente (`,_jsx(_components.code,{children:`customer`}),`, `,_jsx(_components.code,{children:`status=open`}),`), pegue a de `,_jsx(_components.code,{children:`subscription`}),` igual ao ID e consulte a cobrança em `,_jsx(_components.code,{children:`payments[].charge`}),` (veja `,_jsx(_components.a,{href:`/pages/charges/get`,children:`Obter cobrança`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Cartão recusado`}),`: a assinatura continua `,_jsx(_components.code,{children:`incomplete`}),` (a criação não falha). Acompanhe por `,_jsx(_components.a,{href:`/pages/webhooks/payload-subscription`,children:`webhook`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Permissão: `,_jsx(_components.code,{children:`subscription.write`}),`. Apenas chave secreta (`,_jsx(_components.code,{children:`sk_…`}),`).`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Os exemplos usam o sandbox (`,_jsx(_components.code,{children:`https://api.upag.dev/v1`}),`). Em produção use `,_jsx(_components.code,{children:`https://api.upag.io/v1`}),` com `,_jsx(_components.code,{children:`sk_live_…`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`endpoint`,children:`Endpoint`}),`\n`,_jsx(Heading,{level:`3`,id:`cartão`,children:`Cartão`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`11`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.upag.dev/v1/subscriptions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk_test_your_api_key\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"customer\": \"8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"paymentMethod\": \"card\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"card\": \"5f0c3d1a-7b2e-4c9d-8a41-0e6f2b9d7c15\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"items\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"price\": \"3a7e9c14-6b2d-4f85-9e10-5c8d2a7b4f61\", \"quantity\": 1 }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js SDK`,numberOfLines:`10`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Upag`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'upag'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` upag`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Upag`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'sk_test_your_api_key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` subscription`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` upag`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`subscriptions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` customer:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` paymentMethod:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'card'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` card:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '5f0c3d1a-7b2e-4c9d-8a41-0e6f2b9d7c15'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` items:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`price:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '3a7e9c14-6b2d-4f85-9e10-5c8d2a7b4f61'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`quantity:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`pix`,children:`Pix`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.upag.dev/v1/subscriptions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk_test_your_api_key\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"customer\": \"8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"paymentMethod\": \"pix\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"items\": [{ \"price\": \"3a7e9c14-6b2d-4f85-9e10-5c8d2a7b4f61\" }]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js SDK`,numberOfLines:`5`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` subscription`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` upag`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`subscriptions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` customer:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` paymentMethod:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'pix'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` items:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`price:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '3a7e9c14-6b2d-4f85-9e10-5c8d2a7b4f61'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`com-período-de-teste`,children:`Com período de teste`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`10`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.upag.dev/v1/subscriptions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk_test_your_api_key\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"customer\": \"8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"paymentMethod\": \"card\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"card\": \"5f0c3d1a-7b2e-4c9d-8a41-0e6f2b9d7c15\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"trialEnd\": \"2026-10-21T19:00:00.000Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"items\": [{ \"price\": \"3a7e9c14-6b2d-4f85-9e10-5c8d2a7b4f61\" }]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js SDK`,numberOfLines:`7`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` subscription`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` upag`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`subscriptions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` customer:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` paymentMethod:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'card'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` card:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '5f0c3d1a-7b2e-4c9d-8a41-0e6f2b9d7c15'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` trialEnd:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '2026-10-21T19:00:00.000Z'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` items:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`price:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '3a7e9c14-6b2d-4f85-9e10-5c8d2a7b4f61'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`Neste endpoint o teste é uma data fixa (`,_jsx(_components.code,{children:`trialEnd`}),`) e o `,_jsx(_components.code,{children:`paymentMethod`}),` é opcional. Para um teste relativo (`,_jsx(_components.code,{children:`14 dias`}),`) e para escolher o que acontece sem método de pagamento (`,_jsx(_components.code,{children:`trialSettings`}),`), use um `,_jsx(_components.a,{href:`/pages/payment-links/reference`,children:`link de pagamento`}),` ou uma `,_jsx(_components.a,{href:`/pages/checkout-sessions/create`,children:`sessão de checkout`}),`. Veja o fluxo completo em `,_jsx(_components.a,{href:`/pages/guides/free-trial`,children:`Teste grátis`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`parâmetros`,children:`Parâmetros`}),`\n`,_jsx(ParamField,{body:`customer`,type:`string (uuid)`,required:true,id:`param-customer`,children:_jsxs(_components.p,{children:[`UUID de um `,_jsx(_components.a,{href:`/pages/customers/reference`,children:`cliente`}),` da conta.`]})}),`\n`,_jsxs(ParamField,{body:`items`,type:`array`,required:true,id:`param-items`,children:[_jsxs(_components.p,{children:[`Pelo menos um item. Todos os preços precisam ser `,_jsx(_components.code,{children:`recurring`}),`, com o mesmo `,_jsx(_components.code,{children:`interval`}),`, `,_jsx(_components.code,{children:`intervalCount`}),` e moeda; o primeiro define os da assinatura. Não repita o mesmo preço.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`price`}),` (obrigatório): UUID do preço.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`quantity`}),`: inteiro ≥ 1. Padrão `,_jsx(_components.code,{children:`1`}),`.`]}),`\n`]})]}),`\n`,_jsx(ParamField,{body:`paymentMethod`,type:`string`,id:`param-payment-method`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`pix`}),` ou `,_jsx(_components.code,{children:`card`}),`. Obrigatório, exceto quando `,_jsx(_components.code,{children:`trialEnd`}),` é enviado.`]})}),`\n`,_jsx(ParamField,{body:`card`,type:`string (uuid)`,id:`param-card`,children:_jsxs(_components.p,{children:[`UUID de um `,_jsx(_components.a,{href:`/pages/cards/create`,children:`cartão tokenizado`}),`. Obrigatório quando `,_jsx(_components.code,{children:`paymentMethod`}),` é `,_jsx(_components.code,{children:`card`}),` e proibido nos demais casos. O cartão precisa estar ativo e `,_jsxs(_components.strong,{children:[`já pertencer ao `,_jsx(_components.code,{children:`customer`})]}),`. Um cartão recém-tokenizado não pertence a ninguém: ele passa a ser do cliente quando é usado numa `,_jsx(_components.a,{href:`/pages/charges/create`,children:`cobrança`}),` de cartão ou numa `,_jsx(_components.a,{href:`/pages/checkout-sessions/confirm`,children:`confirmação de checkout`}),`. Para assinar um cliente novo no cartão, use o `,_jsx(_components.a,{href:`/pages/guides/subscription-recurring`,children:`checkout`}),`.`]})}),`\n`,_jsx(ParamField,{body:`trialEnd`,type:`string`,id:`param-trial-end`,children:_jsxs(_components.p,{children:[`Fim do teste, em ISO 8601. Precisa estar no futuro. A assinatura começa `,_jsx(_components.code,{children:`trialing`}),` e a primeira fatura só é gerada nessa data.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`resposta`,children:`Resposta`}),`\n`,_jsx(_components.p,{children:_jsx(_components.code,{children:`201 Created`})}),`\n`,_jsx(CodeBlock,{filename:`Response`,numberOfLines:`35`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`35`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"9a3c6e1f-0d58-4b72-a4e9-7c2f8b5d1e36\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"customer\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"paymentMethod\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"card\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"card\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"5f0c3d1a-7b2e-4c9d-8a41-0e6f2b9d7c15\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"active\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"currency\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"brl\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"interval\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"month\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"intervalCount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"cancelAtPeriodEnd\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"startDate\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-10-07T19:00:00.000Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"endDate\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"trialStartDate\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"trialEndDate\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"trialEndBehavior\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"currentPeriodStart\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-10-07T19:00:00.000Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"currentPeriodEnd\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-11-07T19:00:00.000Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"canceledAt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"cancellationReason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"items\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"c6d2f9a4-7e18-4b35-9a60-3f1e8d5b2c07\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"product\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"7d2b5e90-1c34-4a68-b9f7-0e3a6c8d1f25\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"price\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"3a7e9c14-6b2d-4f85-9e10-5c8d2a7b4f61\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Plano mensal\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"amount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`9900`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"quantity\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"totalAmount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`9900`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"createdAt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-10-07T19:00:00.000Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"updatedAt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-10-07T19:00:00.000Z\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"createdAt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-10-07T19:00:00.000Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"updatedAt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-10-07T19:00:05.000Z\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Com `,_jsx(_components.code,{children:`trialEnd`}),`, `,_jsx(_components.code,{children:`status`}),` vem `,_jsx(_components.code,{children:`trialing`}),`, `,_jsx(_components.code,{children:`trialStartDate`}),` e `,_jsx(_components.code,{children:`trialEndDate`}),` preenchidos, `,_jsx(_components.code,{children:`startDate`}),` e o período atual `,_jsx(_components.code,{children:`null`}),` e nenhuma fatura é criada. Se o teste acabar sem método de pagamento, a fatura é gerada e a assinatura fica `,_jsx(_components.code,{children:`past_due`}),` até você definir um `,_jsx(_components.a,{href:`/pages/subscriptions/update`,children:_jsx(_components.code,{children:`paymentMethod`})}),` ou a fatura ser paga.`]}),`\n`,_jsx(Heading,{level:`2`,id:`erros`,children:`Erros`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Código`}),_jsx(_components.th,{children:`Quando`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`CUSTOMER_NOT_FOUND`})}),_jsx(_components.td,{children:`O cliente não existe na conta`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`PRICE_NOT_FOUND`}),` / `,_jsx(_components.code,{children:`PRODUCT_NOT_FOUND`})]}),_jsx(_components.td,{children:`O preço, ou o produto dele, não existe na conta`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`SUBSCRIPTION_CARD_NOT_FOUND`})}),_jsx(_components.td,{children:`O cartão não existe, está inativo ou não pertence ao cliente (inclusive um token novo, ainda sem cliente)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`SUBSCRIPTION_PRICE_NOT_RECURRING`})}),_jsxs(_components.td,{children:[`Um dos preços não é `,_jsx(_components.code,{children:`recurring`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`SUBSCRIPTION_PRICE_MISMATCH`})}),_jsx(_components.td,{children:`Os preços têm intervalo ou moeda diferentes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`SUBSCRIPTION_DUPLICATE_PRICE`})}),_jsxs(_components.td,{children:[`O mesmo preço aparece mais de uma vez em `,_jsx(_components.code,{children:`items`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`422`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`VALIDATION_FAILED`})}),_jsxs(_components.td,{children:[`Sem `,_jsx(_components.code,{children:`paymentMethod`}),` nem `,_jsx(_components.code,{children:`trialEnd`}),`; `,_jsx(_components.code,{children:`card`}),` ausente com `,_jsx(_components.code,{children:`paymentMethod: \"card\"`}),` (ou enviado sem ele); `,_jsx(_components.code,{children:`trialEnd`}),` no passado`]})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Criar assinatura","description":"Assina um cliente a preços recorrentes, com Pix, cartão ou período de teste","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/subscriptions","href":"/pages/subscriptions/create"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Endpoint","slug":"endpoint","depth":2,"children":[{"title":"Cartão","slug":"cartão","depth":3,"children":[]},{"title":"Pix","slug":"pix","depth":3,"children":[]},{"title":"Com período de teste","slug":"com-período-de-teste","depth":3,"children":[]}]},{"title":"Parâmetros","slug":"parâmetros","depth":2,"children":[]},{"title":"Resposta","slug":"resposta","depth":2,"children":[]},{"title":"Erros","slug":"erros","depth":2,"children":[]}],"codeExamples":{},"endpoint":{"title":"Criar assinatura","path":"/v1/subscriptions","servers":[{"url":"https://api.upag.io"}],"method":"post","request":{"security":[{"title":"Bearer Auth","parameters":{"header":{"Authorization":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token."}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"customer":[{"type":"object","properties":{},"description":"UUID de um cliente da conta.","required":true}],"items":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"Pelo menos um item. Todos os preços precisam ser `recurring` , com o mesmo `interval` , `intervalCount` e moeda; o primeiro define os da assinatura. Não repita o mesmo preço. `price` (obrigatório): UUID do preço. `quantity` : inteiro ≥ 1. Padrão `1` .","required":true}],"paymentMethod":[{"type":"string","description":"`pix` ou `card` . Obrigatório, exceto quando `trialEnd` é enviado."}],"card":[{"type":"object","properties":{},"description":"UUID de um cartão tokenizado . Obrigatório quando `paymentMethod` é `card` e proibido nos demais casos. O cartão precisa estar ativo e já pertencer ao `customer` . Um cartão recém-tokenizado não pertence a ninguém: ele passa a ser do cliente quando é usado numa cobrança de cartão ou numa confirmação de checkout . Para assinar um cliente novo no cartão, use o checkout ."}],"trialEnd":[{"type":"string","description":"Fim do teste, em ISO 8601. Precisa estar no futuro. A assinatura começa `trialing` e a primeira fatura só é gerada nessa data."}]}}],"examples":{"example":{"value":{"customer":{},"items":[{}],"paymentMethod":"\u003cstring>","card":{},"trialEnd":"\u003cstring>"}}}}}},"response":{},"deprecated":false}},"jsLinks":[],"subdomain":"upag","siteName":"Upag Documentation","title":"Criar assinatura - Upag Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-08T11:19:48.266Z","originalFileLocation":"pages/subscriptions/create.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Assina um cliente a preços recorrentes, com Pix, cartão ou período de teste\">\u003cmeta data-mint-head name=\"application-name\" content=\"Upag Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/upag/-kAfZwMHyVqMVY71/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/upag/-kAfZwMHyVqMVY71/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/upag/-kAfZwMHyVqMVY71/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/upag/-kAfZwMHyVqMVY71/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/upag/-kAfZwMHyVqMVY71/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/upag/-kAfZwMHyVqMVY71/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/upag/-kAfZwMHyVqMVY71/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/upag/-kAfZwMHyVqMVY71/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/upag/-kAfZwMHyVqMVY71/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Criar assinatura - Upag Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Assina um cliente a preços recorrentes, com Pix, cartão ou período de teste\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Upag Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.upag.io/pages/subscriptions/create\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://upag.mintlify.site/_mintlify/api/og/v2?division=Assinaturas\u0026amp;title=Criar+assinatura\u0026amp;description=Assina+um+cliente+a+pre%C3%A7os+recorrentes%2C+com+Pix%2C+cart%C3%A3o+ou+per%C3%ADodo+de+teste\u0026amp;theme=24438c70022642b5f3af8183\u0026amp;signature=29622d71a4098e520185ad2cef2f3af00d2533af6d9ac4b58ee4f66a0f4cb07b\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Criar assinatura - Upag Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Assina um cliente a preços recorrentes, com Pix, cartão ou período de teste\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://upag.mintlify.site/_mintlify/api/og/v2?division=Assinaturas\u0026amp;title=Criar+assinatura\u0026amp;description=Assina+um+cliente+a+pre%C3%A7os+recorrentes%2C+com+Pix%2C+cart%C3%A3o+ou+per%C3%ADodo+de+teste\u0026amp;theme=24438c70022642b5f3af8183\u0026amp;signature=29622d71a4098e520185ad2cef2f3af00d2533af6d9ac4b58ee4f66a0f4cb07b\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/upag/-kAfZwMHyVqMVY71/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Upag Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#06AEDD\">\u003cmeta data-mint-head name=\"og:locale\" content=\"pt_BR\">\u003cmeta data-mint-head name=\"language\" content=\"pt-BR\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.upag.io/pages/subscriptions/create\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/pages/subscriptions/create.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://upag.io/#organization\",\"name\":\"Upag\",\"url\":\"https://upag.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/upag/J0FSTIds_wQSyfe4/logo/light.svg?fit=max\u0026auto=format\u0026n=J0FSTIds_wQSyfe4\u0026q=85\u0026s=69934217fd5359442c60393a5611af74\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.upag.io#website\",\"name\":\"Upag Documentation\",\"url\":\"https://docs.upag.io\",\"publisher\":{\"@id\":\"https://upag.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.upag.io/pages/subscriptions/create#webpage\",\"url\":\"https://docs.upag.io/pages/subscriptions/create\",\"name\":\"Criar assinatura\",\"description\":\"Assina um cliente a preços recorrentes, com Pix, cartão ou período de teste\",\"dateModified\":\"2026-10-08T11:19:48.266Z\",\"isPartOf\":{\"@id\":\"https://docs.upag.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.upag.io/pages/subscriptions/create#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.upag.io/pages/subscriptions/create#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Assinaturas\",\"item\":\"https://docs.upag.io/pages/subscriptions/reference\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Criar assinatura\",\"item\":\"https://docs.upag.io/pages/subscriptions/create\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.upag.io/pages/subscriptions/create#apireference\",\"headline\":\"Criar assinatura\",\"name\":\"Criar assinatura\",\"description\":\"Assina um cliente a preços recorrentes, com Pix, cartão ou período de teste\",\"url\":\"https://docs.upag.io/pages/subscriptions/create\",\"mainEntityOfPage\":{\"@id\":\"https://docs.upag.io/pages/subscriptions/create#webpage\"},\"dateModified\":\"2026-10-08T11:19:48.266Z\",\"publisher\":{\"@id\":\"https://upag.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.upag.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Upag Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Upag Documentation","nav":{"global":null,"tabs":[{"tab":"Guias","pages":[{"title":"Guias","href":"/pages/guides/quickstart"}]},{"tab":"Referência","groups":[{"group":"Cobranças","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/charges/reference"},{"title":"Criar cobrança","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/charges","href":"/pages/charges/create"},{"title":"Listar cobranças","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/charges","href":"/pages/charges/list"},{"title":"Obter cobrança","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/charges/{chargeId}","href":"/pages/charges/get"}]},{"group":"Cartões","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/cards/reference"},{"title":"Criar cartão","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/cards","href":"/pages/cards/create"},{"title":"Listar cartões","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/cards","href":"/pages/cards/list"},{"title":"Obter cartão","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/cards/{cardId}","href":"/pages/cards/get"},{"title":"Remover cartão","sidebarTitle":"Remover","api":"DELETE https://api.upag.io/v1/cards/{cardId}","href":"/pages/cards/delete"}]},{"group":"3D Secure","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/three-d-secure/reference"},{"title":"Criar sessão 3DS","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/3ds/sessions","href":"/pages/three-d-secure/create"},{"title":"Obter sessão 3DS","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/3ds/sessions/{sessionId}","href":"/pages/three-d-secure/get"},{"title":"Iniciar sessão 3DS","sidebarTitle":"Iniciar","api":"POST https://api.upag.io/v1/3ds/sessions/start","href":"/pages/three-d-secure/start"},{"title":"Concluir sessão 3DS","sidebarTitle":"Concluir","api":"POST https://api.upag.io/v1/3ds/sessions/complete","href":"/pages/three-d-secure/complete"}]},{"group":"Clientes","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/customers/reference"},{"title":"Criar cliente","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/customers","href":"/pages/customers/create"},{"title":"Listar clientes","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/customers","href":"/pages/customers/list"},{"title":"Obter cliente","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/customers/{customerId}","href":"/pages/customers/get"},{"title":"Atualizar cliente","sidebarTitle":"Atualizar","api":"PATCH https://api.upag.io/v1/customers/{customerId}","href":"/pages/customers/update"},{"title":"Excluir cliente","sidebarTitle":"Excluir","api":"DELETE https://api.upag.io/v1/customers/{customerId}","href":"/pages/customers/delete"}]},{"group":"Produtos","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/products/reference"},{"title":"Criar produto","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/products","href":"/pages/products/create"},{"title":"Listar produtos","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/products","href":"/pages/products/list"},{"title":"Obter produto","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/products/{productId}","href":"/pages/products/get"},{"title":"Atualizar produto","sidebarTitle":"Atualizar","api":"PATCH https://api.upag.io/v1/products/{productId}","href":"/pages/products/update"}]},{"group":"Preços","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/prices/reference"},{"title":"Criar preço","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/products/{productId}/prices","href":"/pages/prices/create"},{"title":"Listar preços","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/products/{productId}/prices","href":"/pages/prices/list"},{"title":"Obter preço","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/products/{productId}/prices/{priceId}","href":"/pages/prices/get"},{"title":"Atualizar preço","sidebarTitle":"Atualizar","api":"PATCH https://api.upag.io/v1/products/{productId}/prices/{priceId}","href":"/pages/prices/update"}]},{"group":"Cupons","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/coupons/reference"},{"title":"Criar cupom","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/coupons","href":"/pages/coupons/create"},{"title":"Listar cupons","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/coupons","href":"/pages/coupons/list"},{"title":"Obter cupom","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/coupons/{couponId}","href":"/pages/coupons/get"},{"title":"Atualizar cupom","sidebarTitle":"Atualizar","api":"PATCH https://api.upag.io/v1/coupons/{couponId}","href":"/pages/coupons/update"},{"title":"Excluir cupom","sidebarTitle":"Excluir","api":"DELETE https://api.upag.io/v1/coupons/{couponId}","href":"/pages/coupons/delete"}]},{"group":"Faturas","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/invoices/reference"},{"title":"Criar fatura","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/invoices","href":"/pages/invoices/create"},{"title":"Listar faturas","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/invoices","href":"/pages/invoices/list"},{"title":"Obter fatura","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/invoices/{invoiceId}","href":"/pages/invoices/get"},{"title":"Atualizar fatura","sidebarTitle":"Atualizar","api":"PATCH https://api.upag.io/v1/invoices/{invoiceId}","href":"/pages/invoices/update"},{"title":"Próxima fatura","sidebarTitle":"Próxima fatura","api":"GET https://api.upag.io/v1/invoices/upcoming","href":"/pages/invoices/upcoming"},{"title":"Pagar fatura","sidebarTitle":"Pagar","api":"POST https://api.upag.io/v1/invoices/{invoiceId}/pay","href":"/pages/invoices/pay"},{"title":"Marcar como paga","sidebarTitle":"Marcar como paga","api":"POST https://api.upag.io/v1/invoices/{invoiceId}/mark-as-paid","href":"/pages/invoices/mark-as-paid"},{"title":"Adicionar item","sidebarTitle":"Adicionar item","api":"POST https://api.upag.io/v1/invoices/{invoiceId}/items","href":"/pages/invoices/create-item"},{"title":"Atualizar item","sidebarTitle":"Atualizar item","api":"PATCH https://api.upag.io/v1/invoices/{invoiceId}/items/{itemId}","href":"/pages/invoices/update-item"},{"title":"Remover item","sidebarTitle":"Remover item","api":"DELETE https://api.upag.io/v1/invoices/{invoiceId}/items/{itemId}","href":"/pages/invoices/delete-item"}]},{"group":"Assinaturas","pages":[{"title":"Referência","description":"Objeto Assinatura (subscription): cobrança recorrente de preços","sidebarTitle":"Visão geral","href":"/pages/subscriptions/reference"},{"title":"Criar assinatura","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/subscriptions","href":"/pages/subscriptions/create"},{"title":"Listar assinaturas","description":"Lista as assinaturas da conta, da mais nova para a mais antiga","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/subscriptions","href":"/pages/subscriptions/list"},{"title":"Obter assinatura","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/subscriptions/{subscriptionId}","href":"/pages/subscriptions/get"},{"title":"Atualizar assinatura","sidebarTitle":"Atualizar","api":"PATCH https://api.upag.io/v1/subscriptions/{subscriptionId}","href":"/pages/subscriptions/update"},{"title":"Cancelar assinatura","sidebarTitle":"Cancelar","api":"POST https://api.upag.io/v1/subscriptions/{subscriptionId}/cancel","href":"/pages/subscriptions/cancel"},{"title":"Adicionar item","sidebarTitle":"Adicionar item","api":"POST https://api.upag.io/v1/subscriptions/{subscriptionId}/items","href":"/pages/subscriptions/create-item"},{"title":"Atualizar item","sidebarTitle":"Atualizar item","api":"PATCH https://api.upag.io/v1/subscriptions/{subscriptionId}/items/{itemId}","href":"/pages/subscriptions/update-item"},{"title":"Remover item","sidebarTitle":"Remover item","api":"DELETE https://api.upag.io/v1/subscriptions/{subscriptionId}/items/{itemId}","href":"/pages/subscriptions/delete-item"},{"title":"Mudanças agendadas","sidebarTitle":"Mudanças agendadas","api":"GET https://api.upag.io/v1/subscriptions/{subscriptionId}/scheduled-changes","href":"/pages/subscriptions/scheduled-changes"},{"title":"Cancelar mudança agendada","sidebarTitle":"Cancelar mudança agendada","api":"DELETE https://api.upag.io/v1/subscriptions/{subscriptionId}/scheduled-changes/{changeId}","href":"/pages/subscriptions/delete-scheduled-change"}]},{"group":"Links de pagamento","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/payment-links/reference"},{"title":"Criar link de pagamento","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/payment-links","href":"/pages/payment-links/create"},{"title":"Listar links de pagamento","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/payment-links","href":"/pages/payment-links/list"},{"title":"Obter link de pagamento","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/payment-links/{paymentLinkId}","href":"/pages/payment-links/get"},{"title":"Atualizar link de pagamento","sidebarTitle":"Atualizar","api":"PATCH https://api.upag.io/v1/payment-links/{paymentLinkId}","href":"/pages/payment-links/update"},{"title":"Adicionar item ao link","sidebarTitle":"Adicionar item","api":"POST https://api.upag.io/v1/payment-links/{paymentLinkId}/items","href":"/pages/payment-links/add-item"},{"title":"Atualizar item do link","sidebarTitle":"Atualizar item","api":"PATCH https://api.upag.io/v1/payment-links/{paymentLinkId}/items/{itemId}","href":"/pages/payment-links/update-item"},{"title":"Remover item do link","sidebarTitle":"Remover item","api":"DELETE https://api.upag.io/v1/payment-links/{paymentLinkId}/items/{itemId}","href":"/pages/payment-links/remove-item"},{"title":"Adicionar bump ao link","sidebarTitle":"Adicionar bump","api":"POST https://api.upag.io/v1/payment-links/{paymentLinkId}/bumps","href":"/pages/payment-links/add-bump"},{"title":"Atualizar bump do link","sidebarTitle":"Atualizar bump","api":"PATCH https://api.upag.io/v1/payment-links/{paymentLinkId}/bumps/{bumpId}","href":"/pages/payment-links/update-bump"},{"title":"Remover bump do link","sidebarTitle":"Remover bump","api":"DELETE https://api.upag.io/v1/payment-links/{paymentLinkId}/bumps/{bumpId}","href":"/pages/payment-links/remove-bump"}]},{"group":"Sessões de checkout","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/checkout-sessions/reference"},{"title":"Criar sessão de checkout","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/checkout/sessions","href":"/pages/checkout-sessions/create"},{"title":"Listar sessões de checkout","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/checkout/sessions","href":"/pages/checkout-sessions/list"},{"title":"Obter sessão de checkout","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/checkout/sessions/{sessionId}","href":"/pages/checkout-sessions/get"},{"title":"Atualizar sessão de checkout","sidebarTitle":"Atualizar","api":"PATCH https://api.upag.io/v1/checkout/sessions/{sessionId}","href":"/pages/checkout-sessions/update"},{"title":"Remover sessão de checkout","sidebarTitle":"Remover","api":"DELETE https://api.upag.io/v1/checkout/sessions/{sessionId}","href":"/pages/checkout-sessions/delete"},{"title":"Iniciar sessão de checkout","sidebarTitle":"Iniciar","api":"POST https://api.upag.io/v1/checkout/payment-links/{code}/sessions","href":"/pages/checkout-sessions/start"},{"title":"Obter sessão (pagador)","sidebarTitle":"Obter (pagador)","api":"GET https://api.upag.io/v1/checkout/sessions/{sessionId}","href":"/pages/checkout-sessions/retrieve"},{"title":"Confirmar sessão de checkout","sidebarTitle":"Confirmar","api":"POST https://api.upag.io/v1/checkout/sessions/{sessionId}/confirm","href":"/pages/checkout-sessions/confirm"},{"title":"Abrir sessão 3DS do checkout","sidebarTitle":"Sessão 3DS","api":"POST https://api.upag.io/v1/checkout/sessions/{sessionId}/3ds/session","href":"/pages/checkout-sessions/three-d-secure"},{"title":"Aplicar cupom","sidebarTitle":"Aplicar cupom","api":"POST https://api.upag.io/v1/checkout/sessions/{sessionId}/coupon","href":"/pages/checkout-sessions/apply-coupon"},{"title":"Remover cupom","sidebarTitle":"Remover cupom","api":"DELETE https://api.upag.io/v1/checkout/sessions/{sessionId}/coupon","href":"/pages/checkout-sessions/remove-coupon"},{"title":"Listar apps do checkout","sidebarTitle":"Listar apps","api":"GET https://api.upag.io/v1/checkout/sessions/{sessionId}/apps","href":"/pages/checkout-sessions/list-apps"},{"title":"Iniciar checkout Shopify","sidebarTitle":"Checkout Shopify","api":"POST https://api.upag.io/v1/checkout/shopify/sessions","href":"/pages/checkout-sessions/shopify"}]},{"group":"Layouts de checkout","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/checkout-layouts/reference"},{"title":"Criar layout de checkout","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/checkout/layouts","href":"/pages/checkout-layouts/create"},{"title":"Listar layouts de checkout","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/checkout/layouts","href":"/pages/checkout-layouts/list"},{"title":"Obter layout de checkout","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/checkout/layouts/{layoutId}","href":"/pages/checkout-layouts/get"},{"title":"Atualizar layout de checkout","sidebarTitle":"Atualizar","api":"PATCH https://api.upag.io/v1/checkout/layouts/{layoutId}","href":"/pages/checkout-layouts/update"},{"title":"Excluir layout de checkout","sidebarTitle":"Excluir","api":"DELETE https://api.upag.io/v1/checkout/layouts/{layoutId}","href":"/pages/checkout-layouts/delete"}]},{"group":"Transferências Pix","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/transfers/reference"},{"title":"Consultar destino Pix","sidebarTitle":"Consultar","api":"POST https://api.upag.io/v1/transfers/lookup","href":"/pages/transfers/lookup"},{"title":"Criar transferência","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/transfers","href":"/pages/transfers/create"},{"title":"Listar transferências","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/transfers","href":"/pages/transfers/list"},{"title":"Obter transferência","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/transfers/{transferId}","href":"/pages/transfers/get"},{"title":"Comprovante","sidebarTitle":"Comprovante","api":"GET https://api.upag.io/v1/transfers/{transferId}/receipt","href":"/pages/transfers/receipt"}]},{"group":"Subcontas","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/sub-accounts/reference"},{"title":"Criar subconta","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/sub-accounts","href":"/pages/sub-accounts/create"},{"title":"Listar subcontas","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/sub-accounts","href":"/pages/sub-accounts/list"},{"title":"Obter subconta","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/sub-accounts/{subAccountId}","href":"/pages/sub-accounts/get"},{"title":"Rotacionar chave da subconta","sidebarTitle":"Rotacionar chave","api":"POST https://api.upag.io/v1/sub-accounts/{subAccountId}/api-key/roll","href":"/pages/sub-accounts/roll-api-key"}]},{"group":"Apps","pages":[{"title":"Referência","sidebarTitle":"Visão geral","href":"/pages/apps/reference"},{"title":"Criar app","sidebarTitle":"Criar","api":"POST https://api.upag.io/v1/apps","href":"/pages/apps/create"},{"title":"Listar apps","sidebarTitle":"Listar","api":"GET https://api.upag.io/v1/apps","href":"/pages/apps/list"},{"title":"Obter app","sidebarTitle":"Obter","api":"GET https://api.upag.io/v1/apps/{appId}","href":"/pages/apps/get"},{"title":"Atualizar app","sidebarTitle":"Atualizar","api":"PATCH https://api.upag.io/v1/apps/{appId}","href":"/pages/apps/update"},{"title":"Excluir app","sidebarTitle":"Excluir","api":"DELETE https://api.upag.io/v1/apps/{appId}","href":"/pages/apps/delete"},{"title":"Instalar app","sidebarTitle":"Instalar","api":"POST https://api.upag.io/v1/apps/{appId}/install","href":"/pages/apps/install"},{"title":"Verificar script","sidebarTitle":"Verificar script","api":"GET https://api.upag.io/v1/apps/{appId}/script","href":"/pages/apps/verify-script"},{"title":"Desinstalar app","sidebarTitle":"Desinstalar","api":"DELETE https://api.upag.io/v1/apps/{appId}/uninstall","href":"/pages/apps/uninstall"},{"title":"Listar logs do app","sidebarTitle":"Listar logs","api":"GET https://api.upag.io/v1/apps/{appId}/logs","href":"/pages/apps/list-logs"},{"title":"Obter log do app","sidebarTitle":"Obter log","api":"GET https://api.upag.io/v1/apps/{appId}/logs/{logId}","href":"/pages/apps/get-log"}]},{"group":"Chave de API","pages":[{"title":"Identificar chave","sidebarTitle":"Identificar chave","api":"GET https://api.upag.io/v1/me","href":"/pages/me/get"}]}]},{"tab":"Webhooks","pages":[{"title":"Webhooks","href":"/pages/webhooks/overview"}]},{"tab":"SDK","pages":[{"title":"SDK","href":"/pages/sdk/overview"}]},{"tab":"Simulador","pages":[{"title":"Simulador","href":"/pages/simulator"}]}]},"basePath":"","title":"Criar assinatura - Upag Documentation","buildId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","deploymentId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-Myd8dsju.js","utils-C2HkQgW0.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-8rSppmTv.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B6MjiCFm.js","snippetPresets-DwrSAONL.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-1-a5UQKQ.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C541m7wZ.js","shallow-CWELCZ77.js","getApiPlaygroundDisplay-CTo5Zn03.js","CodeSnippet-D--dzvnl.js","CodeSnippets-DM3cXEDh.js","Page-CxAy5y67.js","getPastedJson-C-VECgcL.js","icon-BPq2-Mg3.js","MethodPill-D9J5cUHd.js","DuplicateIcon-BqHaxUnD.js","createIcon-CIbcZHp9.js","DynamicMarkdown-BKiHAm_d.js","SectionHeading-DstQXt3H.js","axios-vUo_bRtp.js"]}