Update a recipient
Update recipient details including name, email, description, and metadata. Note that bank account details cannot be updated.
API Credentials
Request Parametersโ
Required - 1 fieldRequired Parameters
`id`STRING(required)
Recipient ID (e.g., recp_test_...). Provided in the URL path.
Additional - 4 fieldsAdditional Parameters
`name`STRING(optional)
Updated recipient name.
`email`STRING(optional)
Updated email address.
`description`STRING(optional)
Updated description.
`metadata`OBJECT(optional)
Updated metadata (completely replaces existing metadata).
Responsesโ
200
Successful transactionRecipient updated successfully. Returns the updated recipient object.
Updated recipient attributes:
name- Updated recipient nameemail- Updated email addressdescription- Updated descriptionmetadata- Updated metadata- Bank account details remain unchanged
400
Bad requestRequest validation failed. Check the error message for details.
Common causes:
- Invalid email format
- Malformed metadata
- Metadata exceeds 15,000 characters
401
UnauthorizedAuthentication failed. Invalid or missing API key.
Common causes:
- Missing Authorization header
- Invalid secret key
- Using public key instead of secret key
- Incorrect HTTP Basic Auth format
404
Not foundRecipient not found.
Common causes:
- Invalid recipient ID
- Recipient does not belong to your account
- Recipient has been deleted
- Mixing test and live mode IDs
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/recipients/recp_test_5xuy4w91xqz7d1w9u0t \
-X PATCH \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "name=John Smith" \
-d "email=john.smith@example.com"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
recipient = Omise::Recipient.update('recp_test_5xuy4w91xqz7d1w9u0t', {
name: 'John Smith',
email: 'john.smith@example.com'
})
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
recipient = omise.Recipient.retrieve('recp_test_5xuy4w91xqz7d1w9u0t')
recipient.name = 'John Smith'
recipient.email = 'john.smith@example.com'
recipient.update()
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const recipient = await omise.recipients.update('recp_test_5xuy4w91xqz7d1w9u0t', {
name: 'John Smith',
email: 'john.smith@example.com'
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$recipient = OmiseRecipient::retrieve('recp_test_5xuy4w91xqz7d1w9u0t');
$recipient->update([
'name' => 'John Smith',
'email' => 'john.smith@example.com'
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Recipient recipient = client.recipients()
.update("recp_test_5xuy4w91xqz7d1w9u0t")
.name("John Smith")
.email("john.smith@example.com")
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var recipient = await client.Recipients.Update("recp_test_5xuy4w91xqz7d1w9u0t", new UpdateRecipientRequest
{
Name = "John Smith",
Email = "john.smith@example.com"
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
recipient, _ := client.Recipients().Update("recp_test_5xuy4w91xqz7d1w9u0t", &operations.UpdateRecipient{
Name: "John Smith",
Email: "john.smith@example.com",
})
Important notesโ
- Bank account details cannot be updated
- To change bank account, delete the recipient and create a new one
- Metadata parameter completely replaces existing metadata
- To preserve existing metadata, retrieve recipient first and merge
Try it outโ
Required - 1 fields
Additional - 4 fields