Skip to main content
PATCH
/
subscriptions
/
{id}
Update Subscription
curl --request PATCH \
  --url https://api-sandbox.y.uno/v1/subscriptions/{id} \
  --header 'Content-Type: application/json' \
  --header 'private-secret-key: <api-key>' \
  --header 'public-api-key: <api-key>' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "account_id": "<string>",
  "merchant_reference": "<string>",
  "country": "<string>",
  "amount": {
    "currency": "<string>",
    "value": 123
  },
  "frequency": {
    "type": "DAY",
    "value": 123,
    "monthly_billing_day": 123
  },
  "billing_cycles": {
    "total": 123
  },
  "customer_payer": {
    "id": "<string>"
  },
  "payment_method": {
    "type": "CARD",
    "vaulted_token": "<string>",
    "card": {
      "verify": true,
      "card_data": {
        "number": "<string>",
        "expiration_month": 123,
        "expiration_year": 123,
        "security_code": 123,
        "holder_name": "<string>"
      }
    },
    "": "<string>"
  },
  "availability": {
    "start_at": "2023-11-07T05:31:56Z",
    "finish_at": "2023-11-07T05:31:56Z"
  },
  "retries": {
    "retry_on_decline": true,
    "amount": 123
  },
  "metadata": {
    "key": "<string>",
    "value": "<string>"
  }
}
'
"{\n    \"id\": \"0c7fed3e-ee0d-4d34-9547-778be4ec0798\",\n    \"name\": \"Test Subscription\",\n    \"account_id\": \"493e9374-510a-4201-9e09-de669d75f256\",\n    \"country\": \"US\",\n    \"description\": \"Subscription Test\",\n    \"merchant_reference\": \"subscription-ref-merchant-AA01\",\n    \"status\": \"ACTIVE\",\n    \"amount\": {\n        \"currency\": \"USD\",\n        \"value\": 15000\n    },\n    \"frequency\": {\n        \"type\": \"MONTH\",\n        \"value\": 1\n    },\n    \"billing_cycles\": {\n        \"total\": 12,\n        \"current\": 1,\n        \"next_at\": \"2024-09-30T12:04:23.265393Z\"\n    },\n    \"customer_payer\": {\n        \"id\": \"a1d3b664-e32a-4508-9da1-9ede3e62a60c\"\n    },\n    \"payment_method\": {\n        \"type\": \"CARD\",\n        \"vaulted_token\": \"d4aa3586-def2-4705-b7cd-fe064bb764e6\"\n    },\n    \"availability\": {\n        \"start_at\": \"2024-09-30T12:04:23.265393Z\",\n        \"finish_at\": null\n    },\n    \"metadata\": null,\n    \"created_at\": \"2024-09-30T12:04:23.265372Z\",\n    \"updated_at\": \"2024-09-30T12:04:23.265372Z\"\n}\n"
Subscription TransitionThe fields billing_cycles and availability.finish_at have an impact on each other. If both are completed during the subscription creation, it will transition to the COMPLETED state upon reaching the nearest event defined in these fields, whether it is the billing cycle or the corresponding finish_at.

Authorizations

public-api-key
string
header
default:<Your public-api-key>
required
private-secret-key
string
header
default:<Your private-secret-key>
required

Path Parameters

id
string
required

The unique identifier of the subscription.

Body

application/json
name
string

The subscription plan name (MAX 255; MIN 3).

description
string

The subscription plan description (MAX 255; MIN 3).

account_id
string

The unique identifier of the account that will have the subscription plan available to use (MAX 64 ; MIN 36).

merchant_reference
string

Identification of the subscription plan (MAX 255; MIN 3).

country
string

The subscription's country.

amount
object

Specifies the amount object, with the value of each subscription payment and the used currency.

frequency
object

Specifies the frequency object. Defines the billing frequency for the subscription. Including type and value.

billing_cycles
object

Specifies the billing_cycles object. Defines the number of charges associated to the subscription.

customer_payer
object

Specifies the customer_payer object to identify the customer.

payment_method
object

Specifies the payment_method object. Currently, only card as available as payment methods. You can use the card token, the vaulted_token or the card information using through the card object.

availability
object

Specifies the availability object. Defines a date interval based on starting and ending dates when the subscription is available to use.

retries
object

Specified the 'retries' object. If we need to retry declined transactions in Yuno and the amount if necessary. If modified, the retries will apply to the next payment intent.

metadata
object

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

Response

200

id
string
Example:

"0c7fed3e-ee0d-4d34-9547-778be4ec0798"

name
string
Example:

"Test Subscription"

account_id
string
Example:

"493e9374-510a-4201-9e09-de669d75f256"

country
string
Example:

"US"

description
string
Example:

"Subscription Test"

merchant_reference
string
Example:

"subscription-ref-merchant-AA01"

status
string
Example:

"ACTIVE"

amount
object
frequency
object
billing_cycles
object
customer_payer
object
payment_method
object
availability
object
metadata
any
created_at
string
Example:

"2024-09-30T12:04:23.265372Z"

updated_at
string
Example:

"2024-09-30T12:04:23.265372Z"