Skip to content

Add action responses and improved custom client headers#5

Merged
victorycodedev merged 1 commit into
mainfrom
feature/action-response-and-default-headers
Jun 15, 2026
Merged

Add action responses and improved custom client headers#5
victorycodedev merged 1 commit into
mainfrom
feature/action-response-and-default-headers

Conversation

@victorycodedev

Copy link
Copy Markdown
Owner

Summary

This release improves account creation workflows and custom HTTP client support.

Changes

  • Added ActionResponse for account and account replica creation
  • Added helpers to detect 201 Created vs 202 Accepted
  • Added retryAfter(), shouldRetry(), id(), and state() helpers
  • Updated accounts()->create() to return ActionResponse
  • Updated accountReplicas()->createReplica() to return ActionResponse
  • Ensured SDK authentication headers are applied even when using a custom Guzzle client
  • Avoided forcing JSON Content-Type on file uploads
  • Updated README examples for account and replica creation
  • Expanded Pest test coverage

Example

$response = $metaapi->accounts()->create([
    'login' => '123456',
    'password' => 'password',
    'name' => 'Main account',
    'server' => 'ICMarketsSC-Demo',
    'platform' => 'mt5',
    'magic' => 123456,
    'type' => 'cloud-g2',
]);

if ($response->isCreated()) {
    echo $response->id();
}

if ($response->isAccepted()) {
    echo $response->retryAfter();
}

@victorycodedev
victorycodedev merged commit c5560a2 into main Jun 15, 2026
12 checks passed
@victorycodedev
victorycodedev deleted the feature/action-response-and-default-headers branch June 15, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant