Create contact payment method
curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/{contact_id}/payment_methods \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"payment_method": {
"gateway": "<string>",
"token": "<string>",
"method_type": "<string>",
"meta": {}
}
}
'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_method: {gateway: '<string>', token: '<string>', method_type: '<string>', meta: {}}
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/{contact_id}/payment_methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/{contact_id}/payment_methods"
payload = { "payment_method": {
"gateway": "<string>",
"token": "<string>",
"method_type": "<string>",
"meta": {}
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"gateway": "<string>",
"method_type": "<string>",
"status": "<string>",
"meta": {},
"payment_instrument_id": 123,
"safe_token": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{}{}Contacts
Create contact payment method
Store a payment method (and register the recurring card source) on a contact.
POST
/
api
/
v1
/
accounts
/
{account_id}
/
contacts
/
{contact_id}
/
payment_methods
Create contact payment method
curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/{contact_id}/payment_methods \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"payment_method": {
"gateway": "<string>",
"token": "<string>",
"method_type": "<string>",
"meta": {}
}
}
'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_method: {gateway: '<string>', token: '<string>', method_type: '<string>', meta: {}}
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/{contact_id}/payment_methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/{contact_id}/payment_methods"
payload = { "payment_method": {
"gateway": "<string>",
"token": "<string>",
"method_type": "<string>",
"meta": {}
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"gateway": "<string>",
"method_type": "<string>",
"status": "<string>",
"meta": {},
"payment_instrument_id": 123,
"safe_token": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{}{}Authorizations
Body
application/json
Show child attributes
Show child attributes