Attach Payment Resource

Update an existing payment link on your Terraswitch account.

PUT {{ BASE_URL }}/v1/corporate/payment-resource/{{slug}}

You can only attach a resource ( i.e. product or invoice ) to a payment link if the feature of the payment link is product or invoice

Body Parameters

Property
Data Type
Description
Example
Required

type

string

The type of resource to attach. This can be product or invoice

"product"

Yes

code

string

The code of the resource to attach. This can be the product code or the invoice code

"TSDLASTXD"

Yes

import Axios from 'axios';

// set the api url
const API_URL = `${BASE_URL}/v1/corporate/payment-resource/${slug}`;

// define request body
const data = {
  type: "product",
  code: "VPDLASTXD"
}

// make request using axios
Axios({
    method: "POST",
    url: `${API_URL}`,
    headers: {
        lg: 'en',
        ch: 'web'
        Authorization: `Bearer ${API_KEY}`,
        'Content-Type': 'application/json',
    },
    data: data
}).then((resp) => {
    console.log(resp)
}).catch((err) => {
    console.log(err)
})

Please note that the amount of the resource ( Product or Invoice ) you attach to a payment link overrides the default amount ( if already set ) of the payment link.

Last updated