import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
checkout_com: {
type: "app",
app: "checkout_com",
}
},
async run({steps, $}) {
const timestamp = Date.now()
const data = {
"email": `test-${timestamp}@example.com`
}
return await axios($, {
method: "post",
url: `https://api.${this.checkout_com.$auth.authorization_server}/customers`,
headers: {
Authorization: `Bearer ${this.checkout_com.$auth.oauth_access_token}`,
"accept": `application/json`,
},
data,
})
},
})
Checkout.com uses OAuth authentication. When you connect your Checkout.com account, Pipedream will open a popup window where you can sign into Checkout.com and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Checkout.com API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://access.{{custom_fields.authorization_server}}/connect/token
content-type: application/x-www-form-urlencoded
accept: application/json
grant_type=client_credentials
POST
https://access.{{custom_fields.authorization_server}}/connect/token
content-type: application/x-www-form-urlencoded
accept: application/json
grant_type=client_credentials