Checkout/Payment Links

Update Payment Link Status

Update the status of a payment link.

Allows activating or deactivating a payment link. When deactivated, the link will no longer accept new payments. Existing payments in progress are not affected.

patch/api/v2/payment_links/{payment_link_id}/status

Path parameters

payment_link_idstring uuid required

Unique identifier (UUID) of the payment link to update

Unique identifier (UUID) of the payment link to update

Request body

status'INACTIVE' | 'ACTIVE' | 'COMPLETED' required
deactivate_messagestring nullable

Optional message to display when the payment link is deactivated

Response

Successful Response

created_atstring date-time

Creation timestamp of the object.

updated_atstring date-time nullable

Last modification timestamp of the object.

idstring uuid4

Unique identifier (UUID) of the payment link

namestring

Name of the payment link

descriptionstring nullable

Description of the payment link

amountstring

Total payment link amount after discounts

original_amountstring

Original payment link amount before discounts

item_level_discounted_amountstring

Total amount discounted at the item level

currency'SAR' | 'USD' | 'EUR' | 'GBP' | 'AED' | 'BHD' | 'KWD' | 'OMR' | 'QAR'

ISO 4217 currency codes supported by Moyasar.

Includes all currencies supported by Moyasar payment gateway.

home_currency_amountstring nullable

Amount in home currency (SAR) at creation; for SAR links or when converted from other currencies.

exchange_rate_at_creationstring nullable

Exchange rate from link currency to home currency (SAR) at creation time

max_number_of_paymentsinteger nullable

Maximum number of times this payment link can be used

valid_untilstring date-time nullable

UTC datetime after which the payment link is no longer valid

created_resource_effective_atstring date-time nullable

UTC datetime when the resource created from this payment link becomes effective

confirmation_messagestring nullable

Message to display to the payer after successful payment

recurring_interval'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR'
recurring_interval_countinteger nullable

Number of intervals per billing cycle for recurring payments

trial_period_daysinteger nullable

Free trial duration (in days) for subscriptions created from this link. Only meaningful for recurring (subscription) products. When set, each consumer who subscribes via this link gets a free trial of this length, after which the first real billing period begins. Must be between 1 and 365.

status'INACTIVE' | 'ACTIVE' | 'COMPLETED'
organization_idstring uuid4

Unique identifier (UUID) of the organization

user_idstring uuid4

Unique identifier (UUID) of the user who created the payment link

organization_consumer_idstring uuid4 nullable

Unique identifier (UUID) of the organization consumer if linked to a specific consumer

deactivate_messagestring nullable

Message to display when the payment link is deactivated

custom_fieldsobject nullable

Custom fields schema for collecting additional information

success_redirect_urlstring nullable

URL to redirect the payer to after a successful payment

failure_redirect_urlstring nullable

URL to redirect the payer to after a failed payment

custom_metadataobject nullable

The key-value metadata dictionary passed during creation.

contact_information_type'PHONE' | 'EMAIL'
urlstring

Public URL of the payment link for sharing with payers

amount_collectedstring

Total amount collected from payments

amount_in_smallest_unitinteger

Payment link amount in smallest currency unit (e.g. halala for SAR).

original_amount_in_smallest_unitinteger

Original payment link amount (before discounts) in smallest currency unit.

amount_collected_in_smallest_unitinteger

Total amount collected in smallest currency unit.

Example response

{
  "custom_fields": {
    "properties": {
      "child_name": {
        "title": "Child Name",
        "type": "string"
      },
      "parent_email": {
        "title": "Parent Email",
        "type": "string"
      }
    },
    "required": [
      "child_name"
    ],
    "type": "object"
  }
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.