UseePay API
  1. Subscriptions
UseePay API
  • Introduction
  • Product Overview
  • Authentication
  • Errors
  • Changelog
  • Integration
    • Get started with online payments
    • Get started with subscriptions
  • Payment Intents
    • Create a PaymentIntent
      POST
    • Retrieve a PaymentIntent
      GET
    • Update a PaymentIntent
      POST
    • Confirm a PaymentIntent
      POST
    • Cancel a PaymentIntent
      POST
    • Capture a PaymentIntent
      POST
    • List all payment intents
      GET
  • Customers
    • Create a customer
      POST
    • Retrieves a customer
      GET
    • Update a customer
      POST
    • List all customers
      GET
  • Subscriptions
    • Create a subscription
      POST
    • Retrieves a subscription
      GET
    • Update a subscription
      POST
    • List all subscriptions
      GET
    • Cancel a subscription
      POST
  • Invoices
    • Create a invoice
      POST
    • Retrieves a invoice
      GET
    • Update a invoice
      POST
    • List all invoices
      GET
    • Pay a invoice
      POST
  • Payment Methods
    • Create a payment method
    • Retrieves a payment method
    • Update a payment method
    • List all payment methods
  • Mandates
    • Create a mandate
    • Retrieves a mandate
    • Update a mandate
    • List all mandates
  • Refunds
    • Create a refund
    • Retrieves a refund
    • Update a refund
    • List all refunds
  • Webhooks
    • Webhook envents
    • Create a webhook
    • Retrieves a webhook
    • Update a webhook
    • List all webhooks
  • Payment Links
    • Create a payment link
    • Retrieves a payment link
    • Update a payment link
    • List all payment links
  • Embedded Checkout
    • Payment Elements
  • About Testing
    • Test Cards
    • ApplePay&GooglePay
  1. Subscriptions

Update a subscription

POST
/api/v1/subscriptions/{{subscription-id}}

Request

Header Params

Body Params application/json

Example
{
    "currency":"USD"
    ,"customer_id":"{{customer-id}}"
    ,"recurring":{
        "interval":"month"
        ,"interval_count":1
        ,"unit_amount":112
        ,"total_billing_cycles":10
    }
    ,"default_payment_method":"{{payment-method-id}}"
    ,"description":"subscription desc111"
    ,"order":{
        "category":"Apparel and accessories",
         "products": [
            {
                "category": "Apparel and accessories",
                "code": "3414314111",
                "desc": "IPHONE 7",
                "effective_end_at": "2020-12-31T23:59:59Z",
                "effective_start_at": "2020-01-01T00:00:00Z",
                "name": "IPHONE7",
                "quantity": 5,
                "seller": {
                    "identifier": "string",
                    "name": "string"
                },
                "sku": "100004",
                "type": "physical",
                "unit_price": 100.01,
                "url": "https://example.airwallex.com/product/12345"
            }
        ],
        "shipping": {
            "address": {
                "city": "Shanghai",
                "country_code": "CN",
                "postcode": "100000",
                "state": "Shanghai",
                "line1": "Pudong District"
            },
            "first_name": "John",
            "last_name": "Doe",
            "phone_number": "13800000000",
            "shipping_method": "sameday"
        }
    }
    ,"metadata":{
        "sid":"0002"
    }
    ,"collection_method":"send_invoice"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://openapi1.uat.useepay.com/api/v1/subscriptions/sub_1JBQUBE5K0000' \
--header 'x-merchant-no: 500000000007245' \
--header 'x-api-key: FUYTIUvjhgfytfuytwiue' \
--header 'x-app-id: www.pay.com' \
--header 'Content-Type: application/json' \
--data-raw '{
    "currency":"USD"
    ,"customer_id":"cus_1JA7UDDQG3800"
    ,"recurring":{
        "interval":"month"
        ,"interval_count":1
        ,"unit_amount":112
        ,"total_billing_cycles":10
    }
    ,"default_payment_method":"pm_1JAS4J8JK0800"
    ,"description":"subscription desc111"
    ,"order":{
        "category":"Apparel and accessories",
         "products": [
            {
                "category": "Apparel and accessories",
                "code": "3414314111",
                "desc": "IPHONE 7",
                "effective_end_at": "2020-12-31T23:59:59Z",
                "effective_start_at": "2020-01-01T00:00:00Z",
                "name": "IPHONE7",
                "quantity": 5,
                "seller": {
                    "identifier": "string",
                    "name": "string"
                },
                "sku": "100004",
                "type": "physical",
                "unit_price": 100.01,
                "url": "https://example.airwallex.com/product/12345"
            }
        ],
        "shipping": {
            "address": {
                "city": "Shanghai",
                "country_code": "CN",
                "postcode": "100000",
                "state": "Shanghai",
                "line1": "Pudong District"
            },
            "first_name": "John",
            "last_name": "Doe",
            "phone_number": "13800000000",
            "shipping_method": "sameday"
        }
    }
    ,"metadata":{
        "sid":"0002"
    }
    ,"collection_method":"send_invoice"
}'

Responses

🟢200Success
application/json
Body

Example
{
    "id": "sub_1JBPC9HT80000",
    "recurring": {
        "interval": "month",
        "interval_count": 1,
        "unit_amount": 112,
        "total_billing_cycles": 10
    },
    "currency": "USD",
    "description": "subscription desc",
    "order": {
        "category": "Apparel and accessories",
        "products": [
            {
                "category": "Apparel and accessories",
                "code": "3414314111",
                "desc": "IPHONE 7",
                "effective_end_at": "2020-12-31T23:59:59Z",
                "effective_start_at": "2020-01-01T00:00:00Z",
                "name": "IPHONE7",
                "quantity": 5,
                "seller": {
                    "identifier": "string",
                    "name": "string"
                },
                "sku": "100004",
                "type": "physical",
                "unit_price": 100.01,
                "url": "https://example.useepay.com/product/12345"
            }
        ],
        "shipping": {
            "address": {
                "city": "Shanghai",
                "country_code": "CN",
                "postcode": "100000",
                "state": "Shanghai",
                "line1": "Pudong District"
            },
            "first_name": "John",
            "last_name": "Doe",
            "phone_number": "13800000000",
            "shipping_method": "sameday"
        }
    },
    "metadata": {
        "sid": "0001"
    },
    "status": "incomplete",
    "livemode": null,
    "prorate": null,
    "merchant_no": "500000000007264",
    "app_id": "www.demo.com",
    "create_at": "2024-10-28T03:49:28Z",
    "modify_at": "2024-10-28T03:49:28Z",
    "customer_id": "cus_1JA7UDDQG3800",
    "cancel_at_period_end": null,
    "current_period_end": null,
    "current_period_start": null,
    "latest_invoice": null,
    "first_invoice_id": null,
    "cancel_at": null,
    "canceled_at": null,
    "collection_method": "charge_automatically",
    "days_until_due": null,
    "ended_at": null,
    "cancellation_details": null,
    "invoice_now": null
}
Modified at 2025-01-13 12:04:21
Previous
Retrieves a subscription
Next
List all subscriptions
Built with