Oneinfinite v1
  • API Integration
    • Getting started
      • Environments
      • Security
    • API reference
      • Payment Methods
      • Checkout Preferences
        • Create a one-time payment
        • Create a Subscription
        • Get a Checkout Preference
      • Payment Orders
        • Get a Payment Order
      • Recurrent Payments
        • Get a Recurrent Payment
    • Webhooks
      • Configure
      • Notifications
    • Supported entities
      • Currencies
  • WooCommerce
    • WooCommerce Plugin
Powered by GitBook
On this page
  1. API Integration
  2. API reference
  3. Checkout Preferences

Create a Subscription

PreviousCreate a one-time paymentNextGet a Checkout Preference

Last updated 6 months ago

For managing subscriptions, the first step is to create one through our , specifically in the Payment Links section. When creating the subscription, you’ll need to specify details such as the amount per period and the duration. Once the subscription is set up, you can use the ID to create subsequent Checkout Preferences, allowing new users to subscribe easily.

  1. Go to Oneinfinite dashboard and create a subscription in payment links section

  2. Copy the ID to be set in the payment_link_id field.

Now you’re ready to make the request.

Create a subscription

POST /v1/checkout_preferences

Headers

Name
Value

x-api-key

<your api key>

x-api-secret

<your api secret>

Body

Name
Type
Required
Description

type

string

required

SUBSCRIPTION

payment_link_id

float

required

You can find the payment_link_id in your Oneinfinite Dashboard

origin

string

required

if use api integration use "API"

external_id

string

optional

The ID of your business

expiration_date

string

optional

Date with format RFC3339: yyyy-MM-dd'T'HH:mm:ss'Z' Ex: 2016-11-01T20:44:39Z, The expiration_date must be at most one week from the current date. If you don’t send any the expiration_date will be in 15 min.

payer

Object

optional

If you provide the payer's details, we won't request them during the checkout process.

payer.email

string

optional

Payer email ie. johndou@gmail.com

payer.name

string

optional

Payer name ie. John

payer.last_name

string

optional

Payer last_name ie. Doe

payer.phone

string

optional

Payer phone ie. +542615985699

payment_method_types

[]string

optional

List of available payment methods you want to use in your checkout preference. If you don’t send any, all payment methods will be used.

selected_payment_method_id

string

optional

If you provide the ID of a specific payment method, we won't ask to select a payment method during the checkout process

Example

curl 'https://api.oneinfinite.la/v1/checkout_preferences' \
--header 'x-api-key: MY_API_KEY' \
--header 'x-api-secret: MY_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
    "payment_link_id": ID,
    "origin": "API",
    "external_id": "external_id_1234",
    "type: "SUBCRIPTION",
    "custom_urls": {
        "status_changes_webhook": "https://api.mycompany.io/webhook",
	"success_payment_redirect": "https://mycompany.io/success.html",
	"error_payment_redirect": "https://mycompany.io/error.html"
    },
    "payer": {
        "email": "luca@test.com",
	"phone_number": "+521142567689",
        "first_name": "Luca",
        "last_name": "Dorain"
    },
}'

Dashboard